Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions .github/workflows/smoke-gemini.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .github/workflows/smoke-gemini.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ network:
allowed:
- defaults
- github
- generativelanguage.googleapis.com
- aiplatform.googleapis.com
tools:
bash:
- "*"
Expand Down
12 changes: 11 additions & 1 deletion src/container-lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as fs from 'fs';
import * as path from 'path';
import * as yaml from 'js-yaml';
import execa from 'execa';
import { WrapperConfig, BlockedTarget } from './types';
import { WrapperConfig, BlockedTarget, API_PROXY_PORTS } from './types';
import { logger } from './logger';
import { generateSquidConfig, generatePolicyManifest } from './squid-config';
import { parseDomainWithProtocol, isWildcardPattern, wildcardToRegex } from './domain-patterns';
Expand Down Expand Up @@ -252,6 +252,13 @@ export async function writeConfigs(config: WrapperConfig): Promise<void> {
enableDlp: config.enableDlp,
dnsServers: config.dnsServers,
upstreamProxy: config.upstreamProxy,
// Allow the api-proxy sidecar IP through Squid before the raw-IP deny rule.
// Some HTTP clients (e.g., Node.js fetch / undici ProxyAgent) route requests
// to the api-proxy via HTTP_PROXY without honouring NO_PROXY for raw IPs.
...(config.enableApiProxy && networkConfig.proxyIp ? {
apiProxyIp: networkConfig.proxyIp,
apiProxyPorts: Object.values(API_PROXY_PORTS),
} : {}),
});
const squidConfigPath = path.join(config.workDir, 'squid.conf');
fs.writeFileSync(squidConfigPath, squidConfig, { mode: 0o644 });
Expand Down Expand Up @@ -297,6 +304,9 @@ export async function writeConfigs(config: WrapperConfig): Promise<void> {
allowHostPorts: config.allowHostPorts,
enableDlp: config.enableDlp,
dnsServers: config.dnsServers,
...(config.enableApiProxy && networkConfig.proxyIp ? {
apiProxyIp: networkConfig.proxyIp,
} : {}),
});
fs.writeFileSync(
path.join(auditDir, 'policy-manifest.json'),
Expand Down
7 changes: 7 additions & 0 deletions src/services/agent-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ export function buildAgentEnvironment(params: AgentEnvironmentParams): Record<st
// via --env-all; they are set explicitly by generateDockerCompose when needed.
'AWF_PREFLIGHT_BINARY',
'AWF_GEMINI_ENABLED',
// Host-side MCP gateway domain (always "localhost" on the runner) must not leak
// into the agent container. Inside the container, MCP CLI wrappers must use
// MCP_GATEWAY_DOMAIN (host.docker.internal) to reach the gateway — not this
// host-only alias. Leaking MCP_GATEWAY_HOST_DOMAIN=localhost causes some HTTP
// clients to route MCP gateway requests through HTTP_PROXY to Squid, which then
// blocks "localhost" because it is not in the domain allow-list.
'MCP_GATEWAY_HOST_DOMAIN',
]);

// When api-proxy is enabled, exclude API keys from agent environment
Expand Down
Loading
Loading