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
You are a security-focused AI agent that carefully reviews pull requests in this repository to identify changes that could weaken the security posture or extend the security boundaries of the Agentic Workflow Firewall (AWF).
63
+
## Security Relevance Check
64
+
65
+
**Security-critical files changed in this PR:** ${{ steps.security-relevance.outputs.security_files_changed }}
66
+
67
+
> If this value is `0`, no security-critical files were modified. Use `noop` immediately without further analysis — this PR does not require a security review.
50
68
51
69
## Repository Context
52
70
71
+
You are a security-focused AI agent that carefully reviews pull requests in this repository to identify changes that could weaken the security posture or extend the security boundaries of the Agentic Workflow Firewall (AWF).
72
+
53
73
This repository implements a **network firewall for AI agents** that provides L7 (HTTP/HTTPS) egress control using Squid proxy and Docker containers. The firewall restricts network access to a whitelist of approved domains.
54
74
55
75
### Critical Security Components
@@ -134,6 +154,8 @@ Look for these types of security-weakening changes:
134
154
135
155
## Output Format
136
156
157
+
**IMPORTANT: Be concise.** Report each security finding in ≤ 150 words. Maximum 5 findings total.
158
+
137
159
If you find security concerns:
138
160
1. Add a comment to the PR explaining each concern
|`COPILOT_PROVIDER_BASE_URL`|`http://172.30.0.30:10002`|`COPILOT_API_KEY` provided to host | Points Copilot CLI BYOK provider at sidecar |
150
151
|`COPILOT_PROVIDER_API_KEY`|`placeholder-token-for-credential-isolation`|`COPILOT_API_KEY` provided to host | BYOK provider API key placeholder (real key in sidecar) |
152
+
|`GEMINI_API_BASE_URL`|`http://172.30.0.30:10003`|`--enable-api-proxy` always | Redirects Gemini CLI to proxy (set unconditionally — see note below) |
153
+
|`GEMINI_API_KEY`|`gemini-api-key-placeholder-for-credential-isolation`|`--enable-api-proxy` always | Placeholder so Gemini CLI auth check passes (real key in sidecar) |
151
154
|`OPENAI_API_KEY`| Not set |`--enable-api-proxy`| Excluded from agent (held in api-proxy) |
152
155
|`ANTHROPIC_API_KEY`| Not set |`--enable-api-proxy`| Excluded from agent (held in api-proxy) |
153
156
|`HTTP_PROXY`|`http://172.30.0.10:3128`| Always | Routes through Squid proxy |
@@ -156,6 +159,14 @@ The agent container receives **redacted placeholders** and proxy URLs:
156
159
|`AWF_API_PROXY_IP`|`172.30.0.30`|`--enable-api-proxy`| Used by iptables setup script |
157
160
|`AWF_ONE_SHOT_TOKENS`|`COPILOT_GITHUB_TOKEN,GITHUB_TOKEN,...`| Always | Tokens protected by one-shot-token library |
158
161
162
+
:::note[Gemini always redirected to proxy]
163
+
Unlike OpenAI, Anthropic, and Copilot, `GEMINI_API_BASE_URL` and the `GEMINI_API_KEY` placeholder are **always** set in the agent when `--enable-api-proxy` is active, regardless of whether `GEMINI_API_KEY` is present in the runner environment.
164
+
165
+
This prevents the Gemini CLI from failing with exit code 41 ("no auth method") when the real API key is only available as a GitHub Actions secret (not as a runner-level environment variable). In that case the api-proxy sidecar will return `503` for Gemini requests — a clear, actionable failure rather than a confusing missing-auth error.
166
+
167
+
**Important**: `GEMINI_API_KEY` must be set as a **runner-level environment variable** (e.g. `env: GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}` in the workflow step), not only as a GitHub Actions secret. The AWF process running on the runner must be able to read it so it can pass the key to the api-proxy sidecar container.
168
+
:::
169
+
159
170
:::tip[Placeholder tokens]
160
171
Token variables in the agent are set to `placeholder-token-for-credential-isolation` instead of real values. This ensures:
-`COPILOT_API_KEY` — GitHub Copilot API key (BYOK)
279
+
280
+
:::caution[GitHub Actions: expose keys as runner env vars]
281
+
When running AWF in a GitHub Actions workflow, API keys must be available as **runner-level environment variables** — not just as GitHub Actions secrets. AWF reads the key from the environment at startup to pass it to the api-proxy sidecar container. Use `env:` in the workflow step and `sudo --preserve-env` to ensure keys pass through:
> **Note:** `sudo` strips most environment variables by default. Use `--preserve-env=VAR` (or `sudo -E` to preserve all) to ensure API keys are visible to the AWF process.
291
+
292
+
If the key is present only in `secrets.*` but not exported into the step's `env:`, AWF will warn that no Gemini key was found and the api-proxy Gemini listener will return `503`.
- **Proxy**: Routes via Squid at `http://172.30.0.10:3128`
288
317
289
318
### Health check
@@ -296,14 +325,33 @@ Docker healthcheck on the `/health` endpoint (port 10000):
296
325
297
326
## Troubleshooting
298
327
328
+
### Gemini proxy returns 503
329
+
330
+
When `--enable-api-proxy` is active, `GEMINI_API_BASE_URL` and a placeholder `GEMINI_API_KEY` are always injected into the agent container. If the real `GEMINI_API_KEY` was not set in the AWF runner environment, the api-proxy Gemini listener (port 10003) responds with **503** to all requests.
331
+
332
+
**Solution**: Export `GEMINI_API_KEY` in the runner environment before invoking AWF. In GitHub Actions, add it to the step's `env:` block and use `sudo --preserve-env`:
> **Note:** Exit code 41 ("no auth method") should no longer occur with `--enable-api-proxy` since the placeholder key satisfies the CLI's pre-flight check. If you see exit 41, ensure `--enable-api-proxy` is active.
346
+
299
347
### API keys not detected
300
348
301
349
```
302
350
⚠️ API proxy enabled but no API keys found in environment
303
-
Set OPENAI_API_KEYor ANTHROPIC_API_KEY to use the proxy
351
+
Set OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, COPILOT_GITHUB_TOKEN, or COPILOT_API_KEY to use the proxy
304
352
```
305
353
306
-
**Solution**: Export API keys before running awf:
354
+
**Solution**: Export API keys before running awf (use `sudo --preserve-env` in CI):
0 commit comments