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
179 changes: 179 additions & 0 deletions docs-site/src/content/docs/reference/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ awf [options] -- <command>
| `--enable-dind` | flag | `false` | Enable Docker-in-Docker by exposing host Docker socket |
| `--enable-dlp` | flag | `false` | Enable DLP scanning to block credential exfiltration |
| `--agent-image <value>` | string | `default` | Agent container image (default, act, or custom) |
| `--enable-api-proxy` | flag | `false` | Enable API proxy sidecar for secure credential injection |
| `--copilot-api-target <host>` | string | `api.githubcopilot.com` | Target hostname for Copilot API requests |
| `--openai-api-target <host>` | string | `api.openai.com` | Target hostname for OpenAI API requests |
| `--openai-api-base-path <path>` | string | — | Base path prefix for OpenAI API requests |
| `--anthropic-api-target <host>` | string | `api.anthropic.com` | Target hostname for Anthropic API requests |
| `--anthropic-api-base-path <path>` | string | — | Base path prefix for Anthropic API requests |
| `--rate-limit-rpm <n>` | number | `600` | Max requests per minute per provider |
| `--rate-limit-rph <n>` | number | `10000` | Max requests per hour per provider |
| `--rate-limit-bytes-pm <n>` | number | `52428800` (~50 MB) | Max request bytes per minute per provider |
Comment on lines +61 to +63
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The Options Summary table lists --rate-limit-* defaults as always-on numeric values, but buildRateLimitConfig only applies these defaults when rate limiting is enabled (i.e., when at least one --rate-limit-* flag is provided). Consider updating the defaults column to reflect this (e.g., “600 (when enabled)”) to avoid implying rate limiting is enabled by default.

Suggested change
| `--rate-limit-rpm <n>` | number | `600` | Max requests per minute per provider |
| `--rate-limit-rph <n>` | number | `10000` | Max requests per hour per provider |
| `--rate-limit-bytes-pm <n>` | number | `52428800` (~50 MB) | Max request bytes per minute per provider |
| `--rate-limit-rpm <n>` | number | `600` (when enabled) | Max requests per minute per provider |
| `--rate-limit-rph <n>` | number | `10000` (when enabled) | Max requests per hour per provider |
| `--rate-limit-bytes-pm <n>` | number | `52428800` (~50 MB, when enabled) | Max request bytes per minute per provider |

Copilot uses AI. Check for mistakes.
| `--no-rate-limit` | flag | — | Disable rate limiting in API proxy |
| `-V, --version` | flag | — | Display version |
| `-h, --help` | flag | — | Display help |

Expand Down Expand Up @@ -573,6 +583,174 @@ sudo awf --enable-dlp --allow-domains github.com \
Enable DLP scanning as a defense-in-depth measure when running untrusted code that has access to environment variables or files containing credentials.
:::

### `--enable-api-proxy`

Enable the API proxy sidecar for secure credential injection. The sidecar is a Node.js proxy (`172.30.0.30`) that holds real API credentials so the agent never sees them. The agent sends unauthenticated requests to the sidecar, which injects the credentials and forwards the request through Squid to the upstream API.

```bash
# Enable with keys from environment
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
sudo -E awf --enable-api-proxy \
--allow-domains api.openai.com,api.anthropic.com \
-- command
```

**Required environment variables** (at least one):

| Variable | Provider |
|----------|----------|
| `OPENAI_API_KEY` | OpenAI / Codex |
| `ANTHROPIC_API_KEY` | Anthropic / Claude |
| `COPILOT_GITHUB_TOKEN` | GitHub Copilot |

Comment on lines +599 to +606
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

This section labels the API key environment variables as “Required”, but the CLI does not require them to be set when --enable-api-proxy is used—validateApiProxyConfig only emits warnings when no keys are present. Consider rewording to indicate they’re required to make proxied requests (or “recommended”), rather than required to run the command.

Copilot uses AI. Check for mistakes.
**Sidecar ports:**

| Port | Provider |
|------|----------|
| `10000` | OpenAI |
| `10001` | Anthropic |
| `10002` | GitHub Copilot |
| `10004` | OpenCode |

:::tip
Use `sudo -E` to preserve environment variables like API keys through sudo.
:::

:::danger[Security]
API keys are held exclusively in the sidecar container. The agent container receives only the sidecar proxy URL — never the actual credentials.
:::

### `--copilot-api-target <host>`

Target hostname for GitHub Copilot API requests. Useful for GitHub Enterprise Server (GHES) deployments where the Copilot API endpoint differs from the public default. Can also be set via the `COPILOT_API_TARGET` environment variable.

- **Default:** `api.githubcopilot.com`
- **Requires:** `--enable-api-proxy`
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The “Requires: --enable-api-proxy” line implies the CLI will error if this flag is used without --enable-api-proxy, but there’s no validation enforcing that (unlike the rate-limit flags). Consider rephrasing to something like “Only takes effect with --enable-api-proxy” to match current behavior.

This issue also appears in the following locations of the same file:

  • line 433
  • line 447
  • line 463
  • line 477
Suggested change
- **Requires:** `--enable-api-proxy`
- **Only takes effect with:** `--enable-api-proxy`

Copilot uses AI. Check for mistakes.

```bash
sudo -E awf --enable-api-proxy \
--copilot-api-target api.github.mycompany.com \
--allow-domains api.github.mycompany.com \
-- command
```

### `--openai-api-target <host>`

