Repository navigation
feat(redaction): owner-only reveal of removed credential values (way A) - #29513
Conversation
Sensitive Change ReviewSensitive files changed:
|
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. The values stay in memory only, the one reader is gated to the owner, and the agent paths that could reach it are refused before any read. Notes
[DESIGN-REVIEWED] 27f6100 Description read[DESCRIPTION-READ] c6d4ca5f8c7849161bcb037781113d8d2cd527ef61f80e1c329beca7a51e3f44 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the base commit records the reveal as RFC §7 ( What this change shipsInventory (10 items) — 10 justifiedIntent: let the dashboard owner recover a credential value that chat redaction removed, without any agent being able to get it. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 27f6100 Description read[DESCRIPTION-READ] 3bd6850f57e14352be29c9935ced3662a28e72aa98fa980f566aafa32b682db5 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the "value not kept" card state. Every lock tag saved before this PR lands in it. The screenshots stage an Evidence gaps
Notes
[UX-REVIEWED] 27f6100 Description read[DESCRIPTION-READ] 2f57c9424d8e32966ef0fe6218f5287f18e1002414692203fff5467741225d1a That sha256 names everything this verdict read: the PR description, plus the 17 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Security Scope Review -- ✅ PASSWhich legitimate operations does Verdict basis: adjudicated, zero confirmed regressions. Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. Scope-Verdict: PASS Reason: The diff doesn't touch any shell-deny tier ( TIGHTENING: A new owner-only reader of removed credential values, plus a toolbar guard for content only the host should see. The one threat it refuses is an agent, app or non-owner reading a removed credential back: ADJUDICATED: 16 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: The diff adds no path, separator, interpreter or environment assumption to the shell gate. The only platform-shaped strings it adds are repo-relative test and script paths. Candidates cover both spellings:
No UNADJUDICATED:
[SCOPE-REVIEWED] 27f6100 |
b5bef3f to
f084d42
Compare
Sensitive change review
|
f084d42 to
8afdb20
Compare
Sensitive change review
|
8afdb20 to
fe33e6f
Compare
Sensitive change review
|
fe33e6f to
1015e44
Compare
Sensitive change review
|
1015e44 to
7617694
Compare
Sensitive change review
|
Sensitive change review
|
0551d3e to
bf6d431
Compare
Sensitive change review
|
bf6d431 to
3e286da
Compare
Sensitive change review
|
Sensitive change review
|
3e286da to
1140b44
Compare
When redaction removes a credential from an agent reply, keep the value in gateway memory only (bounded, 24h TTL) behind a random reveal_id on the record. The owner's browser can Show / Copy / Hide it from the lock-tag card through POST /api/security/redacted-value, which refuses every internal (agent/MCP/crewmate/sub-agent/cron), app, non-dashboard and non-owner caller and SEL-audits each reveal without the value. After a restart or the TTL the card says the value is gone and points to its source. Coach and card text updated; RFC states the rule.
1140b44 to
27f6100
Compare
Sensitive change review
|
bolichen97
left a comment
There was a problem hiding this comment.
[operator: bolichen97]
Reviewed at the current head. No breaking issues found; approving.
Non-blocking suggestions:
- Deleting a session or turning redaction off does not purge that slot's reveal entries; they stay until TTL or restart. Consider purging by scope on session delete.
- Plaintext values now stay in gateway memory up to 24h; worth a line in the security spec, or a shorter default TTL.
- After a rollback, an older gateway's strict key check drops records that carry
reveal_id(cosmetic); worth a release-note line. - The 400 responses omit the
no-storeheaders; harmless, but could be consistent.
AI-assisted, approved by bolichen97
Problem / Motivation
Goal: The dashboard owner can see a credential value that chat redaction removed, while the gateway runs, and no agent can ever get it.
A customer had an agent mint a secret and store it in Supabase. Supabase cannot read secrets back, and chat redaction replaced the value with
[REDACTED: credential]before the reply was saved. The only copy was gone. The lock-tag card said "Nothing can show them", so the customer had no way to get the value.Why it matters
Any agent that creates a secret (an API token, a generated password) and puts it somewhere write-only leaves the user with no copy. Redaction is right to keep the value out of saved transcripts, channels and the model, but losing the one copy the owner needs blocks real work.
Not a goal
Amended 2026-11-04 at the owner's explicit request: the owner ruled that way A covers every place that renders a credential lock tag for this gateway's own sessions, so the Crew page crewmate DM and session-grid panes are in scope (see Coverage); only the two surfaces above are out.
What changed (motivation → approach → change)
Owner-decided design ("way A"). The decision is recorded as RFC §7 Owner reveal in
docs/request-for-change/rfc-redaction-explain-and-reveal.md(statuspartial), merged on main by the docs-only PR #29519; this PR does not touch the RFC. Follow-up #29839 aligns two older RFC sentences with §7.src/kiro_crew/security/reveal_store.py, new): when a reply is saved, each removed credential is kept in process memory behind a randomreveal_id(rv_+ 128 random bits). Bounded: 2048 entries, 16 KB per value, 4 MB total, oldest first; 24-hour TTL. Noreprof the value, not picklable. A restart empties it.security/credential_sources.py): with a caller-owned pending map,credential_records(..., reveal_pending=...)mints areveal_idinto each record and puts the value only in that map.revalidate_credential_recordaccepts the optional key and checks its shape. The segment flush (chat_turn/segment_flush.py) keeps a value in the store (_commit_reveals) only for the records it actually saves: the per-delta check, a strict retry that lost and a flush that failed closed leave nothing in memory.dashboard/handlers/redacted_reveal.py, new, handlerapi_owner_value_reveal):POST /api/security/redacted-valuewith{slot, id}is the store's only reader. Before reading the store it refuses: the internal loopback caller (internal_auth, which every MCP tool, agent, crewmate, sub-agent and cron uses), anyX-Internal-Secretheader, any app claim, any non-dashboard-user credential, and every non-owner (is_owner_dashboard_request). A handle opens only in the slot it was kept for. Each reveal writes a synchronous (critical=True) SEL rowredacted_value.revealwith caller, handle and slot, never the value; if that row cannot be written, the value is not returned (503). Expired or restarted: 410reveal_unavailable. Responses areCache-Control: no-store.website/src/components/RedactionCards.tsx, with the reveal in the newRedactedValueReveal.tsxand the card's shared buttons / action row moved unchanged into the newredactionPrimitives.tsxto keepRedactionCards.tsxunder the 2,000-line cap): the credential card gets Show; once shown, the value appears with Copy (the existing "select it by hand" message on clipboard failure) and Hide. The value is kept in memory owned by the reply'sRedactionProvider, so it stays visible across closing and reopening the card until Hide, and is cleared when the reply unmounts (leaving the page or session); a reveal still in flight then keeps nothing. Each handle tracks its newest request, so a late answer after Hide or after a second Show is dropped. The shown value carries the newdata-host-onlymarker (utils/visibleText.ts), so message actions and app invocations that read a reply's text never include it; it stays visible to the owner and to assistive technology. A text selection that reaches the shown value opens no selection toolbar (SelectionToolbar.tsx,selectionTouchesHostOnly), so Quote, Ask and app selection actions cannot carry it either; the owner's Copy button and the browser's own copy still work. 410 shows through the shared error line (ErrorNotice), says the value may still be where it came from, and holds Show; 403 says only the owner can show it. A record with no handle (a reply saved before this PR, or a value over the size cap) says the value was not kept, with no Show.renderAssistantBubble(app-sdk) andcreateTranscriptRendererstake an optional localredactionSlot/revealSlot;ChatPaneTranscriptpasses its own slot key. So crewmate DMs on the Crew page and session-grid panes now draw lock tags with the reveal, through the sameCredentialTagcard and endpoint.Why memory and not an encrypted store: the owner chose way A for the smallest risk. Nothing new on disk keeps the card's promise "No saved copy contains these values" true.
Coverage
Every place on main that renders a credential lock tag (
CredentialTag, fed bymeta.redactionsthroughMarkdownRenderer):/workflow,/goal,/agent,/prompts, …)MembersPageThread→ChatPane)SessionGridView→ChatPane)Tool output, sub-agent / workflow cards, the Activity viewer, thread side panel, notifications and artifacts draw no lock tag on main (plain
[REDACTED: credential]text, no record), so they are unchanged.Crew window: its rows go through
crewWindowRenderers, which never passesredactionSlot, andPEER_SAFE_ROWSexcludes theassistantid, so the remote path renders exactly as on main. Pinned byRedactionCards.reveal.test.tsx("a host with no local slot (the crew window) keeps the plain placeholder"). No file undercrew-window/or the hub proxy changed.Backwards compatibility
Compatible:
reveal_idis an optional extra record key. Rows saved before this PR have no key, read back unchanged, and their card says the value is no longer available. The new prop on the renderers is optional and defaults to today's behaviour.Removes nothing: no route, record, row or key is removed; the coach and card sentences that said nothing could show the value are replaced because they are no longer true.
Tests
test/test_redacted_value_reveal.py(new, 23 cases):deniedrow: internal/MCP caller, internal caller that otherwise looks like the owner,X-Internal-Secretheader, app token, non-owner dashboard user, non-dashboard credential. A grep test pins that onlydashboard/handlers/redacted_reveal.pycallsSTORE.reveal(.open/os.openpatched to fail); store and entries refuse pickling and do not print the value; no log line holds the value.critical, and never holds the value; no audit means no value (503).website/src/test/RedactionCards.reveal.test.tsx(new, 11 cases): Show calls the endpoint with slot and handle; Copy and its failure fallback; value stays shown across reopening until Hide; 410 and 403 messages; no handle means no Show; value never written to browser storage; the shared bubble reveals in a crewmate / grid slot; the crew window keeps the plain placeholder; record shape validation.MarkdownRenderer.blockedLink.test.tsxandRedactionCards.preview.test.tsxfor the new sentences.Mutation proof of the agent-refusal guard: with
request.get("internal_auth") is Trueremoved from_refusal,test_agents_apps_and_non_owners_are_refused[caller1]fails (assert 200 == 403); with it restored, all pass.Proof: not provable -- other: the core tests are new files for new behaviour; the guard's mutation proof is recorded above.
Manual verification
Still required with a live gateway: open a chat, ask the agent to print a fake token, open the lock tag, press Show, Copy, Hide; restart the gateway and confirm the card says the value is gone; check the SEL for the
redacted_value.revealrow.Screenshots / video
Fixture-driven shots of the real built SPA (
website/scripts/capture-redacted-reveal.mjs); the value is a fake demo string.Value shown (Copy / Hide), dark:
Value gone after a restart (410, Show held), light:
An older reply whose value was never kept (no Show), light:
Coach, card, refused (403), failed and the other theme
Related Issues
Customer report (Anthony Virtuoso, agent-minted Supabase secret). RFC decision: #29519 (§7 Owner reveal).
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.