Skip to content

feat(redaction): owner-only reveal of removed credential values (way A) - #29513

Merged
bolichen97 merged 1 commit into
mainfrom
feat/reveal-redacted-values
Nov 4, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
feat/reveal-redacted-values

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Saving removed values anywhere on disk, in the transcript, crew log, history or any backup. The value lives in gateway memory only.
  • A reveal for anyone but the owner, or through any agent-reachable path (MCP tool, agent route, session context, tool result).
  • The crew window (another crew's sessions through the hub, a remote gateway): the values live in that gateway's memory and the hub proxy cannot prove the owner to it. Follow-up task.
  • Messaging channels (Slack, Discord, Telegram, Webex, ...): no owner browser click.

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 (status partial), 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.

Redacted values may be revealed only to the owner through the browser; no agent-reachable path may ever return them; originals never touch disk.

  • Memory store (src/kiro_crew/security/reveal_store.py, new): when a reply is saved, each removed credential is kept in process memory behind a random reveal_id (rv_ + 128 random bits). Bounded: 2048 entries, 16 KB per value, 4 MB total, oldest first; 24-hour TTL. No repr of the value, not picklable. A restart empties it.
  • Record (security/credential_sources.py): with a caller-owned pending map, credential_records(..., reveal_pending=...) mints a reveal_id into each record and puts the value only in that map. revalidate_credential_record accepts 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.
  • Endpoint (dashboard/handlers/redacted_reveal.py, new, handler api_owner_value_reveal): POST /api/security/redacted-value with {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), any X-Internal-Secret header, 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 row redacted_value.reveal with caller, handle and slot, never the value; if that row cannot be written, the value is not returned (503). Expired or restarted: 410 reveal_unavailable. Responses are Cache-Control: no-store.
  • Card (website/src/components/RedactionCards.tsx, with the reveal in the new RedactedValueReveal.tsx and the card's shared buttons / action row moved unchanged into the new redactionPrimitives.tsx to keep RedactionCards.tsx under 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's RedactionProvider, 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 new data-host-only marker (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.
  • Text: the "N values were removed" coach drops "Always on. Nothing can show them" and says the owner can reveal while the gateway runs; a new line points to Settings → Secrets. Card body and hover preview updated to match. All 12 locales plus the pseudolocale.
  • Coverage wiring: renderAssistantBubble (app-sdk) and createTranscriptRenderers take an optional local redactionSlot / revealSlot; ChatPaneTranscript passes its own slot key. So crewmate DMs on the Crew page and session-grid panes now draw lock tags with the reveal, through the same CredentialTag card 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 by meta.redactions through MarkdownRenderer):

Surface Status
Chat page assistant replies (prose, code blocks, diagram / diff fences, regenerated variants) Covered
Local slash-command replies (/workflow, /goal, /agent, /prompts, …) Covered
Crew page crewmate DM (MembersPageThread → ChatPane) Covered (newly draws the lock tag)
Session grid panes (SessionGridView → ChatPane) Covered (newly draws the lock tag)
Crew window (another crew's session through the hub) Skipped: values live in the remote gateway's memory and the hub proxy cannot prove the owner to that gateway. Unchanged from main; follow-up task.
Slack, Discord, Telegram, Webex and other messaging channels Skipped: no owner browser click; channels keep the placeholder text

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 passes redactionSlot, and PEER_SAFE_ROWS excludes the assistant id, so the remote path renders exactly as on main. Pinned by RedactionCards.reveal.test.tsx ("a host with no local slot (the crew window) keeps the plain placeholder"). No file under crew-window/ or the hub proxy changed.

Backwards compatibility

Compatible: reveal_id is 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):
    • (a) owner reveals the removed value; a handle only opens in its own slot.
    • (b) refused with 403 and an audited denied row: internal/MCP caller, internal caller that otherwise looks like the owner, X-Internal-Secret header, app token, non-owner dashboard user, non-dashboard credential. A grep test pins that only dashboard/handlers/redacted_reveal.py calls STORE.reveal(.
    • (c) the saved row holds only the handle; stash and reveal open no file (open / os.open patched to fail); store and entries refuse pickling and do not print the value; no log line holds the value.
    • (d) a fresh store (restart) answers 410; TTL expiry empties the store; size bounds hold.
    • (e) the audit row names caller, operation and handle, is 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.
  • Updated: MarkdownRenderer.blockedLink.test.tsx and RedactionCards.preview.test.tsx for the new sentences.

Mutation proof of the agent-refusal guard: with request.get("internal_auth") is True removed 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.reveal row.

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 shown, dark

Value gone after a restart (410, Show held), light:

value gone, light

An older reply whose value was never kept (no Show), light:

not kept, light

Coach, card, refused (403), failed and the other theme

coach, dark

card show, dark

value gone, dark

refused, dark

failed, dark

not kept, dark

coach, light

card show, light

value shown, light

refused, light

failed, light

Related Issues

Customer report (Anthony Virtuoso, agent-minted Supabase secret). RFC decision: #29519 (§7 Owner reveal).

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners November 4, 2026 08:58
@iamwhatever
iamwhatever requested a review from buluoray November 4, 2026 08:58
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security/credential_sources.py

  • src/kiro_crew/security/reveal_store.py

  • @iamwhatever posted a complete reasoning template for 27f6100.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 27f6100f4993e87f773a019b7540ab76199337bb and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 27f6100

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 27f6100f4993e87f773a019b7540ab76199337bb false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 27f6100f4993e87f773a019b7540ab76199337bb — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The store is a per-process singleton. If a chat turn ever runs in a different process from the dashboard handler, every reveal will quietly return 410. Pinning in a test that _commit_reveals and api_owner_value_reveal share STORE would turn that into a visible failure.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 27f6100f4993e87f773a019b7540ab76199337bb — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: the base commit records the reveal as RFC §7 (partial), the reported defect is concrete, and each item reuses the existing owner gate and lock-tag card.

What this change ships

Inventory (10 items) — 10 justified

Intent: let the dashboard owner recover a credential value that chat redaction removed, without any agent being able to get it. This is an ADDITION.

  1. The credential card gets Show, then Copy and Hide for the removed value — justified
  2. Each removed value is kept in gateway memory only, for up to 24 hours, behind a random handle — justified
  3. A new owner-only endpoint that returns the value, refuses agents, apps and non-owners, and returns nothing if the audit row cannot be written — justified
  4. The coach and card text drop "Nothing can show them", say the owner can reveal, and point to Settings → Secrets — justified
  5. Crew-page DMs and session-grid panes now draw lock tags with the reveal — justified
  6. A shown value is left out of the reply text that message actions and apps read — justified
  7. A text selection that touches a shown value gets no Quote/Ask toolbar — justified
  8. Older replies, and values over the size cap, say the value was not kept and offer no Show — justified
  9. The security package line budget is raised by 170 lines for the new store — justified
  10. A screenshot harness for the reveal states — justified

[FIRST-PRINCIPLES-REVIEWED] 27f6100

Description read

[DESCRIPTION-READ] 3bd6850f57e14352be29c9935ced3662a28e72aa98fa980f566aafa32b682db5

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

UX-level review of 27f6100f4993e87f773a019b7540ab76199337bb — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 OLD_SECRET tag for this case but never open its card.

Evidence gaps

  • The reveal_not_kept state ("This value was not kept for showing here.", with no Show button) appears in no screenshot. It shows on every row saved before this PR and on any value over the size cap. To close: attach a screenshot of the OLD_SECRET lock tag's card opened, in both themes.
  • The changed hover preview preview_cred_floor ("Never saved. The owner can show it from the card while this gateway runs.") appears in no screenshot, and the blind read never mentions it. To close: attach a screenshot of the hover over a lock tag.

Notes

  • reveal_hint reads "kept in memory until restart", but reveal_gone adds "or 24 hours passed". The blind reader noticed the clash: "24 hours isn't mentioned anywhere else". Change the hint to "· owner only · kept up to 24 h or until restart".
  • reveal_denied and reveal_gone keep the Show button and "Ask the agent" beside them. For the denied case the reader said: "no idea… no". Hide or disable Show when the state is denied.
  • The reader found "gateway" unclear in cred_body and coach_fact_always ("don't know what 'gateway' means"). Use "while Kiro Crew is running", which matches reveal_gone's "Kiro Crew restarted".

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 27f6100f4993e87f773a019b7540ab76199337bb — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 27f6100

Verdict parsed from the review's SHA-scoped output markers for commit 27f6100f4993e87f773a019b7540ab76199337bb.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 27f6100f4993e87f773a019b7540ab76199337bb false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- ✅ PASS

Which legitimate operations does 27f6100f4993e87f773a019b7540ab76199337bb newly refuse? Updated in place on each push. A script-confirmed regression blocks; the model proposes candidates and never decides a refusal.

Verdict basis: adjudicated, zero confirmed regressions.

Security scope review -- adjudicated candidates

  • macos-latest (platform posix): 10 classified, 0 newly refused, 10 still allowed.
  • ubuntu-latest (platform posix): 10 classified, 0 newly refused, 10 still allowed.
  • windows-latest (platform windows): 6 classified, 0 newly refused, 6 still allowed.

No candidate flipped from allowed to refused.

Scope-Verdict: PASS

Reason: The diff doesn't touch any shell-deny tier (sensitive-bash, exfil, deny-rules in SHELL_DENY_TIERS). None of those checks import credential_sources or reveal_store, so no verdict came back that shows a shell operation is newly refused. The tightenings that do exist are in the dashboard: a new owner-gated route, the record validators and the selection toolbar. The classifier can't check any of them. They are named under UNADJUDICATED, and none of them could be shown to refuse an existing legitimate input.

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: if request.get("internal_auth") is True or "X-Internal-Secret" in request.headers: return "internal caller" … if not is_owner_dashboard_request(request): return "not the owner" (dashboard/handlers/redacted_reveal.py, _refusal). On the browser side, a revealed value must not ride Quote, Ask or an app's selection action: if (selectionTouchesHostOnly(sel, container)) { setVisible(false); return } (SelectionToolbar.tsx).

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:

  • posix: pytest over the new and edited test files, vitest over the reveal and preview card tests, the new capture-redacted-reveal.mjs script, the card's pre-filled aws configure get … --profile default view command, aws configure list, and grep/sed/git-diff reads of the new modules.
  • windows: .venv\Scripts\python.exe pytest, PowerShell cd website; npx vitest … with \ separators, node scripts\capture-redacted-reveal.mjs ..\…, the same aws configure get command, and Select-String / Get-Content reads.

No any rows were written, because every candidate names an executable or a path. No platform assumption was left without a candidate.

UNADJUDICATED:

  • POST /api/security/redacted-value gate (routes/system.py → handlers.api_owner_value_reveal → _refusal). The call path is the browser's api.revealRedactedValue(slot, id) → post(...) → token_auth → _refusal, then the body check (REVEAL_ID_RE, slot non-empty and ≤512 characters), then STORE.reveal(handle, scope=slot). Candidate inputs I would have submitted:

    • the owner's cookie session with app == "";
    • an owner session when no owner_id is configured, where several local identities pass the owner check;
    • a slot key longer than 512 characters, if slot keys can reach that.

    The route is new, so nothing that worked before is lost. One narrowing is arguable but not confirmed: test_redacted_value_reveal.py stubs ChatPaneTranscript with slotKey, but a slot key over _MAX_SLOT_CHARS would get 400 even for the owner. I could not confirm how long real slot keys get.

  • revalidate_credential_record (Python) and normalizeCredentialRecords (TS). The call path is a persisted meta.redactions row → bounded_credential_records / MarkdownRenderer → validator. The key-set check is now looser: an extra reveal_id key is accepted. It is stricter only for a record whose reveal_id is not null and not rv_ plus 22 URL-safe characters. Before this change any record carrying that key was already dropped, so no previously accepted record is now refused. The candidate inputs would have been an old six-key record (still accepted) and a record with reveal_id: null (accepted).

  • selectionTouchesHostOnly / the walk skip of data-host-only (SelectionToolbar.tsx → visibleText.ts). The call path is a mouse selection → SelectionToolbar effect → querySelectorAll('[data-host-only]') over the whole document → range.intersectsNode. This only applies while a revealed value is on screen. The candidate input I would have submitted is the owner selecting ordinary text in reply A while a value revealed in reply B is shown. By the code it should still get its toolbar, because intersectsNode is checked per range, but no harness can classify it.

  • New 'assistant' renderer in createTranscriptRenderers, added when revealSlot is set and the view is not a crewmate's. Every ChatPaneTranscript host now gets an extra assistant renderer, and that renderer goes through renderAssistantBubble with only redactionSlot. Whether this shadows options the existing assistant renderer passed (onFileOpen, onRegenerate, quoting) is a correctness question for the other lanes, not a refusal this lane can adjudicate.

[SCOPE-REVIEWED] 27f6100

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: f084d42
  • What rule changed: a credential removed from an agent reply is now also kept in gateway process memory (new security/reveal_store.py: bounded 2048 entries / 16 KB per value / 4 MB total, 24-hour TTL, no repr, not copyable or picklable), and its record (security/credential_sources.py) gains an optional reveal_id handle. Redaction itself is unchanged: the saved text, channels, logs and the model still get the placeholder.
  • Before -> after (what was allowed/blocked, now): before, no one could read a removed value. After, only the dashboard owner's browser can, through POST /api/security/redacted-value, which refuses internal (agent/MCP/crewmate/sub-agent/cron), app, non-dashboard and non-owner callers before reading the store, and writes a synchronous SEL row (caller, handle, never the value) before returning it.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): leaks secret -- a removed value reaches someone other than the owner. Mitigated by the gate above, slot scoping of handles, and the audit-or-refuse rule. No command breaks; nobody is locked out.
  • Evidence checked (which sandbox result proves it): test/test_redacted_value_reveal.py: six refused caller shapes return 403 with an audited denied row; a grep test pins dashboard/handlers/redacted_reveal.py as the only caller of STORE.reveal(; stash and reveal open no file; mutation: removing the internal_auth arm makes the internal-caller case return 200.
  • No regression:
    • Tools still work (which tools/commands were run, result): no tool, MCP server or shell path changed; redaction passes are byte-identical (test_credential_sources.py, test_slash_command_redaction_records.py pass).
    • Backward compatible (old config / old data / old callers still work, how checked): rows saved before this PR have no reveal_id; revalidate_credential_record accepts them unchanged and the card says the value was not kept (record-shape tests in both suites).
    • Existing tests (which suites passed on this head): test_redacted_value_reveal.py, test_security_posture.py, test_credential_sources.py, test_slash_command_redaction_records.py (106 passed); vitest RedactionCards.reveal / MarkdownRenderer.blockedLink / RedactionCards.preview (82 passed).
  • How to undo: revert this commit; the in-memory store disappears with the process and old records keep working (the optional key is ignored).

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 4, 2026
@iamwhatever
iamwhatever force-pushed the feat/reveal-redacted-values branch from f084d42 to 8afdb20 Compare November 4, 2026 09:37
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 8afdb20
  • What rule changed: a credential removed from an agent reply is now also kept in gateway process memory (new security/reveal_store.py: bounded 2048 entries / 16 KB per value / 4 MB total, 24-hour TTL, no repr, not copyable or picklable), and its record (security/credential_sources.py) gains an optional reveal_id handle. Redaction itself is unchanged: the saved text, channels, logs and the model still get the placeholder.
  • Before -> after (what was allowed/blocked, now): before, no one could read a removed value. After, only the dashboard owner's browser can, through POST /api/security/redacted-value, which refuses internal (agent/MCP/crewmate/sub-agent/cron), app, non-dashboard and non-owner callers before reading the store, and writes a synchronous SEL row (caller, handle, never the value) before returning it.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): leaks secret -- a removed value reaches someone other than the owner. Mitigated by the gate above, slot scoping of handles, and the audit-or-refuse rule. No command breaks; nobody is locked out.
  • Evidence checked (which sandbox result proves it): test/test_redacted_value_reveal.py: six refused caller shapes return 403 with an audited denied row; a grep test pins dashboard/handlers/redacted_reveal.py as the only caller of STORE.reveal(; stash and reveal open no file; mutation: removing the internal_auth arm makes the internal-caller case return 200.
  • No regression:
    • Tools still work (which tools/commands were run, result): no tool, MCP server or shell path changed; redaction passes are byte-identical (test_credential_sources.py, test_slash_command_redaction_records.py pass).
    • Backward compatible (old config / old data / old callers still work, how checked): rows saved before this PR have no reveal_id; revalidate_credential_record accepts them unchanged and the card says the value was not kept (record-shape tests in both suites).
    • Existing tests (which suites passed on this head): test_redacted_value_reveal.py, test_security_posture.py (80 passed); vitest RedactionCards.reveal / MarkdownRenderer.blockedLink / RedactionCards.preview / transcriptRenderers (175 passed).
  • How to undo: revert this commit; the in-memory store disappears with the process and old records keep working (the optional key is ignored).

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 4, 2026
@iamwhatever
iamwhatever force-pushed the feat/reveal-redacted-values branch from 8afdb20 to fe33e6f Compare November 4, 2026 10:02
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: fe33e6f
  • What rule changed: a credential removed from an agent reply is now also kept in gateway process memory (new security/reveal_store.py: bounded 2048 entries / 16 KB per value / 4 MB total, 24-hour TTL, no repr, not copyable or picklable), and its record (security/credential_sources.py) gains an optional reveal_id handle. Redaction itself is unchanged: the saved text, channels, logs and the model still get the placeholder.
  • Before -> after (what was allowed/blocked, now): before, no one could read a removed value. After, only the dashboard owner's browser can, through POST /api/security/redacted-value, which refuses internal (agent/MCP/crewmate/sub-agent/cron), app, non-dashboard and non-owner callers before reading the store, and writes a synchronous SEL row (caller, handle, never the value) before returning it.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): leaks secret -- a removed value reaches someone other than the owner. Mitigated by the gate above, slot scoping of handles, and the audit-or-refuse rule. No command breaks; nobody is locked out.
  • Evidence checked (which sandbox result proves it): test/test_redacted_value_reveal.py: six refused caller shapes return 403 with an audited denied row; a grep test pins dashboard/handlers/redacted_reveal.py as the only caller of STORE.reveal(; stash and reveal open no file; mutation: removing the internal_auth arm makes the internal-caller case return 200.
  • No regression:
    • Tools still work (which tools/commands were run, result): no tool, MCP server or shell path changed; redaction passes are byte-identical (test_credential_sources.py, test_slash_command_redaction_records.py pass).
    • Backward compatible (old config / old data / old callers still work, how checked): rows saved before this PR have no reveal_id; revalidate_credential_record accepts them unchanged and the card says the value was not kept (record-shape tests in both suites).
    • Existing tests (which suites passed on this head): test_redacted_value_reveal.py, test_security_posture.py (80 passed); vitest RedactionCards.reveal / MarkdownRenderer.blockedLink / RedactionCards.preview / transcriptRenderers (175 passed).
  • How to undo: revert this commit; the in-memory store disappears with the process and old records keep working (the optional key is ignored).

@iamwhatever
iamwhatever force-pushed the feat/reveal-redacted-values branch from fe33e6f to 1015e44 Compare November 4, 2026 10:32
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 1015e44
  • What rule changed: a credential removed from an agent reply is now also kept in gateway process memory (new security/reveal_store.py: bounded 2048 entries / 16 KB per value / 4 MB total, 24-hour TTL, no repr, not copyable or picklable), and its record (security/credential_sources.py) gains an optional reveal_id handle. Redaction itself is unchanged: the saved text, channels, logs and the model still get the placeholder.
  • Before -> after (what was allowed/blocked, now): before, no one could read a removed value. After, only the dashboard owner's browser can, through POST /api/security/redacted-value, which refuses internal (agent/MCP/crewmate/sub-agent/cron), app, non-dashboard and non-owner callers before reading the store, and writes a synchronous SEL row (caller, handle, never the value) before returning it.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): leaks secret -- a removed value reaches someone other than the owner. Mitigated by the gate above, slot scoping of handles, and the audit-or-refuse rule. No command breaks; nobody is locked out.
  • Evidence checked (which sandbox result proves it): test/test_redacted_value_reveal.py: six refused caller shapes return 403 with an audited denied row; a grep test pins dashboard/handlers/redacted_reveal.py as the only caller of STORE.reveal(; stash and reveal open no file; mutation: removing the internal_auth arm makes the internal-caller case return 200.
  • No regression:
    • Tools still work (which tools/commands were run, result): no tool, MCP server or shell path changed; redaction passes are byte-identical (test_credential_sources.py, test_slash_command_redaction_records.py pass).
    • Backward compatible (old config / old data / old callers still work, how checked): rows saved before this PR have no reveal_id; revalidate_credential_record accepts them unchanged and the card says the value was not kept (record-shape tests in both suites).
    • Existing tests (which suites passed on this head): test_redacted_value_reveal.py, test_security_posture.py (80 passed); vitest RedactionCards.reveal / MarkdownRenderer.blockedLink / RedactionCards.preview / transcriptRenderers (175 passed).
  • How to undo: revert this commit; the in-memory store disappears with the process and old records keep working (the optional key is ignored).

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 4, 2026
@iamwhatever
iamwhatever force-pushed the feat/reveal-redacted-values branch from 1015e44 to 7617694 Compare November 4, 2026 11:03
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 4, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 7617694
  • What rule changed: a credential removed from an agent reply is now also kept in gateway process memory (new security/reveal_store.py: bounded 2048 entries / 16 KB per value / 4 MB total, 24-hour TTL, no repr, not copyable or picklable), and its record (security/credential_sources.py) gains an optional reveal_id handle. Redaction itself is unchanged: the saved text, channels, logs and the model still get the placeholder.
  • Before -> after (what was allowed/blocked, now): before, no one could read a removed value. After, only the dashboard owner's browser can, through POST /api/security/redacted-value, which refuses internal (agent/MCP/crewmate/sub-agent/cron), app, non-dashboard and non-owner callers before reading the store, and writes a synchronous SEL row (caller, handle, never the value) before returning it.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): leaks secret -- a removed value reaches someone other than the owner. Mitigated by the gate above, slot scoping of handles, and the audit-or-refuse rule. No command breaks; nobody is locked out.
  • Evidence checked (which sandbox result proves it): test/test_redacted_value_reveal.py: six refused caller shapes return 403 with an audited denied row; a grep test pins dashboard/handlers/redacted_reveal.py as the only caller of STORE.reveal(; stash and reveal open no file; mutation: removing the internal_auth arm makes the internal-caller case return 200.
  • No regression:
    • Tools still work (which tools/commands were run, result): no tool, MCP server or shell path changed; redaction passes are byte-identical (test_credential_sources.py, test_slash_command_redaction_records.py pass).
    • Backward compatible (old config / old data / old callers still work, how checked): rows saved before this PR have no reveal_id; revalidate_credential_record accepts them unchanged and the card says the value was not kept (record-shape tests in both suites).
    • Existing tests (which suites passed on this head): test_redacted_value_reveal.py, test_security_posture.py and 8 other touched suites (573 passed); vitest RedactionCards.reveal / MarkdownRenderer.blockedLink / RedactionCards.preview / transcriptRenderers (175 passed).
  • How to undo: revert this commit; the in-memory store disappears with the process and old records keep working (the optional key is ignored).

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 0551d3e
  • What rule changed: a credential removed from an agent reply is now also kept in gateway process memory (new security/reveal_store.py: bounded 2048 entries / 16 KB per value / 4 MB total, 24-hour TTL, no repr, not copyable or picklable), and its record (security/credential_sources.py) gains an optional reveal_id handle. Redaction itself is unchanged: the saved text, channels, logs and the model still get the placeholder.
  • Before -> after (what was allowed/blocked, now): before, no one could read a removed value. After, only the dashboard owner's browser can, through POST /api/security/redacted-value, which refuses internal (agent/MCP/crewmate/sub-agent/cron), app, non-dashboard and non-owner callers before reading the store, and writes a synchronous SEL row (caller, handle, never the value) before returning it.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): leaks secret -- a removed value reaches someone other than the owner. Mitigated by the gate above, slot scoping of handles, and the audit-or-refuse rule. No command breaks; nobody is locked out.
  • Evidence checked (which sandbox result proves it): test/test_redacted_value_reveal.py: six refused caller shapes return 403 with an audited denied row; a grep test pins dashboard/handlers/redacted_reveal.py as the only caller of STORE.reveal(; stash and reveal open no file; mutation: removing the internal_auth arm makes the internal-caller case return 200.
  • No regression:
    • Tools still work (which tools/commands were run, result): no tool, MCP server or shell path changed; redaction passes are byte-identical (test_credential_sources.py, test_slash_command_redaction_records.py pass).
    • Backward compatible (old config / old data / old callers still work, how checked): rows saved before this PR have no reveal_id; revalidate_credential_record accepts them unchanged and the card says the value was not kept (record-shape tests in both suites).
    • Existing tests (which suites passed on this head): test_redacted_value_reveal.py, test_security_posture.py and 8 other touched suites (573 passed); vitest RedactionCards.reveal / MarkdownRenderer.blockedLink / RedactionCards.preview / transcriptRenderers (175 passed).
  • How to undo: revert this commit; the in-memory store disappears with the process and old records keep working (the optional key is ignored).

@iamwhatever
iamwhatever force-pushed the feat/reveal-redacted-values branch from 0551d3e to bf6d431 Compare November 4, 2026 11:43
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: bf6d431
  • What rule changed: a credential removed from an agent reply is now also kept in gateway process memory (new security/reveal_store.py: bounded 2048 entries / 16 KB per value / 4 MB total, 24-hour TTL, no repr, not copyable or picklable), and its record (security/credential_sources.py) gains an optional reveal_id handle. Redaction itself is unchanged: the saved text, channels, logs and the model still get the placeholder.
  • Before -> after (what was allowed/blocked, now): before, no one could read a removed value. After, only the dashboard owner's browser can, through POST /api/security/redacted-value, which refuses internal (agent/MCP/crewmate/sub-agent/cron), app, non-dashboard and non-owner callers before reading the store, and writes a synchronous SEL row (caller, handle, never the value) before returning it.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): leaks secret -- a removed value reaches someone other than the owner. Mitigated by the gate above, slot scoping of handles, and the audit-or-refuse rule. No command breaks; nobody is locked out.
  • Evidence checked (which sandbox result proves it): test/test_redacted_value_reveal.py: six refused caller shapes return 403 with an audited denied row; a grep test pins dashboard/handlers/redacted_reveal.py as the only caller of STORE.reveal(; stash and reveal open no file; mutation: removing the internal_auth arm makes the internal-caller case return 200.
  • No regression:
    • Tools still work (which tools/commands were run, result): no tool, MCP server or shell path changed; redaction passes are byte-identical (test_credential_sources.py, test_slash_command_redaction_records.py pass).
    • Backward compatible (old config / old data / old callers still work, how checked): rows saved before this PR have no reveal_id; revalidate_credential_record accepts them unchanged and the card says the value was not kept (record-shape tests in both suites).
    • Existing tests (which suites passed on this head): test_redacted_value_reveal.py, test_security_posture.py and 8 other touched suites (573 passed); vitest RedactionCards.reveal / MarkdownRenderer.blockedLink / RedactionCards.preview / transcriptRenderers (175 passed).
  • How to undo: revert this commit; the in-memory store disappears with the process and old records keep working (the optional key is ignored).

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 4, 2026
@iamwhatever
iamwhatever force-pushed the feat/reveal-redacted-values branch from bf6d431 to 3e286da Compare November 4, 2026 12:05
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 3e286da
  • What rule changed: a credential removed from an agent reply is now also kept in gateway process memory (new security/reveal_store.py: bounded 2048 entries / 16 KB per value / 4 MB total, 24-hour TTL, no repr, not copyable or picklable), and its record (security/credential_sources.py) gains an optional reveal_id handle. Redaction itself is unchanged: the saved text, channels, logs and the model still get the placeholder.
  • Before -> after (what was allowed/blocked, now): before, no one could read a removed value. After, only the dashboard owner's browser can, through POST /api/security/redacted-value, which refuses internal (agent/MCP/crewmate/sub-agent/cron), app, non-dashboard and non-owner callers before reading the store, and writes a synchronous SEL row (caller, handle, never the value) before returning it.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): leaks secret -- a removed value reaches someone other than the owner. Mitigated by the gate above, slot scoping of handles, and the audit-or-refuse rule. No command breaks; nobody is locked out.
  • Evidence checked (which sandbox result proves it): test/test_redacted_value_reveal.py: six refused caller shapes return 403 with an audited denied row; a grep test pins dashboard/handlers/redacted_reveal.py as the only caller of STORE.reveal(; stash and reveal open no file; mutation: removing the internal_auth arm makes the internal-caller case return 200.
  • No regression:
    • Tools still work (which tools/commands were run, result): no tool, MCP server or shell path changed; redaction passes are byte-identical (test_credential_sources.py, test_slash_command_redaction_records.py pass).
    • Backward compatible (old config / old data / old callers still work, how checked): rows saved before this PR have no reveal_id; revalidate_credential_record accepts them unchanged and the card says the value was not kept (record-shape tests in both suites).
    • Existing tests (which suites passed on this head): test_redacted_value_reveal.py, test_security_posture.py and 8 other touched suites (573 passed); vitest RedactionCards.reveal / MarkdownRenderer.blockedLink / RedactionCards.preview / transcriptRenderers (175 passed).
  • How to undo: revert this commit; the in-memory store disappears with the process and old records keep working (the optional key is ignored).

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 4, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 1140b44
  • What rule changed: a credential removed from an agent reply is now also kept in gateway process memory (new security/reveal_store.py: bounded 2048 entries / 16 KB per value / 4 MB total, 24-hour TTL, no repr, not copyable or picklable), and its record (security/credential_sources.py) gains an optional reveal_id handle. Redaction itself is unchanged: the saved text, channels, logs and the model still get the placeholder.
  • Before -> after (what was allowed/blocked, now): before, no one could read a removed value. After, only the dashboard owner's browser can, through POST /api/security/redacted-value, which refuses internal (agent/MCP/crewmate/sub-agent/cron), app, non-dashboard and non-owner callers before reading the store, and writes a synchronous SEL row (caller, handle, never the value) before returning it.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): leaks secret -- a removed value reaches someone other than the owner. Mitigated by the gate above, slot scoping of handles, and the audit-or-refuse rule. No command breaks; nobody is locked out.
  • Evidence checked (which sandbox result proves it): test/test_redacted_value_reveal.py: six refused caller shapes return 403 with an audited denied row; a grep test pins dashboard/handlers/redacted_reveal.py as the only caller of STORE.reveal(; stash and reveal open no file; mutation: removing the internal_auth arm makes the internal-caller case return 200.
  • No regression:
    • Tools still work (which tools/commands were run, result): no tool, MCP server or shell path changed; redaction passes are byte-identical (test_credential_sources.py, test_slash_command_redaction_records.py pass).
    • Backward compatible (old config / old data / old callers still work, how checked): rows saved before this PR have no reveal_id; revalidate_credential_record accepts them unchanged and the card says the value was not kept (record-shape tests in both suites).
    • Existing tests (which suites passed on this head): test_redacted_value_reveal.py, test_security_posture.py and 8 other touched suites (573 passed); vitest RedactionCards.reveal / MarkdownRenderer.blockedLink / RedactionCards.preview / transcriptRenderers (175 passed).
  • How to undo: revert this commit; the in-memory store disappears with the process and old records keep working (the optional key is ignored).

@iamwhatever
iamwhatever force-pushed the feat/reveal-redacted-values branch from 3e286da to 1140b44 Compare November 4, 2026 17:53
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 4, 2026
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.
@iamwhatever
iamwhatever force-pushed the feat/reveal-redacted-values branch from 1140b44 to 27f6100 Compare November 4, 2026 19:13
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 27f6100
  • What rule changed: a credential removed from an agent reply is now also kept in gateway process memory (new security/reveal_store.py: bounded 2048 entries / 16 KB per value / 4 MB total, 24-hour TTL, no repr, not copyable or picklable), and its record (security/credential_sources.py) gains an optional reveal_id handle. Redaction itself is unchanged: the saved text, channels, logs and the model still get the placeholder.
  • Before -> after (what was allowed/blocked, now): before, no one could read a removed value. After, only the dashboard owner's browser can, through POST /api/security/redacted-value, which refuses internal (agent/MCP/crewmate/sub-agent/cron), app, non-dashboard and non-owner callers before reading the store, and writes a synchronous SEL row (caller, handle, never the value) before returning it.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): leaks secret -- a removed value reaches someone other than the owner. Mitigated by the gate above, slot scoping of handles, and the audit-or-refuse rule. No command breaks; nobody is locked out.
  • Evidence checked (which sandbox result proves it): test/test_redacted_value_reveal.py: six refused caller shapes return 403 with an audited denied row; a grep test pins dashboard/handlers/redacted_reveal.py as the only caller of STORE.reveal(; stash and reveal open no file; mutation: removing the internal_auth arm makes the internal-caller case return 200.
  • No regression:
    • Tools still work (which tools/commands were run, result): no tool, MCP server or shell path changed; redaction passes are byte-identical (test_credential_sources.py, test_slash_command_redaction_records.py pass).
    • Backward compatible (old config / old data / old callers still work, how checked): rows saved before this PR have no reveal_id; revalidate_credential_record accepts them unchanged and the card says the value was not kept (record-shape tests in both suites).
    • Existing tests (which suites passed on this head): test_redacted_value_reveal.py, test_security_posture.py and 8 other touched suites (573 passed); vitest RedactionCards.reveal / MarkdownRenderer.blockedLink / RedactionCards.preview / transcriptRenderers (175 passed).
  • How to undo: revert this commit; the in-memory store disappears with the process and old records keep working (the optional key is ignored).

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 4, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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-store headers; harmless, but could be consistent.

AI-assisted, approved by bolichen97

@bolichen97
bolichen97 merged commit c8a7967 into main Nov 4, 2026
104 checks passed
@bolichen97
bolichen97 deleted the feat/reveal-redacted-values branch November 4, 2026 20:45
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 4, 2026
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.

2 participants