Skip to content

Claude-on-Copilot still emits unreachable host gateway with docker-sudo-iptables host-access sandbox #72756

Open

Description

@sakir-sathe

Summary

engine: claude with GitHub Copilot inference fails before model inference when using the docker-sudo-iptables sandbox profile together with GitHub Actions services such as PostgreSQL.

This appears to be a remaining edge case after #66788 / #66957.

The generated Claude environment receives:

ANTHROPIC_BASE_URL=http://host.docker.internal:10002

However, the AWF Copilot API proxy is running inside the sandbox network and is not reachable through host.docker.internal:10002.

As a result, the Claude pre-flight health check fails before the Claude harness can resolve the correct Copilot endpoint through /reflect.

Environment

  • gh-aw: v1.0.1
  • Engine: claude
  • Model: copilot/auto
  • Authentication: COPILOT_GITHUB_TOKEN
  • Sandbox: docker-sudo-iptables
  • GitHub Actions service: PostgreSQL
  • Firewall/network isolation: enabled
  • No Anthropic API key

Host access is required because the agent needs to connect to the PostgreSQL GitHub Actions service.

Observed failure

The Copilot proxy starts successfully:

[INFO] API proxy enabled: OpenAI=false, Anthropic=false, Copilot=true (github-token), Gemini=false

Claude then fails during pre-flight:

[health-check] Checking Anthropic API proxy configuration...
[health-check] ✓ Anthropic credentials NOT in agent environment (correct)
[health-check] Testing connectivity to Anthropic API proxy at http://host.docker.internal:10002...
[health-check][ERROR] Cannot connect to Anthropic API proxy at http://host.docker.internal:10002
[health-check][ERROR] Proxy may not be running or network is blocked

The agent never reaches model inference:

  • execution state is not_started
  • token usage is empty
  • no inference request is made

Root cause

docker-sudo-iptables supports both:

  • network isolation
  • host access

Host access is required for external GitHub Actions services such as PostgreSQL.

The current gateway-selection logic appears to treat SupportsHostAccess=true as a reason to use:

host.docker.internal:10002

for the Claude/Copilot gateway.

But host access for PostgreSQL does not mean the AWF internal API proxy is published or reachable through the host gateway.

These are separate networking concerns.

For example:

PostgreSQL:
host.docker.internal:5432
✅ Correct and required

AWF/Copilot API proxy:
host.docker.internal:10002
❌ Not reachable

Why the existing fix does not fully cover this

#66788 / #66957 addressed Claude-on-Copilot gateway routing for isolated agents.

However, docker-sudo-iptables also supports host access, so it still falls into the host-gateway path even though the Copilot API proxy remains internal to the AWF sandbox network.

This leaves the host-access sandbox profile with an invalid Claude bootstrap gateway.

Expected behavior

When using:

  • engine: claude
  • model: copilot/auto
  • docker-sudo-iptables

the Claude/AWF pre-flight should use the actual AWF/Copilot internal gateway.

At the same time:

  • PostgreSQL access through host.docker.internal:5432 must continue to work.
  • No Anthropic API key should be required.
  • Sandbox and firewall protections must remain enabled.
  • No broad network access should be added.
  • The AWF proxy should not need to be exposed publicly or broadly on host port 10002.

Suggested fix direction

LLM gateway routing should be determined independently from generic sandbox host-access capability.

SupportsHostAccess=true should not automatically imply that the AWF inference proxy is available through host.docker.internal.

For Claude using Copilot inference, use the AWF-local/internal Copilot gateway whenever the proxy is running inside the sandbox network, even when host access is enabled for unrelated services such as PostgreSQL.

Additional compiler limitation

A possible repo-level workaround was:

engine:
  id: claude
  env:
    ANTHROPIC_BASE_URL: ""

However, the current empty-string YAML serialization produces a bare empty value / YAML null rather than a quoted empty string, causing schema validation issues.

So a clean repo-level bootstrap override is also currently blocked.

This is secondary to the gateway-routing bug, but may be worth fixing separately.

Acceptance criteria

The following configuration should work:

  • engine: claude
  • model: copilot/auto
  • docker-sudo-iptables
  • GitHub Actions PostgreSQL service

And:

  • Claude pre-flight succeeds.
  • Agent execution progresses beyond not_started.
  • At least one Copilot-backed inference succeeds.
  • PostgreSQL host access remains functional.
  • No Anthropic key is required.
  • Network isolation remains enabled.
  • No broad firewall relaxation is required.
  • Regression coverage is added for this host-access + internal Copilot proxy topology.

Related

Activity

  1. locked and limited conversation to collaborators on Oct 28, 2026
  2. unlocked this conversation on Oct 28, 2026
  3. sakir-sathe commented on Oct 28, 2026

    @sakir-sathe
    Author

    I investigated this and have a working patch with regression coverage in my fork.

    Branch:
    https://github.com/sakir-sathe/gh-aw/tree/fix/claude-copilot-host-gateway

    Commit:
    fix: route host-access LLM gateways through AWF proxy

    The fix updates the shared LLM gateway selector so docker-sudo-iptables uses the AWF-local api-proxy for model inference while preserving host access for GitHub Actions services such as PostgreSQL.

    Regression coverage includes Claude + copilot/auto + docker-sudo-iptables + PostgreSQL service-port forwarding.

    I attempted to open a PR against github/gh-aw, but the repository currently restricts pull-request creation to collaborators.

    The tested patch is available in the linked branch. Please let me know the preferred contribution path for submitting it upstream.

  4. locked and limited conversation to collaborators on Oct 28, 2026
  5. unlocked this conversation on Oct 28, 2026
  6. lpcox commented on Oct 29, 2026

    @lpcox
    Collaborator

    🔗 AWF tracking issue: github/gh-aw-firewall#10807

    Generated by Firewall Issue Dispatcher · copilot · auto · ~24 AIC · ⊞ 5.5K · ◷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions