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
{{ message }}
Repository navigation
[awf] docs: COPILOT_PROVIDER_* BYOK variables undocumented and domain allowlist not updated #2331
Users attempting to configure a Bring-Your-Own-Key (BYOK) external model provider with gh aw cannot find documentation for the COPILOT_PROVIDER_* environment variables. Additionally, engine.env secrets may be leaked warnings surface, and the firewall domain allowlist is not updated to permit the external provider's API endpoint.
Context
Reported in github/gh-aw#29378 by @MauroDruwel. An internal comment from @lpcox (2026-05-01) describes the full variable set, but this is not captured in any official docs.
Root Cause
No documentation page (README, guides, or docs/) covers COPILOT_PROVIDER_BASE_URL, COPILOT_PROVIDER_API_KEY, COPILOT_PROVIDER_TYPE, COPILOT_MODEL, and related optional vars.
The AWF domain allowlist (src/squid-config.ts or equivalent allow-domains defaults) is not updated to include external provider API hostnames when BYOK is active.
Users are unsure whether engine.env is the right place for provider secrets, causing confusion about credential handling.
Proposed Solution
Add a BYOK guide to the docs with the complete variable reference (required/optional, descriptions, and a working example workflow).
When COPILOT_PROVIDER_BASE_URL is set, automatically extract its hostname and inject it into the AWF domain allowlist.
Clarify in docs that engine.env secrets are the correct placement and explain how AWF handles them securely.
AWF and the api-proxy sidecar fully support BYOK (Bring Your Own Key) for external model providers. Here's how it works:
Domain Allowlisting
AWF reads --copilot-api-target (CLI flag) or COPILOT_API_TARGET (env var) and automatically adds the hostname to the Squid domain allowlist via resolveApiTargetsToAllowedDomains() in src/cli.ts:571-626.
The same mechanism exists for all providers: --openai-api-target, --anthropic-api-target, --gemini-api-target.
Credential Isolation (with --enable-api-proxy)
When the api-proxy sidecar is active:
COPILOT_PROVIDER_BASE_URL is overridden to point at the local sidecar (http://172.30.0.30:10002) — src/docker-manager.ts:1920
COPILOT_PROVIDER_API_KEY is set to a placeholder — the real key is held by the sidecar and never exposed to the agent
The sidecar injects the real COPILOT_API_KEY and forwards requests through Squid to COPILOT_API_TARGET
COPILOT_PROVIDER_API_KEY is in AWF_ONE_SHOT_TOKENS for additional protection
gh-aw Workflow Usage
In agentic workflows, the compiler passes COPILOT_API_TARGET to AWF from the engine.env configuration. The domain is then auto-allowed.
Documentation
The api-proxy sidecar docs cover this: docs/api-proxy-sidecar.md:150-151.
Activity
pelikhan commentedon May 1, 2026
I merge on my side, I taught it was supported already.
lpcox commentedon May 1, 2026
Already Supported
AWF and the api-proxy sidecar fully support BYOK (Bring Your Own Key) for external model providers. Here's how it works:
Domain Allowlisting
--copilot-api-target(CLI flag) orCOPILOT_API_TARGET(env var) and automatically adds the hostname to the Squid domain allowlist viaresolveApiTargetsToAllowedDomains()insrc/cli.ts:571-626.--openai-api-target,--anthropic-api-target,--gemini-api-target.Credential Isolation (with
--enable-api-proxy)When the api-proxy sidecar is active:
COPILOT_PROVIDER_BASE_URLis overridden to point at the local sidecar (http://172.30.0.30:10002) —src/docker-manager.ts:1920COPILOT_PROVIDER_API_KEYis set to a placeholder — the real key is held by the sidecar and never exposed to the agentCOPILOT_API_KEYand forwards requests through Squid toCOPILOT_API_TARGETCOPILOT_PROVIDER_API_KEYis inAWF_ONE_SHOT_TOKENSfor additional protectiongh-aw Workflow Usage
In agentic workflows, the compiler passes
COPILOT_API_TARGETto AWF from theengine.envconfiguration. The domain is then auto-allowed.Documentation
The api-proxy sidecar docs cover this:
docs/api-proxy-sidecar.md:150-151.Closing as already implemented.