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
Enable DLP scanning as a defense-in-depth measure when running untrusted code that has access to environment variables or files containing credentials.
574
584
:::
575
585
586
+
### `--enable-api-proxy`
587
+
588
+
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.
**Required environment variables** (at least one):
600
+
601
+
| Variable | Provider |
602
+
|----------|----------|
603
+
| `OPENAI_API_KEY` | OpenAI / Codex |
604
+
| `ANTHROPIC_API_KEY` | Anthropic / Claude |
605
+
| `COPILOT_GITHUB_TOKEN` | GitHub Copilot |
606
+
607
+
**Sidecar ports:**
608
+
609
+
| Port | Provider |
610
+
|------|----------|
611
+
| `10000` | OpenAI |
612
+
| `10001` | Anthropic |
613
+
| `10002` | GitHub Copilot |
614
+
| `10004` | OpenCode |
615
+
616
+
:::tip
617
+
Use `sudo -E` to preserve environment variables like API keys through sudo.
618
+
:::
619
+
620
+
:::danger[Security]
621
+
API keys are held exclusively in the sidecar container. The agent container receives only the sidecar proxy URL — never the actual credentials.
622
+
:::
623
+
624
+
### `--copilot-api-target <host>`
625
+
626
+
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.
627
+
628
+
- **Default:** `api.githubcopilot.com`
629
+
- **Requires:** `--enable-api-proxy`
630
+
631
+
```bash
632
+
sudo -E awf --enable-api-proxy \
633
+
--copilot-api-target api.github.mycompany.com \
634
+
--allow-domains api.github.mycompany.com \
635
+
-- command
636
+
```
637
+
638
+
### `--openai-api-target <host>`
639
+
640
+
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.
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.
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.
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.
685
+
686
+
- **Default:** none
687
+
- **Requires:** `--enable-api-proxy`
688
+
689
+
```bash
690
+
sudo -E awf --enable-api-proxy \
691
+
--anthropic-api-target custom-llm.example.com \
692
+
--anthropic-api-base-path /anthropic \
693
+
--allow-domains custom-llm.example.com \
694
+
-- command
695
+
```
696
+
697
+
### `--rate-limit-rpm <n>`
698
+
699
+
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.
700
+
701
+
- **Default:** `600` (when rate limiting is enabled)
702
+
- **Requires:** `--enable-api-proxy`
703
+
704
+
```bash
705
+
sudo -E awf --enable-api-proxy \
706
+
--rate-limit-rpm 100 \
707
+
--allow-domains api.openai.com \
708
+
-- command
709
+
```
710
+
711
+
### `--rate-limit-rph <n>`
712
+
713
+
Maximum number of requests per hour per provider.
714
+
715
+
- **Default:** `10000` (when rate limiting is enabled)
716
+
- **Requires:** `--enable-api-proxy`
717
+
718
+
```bash
719
+
sudo -E awf --enable-api-proxy \
720
+
--rate-limit-rph 5000 \
721
+
--allow-domains api.anthropic.com \
722
+
-- command
723
+
```
724
+
725
+
### `--rate-limit-bytes-pm <n>`
726
+
727
+
Maximum request bytes per minute per provider.
728
+
729
+
- **Default:** `52428800` (~50 MB, when rate limiting is enabled)
730
+
- **Requires:** `--enable-api-proxy`
731
+
732
+
```bash
733
+
sudo -E awf --enable-api-proxy \
734
+
--rate-limit-bytes-pm 10485760 \
735
+
--allow-domains api.openai.com \
736
+
-- command
737
+
```
738
+
739
+
### `--no-rate-limit`
740
+
741
+
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.
742
+
743
+
- **Requires:** `--enable-api-proxy`
744
+
745
+
```bash
746
+
sudo -E awf --enable-api-proxy --no-rate-limit \
747
+
--allow-domains api.anthropic.com \
748
+
-- command
749
+
```
750
+
751
+
:::caution
752
+
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.
753
+
:::
576
754
577
755
## Exit Codes
578
756
@@ -885,6 +1063,7 @@ Denied Requests (3):
885
1063
886
1064
## See Also
887
1065
1066
+
-[API Proxy Sidecar](/gh-aw-firewall/reference/api-proxy-sidecar) - Secure credential injection architecture and configuration
888
1067
-[Domain Filtering Guide](/gh-aw-firewall/guides/domain-filtering) - Allowlists, blocklists, and wildcards
889
1068
-[SSL Bump Reference](/gh-aw-firewall/reference/ssl-bump/) - HTTPS content inspection and URL filtering
890
1069
-[Quick Start Guide](/gh-aw-firewall/quickstart) - Getting started with examples
0 commit comments