Skip to content

ui-server: the Claude runtime's own api.anthropic.com traffic taints every governed turn, blocking WebFetch and reranking #3244

Open

Description

@schlessera

Context

The original 0.44.0 report concerns ordinary governed/strict Claude connections being recorded as untrusted input before a tool ran. Current source navigation at inspected main: admitted (packages/ui-server/src/brain/turn-egress.ts:224-248) excludes validated inference/provider and host-only managed-reference acquisition operations before recording a worker's actual connection; narrowed (packages/ui-sdk/src/server/egress-proxy.ts:279) enforces G6 recipient restrictions. The managed-reference foundation is separate #3613 work and does not qualify source/read trust or complete this issue's original runtime check.

On a hosted 0.44.0 install using Claude subscription auth, the Claude runtime's own traffic triggers this. In one evening's governed sessions, the governance record shows:

  • 92 egress_connection events to api.anthropic.com:443. Only 20 carry inference: true. The other 72 are plain CONNECTs from the runtime.
  • Every governed session recorded a taint event within its first second, with detail: "CONNECT api.anthropic.com:443". This happened before any tool ran and before the turn read any untrusted content.
  • Each later attempt to reach a new host was then refused with egress_denial reason: "taint_allowlist":
    • WebFetch of a public article failed with proxy refused the connection. A roadblock was recorded (network_refused, remedy: capability). The model then told the user the page "wouldn't load here".
    • brain_context reranking was refused its call to generativelanguage.googleapis.com. A provider_unavailable event was recorded with capability: reranking, degradedTo: lifecycle_order, so context retrieval silently lost reranking.

So in practice, every governed Claude turn is "tainted" before its first tool call. WebFetch and the brain CLI's network providers are unusable in normal chat. The taint signal is also meaningless, because it fires on every session.

The same holds for OpenRouter-profile sessions run by the Claude runtime. Their openrouter.ai traffic is relayed (inference: true), but the runtime still opens a direct api.anthropic.com connection, which taints the session.

Scope

The implementation is delivered by #3249: pin the runtime's non-essential-traffic suppression and skip WebFetch preflight while preserving the relay and G6 boundary. The alternatives in the original brief are historical, not open implementation choices. Remaining work is publication plus the exact governed subscription/native-storage runtime verification below. The current pins are (RELAYED_TURN_TRAFFIC_ENV, packages/ui-backend-claude/src/relayed-turn-traffic.ts:10-12) and (RELAYED_TURN_SETTINGS, packages/ui-backend-claude/src/relayed-turn-traffic.ts:18). The separately owned Jev reranking relay #3792 is delivered through #4024 (86003b261f), an ancestor of inspected main; that delivery does not substitute for this handoff's original runtime verification.

Out of scope

  • Changing what taints a session when the agent itself fetches an untrusted host. G6 semantics stay as they are.
  • The taint allowlist policy defaults.
  • Pi-backend egress, unless the same defect reproduces there.

Acceptance criteria

  • A governed Claude turn that runs no network tool records no taint event. The delivered proof in fix(backend-claude): keep the runtime's own traffic off the turn proxy #3249 uses the runtime's measured connection pattern and records a failing result on the pre-fix tree.
  • In an untainted governed session, WebFetch to an allowed host is admitted.
  • brain_context inside a governed turn reranks, with no provider_unavailable event, when the provider key is configured on the host.
  • A turn that does fetch an untrusted host is still tainted, and later new hosts are still narrowed. The existing G6 tests stay green.

Verification

Run a governed Claude turn with subscription auth on a native-storage host. Check that governance_events has no taint row for the session until a tool contacts a non-relay host.

Contract impact

None expected. Governance event shapes are unchanged.

