Skip to content

Use aiplatform.user role for agent identity permissions#727

Merged
eliasecchig merged 1 commit intomainfrom
fix/agent-identity-role-update
Jan 21, 2026
Merged

Use aiplatform.user role for agent identity permissions#727
eliasecchig merged 1 commit intomainfrom
fix/agent-identity-role-update

Conversation

@eliasecchig
Copy link
Collaborator

Summary

  • Update agent identity IAM role from roles/aiplatform.expressUser to roles/aiplatform.user
  • Provides broader Vertex AI service access for agents with identity-based permissions

Problem

The current implementation grants roles/aiplatform.expressUser which is designed for simplified Express Mode usage with API keys. This role has limited capabilities compared to the full Vertex AI user role.

Solution

Changed the IAM role assignment in deploy.py:151 to use roles/aiplatform.user instead. This role provides:

  • Access to core generative AI features (same as expressUser)
  • Additional permissions to predict with models
  • Broader Vertex AI service capabilities for more complex agent workflows

The change affects the setup_agent_identity() function which automatically configures IAM permissions when deploying agents with the --agent-identity flag.

Update agent identity setup to grant roles/aiplatform.user instead of
roles/aiplatform.expressUser. The user role provides broader access to
Vertex AI services including model prediction capabilities, while
expressUser is limited to simplified Express Mode features with API keys.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @eliasecchig, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the operational scope of AI agents by upgrading their assigned Identity and Access Management (IAM) role. The previous role, aiplatform.expressUser, was found to be too restrictive, primarily designed for simplified API key usage. By transitioning to the aiplatform.user role, agents will now possess a more comprehensive set of permissions within Vertex AI, allowing them to leverage a wider array of services and perform more advanced tasks, such as model predictions, thereby supporting more sophisticated agent deployments.

Highlights

  • IAM Role Update: The IAM role assigned to agent identities has been updated from roles/aiplatform.expressUser to roles/aiplatform.user.
  • Enhanced Agent Capabilities: This change provides broader Vertex AI service access for agents, enabling more complex workflows and additional permissions to predict with models.
  • Affected Function: The modification occurs within the setup_agent_identity() function in deploy.py, which configures IAM permissions for agents deployed with the --agent-identity flag.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@eliasecchig eliasecchig merged commit 890b7dc into main Jan 21, 2026
34 checks passed
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the IAM role for the agent identity from the restrictive roles/aiplatform.expressUser to the more permissive roles/aiplatform.user. This change is intended to provide agents with broader access to Vertex AI services for more complex workflows. While the change is functionally correct, I have raised a concern regarding the principle of least privilege, suggesting the use of a custom IAM role to grant only the necessary permissions instead of the broad aiplatform.user role.


roles = [
"roles/aiplatform.expressUser",
"roles/aiplatform.user",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The change from roles/aiplatform.expressUser to roles/aiplatform.user significantly broadens the permissions granted to the agent identity. The roles/aiplatform.user role is quite powerful, granting permissions to create, delete, and manage various Vertex AI resources. This goes against the principle of least privilege. For better security, consider creating a custom IAM role that includes only the specific additional permissions required for the agent's complex workflows, rather than using the broad aiplatform.user predefined role. This would limit the potential attack surface if the agent's identity were compromised.

enriquekalven pushed a commit to enriquekalven/agent-starter-pack that referenced this pull request Feb 7, 2026
…gleCloudPlatform#727)

Update agent identity setup to grant roles/aiplatform.user instead of
roles/aiplatform.expressUser. The user role provides broader access to
Vertex AI services including model prediction capabilities, while
expressUser is limited to simplified Express Mode features with API keys.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant