feat(cli): Support custom service accounts for Agent Engine deploy - #6702
Open
a2105z wants to merge 1 commit into
Open
feat(cli): Support custom service accounts for Agent Engine deploy#6702a2105z wants to merge 1 commit into
a2105z wants to merge 1 commit into
Conversation
Contributor
Author
|
Friendly ping for Agent Engine / CLI triage: @yeesian @klateefa @wuliang229 @Jacksunwei @llalitkumarrr @GWeale — small focused follow-on in the Agent Engine deploy CLI for custom runtime service accounts (#2951). Happy to adjust naming or precedence if you prefer config-file-only / no |
Enterprise deploys should use least-privilege runtime identities instead of only the default Agent Engine service agent. Accept --service_account (plus .env / config-file equivalents) and forward it as config.service_account. Fixes google#2951
a2105z
force-pushed
the
feat/agent-engine-service-account
branch
from
August 13, 2026 00:54
9155769 to
254aa02
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements custom runtime service account support for
adk deploy agent_engine(#2951).Why this is needed
Using a dedicated least-privilege service account is Cloud IAM best practice for Agent Engine. Today
adk deploy agent_enginealways falls back to the default Agent Engine service agent — there is no first-class CLI/config way to set the runtime identity that Vertex documents for Agent Engine deploy.The Vertex Agent Engine SDK already accepts
config.service_account→spec.service_account. ADK just never exposed it.What we did
--service_accounttoadk deploy agent_engine.agent_engine_config.json("service_account": "...").env(GOOGLE_CLOUD_SERVICE_ACCOUNT=..., popped so it is not leaked into runtimeenv_vars).env(CLI wins)agent_config["service_account"]onclient.agent_engines.update(...)(runtime identity — distinct frombuild_config.service_accountused for Cloud Build)How it fits
Usage
Or in
.agent_engine_config.json:{ "service_account": "my-agent@my-project.iam.gserviceaccount.com" }Or in
.env:Verification
mainconfig.service_account→spec.service_accountuv run pytest tests/unittests/cli/utils/test_cli_deploy.py→ 60 passedFixes #2951
Test plan
_validate_service_account(valid + malformed)_apply_service_account_to_agent_config(CLI, config, override)to_agent_engineforwardsservice_accountonagent_engines.update.envGOOGLE_CLOUD_SERVICE_ACCOUNTis applied and not leaked intoenv_vars--service_accountreachesto_agent_enginecc @yeesian @klateefa @wuliang229 @Jacksunwei @llalitkumarrr @GWeale
I claimed this on #2951 (self-assign needs triage permissions — please assign
@a2105zif helpful). Ready for review.