Current state (registry rechecked 2026-11-17)

  • Delivered in fix(backend-claude): keep the runtime's own traffic off the turn proxy #3249 (squash 3b9f3e8, milestone 0.45.0; the former 0.44.1 milestone is now 0.45.0). A governed or strict Claude turn that uses the relay now pins CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 and sets skipWebFetchPreflight.
    • The delivered tests cover suppression of the measured runtime traffic. The reserved live-runtime verification remains below. G6 is unchanged: a tool's own connection still taints.
    • The non-relayed CONNECTs were the CLI's first-party event logging, one more unlogged non-essential request (probably the feature-flag fetch), and WebFetch's /api/web/domain_info preflight. The PR records the measurements.
  • Acceptance criteria. Criteria 1–4 are covered by tests in fix(backend-claude): keep the runtime's own traffic off the turn proxy #3249, including a real-runtime test that fails on the previous main.
  • Reranking. It goes through the metered provider relay, which shares the turn proxy's admission by ui-sdk: route the brain CLI's paid provider calls from workers through metered host relays #1673's design. It is admitted in an untainted session. Its own taint and narrowing are tracked in ui-server: a relayed provider request taints the session and is narrowed after taint, so tool order decides whether WebFetch or reranking works #3246 (option C delivered; the validated inference/provider-relay exemption is present in admitted, packages/ui-server/src/brain/turn-egress.ts:224-232).
  • Release prerequisite. 3b9f3e8 is on main but unreleased: the newest tag at main 3d3516a02 is @schlessera/brain-ui-server@0.44.0, which predates it. Hosted installs keep the defect until a release that contains it is published, and publishing needs a human's interactive auth (the release skill). The needs: release label is declared in scripts/labels.ts. The currently attributed target is 0.45.0; completion requires npm publication of a ui-server artifact containing this fix, with the actual version and package contents verified. Read-only registry verification on 2026-11-11 still reports latest 0.44.0; the 0.45.0 version endpoint returns 404. Its downloaded npm archive’s src/brain/host-boundary.ts lacks CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC; the published artifact therefore does not contain fix(backend-claude): keep the runtime's own traffic off the turn proxy #3249’s pinned runtime suppression. Publication remains incomplete. This archive inspection is not a live-runtime check.
  • Remaining human action (Verification). Run a governed Claude turn with subscription auth on a host with managed native storage, running a published release or a build that includes 3b9f3e8.
    • Check governance_events for that session. There must be no taint row until a tool contacts a non-relay host. The only egress_connection rows before that are inference: true.
    • Optionally run a WebFetch to an allowed host. Its target should be admitted and should be the session's first taint row.
  • Completion evidence. Comment with the session's governance_events kinds and payload hosts, sanitized, with no deployment details. Then remove needs: human; close only after the independent publication prerequisite is also evidenced, removing needs: release when its containing artifact is verified.

Implementation merged in #3249; publication and the independent runtime verification above remain.

Triage 2026-11-03: corrected the delivery milestone to 0.45.0 and recorded that the fix is unreleased (newest tag 0.44.0), so verification on a hosted install waits for a published release or a build from main.

2026-11-04 triage: corrected the manifest-label claim and made release versus human-verification completion independent; a main build may satisfy the listening/runtime check without proving npm publication. No publication or live verification was performed.

