Conversation
…token Signed-off-by: David Haifley <david.haifley@solo.io>
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.
Description
Since #2868 every ModelConfig credential goes through Substrate's egress gateway as an injected header, and the Claude compiler rejects an
AnthropicVertexAIModelConfig withenvironment credential "KAGENT_CLAUDE_GOOGLE_CREDENTIALS_JSON" cannot use gateway header injection. A service account key needs local signing, which the gateway cannot do, so Claude Code on Vertex AI has been unusable since then.Substrate's Kubernetes credential provider now serves a second provider name,
google-access-token.kubernetes.io(kagent-dev/substrate#47), which reads the same key Secret and returns a short-livedcloud-platformaccess token instead of the key. This change treats Vertex AI like Bedrock's bearer token: a gateway credential the runtime never holds.modelCredentialTargetreturns a target that carries the provider authority beside the header, andAnthropicVertexAIbindsauthorization: Beareron the Vertex AI hostname for its location, with a URI on the Google authority.egress.CanonicalCredentialsaccepts that authority and still rejects any other. The Vertex hostname mapping moves from the Claude compiler to the shared translator package.CLAUDE_CODE_SKIP_VERTEX_AUTH=1beside the project and region and no longer renders the key. The pinned Claude Code carries the switch. Verified against the binary with a capture endpoint in place of Vertex: with the flag, every request arrives with noauthorizationheader for the gateway to complete; without it, no request leaves the process. Theoauth2.googleapis.comegress goes away because the runtime no longer talks to Google's token endpoint. The compile-time checks on the key (service account type, project match, Google token URI) stay, so a misconfigured Secret is still reported against the AgentTemplate rather than at fetch time.KAGENT_CLAUDE_GOOGLE_CREDENTIALS_JSONand the code that wrote it to ephemeral storage are removed.CLAUDE_CODE_SKIP_VERTEX_AUTHandGOOGLE_APPLICATION_CREDENTIALSstay compiler-owned so a Harness cannot point Claude Code at a credential it does not have.The kagent runtimes are unchanged: they still authenticate to Vertex AI themselves, so a Vertex ModelConfig with a Secret remains rejected for them as before (unsupported volume mounts). The runtime configuration JSON is unchanged, so the config contract version does not move; this controller with an older Claude image works as long as its Claude Code has the switch, which the pinned 2.1.260 does.
This needs a Substrate release whose provider serves the Google authority. The Go pin, CI's
SUBSTRATE_VERSIONanddocs/architecture/credential-injection.mdmove when it ships. Against an older provider the compiled binding is refused at fetch time withthis provider serves "kubernetes.io", and the model call fails; nothing is serialized into the runtime either way.Related Issues
kagent-dev/substrate#47 adds the provider side.
Testing
All 87 packages pass and lint reports 0 issues (run without the kube-api-linter plugin, which does not load on macOS and covers only
api/v1alpha).go mod tidyproduces no change. The Claude compiler tests now pin the compiled bindings for every provider and assert that no Vertex revision points Claude Code at a local credential file; the shared credential tests cover the Vertex target with and without an environment variable. Not run: the KinD E2E suite, which mocks the LLM upstream and has no Vertex case.Change Type
Bug fix.