Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions docs/src/content/docs/reference/engines.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,43 @@ engine:

Environment variables can also be defined at workflow, job, step, and other scopes. See [Environment Variables](/gh-aw/reference/environment-variables/) for complete documentation on precedence and all 13 env scopes.

#### Custom API Endpoints

Two environment variables receive special treatment when set in `engine.env`: `OPENAI_BASE_URL` (for `codex`) and `ANTHROPIC_BASE_URL` (for `claude`). When either is present, the AWF sandbox proxy automatically routes API calls to the specified host instead of the default `api.openai.com` or `api.anthropic.com`. Credential isolation and firewall enforcement remain active.
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The term “AWF sandbox proxy” isn’t used elsewhere in the docs and may be confusing/inconsistent with established terminology (“AWF firewall” / “API proxy sidecar”). Consider renaming this to match existing docs terminology, or add a brief link/clarifier to the network/firewall docs (e.g., docs/src/content/docs/reference/network.md:10,180).

Suggested change
Two environment variables receive special treatment when set in `engine.env`: `OPENAI_BASE_URL` (for `codex`) and `ANTHROPIC_BASE_URL` (for `claude`). When either is present, the AWF sandbox proxy automatically routes API calls to the specified host instead of the default `api.openai.com` or `api.anthropic.com`. Credential isolation and firewall enforcement remain active.
Two environment variables receive special treatment when set in `engine.env`: `OPENAI_BASE_URL` (for `codex`) and `ANTHROPIC_BASE_URL` (for `claude`). When either is present, the AWF API proxy sidecar automatically routes API calls to the specified host instead of the default `api.openai.com` or `api.anthropic.com`, while the [AWF firewall](/gh-aw/reference/network/#firewall) continues to enforce outbound network policy and credential isolation.

Copilot uses AI. Check for mistakes.

This enables workflows to use internal LLM routers, Azure OpenAI deployments, or other OpenAI-compatible endpoints without bypassing AWF's security model.

```yaml wrap
engine:
id: codex
model: gpt-4o
env:
OPENAI_BASE_URL: "https://llm-router.internal.example.com/v1"
OPENAI_API_KEY: ${{ secrets.LLM_ROUTER_KEY }}

network:
allowed:
- github.com
- llm-router.internal.example.com # must be listed here for the firewall to permit outbound requests
```

For Claude workflows routed through a custom Anthropic-compatible endpoint:

```yaml wrap
engine:
id: claude
env:
ANTHROPIC_BASE_URL: "https://anthropic-proxy.internal.example.com"
ANTHROPIC_API_KEY: ${{ secrets.PROXY_API_KEY }}

network:
allowed:
- github.com
- anthropic-proxy.internal.example.com
```

The custom hostname is extracted from the URL and passed to the AWF `--openai-api-target` or `--anthropic-api-target` flag automatically at compile time. No additional configuration is required.
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph currently says “The custom hostname is extracted … No additional configuration is required.” Two accuracy issues: (1) the implementation extracts the host (and optional port), and ignores scheme/path; calling it only a “hostname” is slightly misleading, especially for localhost/ports. (2) Workflows typically still need to allow the extracted host in network.allowed (as your example already notes), so “no additional configuration” is easy to misread. Suggest rephrasing to explicitly say it forwards the extracted host[:port] as --openai-api-target/--anthropic-api-target, and that you may need to add the domain to network.allowed for the firewall.

Suggested change
The custom hostname is extracted from the URL and passed to the AWF `--openai-api-target` or `--anthropic-api-target` flag automatically at compile time. No additional configuration is required.
The custom host (including any port) is extracted from the base URL (scheme and path are ignored) and automatically forwarded at compile time as the AWF `--openai-api-target` or `--anthropic-api-target` flag. You may still need to add the extracted host (and port, if applicable) to `network.allowed` so the firewall permits outbound requests.

Copilot uses AI. Check for mistakes.

### Engine Command-Line Arguments

All engines support custom command-line arguments through the `args` field, injected before the prompt:
Expand Down
Loading