Triage 2026-11-09 at main fb999b8ba: moved the admitted, narrowed and PROVIDERS_RELAYED anchors to current lines (the Context section describes the 0.44.0 behaviour that #3249 fixed). 3b9f3e8 is an ancestor of that main. Registry read: @schlessera/brain-ui-server latest is still 0.44.0 (published 2026-11-01) and no 0.45.0 exists, so needs: release stands. No comment records the governed-turn verification, so needs: human stands. No publication or live run was performed.

2026-11-14 triage at main faa480e8c864d547cd8b4eb75965b7d609284770: Refreshed verified current-source pointers; historical receipts, decisions and remaining qualification requirements retain their identities.

2026-11-15 triage at main 3f8ff29341fbe25665cea42659f92e6f3d3ccef0: Separated the historical 0.44.0 report from verified current egress navigation. Registry latest remains 0.44.0 and 0.45.0 is absent; the containing-release and reserved subscription/native-storage runtime checks remain independent prerequisites.

2026-11-16 registry read: the live @schlessera/brain-ui-server registry document still reports latest 0.44.0 and contains no 0.45.0 version/distribution entry. No new containing artifact exists to inspect; the prior downloaded 0.44.0 archive evidence remains attributed above. Preserve needs: release and the independent subscription-auth/native-storage needs: human check.

2026-11-17 triage at main 9e7429a914a8aaf5967f074fa9e09984968fc9dc: Refreshed verified active source navigation; historical receipts retain their source identities. The live registry still reports latest 0.44.0 and HTTP 404 for 0.45.0, with no newer artifact to inspect; publication and the reserved subscription/native-storage verification remain independent unmet prerequisites. No new runtime qualification or readiness is claimed.

2026-11-20 triage — Registry readback still reports @schlessera/brain-ui-server latest 0.44.0 and HTTP 404 for 0.45.0. For the containing release, check the published UI server and its companion Claude backend package together, including the actual pins in the backend artifact. The separately reserved live runtime check still needs its sanitized event receipt.

Activity

  1. added this to the milestone on Nov 1, 2026
  2. added
    type: fixSomething is broken and must behave the way it is documented.
    area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.
    priority: p1Scheduled into the current or next milestone.
    on Nov 1, 2026
  3. self-assigned this
    on Nov 1, 2026
  4. schlessera commented on Nov 1, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation (claim token claim-3244-77439). Branch: fix/3244-runtime-egress-taint. The "possible fixes" choice is delegated to the PR by the issue's scope; I'll record which requests make up the non-relayed CONNECTs and the chosen fix there.

  5. added
    needs: humanWaiting on an action only a human can perform. State the required action in the issue.
    on Nov 2, 2026
  6. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Merged #3249 as 3b9f3e8 (milestone 0.44.1). The hosted candidate proof passed on head 7600811 against base a84d9bf, and the squash parent and tree match the tested candidate. The fix keeps the Claude runtime's own non-essential traffic and WebFetch's domain preflight off the turn proxy, so a governed turn is no longer tainted before its first tool runs. G6 semantics are unchanged. The issue stays open with needs: human for the Verification step: a governed subscription-auth turn on a native-storage host. The body now gives the exact check and the evidence needed to close. The provider-relay taint interaction is filed as #3246 (needs: decision). Releasing my claim.

  7. removed their assignment
    on Nov 2, 2026
  8. modified the milestones: , 0.45.0 on Nov 2, 2026
  9. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Production evidence from a hosted 0.44.0 install, second day after upgrade. This is unchanged from the issue body, and it confirms the scale.

    • 10 of 10 governed Claude sessions started since the upgrade recorded taint within their first second, each with detail: "CONNECT api.anthropic.com:443".
    • Over two days: 386 non-relayed CONNECT api.anthropic.com:443 against 155 inference: true connections.
    • Every refusal was egress_denial with reason: "taint_allowlist":
      • 4 WebFetch calls to public sites, which the model saw as proxy refused the connection;
      • 3 api.github.com connections, from curl, gh and WebFetch;
      • 3 generativelanguage.googleapis.com connections.
    • The recorded roadblocks were five network_refused entries. The model told the user that pages "wouldn't load here".

    The fix in #3249 (3b9f3e8) is not on npm yet. The registry's latest @schlessera/brain-ui-server is 0.44.0. So every hosted 0.44.0 install has WebFetch broken in governed chat until a release ships it. The milestone on this issue is 0.45.0, not a patch.

    The release needs a human: publishing needs interactive auth. The verification in the body can run as soon as an install picks up a build that includes 3b9f3e8.

  10. added
    needs: releaseWaiting on a published release or artifact. State the required version and publication evidence.
    on Nov 2, 2026
  11. schlessera commented on Nov 11, 2026

    @schlessera
    OwnerAuthor

    2026-11-11 triage: made the remaining publication/runtime handoff current instead of leaving implementation alternatives open. Registry latest is still 0.44.0 and 0.45.0 is absent. Retain needs: release and needs: human until the containing artifact and the exact governed subscription/native-storage evidence are recorded independently. #3792 retains the separate Jev relay scope. No release, login or live verification was performed.

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

    area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.needs: humanWaiting on an action only a human can perform. State the required action in the issue.needs: releaseWaiting on a published release or artifact. State the required version and publication evidence.priority: p1Scheduled into the current or next milestone.type: fixSomething is broken and must behave the way it is documented.

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions