You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support runtime secret-backed OpenAI endpoint override in AWF api-proxy (#6656)
* Initial plan
* feat: support secret-backed OpenAI endpoint override
* fix: address review feedback for secret-backed OpenAI endpoint override
Three security issues identified in code review are fixed:
1. Sensitive hostname not leaked in logs/audit (Issue 1):
- Add sensitiveAllowedDomains to NetworkOptions and propagate through config
- resolveApiTargetsToAllowedDomains routes secret-derived entries to
sensitiveAllowedDomains instead of allowedDomains when the array is provided
- Squid config generation combines both arrays so egress still works
- sensitiveAllowedDomains added to SENSITIVE_CONFIG_KEYS so it is
excluded from the debug log and awf-resolved-config.json audit artifact
2. OPENAI_ENDPOINT_OVERRIDE excluded from agent environment (Issue 2):
- Added to excluded-vars.ts when enableApiProxy is true so the sidecar
endpoint URL never reaches the untrusted agent container
3. Allowlist resolution parity with sidecar routing (Issue 3):
- resolveApiTargetsToAllowedDomains accepts new openaiEndpointOverride param
- preflight.ts resolves OPENAI_ENDPOINT_OVERRIDE from all config sources
(additionalEnv > envFile > process.env) matching getConfigEnvValue semantics
- Ensures that --env / --env-file supplied overrides reach the Squid ACL
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/api-proxy-sidecar.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -318,7 +318,7 @@ If the key is present only in `secrets.*` but not exported into the step's `env:
318
318
319
319
| Flag | Default | Description |
320
320
|------|---------|-------------|
321
-
| `--openai-api-target <host>` | `api.openai.com` | Custom upstream for OpenAI API requests (e.g. Azure OpenAI or an internal LLM router). Can also be set via `OPENAI_API_TARGET` env var. |
321
+
| `--openai-api-target <host>` | `api.openai.com` | Custom upstream for OpenAI API requests (e.g. Azure OpenAI or an internal LLM router). Can also be set via `OPENAI_API_TARGET` env var (or `OPENAI_ENDPOINT_OVERRIDE` for runtime secret-backed endpoint injection). |
322
322
| `--anthropic-api-target <host>` | `api.anthropic.com` | Custom upstream for Anthropic API requests (e.g. an internal Claude router). Can also be set via `ANTHROPIC_API_TARGET` env var. |
323
323
| `--copilot-api-target <host>` | auto-derived | Custom upstream for GitHub Copilot API requests (useful for GHES). Can also be set via `COPILOT_API_TARGET` env var. |
324
324
| `--vertex-api-target <host>` | `aiplatform.googleapis.com` | Custom upstream for Vertex API requests. Can also be set via `VERTEX_API_TARGET` env var. |
0 commit comments