- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- Prompt
- Recommendation
- Role
- RoleType
- Try it!
Gets role suggestions for individual principals with AI assistance. To get the role suggestions, make sure the following pre-requisites are met:
- Vertex AI API is enabled on the project.
- The user has the
aiplatform.endpoints.predictpermission on the project. You can give this permissions to the user by granting the Vertex AI Platform Express User role on the project.
HTTP request
POST https://policyassist.googleapis.com/v1/{parent=projects/*}/locations/global:recommendIamRoles
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
parent |
Required. The project on which the user wants to grant the suggested roles. Use one of the following formats:
|
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{
"prompt": {
object ( |
| Fields | |
|---|---|
prompt |
Required. The user's prompt. |
Response body
Response to the recommendIamRoles method.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{
"summary": string,
"recommendations": [
{
object ( |
| Fields | |
|---|---|
summary |
A summary of the reasoning for the suggested roles. If no role suggestions are provided, this field displays the reasoning for no suggestions. |
recommendations[] |
A list of the suggested roles that are considered appropriate based on the user's prompt. |
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
Prompt
Prompt object defines the building block for the user's prompt.
| JSON representation |
|---|
{ "userInstructions": string } |
| Fields | |
|---|---|
userInstructions |
Required. The user's prompt. For example, "Suggest a role that lets me view storage buckets. |
Recommendation
A role recommendation.
| JSON representation |
|---|
{
"intro": string,
"roles": [
{
object ( |
| Fields | |
|---|---|
intro |
Short intro text displayed before the role recommendations. |
roles[] |
A list of the suggested roles. |
detailedReasoning |
Detailed reasoning for why the suggested roles are considered appropriate. |
Role
An IAM role.
| JSON representation |
|---|
{
"name": string,
"roleType": enum ( |
| Fields | |
|---|---|
name |
The role name. For example, roles/storage.admin. |
roleType |
The type of role suggested. For example, a predefined role or a custom role. |
grantableScopes[] |
The list of scopes where the role can be granted. For example, a role can be granted at the project-, folder-, or organization-level. |
RoleType
RoleType defines a list of role types. Current supported values include predefined roles and custom roles.
| Enums | |
|---|---|
ROLE_TYPE_UNSPECIFIED |
Default value. |
ROLE_TYPE_PREDEFINED |
Predefined roles. |
ROLE_TYPE_CUSTOM |
Custom roles defined by the user. |