Skip to content

ui-server: preserve restricted egress after tolerated permanent-gap writes #4351

Open

Description

@schlessera

Context

Final review of #4270 at 11f56e98dc42129cadb8622cb7680d5e64e6830a deferred two containment findings from #3609. On an already permanently gapped turn, the writer can return {id:0,recorded:false} by design (packages/ui-server/src/governance/event-writes.ts:239-242). The egress occurrence guard then refuses ordinary untrusted traffic, and audit tracking can abort the whole turn for a missing terminal exposure. At main a3395c4b2: the write worker's firstTaint maps that result to false (firstTaint, packages/ui-server/src/brain/turn-egress.ts:129-137), admission then refuses every proxy input with egress_unavailable (packages/ui-server/src/brain/turn-egress.ts:358-362), and track treats {id:0,recorded:false} as a lost write and aborts the turn controller through fail (fail, packages/ui-server/src/brain/turn-egress.ts:176-187), including for the terminal taint_exposure record appended in report (report, packages/ui-server/src/brain/turn-egress.ts:196-211). A turn counts as permanently gapped when its collection began restricted (covered, packages/ui-server/src/governance/event-writes.ts:166). These cases fail closed; they require a real write failure after a permanent gap already exists.

Previously blocked by #3609 (closed as completed 2026-11-21); no open dependency remains.

Scope

Restore proportionate containment for ordinary untrusted proxy traffic and tolerated terminal-record loss on permanently gapped turns. Keep strict durable confirmation for source-trusted admissions.

Out of scope

Trust-selector changes, historical safe verdicts, clearing permanent coverage gaps, weakening trusted-admission evidence or changing provider-facing history.

Acceptance criteria

  • With a permanent recording gap and a tolerated false occurrence-write result, ordinary untrusted traffic may proceed only under its existing restricted recipient policy; it never acquires source trust.
  • A source-trusted admission still refuses with 503 unless its immutable occurrence is confirmed durable.
  • A tolerated false terminal-exposure write on that already gapped turn does not abort unrelated operations or the turn; the permanent gap remains visible.
  • Actual audit failures outside the tolerated condition retain their existing containment, and positive durable replay results remain healthy.
  • Runtime tests inject the real store failure, assert network dispatch/refusal and turn/controller state, and fail under a restored mutation.

Verification

Run keyless offline ui-server/ui-sdk suites and the permanent-gap source, terminal-exposure, and healthy-peer recovery cases. Assert immutable safety history and unchanged provider prefixes.

Contract impact

Narrow existing fail-closed containment without granting new recipient/source authority. Update the egress section of docs/integration-contract/package-api.md (which documents egress_unavailable) and a changeset if caller-visible status or scope changes. Maintainer final triage deferred both findings at p2 to 0.45.0.

2026-11-23 triage at main a3395c4: re-verified the tolerated-gap path and refreshed the drifted turn-egress citations by anchor; #3609 is closed, so the blocker line is now historical. Scope, criteria and p2/0.45.0 unchanged.

Activity

  1. added
    area: ui-server
    priority: p2
    blocked
    security
    on Nov 21, 2026
  2. added this to the 0.45.0 milestone on Nov 21, 2026
  3. added
    type: fix
    and removed on Nov 21, 2026
  4. schlessera commented on Nov 21, 2026

    @schlessera
    OwnerAuthor

    Unblocked: #3609 is closed, so scripts/sync-project.ts is removing the blocked label.

  5. added
    agent-ready
    and removed
    blocked
    on Nov 21, 2026
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

    agent-readyarea: ui-serverpriority: p2securitytype: fix

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions