fix(security): point quarantine refusals at the session holding the record - #581
Open
yzxcj797 wants to merge 1 commit into
Open
fix(security): point quarantine refusals at the session holding the record#581yzxcj797 wants to merge 1 commit into
yzxcj797 wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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#refusalNoteanddelivery/run-result-delivery.ts— substituted the fixedSECURITY_QUARANTINE_REFUSAL_TEXTwith no reference, even though:sessionId, andsecurityTainted: true) and the screen's full request snapshot both live on that session, readable viaGET /v1/admin/sessions/:id/llmand 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 inplugins/chassis/src/security-quarantine.ts, used by both rendering sites:(quarantine record: session <id>)— locates the record on the admin history page / admin API;Deliberately not touching part 2 (the
strictposture semantics) — that's a design discussion about whetherstrictshould 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.refusal-admin-link-integrationtest pass unchanged.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.