Skip to content

ui-server: classify a tainted session's outgoing calls with deterministic extraction heuristics at admission #4088

Closed

Description

@schlessera

Context

Spike #3434 measured a host-side classifier for a tainted session's outgoing calls (design, signals and tables: docs/plans/extraction-classifier.md; harness evals/3434-extraction-classifier/, both from #4071). On its held-out Odysseus sessions, the shipped #3430 behaviour admits 4 of 13 extraction calls (all to hosts already contacted) and asks on 19 of 33 benign calls. The deterministic heuristics alone admit 1 and ask on 11. On the realistic benign session they ask on 7 of 22 calls instead of 10. They cost tens of microseconds per call and send nothing anywhere.

Where it hooks in, verified at main 3b104890f:

  • The tainted-destination card: const narrowing (packages/ui-sdk/src/server/egress-proxy.ts:280) and const approveTainted (packages/ui-server/src/brain/turn-egress.ts:168), with its copy in taintedDestinationDescription (packages/ui-server/src/brain/turn-egress.ts:39).
  • Admission, where full inputs are held: enforcementHookFor (packages/ui-backend-claude/src/permission-hooks.ts:289) and prepareOutwardPlan (packages/ui-sdk/src/server/outward-policy.ts:47).
  • Ingestion, where read files and taint content are seen: inputTaintSource (packages/ui-server/src/activity/ingestion-taint.ts:96), consumed in for(const signal (packages/ui-server/src/governance/safety-collector.ts:107).

Part of #3428. Adjacent: #3595 (once/origin/session approval scopes) and #3596 (individual taint review).

Scope

  • Host-side session state for a tainted session: four-word shingle hashes of every brain file read, the hosts the tainting content named (extracted at ingestion; the content itself is not kept for this), the contacted hosts and each site's earlier payloads in the session. Internal storage only.
  • The request schema and the seven signals as the plan defines them: fingerprint overlap (decoded and stream-scored, plus named brain paths), taint host, encoded blob, volume, write-shaped destination, fan-out and method/tool class.
  • The heuristic tiers and their combination with policy as the plan's decide does it:
  • The card and the refusal name the classifier's reason, such as "contains text from health/checkup-log.md" or "matches a link from the content that tainted this session".
  • A governance policy setting that turns the classifier on. It is off by default.

Out of scope

Acceptance criteria

  • With the setting on, in a tainted interactive session, a WebFetch to a new host with no signal is admitted without the ui-sdk: a tainted session's new destination is refused silently instead of asking the user #3430 card. The same call with the setting off still raises the card. The test fails before the change.
  • A call that posts the text of a brain file read in the session to a new host is refused. The tool result names the cause, and no egress_connection is recorded for it.
  • A call to an already-contacted host that carries a strong overlap, or a taint host plus volume or encoded text, raises the card. Today it is admitted silently.
  • Deny, allowlist mode, budgets and outward-action cards are unchanged whatever the band, including allow. Voice and autonomous turns still refuse every tainted new destination, and refuse wherever an interactive turn would ask.
  • An opaque call (a script file, python -c) never receives the allow relaxation for connections it opens.
  • No classifier state, verdict or evidence enters the provider-facing conversation except the refusal text in that call's own tool result. The keyless provider-history guard passes.
  • The keyless Spike: classify a tainted session's outgoing calls for likely data extraction, with heuristics first and JEV for the ambiguous band #3434 labelled set, run through the production classifier, reproduces the plan's heuristics row: held-out 1 leak and 11 benign cards; realistic 7 of 22. A ranking change is a reviewed diff.
  • Mutation receipts in the PR: letting allow relax an outward card, and dropping the opaque-call withhold, each fail a named test.

Verification

ui-server and ui-sdk unit tests at the lowest shared request method, a turn-egress test through the real proxy for the admit, ask and refuse paths, the provider-history guard, and the fixture regression above.

Contract impact

The policy setting is an additive schema change, documented with a CONTRACT: commit and a changeset. If the card or refusal gains a field, rather than only new description text, that field is additive too and documented in the same commit.

Activity

  1. added
    type: feat
    area: ui-sdk
    area: ui-server
    priority: p2
    agent-ready
    contract
    security
    on Nov 16, 2026
  2. added this to the 0.45.0 milestone on Nov 16, 2026
  3. self-assigned this
    on Nov 16, 2026
  4. schlessera commented on Nov 16, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-ad73b1d9. Branch: feat/4088-extraction-heuristics.

    Builds on #4071 (spike/3434-extraction-classifier, unmerged). Path collision: #4002 touches packages/ui-server/src/activity/ingestion-taint.ts; others are closure-only.

  5. schlessera commented on Nov 16, 2026

    @schlessera
    OwnerAuthor

    Merged in #4095 as a7169cb19 through the integration lease (orchestrator merge queue for 0.45.0). Candidate confirmation passed on the exact head; the squash's own main run carries the post-merge heavy categories.

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

Metadata

Metadata

Assignees

Labels

agent-readyarea: ui-sdkarea: ui-servercontractpriority: p2securitytype: feat

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions