Repository navigation
feat(security): one redaction switch, rule table only, value-only masks - #37408
Conversation
Sensitive change review
|
Sensitive Change ReviewSensitive files changed:
|
First Principles Review (Opus 5.5) — ✅ human override accepted@bolichen97 overrode this lane for |
Design Review (Opus 5.5) — ✅ human override accepted@bolichen97 overrode this lane for |
UX Review (Opus 5.5) — ✅ human override accepted@bolichen97 overrode this lane for |
Security Scope Review -- ✅ human override accepted@bolichen97 overrode this lane for [SCOPE-REVIEWED] f0d49b7 |
Opus 5.5 Review — ✅ human override acceptedReviewed Human judgment by @bolichen97 overrides the Opus 5.5 finding for [OPUS-OVERRIDE] f0d49b7 Verdict recorded from an authorized human decision for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ human override acceptedHuman judgment by @bolichen97 overrides the GPT 6.1 finding for [GPT-OVERRIDE] f0d49b7 This comment is updated in place on each push. The model was not re-run because an authorized human decision supersedes it. False positive or not applicable? A repository writer can comment: |
Code change approver recommendation: A person should decideWhy: the decider raised 1 possible problem and estimates a 72% chance that this change introduces a defect; a person should check it. This PR makes credential redaction one owner switch, OFF by default, with the rule table as the only engine. It relies on scope-based bypasses: the whole Slack turn and the whole dashboard chat turn run inside an output seam, and only checks wrapped in always_scan() keep scanning when redaction is off. The PR wraps the shared outbound_files.upload_filename that way, but Slack's own slack/files.upload_filename is a separate copy with no always_scan(), and it runs inside the Slack turn's channel seam. With the new default OFF, a credential-bearing file name is uploaded to Slack while Discord and Telegram replace it. That contradicts the PR's stated guarantee, repeats the class of bug an earlier review found, and has no test. Governance handling of the retired row, the fail directions and cache keying checked out. A maintainer would also hold the PR because most CI (backend lint and type check, macOS tests, CodeQL) was still pending, several lanes failed closed on the diff size, and the First Principles block awaits an override. Request changes. Things to check (possible problems the decider raised; at this confidence many turn out to be fine):
An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
069a1eb to
0268909
Compare
Sensitive change review
|
|
Dispositions for the review round on 069a1eb (fixes are in 0268909):
|
Sensitive change review
|
Sensitive change review
|
0268909 to
152417c
Compare
|
Dispositions for the round on 0268909 (fixes are in 152417c):
|
152417c to
1dac9df
Compare
Sensitive change review
|
|
Dispositions for the UX BLOCK and the new Opus items on 152417c (fixes are in 1dac9df):
|
1dac9df to
fdd9ebe
Compare
Sensitive change review
|
Problem / Motivation
Goal: Give the owner one credential-redaction switch (off by default, governed by policy) whose rule table masks only real secrets, at the value, so daily use is unaffected when it is on.
Follow-up to the merged #29423, implementing #31895 (with the default deviation below), #31690 and #31692 in one change, as the maintainer ordered. Main has a Files-view-only switch beside an output-seams switch and an engine selector, and still runs its old regex and shape passes after the rule table, so certificates, SSH public keys, unsigned JWTs, near-miss tokens, a bare 40-character string and whole URLs (OAuth links, long queries) are rewritten although none of them grants access.
Why it matters
Redaction that rewrites identifiers, public keys and ordinary links breaks normal work (a pasted commit link, OAuth URL or certificate comes back as a placeholder), so owners turn it off or work around it. The maintainer's bar: with the switch on, redaction is imperceptible and hides only what grants access by itself.
Not a goal
redact(x)withx.tokenparameter (it stays, now on the table'surl.token_param.tokenrow).What changed (motivation → approach → change)
Main's old passes ran after the rule table and a URL heuristic replaced whole links; those are what rewrote certificates, keys, near-miss tokens, long OAuth links and identifiers. So the rule table becomes the only engine, every value it masks is masked at the value, and one owner switch, governed by policy, decides whether any of it runs.
enabled(credential_redaction.json), default OFF in one constant (redaction_switch.DEFAULT_REDACTION_ENABLED), read on every redaction path (table under Sensitive change review).capabilities.credential_redaction_off, widened from the Files view to the whole setting (maintainer decision, recorded indocs/decisions/2026-11-15-credential-redaction-off-by-default.md). The seams row is retired: its grant grants nothing, and its deny, nested or flat, still denies the setting beside a grant (tightest wins).?token=value pass, the engine selector,compat.use_rule_table(), the code-text scope and their tests are deleted; the formats the residual branches caught are table rows (Telegram: digits,:, 35 base64url characters; Discord:M/N/Owith three dot-separated parts of fixed lengths;npm_,pypi-,sk-proj-by prefix, length and charset), andtokenis a URL parameter row. Telegram's and Discord's rows have no fixed literal prefix; they guard the crew's own bot tokens, so they stay as structural rows (the maintainer may drop them)._ - .(password, passwd, secret, api_key, apikey, api_secret, api_secret_key, secret_key, client_secret, app_secret, jwt_secret, auth_token, access_token, refresh_token, private_token, db_password, database_password, postgres_password, pgpassword, mysql_password, mysql_pwd, mysql_root_password, redis_password, admin_password, root_password, smtp_password, spring.datasource.password, github_token, gh_token, npm_token, slack_bot_token, openai_api_key, anthropic_api_key, twilio_auth_token, sentry_auth_token, authorization_token, account_key, shared_access_key; the AWS names keep their own rows), with placeholder, prose and reference gates;mysql -p,docker login -p,.netrc,Authorization: Bearer/Basic(any*-Authorizationheader), API-key headers, session cookies,curl -u, URL userinfo password, signature and secret URL params, webhook secret segments, base64 and percent-encoded runs that decode to a credential (a decoded run is read by the table), Slackxapp-,hf_,dckr_pat_, OpenAI legacy keys.&,&,\&).Also touched, each for the change above:
sel.py(every security event log row is scanned in full whatever the setting);security/deny_gate.pyanddashboard/chat_turn/segment_flush.py(SEL previews scanned before their clip);dashboard/file_api/channel_upload.pyandoutbox.py(the upload, notify, list and non-owner download checks scan in full);dashboard/handlers/side.pyanddashboard/chat_threads.py(history reads inside the chat seam);dashboard/handlers/credential_redaction.py(the boot audit record);platform/governance_parts/parsing.py(a flat retired key);platform/wheel_apply.pyandimessage/renderer.py(no clear-text logging);docs/decisions/anddocs/request-for-change/(the decision record; the draft RFC it supersedes);.github/black-baseline.txt(three files graduate);src/kiro_crew/apps/builtins/tests (real-format fixtures);src/kiro_crew/builtin_skills/feature-request/SKILL.md(no suspicious-URL wording);src/kiro_crew/context.pyandcontext_assembly/session_start.py(no out-of-seam URL pass);credential_patterns.py(tier rows of removed rules);crewmate_bundle_export.pyanddecisions/gate.py(scan_exfiltration_urlsdecisions);cron_script.pyandcron_script_context.py(the dead opaque-id carve-out of pass 3);dashboard_frame.py(the code-text mapper);diagnostics.py,doctor_checks/mcp.py,imessage/renderer.py,voice_reply.pyandslack/interactions_approvals.py(comments and counts of the removed URL tag);discord/renderer_text.pyandtelegram/renderer_display.py(steer chips redact before stripping_);log_redaction.py(the full plan, then the Bearer floor);messaging/display_safety.py,driver.py,egress.py,renderer.py(display readings, seams, tag counts);redaction_seams.py;sandbox_precreate.py;security_posture.py,security_posture_controls.py,security_posture_sinks_delivery.py,security_posture_sinks_gateway.py(posture wording and the call-site registry);mcp_core_parts/history.py(the chat-history tool opens the chat seam);website/src/store/chat/side.tsandstate.ts(side-chat rows keep their blocked-link records);slack/handler.py,transport_dispatch.py,gateway_runtime/service_boot.py(the channel seam inside the turn);testing/fake_computer_use.py(maskable fixtures);src/kiro_crew/docs/(user docs and regenerated indexes);website/src/api/,app-sdk/messageRenderers.tsx,components/(MarkdownRenderer.tsx,RedactionCards.tsx,blockedLinkRecords.ts,chat/useRedactionHostsReload.ts,ChatPane.tsx, the settings registry),website/src/i18n/locales/*.jsonanddestructiveConfirm.test.ts(all 13 catalogs: the one toggle, the blocked-link and allowed-hosts strings),prompts/featureRequest.ts,stories/Redaction.stories.tsx,types/index.chat.tsandutils/sanitize.ts(no URL rewriting in the browser).Sensitive change review
Deviation from #31895, stated prominently: the default is OFF (redaction off), as the maintainer ordered; #31895 says "default stays on". The default lives in one constant,
redaction_switch.DEFAULT_REDACTION_ENABLED = False; to ship ON, flip that line (the governed-host rule, the API and the UI need no change). On upgrade, an install with no record, or the{}the sandbox pre-creates, stops redacting on the paths below until the owner turns the switch on.Intended widening, decided by the maintainer: the switch reuses
capabilities.credential_redaction_off(opt-in,capability_default=False). In v0.13.0-rc.1 that row let the owner read only the Files view raw; it now governs the whole setting, so a policy that already grants it now allows turning all credential redaction off.capabilities.credential_redaction_seams_off(main only, in no tag) is retired (governance_parts.catalog.RETIRED_SCOPES): a policy or profile naming it still loads with a warning; its grant grants nothing, and any other value (a deny) is read as a deny ofcapabilities.credential_redaction_off, so retiring it never loosens a ceiling. An explicit deny is never dropped: a deny of the retired row, nested undercapabilitiesor as one flat dotted key, denies the setting even beside a grant ofcapabilities.credential_redaction_off, in either order (tightest wins; the widening applies to grants only). A v0.13.0-rc.1 record'senabledis read as the one setting: a stored OFF equals the new default, a stored ON keeps redaction on.Decision record:
docs/decisions/2026-11-15-credential-redaction-off-by-default.md, from the maintainer's decision restated on this PR: one owner switch, off by default, governed by the widened row, the legacy engine removed. It supersedes, in part,docs/decisions/2026-10-20-redaction-classifies-by-what-a-value-can-do.md(its tiers still say what the switch masks) and the draft RFCrfc-redaction-structured-engine-default-on.md(status nowsuperseded). The decisions README asks for a superseding entry in its own PR; it ships here at the maintainer's order. Audit trail: each gateway boot whose setting in force is OFF only because no choice is stored writes one SEL record (credential_redaction.default_off, outcomeoff_by_default) naming the decision record; a stored choice, or a governed host that reads the default as ON, writes none.credential_redaction_locked_by_policy+governance_decisionrecordEvery reader (
read_state, GET, boot seed, policy refresh) and writer (set_enabled, PUT) returns the state in force under that rule; every change and refusal is SEL-recorded (a disable whose record cannot be written is refused, 503). The PUT body is exactly{"enabled": bool}: an oldengineorseams_enabledfield is a 400 that writes nothing, and a storedengine: legacyrecord reads without error (the field is ignored and dropped on the next write).What the switch governs, path by path. The owner's OFF applies only to what the owner alone sees (
redaction_seams.owner_alone: the owner's own dashboard session, the Files view, the model, the owner's 1:1 DM with the crew bot where the sender knows it is one); anything a non-owner human or an app can see stays redacted whatever the setting (decision). Off = left as written:!dashboarduser, an app token (websocket send, the chat SSE stream, HTTP reads behind a middleware after token auth)ctx.scrub.outbound, an app's own page): a link the dashboard draws as a Blocked link chip (the same decision,blocked_links.replace_blocked_links, under the owner's allowed hosts)[REDACTED: suspicious URL to <host>], counted inurls_removedSecretRedactionFilter)token=floor before)redact_exfiltration_urls)scan_exfiltration_urlsover a command, the OAuth consent-URL gate, refusal gates comparingredact(x)withx(the upload gate's name and text checks, the outbox notify, list and non-owner download checks), every security event log row and its clipped previews, every Stop hook payload (the dashboard turn's and the Slack turn's), vault secret values in logs, the live log stream to non-owner sockets, MCP servers, cron scripts, CLIPer class, with the switch on (principle: grants access by itself, mask the value; otherwise visible):
xghp_...,ghp_...Z)xoxb-your-bot-token)alg: none) JWT, the jwt.io samples (current and older) and the RFC 7519 exampleSHA256:fingerprintsaws configure set), labelled session tokenx-amz-id-2/HostId, AWS documentation example keysTWILIO_AUTH_TOKEN,JWT_SECRET,spring.datasource.password, YAMLpassword:), in env, ini, YAML, JSON (Secrets Manager escaped JSON included), properties and CLI flags;mysql -p<pw>,docker login -p,.netrcpasswords${X},$VAR,<x>,your-...,changeme,example, runs ofxor*), prose or examples (see the vault,my-secret-pw), code (getpass(),os.environ[...],password=password) and page or request tokens (NextToken,ClientToken) stay; a single plain word stays masked, since it can be a real passwordAuthorization: Bearer/Basic(also after punctuation, a no-break space, or aProxy-/X-prefix),x-api-keyand similar headers, session cookies,curl -u user:passclient_secret,access_token,refresh_token,id_token,code_verifier,password,passwd,api_key,apikey,private_token,tokensig(Azure SAS),Signature(CloudFront),X-Amz-Signature,X-Amz-Security-Token,X-Goog-SignatureX-Amz-Credential,X-Amz-Date,X-Amz-Expires,se,spstaycodestate,client_id,scope,redirect_uri,code_challenge,nonce,response_type[REDACTED: encoded credential])Deviation from the false-positive list:
github.gluedandgithub.too_longare masked. A message splitter strips the blank at a chunk edge, so a key split across messages can sit against the next word on screen; reading a checksum-valid token glued to a word is what lets the split grade refuse that cut. Flip back: dropgluedinredaction_structured/tokens.py(two lines).Exfiltration protection, exactly what remains:
security/blocked_links.pyflags a link by the blocking scan's own per-URL verdict (long or base64-looking query, heavy percent-encoding, decode saturation, a credential still in the text), with the same exemptions (platform exact hosts, the Slack app-create link, Outlook web links, valid presigned S3 URLs; PlantUML and document links are not flagged). The dashboard draws a flagged link as a Blocked link chip, not a live link (a record matches the destination as written and as the renderer decodes its character references and escapes), until the reader allows its host for the workspace (/api/redaction/allowed-hosts, owner only, SEL-audited, sealed from the sandbox); remote markdown images never auto-load (click-to-load placeholder).security.exfil.refuses(text, redactor): the redactor run in full underalways_scan, or a URLscan_exfiltration_urlsflags, as on main (list below).scan_exfiltration_urlsover a command, the OAuth consent-URL gateoauth_url_contains_credential,_contains_fixed_credential, the mediated-request refusal (secrets_mediation.dispatch, which reads the scan's decision, so a flagged query payload to the authorized origin is refused, and checks credentials in full) and the other request-blocking gates.[REDACTED: encoded credential]) instead of being committed raw. A reply still streaming has no records yet, so every web link in it is drawn as its text, never a live link, until the reply lands with its records (RedactionMarkers.pending). A finished side-chat answer and a crewmate thread reply carry the same records (link_blocks) as a chat row.exfil_query_length); main replaced each of them whole, and here each is a Blocked link chip with Open once and Allow for this host.platform.binary_content_is_flagged,wide_content_is_flagged,outbound_files.upload_filename), the channel upload gate's name and text checks (_gate_upload_file) and the outbox notify, list and non-owner download checks run underredaction_switch.always_scan(), so a channel seam or an owner view with redaction off still refuses a file that carries a credential; the cached verdicts are full scans keyed by the published switch state, so none survives a change of it, and a non-owner download reads the same full verdict.sel._redact_textunderalways_scan), and an SEL preview that is clipped (the glued-footer preview, the deny and injection gates' samples) is scanned before the clip, so no credential fragment reaches the log.[REDACTED: suspicious URL to <domain>]placeholder and the records that kept its URL (meta.blocked_links) on every reload and save, so it round-trips unchanged; no client is sent those records.ctx.scrub.outboundreplaces each link the dashboard would block (same decision, same allowed hosts) with[REDACTED: suspicious URL to <host>]and counts it inurls_removed, since an app's page draws no chip; every other URL there is masked at the value.[REDACTED: suspicious URL to <domain>]rewrite everywhere else and the frontend mirror that rewrote URLs (sanitizeExfiltrationUrls). Consequence, stated: a link carrying data that is not a credential is stored, exported and posted to channels as written; link previews (Slack unfurls, Telegram and Discord embeds) can fetch such a link with no click.Known gaps (visible with the switch on). On the 258-item corpus 134 of 152 secrets are fully masked (main: 129) and 6 more (PEM and PGP blocks) have their body masked with BEGIN and END kept, so 140 show no key material; the 12 still visible: an AWS session token after a bare
token:label (1,aws/session_token_bare_360:tokenalone is not a listed name); a bare 40-character AWS secret with no key ID or label (2), by the 2026-10-20 decision;ghp_/gho_strings and a base64ghp_string that fail GitHub's checksum (4:github_classic_ghp,github_oauth_gho,b64_github_token,github_token_mid), not tokens GitHub issued; ansk-string without OpenAI's published marker (1); a PNG payload holding text (1); a markdown image URL carrying non-credential data (1; remote images never auto-load); the AWS documentation example secret (1, by decision); a hex-encoded secret (1). Of 106 items without a secret, 4 change (main: 28):github.gluedandgithub.too_long(the deviation above),url.oauth.other_params_stay(itstoken=value is read by the table'stokenparameter row) andurl.oauth.key_in_prose(set access_token=<value>is a written credential after its label). By the table-only order, also visible: a value after a name the list does not hold (for example EMAIL/LDAP/RABBITMQ/KEYSTORE_PASSWORD, DB_PASS, SMTP_PASS, SESSION/COOKIE/WEBHOOK/SIGNING_SECRET, SENDGRID_API_KEY, STRIPE_SECRET_KEY, ACCESS_KEY, PRIVATE_KEY, API_TOKEN, BEARER_TOKEN, GITLAB_TOKEN, BASIC_AUTH, TOKEN, and names that only contain a listed name such as MY_DB_PASSWORD; a real value in a vendor format is still caught by its format row); a quoted cookie value (Set-Cookie: session="<opaque>"); a URL parameter whose separator,=or name is HTML-entity or percent encoded (&access_token=,%3D; a separator written&, as a renderer decodes it, is read as&); a scheme-less?token=(a path, a log line); a token glued after a letter (xnpm_...); a Telegram or Discord token run together with a word is not named by the browser change report's run-together check (browser_harness/change_report.pyreads only fixed prefixes of 3 or more characters, and those two rows have one-character prefixes that ordinary prose matches); the refusal sites in the adopted apps pptx-maker and spec-builder (below) refuse a credential but not a flagged URL until their app PRs land (KiroCrewCaptain/kirocrew-app-pptx-maker#8, KiroCrewCaptain/kirocrew-app-spec-builder#10: eachbackend/_host.pyalso reads the exfil scan, which exists on main and here, so they can land first). Also: a private key written to a log one line per record (each body line is its own record, which no detector reads as a key); an ECR authorization token longer than the 512-character literal cap; a long URL or ARN is held whole in the live stream up to its row cap (4096 or 2048 characters) so a signature at its end cannot leak; the live log stream to non-owner sockets stays redacted with the switch off; processes that never publish the verdict (MCP servers, the CLI, cron) keep redacting; text stored while the switch was on keeps its masks after it is turned off (history is not un-redacted, and an open session keeps its rows until reload); a labelled secret inside a quoted string on a longer line (owner ruling: the parser is not widened for it); a generickey=<40 characters>(no label the table reads); a non-checksum token glued to a letter (for exampledeck-xoxb-...), including when a split puts one against a word on screen; a key that only a whitespace-collapsed reading joins to a preceding word; past batch's 256 KiB decode budget a stream window decodes afresh, so the stream can show a long encoded run that batch withholds whole (the run decodes to no credential), and a percent run longer than 448 characters whose first escape comes late shows its head on the stream while batch masks the whole run (the credential itself never streams); a benign encoded run whose head reads as text and is longer than 4096 characters is withheld on the stream; data that is not a credential carried in a link's query (shown as written; see exfiltration above); link previews (Slack unfurls, Telegram and Discord embeds) fetch a posted URL with no click, so a data-carrying link posted to a channel reaches its host.Refusal gates that decide on
security.exfil.refuses(and the comparison sites left alone)Switched (each refused a flagged URL on main):
acp/stderr_tail.safe_stderr_tail,acp/kas_env_literals._relayable_literal,agent_capabilities._safe_view,apps/job_sdk_records._validated_params,artifact_store/dashboard_package._refuse_credential_shaped_name,autonudge_service/store_loader._addressing_value_unsafe_why,cli_commands_learn._lesson_scope_suffix,cron_script_context._changed_by_scanand_changed_path(MCP tool arguments),dashboard/agent_admin/roster._roster_mask,chat_turn/elicitation_prompt._value_tainted,file_api/channel_uploadtext gate,file_api/outboxnotify, list and non-owner download,file_api/transfer._open_media,handlers/core_config_view._mask_agent_free_text,handlers/cron_lessons._lesson_scope_selector,handlers/member_dashboard._name_unsafeand package names,handlers/office_slides._screen_rendered_text,session_control_parts/model_switch.set_model_target,session_create._model_pin_refusal,external_text.external_text_requires_redaction,guide_catalog.needs_redactionand_redacts,instances/ssh_tunnel_manager_remote_ops._peer_version,mcp_tools/messaging.file_send,messaging/outbound_files.upload_filename,metrics/schema.redact,platform/context.wide_content_is_flaggedandbinary_content_is_flagged,security/credential_sources._is_clean,slack/code_channels/tools._set_viewand_bar_items,workspace/context_bar._item,slack/files.upload_filename,workflows/library._write. Already on the scan:secrets_mediation/dispatch._refuse_if_outbound_redacted,handlers/link_meta.link_meta_get.Left as they are, with a stated loss: the wheel copies of the adopted apps pptx-maker (
decks._preview_url,decks.deck_detail,paths.resolve_deck_dir,routes._scanned_bitmap_bytes) and spec-builder (handlers._handle_put_settings,parsers._usable_name,repository._load_settings). PR Hygiene requires a wheel-copy change to name its app-repository commit, since an adopted host runs the app's own repository at its pin; these sites still compareredact(x)withx, so they refuse a credential but not a flagged URL until their app PRs, which add the exfil scan to each_host.pyrefusal, land: KiroCrewCaptain/kirocrew-app-pptx-maker#8 and KiroCrewCaptain/kirocrew-app-spec-builder#10. Left as they are: credential-only redactors where main never refused a URL (config/loosening_provenance._shown,monitoring/targets,ops_mission_control/ledger_sync._bearing); identity guards against a rewrite URLs no longer get (dev_fleet/worktree_ops_removal,messaging_api/agent_push,card_lifecyclekey check,git_panel.api_project_git_repos,session_files,hooks_webhooks); records, fingerprints, equality, logs and SEL (tool_result_events,client_tool_eventsfingerprints,_frame_record,slot_detail,history_append,segment_flush,log_redaction,sel,_scan_verdict,blocked_links._credential_clean,mcp_body_fields); display, masking, split and stream decisions, where a URL stays visible text (session_update_parser,client_tool_eventsinput views,card_lifecyclereadings,code_channels/tools._audit_view,turn_reply_seams,chat_utils_display,git_panel._redact_status_path,handlers/core._send,memoryandmemory_edit,source_providers/adfandreview,warm_task_brief,mcp_gateway/backend_wire,messaging/display_safety,renderer,split,redact_path_segments,workspace/service,slack/format,handler_runtime/stream).Governance: a policy that names only retired rows still governs the host (
GovernanceCeiling.retired_rows, kept through tier folding as the union of both tiers): its retired grant grants nothing, so the default and a stored OFF read as ON until the policy grantscapabilities.credential_redaction_off; a retired deny still denies, nested or flat, beside a grant, in either order.Worst case if wrong: a credential the table misses reaches a reader with the switch on; with the switch off, everything in the path table reaches its reader as written, which is the owner's choice. Undo: the toggle, or the constant.
Backwards compatibility
Breaking:
PUT /api/security/credential-redactionaccepts only{"enabled": bool}(anengineorseams_enabledbody is a 400); the engine and seams fields leave the GET answer and the push frame;capabilities.credential_redaction_offnow allows turning every path off. Writer sweep on origin/main @ 87b11b5: the only writers are the Settings page (website/src/pages/settings/SecurityPanel.tsx, updated here) and the tests; no app, cron, CLI or MCP tool writes the setting.Adopted apps: the 14 apps in
adoption-pins.jsonwere fetched at their pinned commits, and everykiro_crewname their code imports resolves against this core (static check);test/test_adopted_apps_core_imports.pyholds the wheel copies to the same check. Follow-ups in those repositories: their tests that assert the dropped whole-URL rewrite (auto-improvement, which also imports the removedsecurity.exfil.EXFILTRATION_REDACTION_TAG_PREFIX, auto-research, and design-tweak's host double), and the refusal sites in pptx-maker and spec-builder listed under Sensitive change review.Reader: website/src/pages/settings/SecurityPanelRedaction.tsx -- crew page -- reads
enabledandlocked_by_policyonly (SecurityPanel.credentialRedaction.test.tsx)Reader: website/src/hooks/useWebSocket.ts:credential_redaction_settings_changed -- crew page -- the frame is gone;
credential_redaction_changedstill drops cached file bodies (test_credential_redaction_switch.py)Reader: src/kiro_crew/dashboard/chat_utils_display.py:bare_secret_pass_enabled -- chat -- removed with pass 3; the display battery keys on the published verdict (
test_redaction_one_setting.py)Reader: src/kiro_crew/dashboard/handlers/member_dashboard.py:redact_code_via_context -- crew page -- uses
redact_via_context(test_redaction_one_engine.py)Reader: src/kiro_crew/security/mcp_body_fields.py:code_text -- chat -- the rule table needs no code scope (
test_mcp_body_fields.py)Reader: src/kiro_crew/acp/_frame_record.py:use_rule_table -- chat -- the check is gone; the table always runs (
test_redaction_one_engine.py)Reader: src/kiro_crew/dashboard/chat_turn/segment_flush.py:redact_exfiltration_urls_with_records -- chat -- value-level masking; blocked-link records are computed at display time (
test_blocked_links.py)Reader: src/kiro_crew/platform/governance_parts/parsing.py:capabilities.credential_redaction_seams_off -- release -- a policy naming the retired row loads and ignores it (
test_credential_redaction_switch.py)Tests
test/test_redaction_one_engine.py(new): every benign fixture stays as written on every batch path and the stream; every secret fixture is masked exactly as the table masks it; value-only masking; the residual branches; encoded credentials after a non-ASCII character and past the decode budget; assignment-form Bearer; 400 random 20 to 40 character Bearer tokens are never read as placeholders.test/test_redaction_fixed_point.py(new, 46 tests): redaction is a byte-for-byte fixed point for every fixture and all 225 snippets of the independent verifier's corpus (test/redaction_verifier_*.py), on the batch path,channel_egress_partsper platform,redact_for_displayand repeated transcript saves; underscores survive egress; webhook, inline-code, scan-count and holdback regressions.test/test_redaction_structured_names.py(new) andtest/redaction_structured_cases.py: labelled values by name shape,mysql -p,docker login -p,.netrc, escaped Secrets Manager JSON, PEM body only, placeholder token bodies, both jwt.io samples; plain-word passwords stay masked.test/test_redaction_urls_value_only.py(new): no URL is replaced whole; only credential values inside it change, per parameter class (OAuthcodestays).test/test_credential_redaction_switch.py,test/test_redaction_one_setting.py: default OFF; a governed host keeps ON and refuses OFF with 403; an opt-in allows OFF; the retired seams row loads, its grant grants nothing and its deny denies; a storedengine: legacyrecord reads; a PUT with an old field is a 400; SEL records; the upload scan flags a credential inside an OFF channel seam and its cached verdict never crosses a switch change;TestEveryOutputSiteIsListedholdsredaction_seams.SEAM_SITESandALWAYS_REDACTED_SITESto the source.test/test_blocked_links.py,test/test_blocked_links_diagram_and_document_links.py,test/test_blocked_links_side_and_thread.py,test/test_redaction_allow.py,website/src/test/MarkdownRenderer.streamingLinksInert.test.tsx,website/src/test/RedactionCards.blockedLinkPreview.test.tsx,website/src/test/SideChat.blockedLink.test.tsx,website/src/pages/members/ThreadPanel.blockedLink.test.tsxand the restoredMarkdownRenderer.blockedLink*tests: the blocked-link decision over unaltered text, its exemptions, allowed hosts, the chip, no live link while streaming.test/conftest_resets.py: every test starts and ends with redaction published ON, so a dashboard-boot test no longer leaks the OFF default into its xdist worker.test/test_credential_redaction_switch.pyandtest/test_outbox_binary.py: a flat retired key loads; a retired deny beside a grant denies in either order; inside a channel seam opened with redaction off, and inside an owner view, the upload gate refuses a credential in a file's name or text and a non-owner download meets the full text scan (each fails without its fix).test/test_redaction_one_setting.py: every SEL row stays redacted inside an OFF seam and the deny gate's audit clip leaves no fragment; side-chat and thread history reads follow the switch; a boot that reads OFF from the default writes one SEL record, a stored choice or a governed host none.test/test_glued_footer_text_label.py: the glued-footer SEL preview is scanned before its 200-character clip with redaction off (fails without the fix).test/test_redaction_audience_dashboard.py(21 tests: the owner and a non-owner socket, SSE reader and history read, each with the switch off and on, a credential split across stream slices, the subagent replay, who counts as which reader, a failed owner check);test/test_redaction_one_setting.py(a channel post stays redacted with the switch off, inside the owner's chat seam too, and follows the switch only for a post its sender names as the owner's 1:1 DM; both Stop hook payloads are built underalways_scan);test/test_credential_redaction_switch.py(a policy naming only retired rows governs, flat or nested; a lower tier's retired row survives the fold);test/test_refusal_gates_flagged_url.pyandtest/test_cron_call_tool_scan.py(a flagged URL is refused by 14 refusal gates, the file-content readers and the cron MCP tool arguments; 22 fail without the fix); known-gap tables in the redaction tests (unlisted names, quoted and entity-encoded values, a scheme-less?token=). Fakes replaced this round:test_crewmate_import_route.pyandtest_kiro_prerequisite_agent_specs.py(ghp_with a bad checksum, andsvc?token=AKIAIOSFODNN7EXAMPLE) togithub_classic(seed=411, 412);test_channel_upload_field_types.pyandtest_slack_upload_binary.pynow expect a channel caption masked with the switch off.test/test_redaction_audience_dashboard.py(turning redaction on mid-reply releases no credential to a non-owner socket, whose stream redactor now runs whatever the setting reads and keeps its context across the change; a frame past the memo's byte bound is redacted and not kept);test/test_security_token_params.py(atoken,access_tokenorsigvalue after a&separator is masked at the value);test/test_scrub_sdk.py(the same URL is a chip on the dashboard and the placeholder in app egress, an allowed host passes untouched in both, any other link is masked at the value only);test/test_adopted_apps_core_imports.py(new: every core name each adopted app's wheel copy imports resolves, and a removed name is reported);test/test_stop_hook_payload_redaction.py(new: a dashboard turn's Stop hook payload carries no credential with the switch off or on; fails without the fix);test/test_arn_redaction.py(the boundedness test drivesiter_credential_matches, the scan that runs the ARN guard for the deploy scan and the preview and ledger readers; the rule table never reads a token glued after:, so the redactor no longer reaches the guard; same assertions);test/test_file_change_snapshots_turn_budget.py(the growth unitx ?token=abecomesx h://h?token=a, since a scheme-less?token=is a known gap; same assertions, cut offsets 12 and 17 keep a cut between tags and one inside a tag);test/test_browser_change_report.py(the run-together rows skip prefixes shorter than 3 characters, aschange_report._MIN_FIXED_PREFIXdoes);test/test_refusal_gates_flagged_url.py(the pptx deck case leaves with the adopted-app files; the file-content readers' autouse fixture uses_floor_monkeypatch);test/test_redaction_audience_dashboard.py(waits withkiro_crew.testing.wait); facade manifests (refusesin the session-control, cron handler, cron script and CLI split facades;_credential_matchesin the redaction manifest; the deleted macOS directory-id seam leavestest_redaction_facade);security_posture_sinks_delivery.pyregistersdashboard/redaction_audience.pyas a sink.test/test_stream_table_parity.py: for every shared fixture and random cuts into 2 to 4 chunks at chunk sizes 1, 7 and 40, the stream's output equals batch, plus base64, url-safe, percent, kubeconfigclient-key-dataand past-4096 encoded credentials cut at 750 characters (10 fail without the fix).test/test_mediated_request_dispatch.py: a flagged query payload and a credential are refused with redaction on, off inside a seam, and inside an owner view (all three fail without the fix).test/test_blocked_links.py: an older build's placeholder row and variant round-trip through reload and save with their records, and no client receives them (fails without the fix).test/test_slack_code_channel_workspace.py: the companion pattern's README line carries notoken:label, so the house pattern is what masks it on every platform.test/test_security_bare_secrets.py: the macOS temp-dir test readsconfstritself.test/test_redaction_one_engine.py: Discord, npm, OpenAI project, PyPI and Telegram tokens and a?token=URL, base64- and percent-encoded, are masked on batch and stream and stay a fixed point.website/src/test/MarkdownRenderer.blockedLink.test.tsx: a destination written with&,&,&or\&still meets its record (fails without the fix).test/test_markdown_link_parentheses.py: the label pattern cannot backtrack.test/test_source_providers.py: the exact rendered string, not a substring check.test_claude_fast_mode_toggle.pyandtest_claude_harness_notices.py,"ghp_" + "a" * 36togithub_classic(...)(the GitHub row requires a valid CRC32 checksum, and an all-abody reads as a mask run);test_claude_raw_sdk_tasks.py,printed <40-character AWS secret>toprinted AWS_SECRET_ACCESS_KEY=<same>(a bare 40-character run with no key ID or label is no credential, by the 2026-10-20 decision);test_api_file_diff.py(lp_your_token_here) andtest_file_change_snapshots.py(lp_dummy_placeholder_value, two tests) tolp_Q7mVx9pLw2Kd8Rt4Ny6s(a value with ayour/here/placeholderpart is a placeholder,checks.is_placeholder). This round (each fake the design reads as visible, replaced with one it masks; the test's assertion and subject are unchanged):test_chat_merge_back_merge_hold.py,test_change_card_crewmate_import.py,member_goals_helpers.py(the member-goals tests),test_kas_withheld_credentials_notice.py,test_kas_local_inspect_commands.py,test_api_slash_commands.py,test_agent_panel_routes.pyandtest_autonudge_stop_file.py, hand-typedghp_strings ("ghp_" + "a" * 36,ghp_a1B2...q7R8and similar) togithub_classic(seed=401...410)(the GitHub row checks the CRC32 checksum);test_cli_agent.py,https://user:password@example.comto a 16-character generated password (passwordis a placeholder word);test_mcp_server_wait.py,?k=AKIAIOSFODNN7EXAMPLEto a generated GitHub token (a key ID alone is an identifier, and the AWS documentation example ends inEXAMPLE);test_onboarding_import_coverage.py(2),test_browser_harness_supervisor.py,test_messaging_approval.pyandtest_goal_setup.py, a bare 40-character AWS secret to the same value afteraws_secret_access_key=(no bare-entropy guess, by the 2026-10-20 decision);test/fixtures/acp_frames/kiro/notifications.*, the fake token moves under an"access_token"member ofrawOutput(tokenalone is not a listed name) and the snapshot is regenerated (the mask and the credential record stay). Tests that pinned a value the new name-shape rows mask:test_artifacts_handlers.py(secret = swordfish-actualis a two-word passphrase after a label: the test now checks that the store keeps the real bytes and the response shows the server's mask);test_agent_capabilities_http.pycase 14 tests that the MCP argument rule leaves a non-environment name alone, so it now uses the case's own short valuep7!for both arguments, andtest_redaction_structured_names.pypins that the table masks9DB_PASSWORD=ordinary. No detector was narrowed: no broken test pinned a bare name, a placeholder or prose. About 150 other test files swap fixtures that are no longer credentials for real-format ones; legacy-only tests are deleted (pass 3, the engine selector, the code-text scope, whole-URL rewriting).[REDACTED: redaction unavailable](compat._LOAD_FAILEDis sticky by design). A rerun of the shard passed in full, no test sets or patches the flag or blocks that import, and the trigger is unknown.Manual verification
Daily-use smoke at 67e9cd7, the previous head (this head changes no path it drives; the chat SSE stream now ends with one write of the same bytes): three real gateways from source on 127.0.0.1 (ports 6911 to 6923), throwaway homes, an echo agent and a fake Telegram, 72-item corpus (64 benign, 8 leak) over 23 surfaces.
enabled: true, locked_by_policy: true; PUT OFF 403credential_redaction_locked_by_policy; still ON after; PASS. Each ungoverned gateway's first boot wrote its onecredential_redaction.default_offSEL record; the governed host wrote none.M+there.Independent verifier's corpus (175 benign, 43 leaks, 7 ambiguous), rerun at 67e9cd7 next to its numbers for 13a65bf (its channel, render and live-frame paths now redact with the switch off as well, by the audience rule): benign altered with ON 1 of 175 (was 3; the one is a streaming edit on the Discord renderer, whose final text equals the input), leaks missed 0 of 43 (was 6 of 43, 8 of 49 values), over-masked 4 by its rule (2 PEM bodies masked as one tag across their lines on the transcript save, 2 log lines that carry the log floor's
Bearer [REDACTED]tag instead of the credential tag), and seam surfaces altered with OFF 0 apart from 3 log-filter lines in the harness that a direct check of the installed log filter with OFF published does not reproduce.Screenshots / video
Settings → Security → Redaction, wide and narrow:
ON, wide:
OFF, wide:
Locked by policy, wide:
ON, narrow:
OFF, narrow:
Locked, narrow:
Related Issues
Part of #22552
App repo: KiroCrewCaptain/kirocrew-app-pptx-maker#8
App repo: KiroCrewCaptain/kirocrew-app-spec-builder#10
App repo: KiroCrewCaptain/kirocrew-app-auto-research#4
App repo: KiroCrewCaptain/kirocrew-app-auto-improvement#14
Closes #31895
Refs #31690 #31692 #29423
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)