Repository navigation
Closed
Labels
Description
Summary
With the Gemini engine under network isolation (network: defaults), every run logs 60–72 CONNECT localhost:8080 → 403 TCP_DENIED entries in its firewall report. The agent's MCP client repeatedly tries to reach the in-container MCP gateway at localhost:8080 through the squid egress proxy, which denies it (deny-default). MCP eventually connects via the awmg-mcpg topology hostname and runs succeed, so this is harmless startup-retry noise — but it's noisy, alarming ("MCP issues detected. Run /mcp list for status." prints on every run), and wastes ~50s of retries.
Environment
- gh-aw setup
v0.83.4, AWF firewallv0.27.42, MCP gatewayv0.4.6 - Engine:
gemini(gemini --yolo --skip-trust --output-format stream-json) network: defaults(squid egress isolation,isolation:true,topologyAttach:["awmg-mcpg"])
Root cause
- The compiler sets
MCP_GATEWAY_HOST_DOMAIN="localhost", so the Gemini CLI's MCP client is pointed athttp://localhost:8080/mcp/<server>. - The AWF agent entrypoint sets
HTTP_PROXY/HTTPS_PROXY=http://<squid>:3128but noNO_PROXY. - The Gemini CLI honors
HTTP_PROXYbut ignoresNO_PROXY, so it tunnelslocalhost:8080through squid viaCONNECT. - The squid ACL allowlists real egress domains (and the
awmg-mcpgtopology peer) but has nodstdomain localhost— loopback is only represented asdst 127.0.0.1/ broken.127.0.0.1/.::1dstdomainentries. SoCONNECT localhost:8080matches no allow rule →deny-default.
Audit sample (agent/sandbox/firewall/logs/audit.jsonl):
{"event":"http_access","client":"172.30.0.20","host":"localhost:8080","method":"CONNECT","status":403,"decision":"TCP_DENIED","url":"localhost:8080"}Firewall report:
| localhost | 0 | 62 | ← deny-default
| generativelanguage.googleapis.com | 24 | 0 |
What does NOT fix it (tested on live runs)
- Allowlisting loopback via the
localnetwork ecosystem — the firewall emitsdstdomain .127.0.0.1/.::1(broken leading-dot IP rules) and neverdstdomain localhost, soCONNECT localhost:8080is still denied. NO_PROXY=localhost,127.0.0.1,::1at the workflow level (forwarded viaawf --env-all) — the Gemini CLI ignoresNO_PROXY, so it still proxies loopback.
Suggested fixes (upstream)
- Address the MCP gateway by the allowlisted topology hostname (
awmg-mcpg:8080) instead oflocalhost:8080for the Gemini engine — the auto-allow-topology-hostnames ACL (firewall [plan] Upgrade lipgloss to stable v1.1.0 release #6473) already permits it; or - Set
NO_PROXY/no_proxy=localhost,127.0.0.1,::1in the agent container entrypoint so loopback bypasses squid regardless of engine; or - Emit a real
dstdomain localhostallow rule (not.127.0.0.1/.::1) when loopback is allowlisted.
Happy to test a fix. Thanks!
Reacted by Copilot
Activity
chore(aw): bump gh-aw to v0.83.4; document MCP-gateway firewall-denia…
Fix Gemini engine MCP gateway host domain to use topology hostname un…
gemini: use topology hostname for MCP_GATEWAY_HOST_DOMAIN under netwo…