Target hostname for OpenAI API requests. Useful for custom OpenAI-compatible endpoints such as Azure OpenAI, internal LLM routers, vLLM, or TGI. Can also be set via the `OPENAI_API_TARGET` environment variable.

- **Default:** `api.openai.com`
- **Requires:** `--enable-api-proxy`

```bash
sudo -E awf --enable-api-proxy \
--openai-api-target llm-router.internal.example.com \
--allow-domains llm-router.internal.example.com \
-- command
```

### `--openai-api-base-path <path>`

Base path prefix prepended to every upstream OpenAI API request path. Use this when the upstream endpoint requires a URL prefix (e.g., Databricks serving endpoints, Azure OpenAI deployments). Can also be set via the `OPENAI_API_BASE_PATH` environment variable.

- **Default:** none
- **Requires:** `--enable-api-proxy`

```bash
# Databricks serving endpoint
sudo -E awf --enable-api-proxy \
--openai-api-target myworkspace.cloud.databricks.com \
--openai-api-base-path /serving-endpoints \
--allow-domains myworkspace.cloud.databricks.com \
-- command
```

### `--anthropic-api-target <host>`

Target hostname for Anthropic API requests. Useful for custom Anthropic-compatible endpoints such as internal LLM routers. Can also be set via the `ANTHROPIC_API_TARGET` environment variable.

- **Default:** `api.anthropic.com`
- **Requires:** `--enable-api-proxy`

```bash
sudo -E awf --enable-api-proxy \
--anthropic-api-target llm-router.internal.example.com \
--allow-domains llm-router.internal.example.com \
-- command
```

### `--anthropic-api-base-path <path>`

Base path prefix prepended to every upstream Anthropic API request path. Use this when the upstream endpoint requires a URL prefix. Can also be set via the `ANTHROPIC_API_BASE_PATH` environment variable.

- **Default:** none
- **Requires:** `--enable-api-proxy`

```bash
sudo -E awf --enable-api-proxy \
--anthropic-api-target custom-llm.example.com \
--anthropic-api-base-path /anthropic \
--allow-domains custom-llm.example.com \
-- command
```

### `--rate-limit-rpm <n>`

Maximum number of requests per minute per provider. Rate limiting is opt-in — it is only enabled when at least one `--rate-limit-*` flag is provided.

- **Default:** `600` (when rate limiting is enabled)
- **Requires:** `--enable-api-proxy`

```bash
sudo -E awf --enable-api-proxy \
--rate-limit-rpm 100 \
--allow-domains api.openai.com \
-- command
```

### `--rate-limit-rph <n>`

Maximum number of requests per hour per provider.

- **Default:** `10000` (when rate limiting is enabled)
- **Requires:** `--enable-api-proxy`

```bash
sudo -E awf --enable-api-proxy \
--rate-limit-rph 5000 \
--allow-domains api.anthropic.com \
-- command
```

### `--rate-limit-bytes-pm <n>`

Maximum request bytes per minute per provider.

- **Default:** `52428800` (~50 MB, when rate limiting is enabled)
- **Requires:** `--enable-api-proxy`

```bash
sudo -E awf --enable-api-proxy \
--rate-limit-bytes-pm 10485760 \
--allow-domains api.openai.com \
-- command
```

### `--no-rate-limit`

Explicitly disable rate limiting in the API proxy, even if other `--rate-limit-*` flags are provided. Useful for overriding defaults in scripts or CI configurations.

- **Requires:** `--enable-api-proxy`

```bash
sudo -E awf --enable-api-proxy --no-rate-limit \
--allow-domains api.anthropic.com \
-- command
```

:::caution
When using a custom `--openai-api-target` or `--anthropic-api-target`, you must add the target domain to `--allow-domains` so the firewall permits outbound traffic. AWF emits a warning if a custom target is set but not in the allowlist.
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

This caution says custom --*-api-target domains must be manually added to --allow-domains and that AWF will warn if they’re missing. However, the CLI currently auto-merges API target values (from flags or env) into the allowlist via resolveApiTargetsToAllowedDomains, so users generally don’t need to add them explicitly and won’t see that warning. Consider updating this note to reflect the auto-allowlisting behavior (and any remaining cases where a warning can still occur).

Suggested change
When using a custom `--openai-api-target` or `--anthropic-api-target`, you must add the target domain to `--allow-domains` so the firewall permits outbound traffic. AWF emits a warning if a custom target is set but not in the allowlist.
When you use a custom `--openai-api-target` or `--anthropic-api-target`, AWF normally adds that target domain to the effective allowlist automatically (including when the target is provided via environment variables), so you usually do not need to add it manually to `--allow-domains`. If AWF cannot resolve or apply the custom target as expected, you may still need to verify that the target domain is allowed, and a warning can still appear in those cases.

Copilot uses AI. Check for mistakes.
:::

## Exit Codes

Expand Down Expand Up @@ -885,6 +1063,7 @@ Denied Requests (3):

## See Also

- [API Proxy Sidecar](/gh-aw-firewall/reference/api-proxy-sidecar) - Secure credential injection architecture and configuration
- [Domain Filtering Guide](/gh-aw-firewall/guides/domain-filtering) - Allowlists, blocklists, and wildcards
- [SSL Bump Reference](/gh-aw-firewall/reference/ssl-bump/) - HTTPS content inspection and URL filtering
- [Quick Start Guide](/gh-aw-firewall/quickstart) - Getting started with examples
Expand Down
Loading