Skip to content

fix(security): point quarantine refusals at the session holding the record - #581

Open
yzxcj797 wants to merge 1 commit into
yc-software:mainfrom
yzxcj797:fix/quarantine-refusal-session-reference-574
Open

fix(security): point quarantine refusals at the session holding the record#581
yzxcj797 wants to merge 1 commit into
yc-software:mainfrom
yzxcj797:fix/quarantine-refusal-session-reference-574

Conversation

@yzxcj797

@yzxcj797 yzxcj797 commented Aug 18, 2026

Copy link
Copy Markdown

Summary

Fixes part 1 of #574: the quarantine refusal text promises an admin review, but nothing in the refusal pointed at where the review material actually lives.

The gap

Both rendering sites — slack/refusals.ts#refusalNote and delivery/run-result-delivery.ts — substituted the fixed SECURITY_QUARANTINE_REFUSAL_TEXT with no reference, even though:

  • the orchestrator's refused result already carries sessionId, and
  • the refused input (appended to the session transcript with securityTainted: true) and the screen's full request snapshot both live on that session, readable via GET /v1/admin/sessions/:id/llm and visible on the admin history page.

So the review the sentence promises was reachable with existing storage — only the wire-up was missing.

Fix

A quarantineRefusalText(sessionId?) helper in plugins/chassis/src/security-quarantine.ts, used by both rendering sites:

  • with a session id, the refusal ends with (quarantine record: session <id>) — locates the record on the admin history page / admin API;
  • without one (stored results replaying through delivery), the text is byte-for-byte unchanged;
  • the internal screening reason stays hidden in both cases.

Deliberately not touching part 2 (the strict posture semantics) — that's a design discussion about whether strict should retain inbound screening, and changing posture behavior unilaterally would be the wrong way to settle it.

Tests

  • slack-refusals.test.ts: quarantine note surfaces the session id; no-session fallback keeps the exact prior text; internal reason stays hidden.
  • run-result-delivery.test.ts: delivery text carries the record reference for a refused result with a session.
  • All 30 pre-existing refusal/delivery tests and the refusal-admin-link-integration test pass unchanged.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…ecord

The quarantine refusal text promises an admin review, but both rendering
sites (slack refusalNote and runResultDelivery) substituted the fixed
sentence with no reference to where the review material lives (yc-software#574).

The orchestrator's refused result already carries sessionId, and the
refused input plus the screen's full request snapshot are stored on that
session (readable via GET /v1/admin/sessions/:id/llm). Surface the
session id in the refusal via a quarantineRefusalText(sessionId?) helper:
with a session the text ends with '(quarantine record: session <id>)',
locating the record on the admin history page; without one (stored
results replaying through delivery) the text is unchanged and the
internal screening reason stays hidden.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant