Repository navigation
Description
Context
commandTaintSource (packages/ui-server/src/activity/command-taint.ts:2-27) taints the session on every Bash call it cannot prove is network-free. Only bare ls and brain search with static words pass. The Activity recorder applies it to every interactive turn (inputTaintSource, packages/ui-server/src/activity/ingestion-taint.ts:82-92, from packages/ui-server/src/activity/recorder.ts:336).
On a host with the turn egress proxy, this is redundant with a stronger signal. The proxy already taints the session at the first admitted non-relay connection, before its first byte (admitted, packages/ui-server/src/brain/turn-egress.ts:133-143), whatever program made it. The G6 rule text scopes the classifier to hosts without the proxy: "Before the egress proxy lands, Bash commands classified as fetching … taint the session" (docs/decisions/governed-writable-workers.md:3774). The "Implemented — 2026-10-22" note (docs/decisions/governed-writable-workers.md:3791, section "Untrusted input (G6)" at :3760) keeps it unconditional.
Observed on a hosted 0.44.0 install with the proxy active: the user's first input, !brain diagram --help, recorded taint with source: "unclassified_command". Every later brain image call was then refused (#3246). Since almost every turn runs some shell command, nearly every session is tainted without reading anything untrusted.
Citations verified at main 3d3516a02.
Decision (maintainer, 2026-11-03)
A. Proxy hosts drop shell-classifier taint. On hosts where turn egress runs on the proxy (runtime.workerHost.governed.egress.active), commandTaintSource no longer taints: neither unclassified_command nor fetching_command. The proxy's real-connection taint (egress_connection) and every other input source (WebFetch, shares, workspaces/, other MCP servers, marked files) still taint. Hosts without the proxy keep the classifier unchanged. The G6 ADR text update is part of the work.
Rejected: B (keep fetching-command taint on proxy hosts) and C (keep current behaviour).
Consequence the ruling accepts: a shell command that reads an untrusted file without a network connection (for example cat workspaces/x/README) no longer taints on proxy hosts. Path-based detection is not extended to shell arguments, since that would reintroduce a shell classifier. The G6 update records this as a known gap.
Scope
- Gate
commandTaintSource(or its call ininputTaintSource) on governed proxy egress being active for the turn, so proxy hosts skip both shell-classifier sources. - Update "Untrusted input (G6)" in
docs/decisions/governed-writable-workers.mdwith a dated supersession: on proxy hosts the classifier is off and the proxy's connection taint is the shell signal; non-proxy hosts keep the classifier; the shell-read-of-untrusted-path gap is named.
Out of scope
- Proxy connection taint itself.
- Provider relay taint (ui-server: a relayed provider request taints the session and is narrowed after taint, so tool order decides whether WebFetch or reranking works #3246).
- What a tainted session does at a new destination (ui-sdk: a tainted session's new destination is refused silently instead of asking the user #3430).
- Extending path-based taint detection to shell arguments.
Acceptance criteria
- With the proxy active, a governed turn running
brain diagram --helpandcat notes/x.mdrecords notaint. The test fails on current main. - With the proxy active,
curlto a non-relay host still taints, through the proxy'segress_connectionsource (and not throughfetching_command). - With the proxy active, the non-shell sources (for example WebFetch, an MCP document from another server, a
workspaces/file read through a file tool) still taint. - Without the proxy, the current classifier behaviour is unchanged and its tests stay green.
- The G6 section of
docs/decisions/governed-writable-workers.mdrecords the dated supersession and the known shell-read gap; the contract docs describing taint sources match. - A mutation that removes the proxy gate fails the first criterion's test (receipt in the PR).
Verification
bun run test packages/ui-server/tests for the activity and turn-egress suites, with a mutation receipt for the proxy gate. Run the provider-history keyless guard if any turn-path code changes.
Contract impact
Breaking semantic change to documented governance behaviour: proxy hosts stop recording unclassified_command and fetching_command taint. Pre-1.0 it ships in a minor with the breaking label, this ruling, a CONTRACT: commit updating the contract docs, and a changeset naming the change (#3246 set the pattern).
Triage 2026-11-03: folded the maintainer ruling (A: proxy hosts drop shell-classifier taint; G6 update in scope; shell reads of untrusted paths are a documented gap).
Activity
schlessera commentedon Nov 3, 2026
Decision (maintainer, 2026-11-03): A — on hosts where turn egress runs on the proxy (
runtime.workerHost.governed.egress.active), drop shell-classifier taint, bothunclassified_commandandfetching_command. The proxy's real-connection taint and the other input sources still taint. Non-proxy hosts keep the classifier. Updating the G6 ADR text is part of the acceptance criteria. B and C are rejected.How the body reads the ruling on the open shell-read case: extending path detection to shell arguments would bring back a shell classifier. So a shell read of an untrusted file with no network connection (
cat workspaces/x/README) is recorded as a known gap in G6 rather than detected. This comment is the ruling thebreakinglabel requires. Removedneeds: decision;agent-ready.schlessera commentedon Nov 3, 2026
Decision (maintainer, 2026-11-03): confirmed. A shell command that reads an untrusted local file without a network connection does not taint under ruling A. This is a known gap, recorded in G6 as the body says; closing it would bring the shell classifier back.
schlessera commentedon Nov 3, 2026
Claiming for implementation (token
claim-3429-e60cd81b). Branchfix/3429-shell-command-session-taint, targeting the epic integration branchepic/3428-session-taint. Collision scan: open PRs #3342 and #3404 also touchpackages/ui-server/src/activity/ingestion-taint.ts; several open PRs touchdocs/decisions/governed-writable-workers.md.schlessera commentedon Nov 3, 2026
Implementation is in #3478 (head
a00d45da3), opened againstepic/3428-session-taintwithRefs. The issue stays open until the epic batch lands on main. Local receipts are in the PR: a failing-first run, a mutation for the gate, and a mutation for the run-session wiring. Hosted CI still has to run the governed-runtime suites and the provider-history guard, which this worker's host could not run.CONTRACT: fix(ui-server): shell commands no longer taint a session be…
Merge branch 'main' into epic/3428-session-taint