Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0ecf15c
Initial plan
Claude Feb 13, 2026
a532d64
feat(cli): enable api proxy by default
Claude Feb 13, 2026
5600235
docs: update api-proxy-sidecar.md to reflect default enabled
Claude Feb 13, 2026
cf44476
fix: build api-proxy locally while pulling other containers from GHCR…
Claude Feb 13, 2026
f8fd823
[WIP] Fix the failing GitHub Actions workflow for Test Examples (#800)
Claude Feb 13, 2026
caccd77
fix(api-proxy): keep container running when no API keys present (#801)
Claude Feb 13, 2026
5e69a55
fix(api-proxy): allow direct agent-to-api-proxy traffic bypassing Squid
Mossaka Feb 13, 2026
5f9db48
test: add coverage for api-proxy NO_PROXY and AWF_API_PROXY_IP
Mossaka Feb 13, 2026
1c3e5f4
fix(api-proxy): allow api-proxy outbound traffic in host iptables
Mossaka Feb 13, 2026
537e383
fix(api-proxy): use IP address for API base URLs to avoid DNS issues
Mossaka Feb 13, 2026
c32fe02
fix(ci): add BASE_URL environment variables for CODEX api-proxy routi…
Claude Feb 13, 2026
91c9df5
fix(ci): add network CIDR and localhost to NO_PROXY for api-proxy (#822)
Claude Feb 13, 2026
55c4426
[WIP] Fix failing GitHub Actions workflow agent (#824)
Claude Feb 13, 2026
30e4df6
[WIP] Fix failing GitHub Actions workflow agent (#825)
Claude Feb 13, 2026
2e6ea38
fix(workflow): correct api-proxy IP address in smoke-codex.lock.yml (…
Claude Feb 13, 2026
747f69e
fix(api-proxy): remove proxy agent from Anthropic, keep for OpenAI
Claude Feb 13, 2026
46dd760
fix(api-proxy): remove Anthropic support, pass key directly to agent
Claude Feb 13, 2026
67d85bb
fix(ci): add missing ANTHROPIC_API_KEY to detection job (#827)
Claude Feb 13, 2026
299d116
feat(api-proxy): replace Node.js with Kong Gateway
Claude Feb 13, 2026
defcd9e
fix(docs): update port references from 10000/10001 to 8000/8001
Claude Feb 13, 2026
0471956
Merge remote-tracking branch 'origin/main' into claude/enable-api-pro…
Mossaka Feb 13, 2026
c520cee
Merge branch 'claude/enable-api-proxy-by-default' of https://github.c…
Mossaka Feb 13, 2026
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
2 changes: 0 additions & 2 deletions .github/workflows/secret-digger-claude.lock.yml

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

2 changes: 0 additions & 2 deletions .github/workflows/security-guard.lock.yml

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

7 changes: 3 additions & 4 deletions .github/workflows/smoke-codex.lock.yml

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

23 changes: 23 additions & 0 deletions containers/agent/setup-iptables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,21 @@ fi
echo "[iptables] Allow traffic to Squid proxy (${SQUID_IP}:${SQUID_PORT})..."
iptables -t nat -A OUTPUT -d "$SQUID_IP" -j RETURN

# Bypass Squid for api-proxy when API proxy IP is configured.
# The agent needs to connect directly to api-proxy (not through Squid).
# The api-proxy then routes outbound traffic through Squid to enforce domain whitelisting.
# Architecture: agent -> api-proxy (direct) -> Squid -> internet
# Use AWF_API_PROXY_IP environment variable set by docker-manager (172.30.0.30)
if [ -n "$AWF_API_PROXY_IP" ]; then
if is_valid_ipv4 "$AWF_API_PROXY_IP"; then
echo "[iptables] Allow direct traffic to api-proxy (${AWF_API_PROXY_IP}) - bypassing Squid..."
# NAT: skip DNAT to Squid for all traffic to api-proxy
iptables -t nat -A OUTPUT -d "$AWF_API_PROXY_IP" -j RETURN
else
echo "[iptables] WARNING: AWF_API_PROXY_IP has invalid format '${AWF_API_PROXY_IP}', skipping api-proxy bypass"
fi
fi

# Bypass Squid for host.docker.internal when host access is enabled.
# MCP gateway traffic to host.docker.internal gets DNAT'd to Squid,
# where Squid fails with "Invalid URL" because rmcp sends relative URLs.
Expand Down Expand Up @@ -263,6 +278,14 @@ iptables -A OUTPUT -p tcp -d 127.0.0.11 --dport 53 -j ACCEPT
# Allow traffic to Squid proxy (after NAT redirection)
iptables -A OUTPUT -p tcp -d "$SQUID_IP" -j ACCEPT

# Allow traffic to Kong API Gateway sidecar (port 8000 for OpenAI proxy, 8001 for admin API)
# Must be added before the final DROP rule
if [ -n "$AWF_API_PROXY_IP" ]; then
echo "[iptables] Allow traffic to Kong Gateway (${AWF_API_PROXY_IP}) ports 8000, 8001..."
iptables -A OUTPUT -p tcp -d "$AWF_API_PROXY_IP" --dport 8000 -j ACCEPT
iptables -A OUTPUT -p tcp -d "$AWF_API_PROXY_IP" --dport 8001 -j ACCEPT
fi

# Drop all other TCP traffic (default deny policy)
# This ensures that only explicitly allowed ports can be accessed
echo "[iptables] Drop all non-redirected TCP traffic (default deny)..."
Expand Down
42 changes: 19 additions & 23 deletions containers/api-proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
# Node.js API proxy for credential management
# Kong API Gateway for credential management
# Routes through Squid to respect domain whitelisting
FROM node:22-alpine
FROM kong:3.5-alpine

# Install curl for healthchecks
RUN apk add --no-cache curl
# Install curl for healthchecks and envsubst for config templating
USER root
RUN apk add --no-cache curl gettext

# Create app directory
WORKDIR /app
# Create configuration directory
RUN mkdir -p /etc/kong

# Copy package files
COPY package*.json ./
# Copy Kong declarative configuration template
COPY kong.yml.template /etc/kong/kong.yml.template

# Install dependencies
RUN npm ci --only=production
# Copy entrypoint script that generates config from environment
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

# Copy application files
COPY server.js ./

# Create non-root user
RUN addgroup -S apiproxy && adduser -S apiproxy -G apiproxy

# Switch to non-root user
USER apiproxy
# Switch back to kong user
USER kong

# Expose ports
# 10000 - OpenAI API proxy
# 10001 - Anthropic API proxy
EXPOSE 10000 10001
# 8000 - HTTP proxy port (we'll use this for OpenAI API)
# 8001 - Admin API (for health checks)
EXPOSE 8000 8001

# Start the proxy server
CMD ["node", "server.js"]
# Use our custom entrypoint that generates config from env vars
ENTRYPOINT ["/entrypoint.sh"]
2 changes: 1 addition & 1 deletion containers/api-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Node.js-based API proxy that keeps LLM API credentials isolated from the agent c

```
Agent Container (172.30.0.20)
↓ HTTP request to api-proxy:10000
↓ HTTP request to 172.30.0.30:10000
API Proxy Sidecar (172.30.0.30)
↓ Injects Authorization header
↓ Routes via HTTP_PROXY (172.30.0.10:3128)
Expand Down
Loading
Loading