Skip to content

Add behavioral e2e coverage for the Envoy network proxy #5917

Closed

Description

@ChrisJBurns

Part of #5900. Follow-up from the Envoy backend review (#5907).

Goal

Add automated end-to-end coverage that exercises the Envoy backend against a real MCP server, so egress/ingress enforcement is validated behaviorally — not just via unit tests and envoy --mode validate.

Approach: parametrize the existing suite

test/e2e/network_isolation_test.go already covers exactly the right scenarios against the default Squid backend:

  • inbound + outbound restrictions (allowed host reachable, blocked URL → error)
  • gateway IP denied by default, reachable with --allow-docker-gateway
  • gateway deny→allow rule transition

Rather than duplicate the file, parametrize the behavioral tests over {squid, envoy} by threading TOOLHIVE_NETWORK_PROXY=envoy into the shared startFetchServer / verifyNetworkRestrictions helpers via the existing .WithEnv(...) mechanism. Keep backend-specific config-shape assertions separate: the current squidConf(...) inspection stays Squid-only; add the Envoy equivalent asserting on the generated bootstrap JSON if desired.

Key coverage to guarantee

  • Allowed host reachable through the Envoy egress; denied host blocked.
  • Bridge gateway IP denied by default; reachable only with --allow-docker-gateway. This is the regression guard for the inert-destination_ip bug fixed in Add Envoy network-proxy backend behind TOOLHIVE_NETWORK_PROXY=envoy #5907 — the one gap that unit tests + config validation could not catch.
  • host.docker.internal / gateway.docker.internal blocked by default (incl. an uppercase-authority case).
  • Ingress: the isolated non-stdio workload reaches running (proves the reverse proxy resolves the MCP upstream).

Harness work required

  • Gate the Envoy variant so it only runs where the Envoy image is available/pullable (the e2e runners currently pull only squid/dnsmasq/fetch); skip or pre-pull otherwise.
  • Add flake tolerance for startup: isolated Envoy workloads take longer to become ready, and starting several at once has already shown 60s-readiness flakiness.

Why separate from #5907

The backend PR is already large; this needs its own harness plumbing (env-var threading, image gating, flake handling) and review. It also pairs naturally with #5905 (making Envoy the default) — behavioral e2e should be green before flipping the default.

Activity

  1. added
    needs-triage
    on Jul 22, 2026
  2. added 3 commits that reference this issue on Jul 22, 2026
    ccf7d3c
    bcd8323
    ce45efc
  3. added 7 commits that reference this issue on Jul 22, 2026
    ecae5e0
    644e8de
    5d61557
    078adfd
    b50fe95
    2916d55
    9361e68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions