Repository navigation
Support Claude on Vertex AI in the Claude engine (engine.auth provider: gcp) #71985
Description
Claude is officially available on Google Vertex AI (Google docs), and Claude Code supports it with CLAUDE_CODE_USE_VERTEX=1 (Claude Code docs). In gh-aw, the Gemini engine can already use Vertex through engine.auth (github-oidc / provider: gcp, #48185). The AWF Vertex adapter also proxies the Claude routes as-is, so most of the pieces are in place.
I tried to use Claude on Vertex from engine: claude, authenticating with GCP WIF instead of an API key. With provider: gcp the workflow compiles, but it doesn't run, for three reasons:
ANTHROPIC_API_KEYis still required by the secret check, so the run fails before the agent starts, even though no Anthropic key is used.- No Vertex environment is set, so Claude Code goes to the Anthropic API.
- The adapter returns a retryable 503 until its first token exchange finishes, but
CLAUDE_CODE_MAX_RETRIES=0makes Claude Code exit right away.
After removing the secret check from the lock file by hand and adding this engine.env, requests reach Vertex. The remaining failure is in the api-proxy and is described in #71987.
CLAUDE_CODE_USE_VERTEX: "1"
CLAUDE_CODE_SKIP_VERTEX_AUTH: "1" # the api-proxy adds auth
ANTHROPIC_VERTEX_BASE_URL: "http://172.30.0.30:10004/v1"
ANTHROPIC_VERTEX_PROJECT_ID: <project>
CLOUD_ML_REGION: global
CLAUDE_CODE_MAX_RETRIES: "8"Could this be supported the same way as Gemini on Vertex?
- Add
isClaudeVertexWIFwith the same conditions asisGeminiVertexWIF. - In that case, don't require
ANTHROPIC_API_KEY, as already done for Anthropic WIF (claudeSkipsStaticSecret, Compiler: extend engine.auth for Anthropic Workload Identity Federation; gate ANTHROPIC_API_KEY validation when WIF configured #35561). - In
buildClaudeCommandEnv, set the Vertex values above afterengine.envis applied.- If the compiler owns the URL, add
VertexLLMGatewayPort = 10004inpkg/constants/constants.goand usellmGatewayBaseURL(constants.VertexLLMGatewayPort, workflowData) + "/v1". Verify proxy bypass and reachability for each supported sandbox topology; the hard-coded IP above is only the tested setup. - Take the location from
auth.location;globalis the location verified here. Check availability for the selected Claude model rather than reusing Gemini's regional default. FilterEnvForSecretscan strip the default Anthropic secret expression once it is no longer required. Verify that this mode emits no Anthropic key or direct-API routing, even if an unrelated Anthropic key exists on the runner. Keep the GCP credentials inside the sidecar.
- If the compiler owns the URL, add
- Let the first request wait out the 503, either with the CLI's default retries or with a retry in the harness.
- Add compiler and lock-file tests: no
ANTHROPIC_API_KEYrequirement, correct Vertex URL/project/location after environment merges, startup survives a pending token, and existing Anthropic API-key/WIF modes are unchanged. Document Model Garden enablement and any required VPC-SC ingress.
This is a compiler request in pkg/workflow/claude_engine.go, not a firewall implementation request. The proxy bug in #71987 must be fixed separately. I haven't yet completed an end-to-end inference run through gh-aw.
Activity
pelikhan commentedon Oct 27, 2026
@akitana-airtanker we'll need help testing this
rice-as681 commentedon Oct 27, 2026
Offering a test bed for this: we run gh-aw workflows on Vertex AI with keyless WIF (
engine.authtype: github-oidc,provider: gcp) today on the Gemini engine, and would move to Claude on Vertex as soon as the Claude engine supports it. We can test a branch or pre-release build against a real Vertex project, with Claude enabled in Model Garden, and report back here.One thing we hit on the shared path that may matter here too: the api-proxy's GitHub token needs the workload identity provider's canonical audience (
https://iam.googleapis.com/projects/…/providers/…) when the provider sets noallowedAudiences. Details are in github/gh-aw-firewall#10711.akitana-airtanker commentedon Oct 28, 2026
@pelikhan Thanks for the fix and for asking me to test it. I tried #72273 on a GCP project with an AWF build containing github/gh-aw-firewall#10720 and github/gh-aw-firewall#10721, and Claude on Vertex completed an inference successfully.
Authentication worked with the standard
engine.authsettings (github-oidc/gcp,location: global), including the default OIDC audience. I used gh-aw commitd6fec07and AWF commit331e851. Since that AWF version isn't released yet, I built it from source and applied a temporary patch to the lock file to run that build.With the released AWF v0.29.0, the request fails with
400 stream_options: Extra inputs are not permitted, so an AWF release containing #10721 is needed for this setup.The initial token exchange completed before Claude's first request, so I couldn't exercise the startup 503 retry. I also saw four
[obfuscation]warnings at compile time for the cleared Anthropic environment variables.I'll try again with the AWF release when it's available.
@rice-as681 Thanks for offering to test this too. The default audience worked in my test with the #10720 fix included.