Skip to content

ui-sdk: a tainted session's new destination is refused silently instead of asking the user #3430

Closed

Description

@schlessera

Context

Once a session is tainted, narrowed (packages/ui-sdk/src/server/egress-proxy.ts:119-120 and :136) refuses any connection whose host is neither in taint.egress.allow nor already contacted by the session. The refusal is silent and final. The model sees proxy refused the connection (WebFetch) or CONNECT tunnel failed, response 403 (curl), and the user is never asked. Outward hosts already have an approval path in the same proxy (approveOutward, packages/ui-server/src/brain/turn-egress.ts:150-158). It asks through requestToolPermission, with no grant surface for voice (noGrantSurface: options.origin === "voice", :155).

The G6 rule (docs/decisions/governed-writable-workers.md, "Untrusted input (G6)" at :3760) chose refusal for every tainted session: egress "switches to the policy's taint.egress allow-list".

Observed on a hosted install: in several sessions, WebFetch of public pages and gh/curl to the GitHub API were refused. The agent then told the user that the page "wouldn't load here" or that they "could approve the outward network access for this turn". No such approval route exists.

Citations verified at main 3d3516a02.

Decision (maintainer, 2026-11-03)

A. Ask. When a tainted interactive session reaches a destination outside its taint allow-list, show a permission card naming the destination and the taint source (for example "this session read a shared PDF; allow a connection to example.org?"). An allow covers that host for the rest of the session. Voice and autonomous turns keep refusing. The G6 ADR update is part of the work.

Rejected: B (ask only for reads) and C (keep refusing with an after-the-fact notice).

Scope

  • Route narrowed admissions in interactive turns through an approval path, reusing requestToolPermission and its card, the way approveOutward does.
  • The card names the destination, the session's first taint source, and the consequence of allowing it.
  • An allowed host is admitted for the rest of the session, across turns, without asking again.
  • Voice (noGrantSurface) and autonomous turns keep the current refusal.
  • Record the ruling in G6 (docs/decisions/governed-writable-workers.md) with a dated supersession.

Out of scope

Acceptance criteria

  • In a tainted interactive session, a connection to a new host raises the permission card naming the destination and the taint source. Allowing it admits the connection and records an egress_connection for it. Denying it refuses with a reason the model sees. The test fails on current main.
  • A host allowed once in a session is admitted again in later turns of that session without asking; a different host still asks.
  • Voice and autonomous turns are unchanged: they refuse without a prompt.
  • Hosts denied by deny or outside allowlist mode are refused without a prompt.
  • Cancelling the turn while the card is pending refuses the connection (no admission after abort).
  • The G6 section records the dated supersession; contract docs describe the card if its request shape gains anything.
  • A mutation that skips the approval and refuses (today's behaviour) fails the first criterion's test (receipt in the PR).

Verification

Proxy and turn-egress tests with a real permission bridge double at the lowest shared request method, plus a ui-react test for the card copy.

Contract impact

Additive. The card reuses the existing tool-permission request; any new request kind, field or card variant is additive and is documented with a CONTRACT: commit and changeset. The governance behaviour change (ask instead of refuse in interactive sessions) is recorded in G6.

Triage 2026-11-03: folded the maintainer ruling (A: ask with a session-scoped per-host grant; voice and autonomous keep refusing; G6 update in scope).

Activity

  1. added
    type: feat
    area: ui-sdk
    area: ui-server
    area: ui-react
    priority: p1
    needs: decision
    contract
    on Nov 3, 2026
  2. added this to the 0.45.0 milestone on Nov 3, 2026
  3. added
    agent-ready
    and removed
    needs: decision
    on Nov 3, 2026
  4. schlessera commented on Nov 3, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-03): A — ask. A tainted interactive session that reaches a destination outside its taint allow-list shows a permission card naming the destination and the taint source. An allow covers that host for the rest of the session. Voice and autonomous turns keep refusing. Updating the G6 ADR is part of the acceptance criteria. B and C are rejected. Removed needs: decision; agent-ready. #3434 stays blocked on this issue's delivery.

  5. self-assigned this
    on Nov 3, 2026
  6. schlessera commented on Nov 3, 2026

    @schlessera
    OwnerAuthor

    Claimed (claim-3430-80b3a03b). Branch feat/3430-tainted-destination-asks, targeting the epic integration branch epic/3428-session-taint.

    Collision report: path overlap with #3443 (epic #1645 batch 1 to main; touches egress-proxy.ts, turn-egress.ts and G6) and doc-only overlap on governed-writable-workers.md with #3342, #3393, #3404, #3449, #3456, #3458, #3464. Other reports are closure-only.

  7. schlessera commented on Nov 3, 2026

    @schlessera
    OwnerAuthor

    Implementation is in #3507 (ready), targeting epic/3428-session-taint; head 7184e3eec, epic base c89c5b823. It covers every acceptance criterion, with failing-first and mutation receipts in the PR. Hosted CI proof is pending. The two governed composition cases and the provider-history guard can't run on the local host, which can't create user namespaces; the composition cases fail identically on the unmodified epic. The issue stays assigned and open until the epic batch lands on main.

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-reactarea: ui-sdkarea: ui-servercontractpriority: p1type: feat

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions