← Back to Pull requests

router, node, standalone: external HTTP ingress for a2a, mcp, and inference services #838

Closed
unknown closed this pull request without merging on Nov 01, 2026 10:26 UTC
View on GitHub
unknown unknown commented on Oct 31, 2026 20:39 UTC
Author

Summary

Adds zero-trust External HTTP Ingress so callers outside the mesh can reach explicitly opted-in a2a://, mcp://, and inference:// services on enrolled agentmesh-node members through agentmesh-router (or agentmesh-one's single port) without routing data-plane traffic through agentmesh-control-plane.

Two-Layer Opt-In (Service Capability + Admin Role Ceiling)


  • Mesh Policy (PolicyRole.allowed_ingress): Admins set the ingress ceiling via repeated IngressGrant, compiled into granted_ingress_ Datalog rules by the control plane and enforced at directory announcement (RequireIngress). Omitting allowed_auth_modes grants INGRESS_AUTH_MODE_EDGE only; PASSTHROUGH requires an explicit role grant.

  • Node Configuration (ServiceIngress): Service owners opt in per service (ingress: in agentmesh-node.yaml), with optional caller narrowing via allow in PolicyBinding.members syntax ("email:alice@example.com", "email:@example.com", "group:eng").
  • Default Edge Authentication (INGRESS_AUTH_MODE_EDGE) & Discovery


  • Path-Based URLs: Routers serve <public-url>/ingress/<peer_id>/<service_type>/<service_name>[/<subpath>] (zero wildcard DNS or extra TLS certificates required) plus RFC 9728 /.well-known/oauth-protected-resource, returning 401 Unauthorized with WWW-Authenticate: Bearer resource_metadata="..." when unauthenticated.

  • Credential & Policy Verification: Verifies Delegated Session Biscuits, RFC 8693 task-attenuated Task Biscuits, and trusted OIDC JWTs against mesh Datalog policy, TAR blocks, revocations, banned peers, and ServiceIngress.allow, while rejecting unattenuated standing member/router transport Biscuits.

  • A2A AgentCard Rewriting: GET /.well-known/agent-card.json (and bare service root GET) rewrites supportedInterfaces to the public ingress URL, strips stale backend signatures, and populates OAuth 2.1 / OIDC / Bearer securitySchemes in EDGE mode (preserving backend securitySchemes in PASSTHROUGH mode).

  • End-to-End Router-to-Node Protocol (/mesh/ingress/1.0.0): Streams across local or federated peer routers to the serving node, which admits only authenticated mesh:role:router peers, re-verifies local ingress opt-in and caller authorization end-to-end, strips spoofed X-Mesh- headers, and injects verified attribution headers (X-Mesh-Ingress, X-Mesh-Principal, X-Mesh-Role, X-Mesh-Task).
  • Protocol Gate (/mesh/ingress/1.0.0 is router-only)


  • The node serves /mesh/ingress/1.0.0 through a routerHost gate: a stream from any peer that did not authenticate as mesh:role:router (a member included) is reset before the HTTP server reads a byte and counted in agentmesh_node_streams_refused_total{scope="not_router"}. The handler's own X-Mesh-Biscuit + authority-binding + role check stays as the second, independent layer.

  • HandleAuthHandshake now records the role under the key that verified the credential (authRouters alongside authPeers), so a federated router that handshakes inbound is recognised; a ban drops both.

  • TestNodeProtocolInventoryIsClassified lists every protocol a started node registers and fails on any that is not classified as handshake-open, in-stream-credential, or gated; for each gated protocol it opens a stream from an unauthenticated peer and checks it is refused and counted. TestExternalIngressProtocolServesOnlyRouters checks member-reset / router-served / ban. Both fail against the previous code.

  • ingress.allow node: entries are canonicalised at the config boundary (ServiceIngressFromConfig), and --allow-insecure-ingress-http names the plaintext risk in its help text.
  • Deployment & Operations


  • agentmesh-one: Enabled out of the box on the single port with zero extra flags.

  • Routers, Helm & GKE Testnets: Added --ingress-addr, --ingress-url, --public-control-plane, --ingress-tls-cert-path, --ingress-tls-key-path, and --allow-insecure-ingress-http on agentmesh-router, surfaced RouterInfo.ingress_url on /info and the console (SQLite/Postgres schema v21), and wired charts/agentmesh and .github/k8s Gateway HTTPRoute (/ingress/ -> agentmesh-router).
  • Validation


  • make, make lint, unit tests (-race), integration tests (TestStandaloneExternalIngressCUJ, TestFederatedMultiRouterIngressRoleCeilingAndBan), and make e2e-test (32/32 Bats tests).
  • Diff: 556 lines (+417 / -139) across 6 files Reviewer: aojea Review duration: 826m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 556 lines diff across 6 files
    0.48
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.378
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #838"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 48.1% (MEDIUM) · Higher = larger blast radius
    48.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19% · Safe to merge
    19%