Repository navigation
Support GCP WIF for Gemini and Vertex API proxy adapters - #8888
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
OIDC configuration resolution can enable agent routing without forwarding matching credentials to the sidecar, causing request failures.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (3)
What changed in this PR
Adds GCP Workload Identity Federation authentication to native Gemini and Vertex API-proxy adapters while keeping credentials inside the sidecar.
Changes:
- Adds GCP OIDC routing and bearer-token authentication.
- Adds adapter and environment-routing tests.
- Updates authentication and sidecar documentation.
| File | Description |
|---|---|
src/services/credentials/vertex-credential-env.ts |
Enables Vertex routing for GCP OIDC. |
src/services/credentials/vertex-credential-env.test.ts |
Tests keyless Vertex routing. |
src/services/credentials/gemini-credential-env.ts |
Enables Gemini routing for GCP OIDC. |
src/services/credentials/gemini-credential-env.test.ts |
Tests keyless Gemini routing. |
src/services/credentials/gcp-oidc-config.ts |
Detects GCP WIF configuration. |
src/services/api-proxy-service-api-targets.test.ts |
Tests sidecar credential isolation and routing. |
src/services/agent-environment/api-proxy-environment.ts |
Enables Gemini setup for GCP OIDC. |
docs/authentication-architecture.md |
Documents WIF adapter architecture. |
docs/auth-matrix.md |
Adds Gemini and Vertex WIF matrix entries. |
docs/api-proxy-sidecar.md |
Documents sidecar routing and billing behavior. |
containers/api-proxy/providers/google-adapter.test.js |
Tests Google bearer authentication. |
containers/api-proxy/providers/google-adapter.js |
Adds GCP WIF support to Google adapters. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| unconfiguredResponseWhen: () => (oidcConfigured | ||
| ? { | ||
| kind: 'provider_not_configured', | ||
| message: `${label} OIDC token (${authProvider}) unavailable; retry shortly`, | ||
| retryable: true, |
| const configEnvValue = getConfigEnvValue(config, envVar)?.trim(); | ||
| if (configEnvValue) { | ||
| return configEnvValue; | ||
| } | ||
| return process.env[envVar]?.trim() || undefined; |
| | Env vars | `AWF_AUTH_TYPE=github-oidc`, `AWF_AUTH_PROVIDER=gcp`, `AWF_AUTH_GCP_WORKLOAD_IDENTITY_PROVIDER` | | ||
| | Header sent upstream | Bearer auth header | | ||
| | Optional service account | `AWF_AUTH_GCP_SERVICE_ACCOUNT` | | ||
| | Optional scope | `AWF_AUTH_GCP_SCOPE` (default: `https://www.googleapis.com/auth/cloud-platform`) | |
|
@copilot address review feedback |
Addressed in 9f1e5d6:
Tests added/updated in |
|
✅ Copilot review passed with no inline comments. @copilot Add the |
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit c8d5860 |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
✨ New Files (1 files)
Coverage comparison generated by |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "o205451.ingest.us.sentry.io"See Network Configuration for more information.
|
|
✅ Smoke Claude passed Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
[!TIP] tools:
github:
mode: gh-proxySee GitHub Tools for more information on To allow these domains, add them to the network:
allowed:
- defaults
- "api.github.com"
- "example.com"See Network Configuration for more information.
|
Smoke Test: Cloud Hypervisor + Copilot
All checks passed. Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"
- "github.com"See Network Configuration for more information.
|
|
Copilot Engine Smoke Test —
Overall: PASS
|
Smoke Test: Copilot BYOK ✅
Status: Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com Overall: PASS
|
|
Smoke Test Results
Overall: PASS
|
📡 OTel Tracing Smoke Test Results
Overall: ✅ All applicable scenarios pass. No regressions detected in OTEL tracing integration. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "o205451.ingest.us.sentry.io"See Network Configuration for more information.
|
Smoke Test: Claude Engine Validation
Overall result: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (api.github.com) reachable — HTTP 403 Overall: PASS
Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
[!TIP] tools:
github:
mode: gh-proxySee GitHub Tools for more information on To allow these domains, add them to the network:
allowed:
- defaults
- "api.github.com"
- "example.com"See Network Configuration for more information.
|
Chroot Version Comparison Results
Overall: FAILED — Node.js version mismatch between host and chroot environment. The
|
|
Merged PR titles:
Warning Firewall blocked 12 domainsThe following domains were blocked by the firewall during workflow execution:
[!TIP] tools:
github:
mode: gh-proxySee GitHub Tools for more information on To allow these domains, add them to the network:
allowed:
- defaults
- "ab.chatgpt.com"
- "accounts.google.com"
- "api.github.com"
- "clients2.google.com"
- "collector.github.com"
- "contentautofill.googleapis.com"
- "github.com"
- "github.githubassets.com"
- "msfeed25.pkgs.visualstudio.com"
- "update.googleapis.com"
- "www.google.com"
- "www.gstatic.com"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Note: Java (Maven) builds initially failed with Warning Firewall blocked 9 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.nuget.org"
- "bun.sh"
- "dc.services.visualstudio.com"
- "deno.land"
- "dl.deno.land"
- "github.com"
- "releaseassets.githubusercontent.com"
- "repo.maven.apache.org"
- "repo1.maven.org"See Network Configuration for more information.
|
The 'Agent routing is credential-triggered' caution note said Anthropic WIF was the only exception to credential-triggered agent routing. PR #8888 (merged 2026-09-22) added isGcpOidcConfigured() checks to gemini-credential-env.ts and vertex-credential-env.ts, giving GCP WIF the same OIDC-aware agent routing for Gemini/Vertex. Copilot's GCP OIDC support remains credential-triggered only (buildCopilotCredentialEnv() has no isGcpOidcConfigured() check), so the note is updated to name all three current exceptions precisely instead of implying only Anthropic qualifies. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…-matrix.md (#8953) * docs(auth-matrix): correct stale GCP OIDC agent-routing claim The 'Agent routing is credential-triggered' caution note said Anthropic WIF was the only exception to credential-triggered agent routing. PR #8888 (merged 2026-09-22) added isGcpOidcConfigured() checks to gemini-credential-env.ts and vertex-credential-env.ts, giving GCP WIF the same OIDC-aware agent routing for Gemini/Vertex. Copilot's GCP OIDC support remains credential-triggered only (buildCopilotCredentialEnv() has no isGcpOidcConfigured() check), so the note is updated to name all three current exceptions precisely instead of implying only Anthropic qualifies. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Revise auth-matrix.md for OIDC support updates Updated documentation to reflect GCP OIDC support alongside Azure and AWS for OpenAI/Copilot, clarifying sidecar authentication capabilities and exceptions for specific providers. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Landon Cox <landon.cox@microsoft.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>


Gemini/Vertex proxy auth ignored
AWF_AUTH_GCP_*WIF configuration, leaving Gemini CLI to fall back to GCE metadata and fail under Squid. This adds a sidecar-only GCP OIDC token path for native Gemini and Vertex requests.Google adapter auth
x-goog-api-key.Agent routing
GEMINI_API_KEYorGOOGLE_API_KEY.Docs
Example configuration: