Skip to content

feat(security): one redaction switch, rule table only, value-only masks - #37408

Merged
bolichen97 merged 1 commit into
mainfrom
bolichen97/redaction-master-switch
Nov 16, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
bolichen97/redaction-master-switch

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Turning off request-blocking gates, or any refusal gate that compares redact(x) with x.
  • Changing the Layers panel wording.
  • Changing the companion URL-prefix exemption of a link's token parameter (it stays, now on the table's url.token_param.token row).

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.

Part Now
Switch One owner setting enabled (credential_redaction.json), default OFF in one constant (redaction_switch.DEFAULT_REDACTION_ENABLED), read on every redaction path (table under Sensitive change review).
Governance The existing row capabilities.credential_redaction_off, widened from the Files view to the whole setting (maintainer decision, recorded in docs/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).
Engine The rule table alone, with no regex detection (maintainer order: a rule table, never a broad regex sweep, even at the cost of missed cases). Passes 1 to 3, the five residual fixed branches, the ?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/O with three dot-separated parts of fixed lengths; npm_, pypi-, sk-proj- by prefix, length and charset), and token is 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).
New rows Labelled secrets by an explicit list of 38 well-known names, matched ignoring case and the separators _ - . (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 *-Authorization header), 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), Slack xapp-, hf_, dckr_pat_, OpenAI legacy keys.
URLs Never replaced whole: only the secret value inside a URL is masked, and redaction is a fixed point (masked text redacts to itself). A link whose query looks like it carries data out, to a host the reader has not allowed, renders as a Blocked link chip instead of a live link (a rendering decision; the text is never rewritten), matched on the destination as the renderer decodes it (&, &, \&).
Settings One toggle "Redact credentials", one info tip, locked with one line under policy, in all 12 catalogs; the engine and seams controls are gone.

Also touched, each for the change above: sel.py (every security event log row is scanned in full whatever the setting); security/deny_gate.py and dashboard/chat_turn/segment_flush.py (SEL previews scanned before their clip); dashboard/file_api/channel_upload.py and outbox.py (the upload, notify, list and non-owner download checks scan in full); dashboard/handlers/side.py and dashboard/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.py and imessage/renderer.py (no clear-text logging); docs/decisions/ and docs/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.py and context_assembly/session_start.py (no out-of-seam URL pass); credential_patterns.py (tier rows of removed rules); crewmate_bundle_export.py and decisions/gate.py (scan_exfiltration_urls decisions); cron_script.py and cron_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.py and slack/interactions_approvals.py (comments and counts of the removed URL tag); discord/renderer_text.py and telegram/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.ts and state.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/*.json and destructiveConfirm.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.ts and utils/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 of capabilities.credential_redaction_off, so retiring it never loosens a ceiling. An explicit deny is never dropped: a deny of the retired row, nested under capabilities or as one flat dotted key, denies the setting even beside a grant of capabilities.credential_redaction_off, in either order (tightest wins; the widening applies to grants only). A v0.13.0-rc.1 record's enabled is 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 RFC rfc-redaction-structured-engine-default-on.md (status now superseded). 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, outcome off_by_default) naming the decision record; a stored choice, or a governed host that reads the default as ON, writes none.

Host Stored or default OFF PUT OFF PUT ON Settings
Ungoverned (no policy scope) OFF is in force 200 200 toggle free
Governed, top tier enables the row OFF is in force 200 200 toggle free
Governed without the row, LTS build, folded or unreadable ceiling read and published as ON 403 credential_redaction_locked_by_policy + governance_decision record 200 toggle locked, one line

Every 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 old engine or seams_enabled field is a 400 that writes nothing, and a stored engine: legacy record 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:

Path Switch off Switch on
The same chat, side and thread text to a non-owner: a Shared Crew teammate, an allowlist link, a !dashboard user, an app token (websocket send, the chat SSE stream, HTTP reads behind a middleware after token auth) masked masked
Chat live stream, final reply, history (side-chat and thread reloads included), titles, previews off masked
Saved transcript off masked
Channel egress (Slack, Telegram, Discord, WhatsApp, delivery, proactive send): a channel or group with other members, inside the owner's chat turn too masked masked
App egress (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) replaced by [REDACTED: suspicious URL to <host>], counted in urls_removed the same
ACP prompt replay (the model) off masked
Log records (SecretRedactionFilter) off masked (the full plan once loaded; a Bearer/JWT/token= floor before)
Owner Files view and diff off masked
Credential values inside URLs (redact_exfiltration_urls) off masked at the value
Request-blocking gates, scan_exfiltration_urls over a command, the OAuth consent-URL gate, refusal gates comparing redact(x) with x (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, CLI always on always on

Per class, with the switch on (principle: grants access by itself, mask the value; otherwise visible):

Class Decision Why
Vendor tokens by published format (GitHub classic with checksum, fine-grained, GitLab, Slack bot/user/app, Stripe, SendGrid, Anthropic, OpenAI, Google, Vault, Shopify, DigitalOcean, npm, PyPI, Hugging Face, Docker, Telegram, Discord) masked each authenticates alone
A checksum-valid GitHub token glued to a word (xghp_..., ghp_...Z) masked (deviation, below) the checksum decides it; a split message's stripped blank must not show a key
Other near-miss strings (bad checksum, wrong length, non-checksum token glued to a letter, unknown kind) and token bodies that read as placeholders (xoxb-your-bot-token) visible not a token the vendor issued
Signed JWT/JWE (payload up to 12000 characters), Crew link tokens masked bearer credentials
Unsigned (alg: none) JWT, the jwt.io samples (current and older) and the RFC 7519 example visible nothing to verify, or published documentation
Private keys (PEM, OpenSSH, PGP) body masked; BEGIN and END lines stay secret key material
Public certificates, SSH public keys, SHA256: fingerprints visible public by design
AWS secret key (beside its key ID, after its label anywhere on a line, in a URL query or path, aws configure set), labelled session token masked signs requests
AWS access key ID, account ID, ARN, request id, x-amz-id-2/HostId, AWS documentation example keys visible identifiers (2026-10-20 decision)
Bare 40-character string with no key ID or label visible the entropy guess is removed (2026-10-20 decision)
Labelled values by name shape: a name whose words end in PASSWORD, PASSWD, PWD, PASS, SECRET, TOKEN, CREDENTIAL(S), AUTH, or the pairs API KEY, ACCESS KEY, PRIVATE KEY, CLIENT SECRET, AUTH TOKEN (TWILIO_AUTH_TOKEN, JWT_SECRET, spring.datasource.password, YAML password:), in env, ini, YAML, JSON (Secrets Manager escaped JSON included), properties and CLI flags; mysql -p<pw>, docker login -p, .netrc passwords masked (value only) a written credential; placeholders (${X}, $VAR, <x>, your-..., changeme, example, runs of x or *), 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 password
Authorization: Bearer/Basic (also after punctuation, a no-break space, or a Proxy-/X- prefix), x-api-key and similar headers, session cookies, curl -u user:pass masked (value only) bearer credentials
CSRF cookies visible grants nothing without the session cookie
URL userinfo password masked (password only) scheme, user, host and path stay
URL params client_secret, access_token, refresh_token, id_token, code_verifier, password, passwd, api_key, apikey, private_token, token masked (value only) each grants access
Signature params sig (Azure SAS), Signature (CloudFront), X-Amz-Signature, X-Amz-Security-Token, X-Goog-Signature masked (value only) a signed link is a bearer link keyed on its signature; X-Amz-Credential, X-Amz-Date, X-Amz-Expires, se, sp stay
OAuth code visible single use, minutes long, and redeeming it needs the client secret or the PKCE verifier; masking it would break every pasted callback link
OAuth state, client_id, scope, redirect_uri, code_challenge, nonce, response_type visible public parameters
Slack and Discord webhook URLs secret path segment masked posting rights; host and IDs stay
Base64 run (two levels) or percent-encoded run whose decoded text holds any masked class masked ([REDACTED: encoded credential]) an encoded credential
UUIDs, git SHAs, commit permalinks, docker digests, lockfile hashes, image data URIs, temp paths, prose, code visible not credentials

Deviation from the false-positive list: github.glued and github.too_long are 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: drop glued in redaction_structured/tokens.py (two lines).

Exfiltration protection, exactly what remains:

  • Remains, text (switch on): every credential the table reads is masked at the value inside a URL (path segment, query, fragment, userinfo), including a base64 or percent-encoded value that decodes to one.
  • Remains, rendering (switch-independent): security/blocked_links.py flags 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).
  • Remains, refusals (switch-independent): every refusal gate that used to compare a redactor's output with its input now decides on security.exfil.refuses(text, redactor): the redactor run in full under always_scan, or a URL scan_exfiltration_urls flags, as on main (list below).
  • Remains, decisions (switch-independent): scan_exfiltration_urls over a command, the OAuth consent-URL gate oauth_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.
  • Remains, while streaming: the stream never masks less than batch for the same text: an open base64 or percent run whose head decodes as text is held until it ends, and past 4096 characters it is withheld with the batch tag ([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.
  • Blocked as on main: Google, Microsoft, Cognito and Slack OAuth sign-in links and a CloudWatch Logs Insights link carry long queries (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.
  • Remains, safety scans (switch-independent): the file-content and upload-filename checks (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 under redaction_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.
  • Remains, audit (switch-independent): every security event log row is redacted in full inside a seam too (sel._redact_text under always_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.
  • Older transcripts: a row an older build wrote keeps its [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.
  • Remains, app egress: ctx.scrub.outbound replaces each link the dashboard would block (same decision, same allowed hosts) with [REDACTED: suspicious URL to <host>] and counts it in urls_removed, since an app's page draws no chip; every other URL there is masked at the value.
  • Dropped: the [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: token alone 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 base64 ghp_ string that fail GitHub's checksum (4: github_classic_ghp, github_oauth_gho, b64_github_token, github_token_mid), not tokens GitHub issued; an sk- 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.glued and github.too_long (the deviation above), url.oauth.other_params_stay (its token= value is read by the table's token parameter row) and url.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 (&#38;access_token=, %3D; a separator written &amp;, 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.py reads 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: each backend/_host.py also 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 generic key=<40 characters> (no label the table reads); a non-checksum token glued to a letter (for example deck-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_scan and _changed_path (MCP tool arguments), dashboard/agent_admin/roster._roster_mask, chat_turn/elicitation_prompt._value_tainted, file_api/channel_upload text gate, file_api/outbox notify, 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_unsafe and 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_redaction and _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_flagged and binary_content_is_flagged, security/credential_sources._is_clean, slack/code_channels/tools._set_view and _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 compare redact(x) with x, so they refuse a credential but not a flagged URL until their app PRs, which add the exfil scan to each _host.py refusal, 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_lifecycle key check, git_panel.api_project_git_repos, session_files, hooks_webhooks); records, fingerprints, equality, logs and SEL (tool_result_events, client_tool_events fingerprints, _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_events input views, card_lifecycle readings, code_channels/tools._audit_view, turn_reply_seams, chat_utils_display, git_panel._redact_status_path, handlers/core._send, memory and memory_edit, source_providers/adf and review, 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 grants capabilities.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-redaction accepts only {"enabled": bool} (an engine or seams_enabled body is a 400); the engine and seams fields leave the GET answer and the push frame; capabilities.credential_redaction_off now 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.json were fetched at their pinned commits, and every kiro_crew name their code imports resolves against this core (static check); test/test_adopted_apps_core_imports.py holds 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 removed security.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 enabled and locked_by_policy only (SecurityPanel.credentialRedaction.test.tsx)
Reader: website/src/hooks/useWebSocket.ts:credential_redaction_settings_changed -- crew page -- the frame is gone; credential_redaction_changed still 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_parts per platform, redact_for_display and repeated transcript saves; underscores survive egress; webhook, inline-code, scan-count and holdback regressions.
  • test/test_redaction_structured_names.py (new) and test/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 (OAuth code stays).
  • 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 stored engine: legacy record 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; TestEveryOutputSiteIsListed holds redaction_seams.SEAM_SITES and ALWAYS_REDACTED_SITES to 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.tsx and the restored MarkdownRenderer.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.py and test/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).
  • This round: 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 under always_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.py and test/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.py and test_kiro_prerequisite_agent_specs.py (ghp_ with a bad checksum, and svc?token=AKIAIOSFODNN7EXAMPLE) to github_classic(seed=411, 412); test_channel_upload_field_types.py and test_slack_upload_binary.py now expect a channel caption masked with the switch off.
  • At this head: 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 (a token, access_token or sig value after a &amp; 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 drives iter_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 unit x ?token=a becomes x 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, as change_report._MIN_FIXED_PREFIX does); 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 with kiro_crew.testing.wait); facade manifests (refuses in the session-control, cron handler, cron script and CLI split facades; _credential_matches in the redaction manifest; the deleted macOS directory-id seam leaves test_redaction_facade); security_posture_sinks_delivery.py registers dashboard/redaction_audience.py as 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, kubeconfig client-key-data and 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 no token: label, so the house pattern is what masks it on every platform. test/test_security_bare_secrets.py: the macOS temp-dir test reads confstr itself.
  • 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 &amp;, &#38;, &#x26; 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.
  • Fixture changes others should know about (old value, new value, rule): test_claude_fast_mode_toggle.py and test_claude_harness_notices.py, "ghp_" + "a" * 36 to github_classic(...) (the GitHub row requires a valid CRC32 checksum, and an all-a body reads as a mask run); test_claude_raw_sdk_tasks.py, printed <40-character AWS secret> to printed 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) and test_file_change_snapshots.py (lp_dummy_placeholder_value, two tests) to lp_Q7mVx9pLw2Kd8Rt4Ny6s (a value with a your/here/placeholder part 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.py and test_autonudge_stop_file.py, hand-typed ghp_ strings ("ghp_" + "a" * 36, ghp_a1B2...q7R8 and similar) to github_classic(seed=401...410) (the GitHub row checks the CRC32 checksum); test_cli_agent.py, https://user:password@example.com to a 16-character generated password (password is a placeholder word); test_mcp_server_wait.py, ?k=AKIAIOSFODNN7EXAMPLE to a generated GitHub token (a key ID alone is an identifier, and the AWS documentation example ends in EXAMPLE); test_onboarding_import_coverage.py (2), test_browser_harness_supervisor.py, test_messaging_approval.py and test_goal_setup.py, a bare 40-character AWS secret to the same value after aws_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 of rawOutput (token alone 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-actual is 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.py case 14 tests that the MCP argument rule leaves a non-environment name alone, so it now uses the case's own short value p7! for both arguments, and test_redaction_structured_names.py pins that the table masks 9DB_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).
  • Local at this head (rebased on main cb2f78b): isort, flake8, mypy (4732 files), the black ratchet, every Source Gates script, the docs lint, the security line budget (row -1485), the generators (no change), Semgrep's repo rules on the diff (the five registry packs were clean at 78ecf99), the flake-pattern ratchet, the Static Ratchet Gate set, PR Hygiene's adopted-app check, and the touched-area suites (4086 tests: app egress, blocked links, allowed hosts, the seams, the audience, facades, composition contracts, import budgets, adopted apps). The full backend (48 shards) and frontend (16 shards) suites passed at 78ecf99 except for host-bound tests that fail on main too, and rerun on this head. Full suites at 0712bc4: backend about 282,200 passed, frontend about 71,100 passed; the only failures were host-bound tests that fail on main too or pass alone, and one known test flake: in one xdist worker of backend shard 13 the rule-table detectors failed to import once, so that worker's later redaction tests read the fail-closed [REDACTED: redaction unavailable] (compat._LOAD_FAILED is 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.

  • (a) benign content altered with the switch ON: 0 of 64.
  • (b) fake secrets with the switch ON: masked value-only on every chat, channel, transcript, Files and replay surface; on the gateway log a private key logged one line per record keeps its body lines (known gap) and two items fall past the log's 200-byte cut; dashboard-typed user rows are not redacted by design.
  • (c) anything altered with the switch OFF: 0 of 64 benign items; the 8 leaks are masked on Telegram and channel egress, which stay redacted because a channel is not the owner's alone, and are delivered as written to the owner's own dashboard, transcript, Files view, ACP replay and log surfaces.
  • (d) governed host: GET enabled: true, locked_by_policy: true; PUT OFF 403 credential_redaction_locked_by_policy; still ON after; PASS. Each ungoverned gateway's first boot wrote its one credential_redaction.default_off SEL record; the governed host wrote none.
  • (e) latency (switch ON): 25.1 ms per 100 KB batch (p50), 490 us per 40-character streamed chunk (p50; p95 712 us); channel display 251 ms per 100 KB (p50, p99 276 ms; it was 465 / 776 ms at 13a65bf); raw stream holdback on benign text p50 14, p90 308, p99 512 characters (13a65bf: p99 2110); OFF costs nothing measurable. On Telegram the harness diffs ON against the OFF delivery, which is now redacted too, so its ON cells read M+ there.
  • (f) screenshots below.

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: Redaction section, switch on

OFF, wide: Redaction section, switch off

Locked by policy, wide: Redaction section, locked by policy

ON, narrow: Redaction section, switch on, narrow

OFF, narrow: Redaction section, switch off, narrow

Locked, narrow: Redaction section, 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

  • 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

@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 069a1eb
  • What rule changed: credential redaction is now ONE owner setting (enabled in credential_redaction.json), default OFF in the constant DEFAULT_REDACTION_ENABLED, read by the chat, transcript, channel, ACP prompt, log and Files view paths and the credential rules of the exfil-URL pass.
  • Before -> after (what was allowed/blocked, now): before, those paths always redacted and only the Files view could be switched off; now they do not redact unless the owner turns redaction on, while blocking gates, refusal gates and the exfil-URL shape rules still apply.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): credentials show up in chat, channels, prompts and logs while the owner believes redaction is on; a path that opened a seam wrongly could also relax a refusal gate.
  • Evidence checked (which sandbox result proves it): a real gateway run from source on loopback with fake credentials shows each path visible with the setting off and hidden with it on; unit tests pin the gates, the shape rules and a governed host staying ON.
  • No regression:
    • Tools still work (which tools/commands were run, result): the gateway booted and served chat, file read, logs and replay in the smoke run; pytest over redaction, display, persistence, posture and exfil suites passed.
    • Backward compatible (old config / old data / old callers still work, how checked): old records read the same, seams_enabled is ignored, and the engine PUT still works; checked by tests for a record without the field and a legacy field beside enabled.
    • Existing tests (which suites passed on this head): redaction, credential_redaction_switch, engine selector, security posture, gate liveness, display and persistence suites, plus vitest settings, hooks and i18n.
  • How to undo: turn the toggle on, or set DEFAULT_REDACTION_ENABLED to True, or revert this commit.

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/apps/scrub_sdk.py

  • src/kiro_crew/dashboard/handlers/credential_redaction.py

  • src/kiro_crew/log_redaction.py

  • src/kiro_crew/sandbox_precreate.py

  • src/kiro_crew/security/__init__.py

  • src/kiro_crew/security/_exports.py

  • src/kiro_crew/security/blocked_links.py

  • src/kiro_crew/security/credential_sources.py

  • src/kiro_crew/security/deny_gate.py

  • src/kiro_crew/security/exfil.py

  • src/kiro_crew/security/exfil_oauth.py

  • src/kiro_crew/security/exfil_scan_span.py

  • src/kiro_crew/security/mcp_body_fields.py

  • src/kiro_crew/security/pass_compose.py

  • src/kiro_crew/security/redaction.py

  • src/kiro_crew/security/redaction_allow.py

  • src/kiro_crew/security/redaction_entropy.py

  • src/kiro_crew/security/redaction_structured/__init__.py

  • src/kiro_crew/security/redaction_structured/armour.py

  • src/kiro_crew/security/redaction_structured/charsets.py

  • src/kiro_crew/security/redaction_structured/checks.py

  • src/kiro_crew/security/redaction_structured/compat.py

  • src/kiro_crew/security/redaction_structured/encoded.py

  • src/kiro_crew/security/redaction_structured/engine.py

  • src/kiro_crew/security/redaction_structured/headers.py

  • src/kiro_crew/security/redaction_structured/identifiers.py

  • src/kiro_crew/security/redaction_structured/known_key.py

  • src/kiro_crew/security/redaction_structured/model.py

  • src/kiro_crew/security/redaction_structured/protection.py

  • src/kiro_crew/security/redaction_structured/stream.py

  • src/kiro_crew/security/redaction_structured/table.py

  • src/kiro_crew/security/redaction_structured/tokens.py

  • src/kiro_crew/security/redaction_switch.py

  • src/kiro_crew/security/stream_aws_anchor.py

  • src/kiro_crew/security/text_redaction.py

  • src/kiro_crew/security_posture.py

  • src/kiro_crew/security_posture_controls.py

  • src/kiro_crew/security_posture_sinks_delivery.py

  • src/kiro_crew/security_posture_sinks_gateway.py

  • @bolichen97 posted a complete reasoning template for f0d49b7.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ human override accepted

@bolichen97 overrode this lane for f0d49b7f8fffd118977d11237a35b322bfc93470 via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ human override accepted

@bolichen97 overrode this lane for f0d49b7f8fffd118977d11237a35b322bfc93470 via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ human override accepted

@bolichen97 overrode this lane for f0d49b7f8fffd118977d11237a35b322bfc93470 via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- ✅ human override accepted

@bolichen97 overrode this lane for f0d49b7f8fffd118977d11237a35b322bfc93470 via /ai-review override (this commit only).

[SCOPE-REVIEWED] f0d49b7

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ human override accepted

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

Human judgment by @bolichen97 overrides the Opus 5.5 finding for f0d49b7f8fffd118977d11237a35b322bfc93470; the recorded reason is authoritative for this commit.

[OPUS-OVERRIDE] f0d49b7

Verdict recorded from an authorized human decision for commit f0d49b7f8fffd118977d11237a35b322bfc93470.

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

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ human override accepted

Human judgment by @bolichen97 overrides the GPT 6.1 finding for f0d49b7f8fffd118977d11237a35b322bfc93470; the recorded reason is authoritative for this commit.

[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:
/ai-review override gpt f0d49b7f8fffd118977d11237a35b322bfc93470 false-positive: <reason, 20 to 500 characters>

@KiroCrewCaptain

KiroCrewCaptain commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: 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):

  • The PR says the upload-filename checks run under always_scan(), so a channel post with redaction off still refuses a file that carries a credential. That holds for the shared outbound_files.upload_filename (Discord, Telegram) but not for Slack's own copy, which runs inside the Slack turn's channel s (src/⁠kiro_crew/slack/files.py, medium)

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 afedc5f818 · 37929 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@bolichen97
bolichen97 force-pushed the bolichen97/redaction-master-switch branch from 069a1eb to 0268909 Compare November 14, 2026 23:46
@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 069a1eb
  • What rule changed: credential redaction is now ONE owner setting (enabled in credential_redaction.json), default OFF in the constant DEFAULT_REDACTION_ENABLED, read by the chat, transcript, channel, ACP prompt, log and Files view paths and the credential rules of the exfil-URL pass.
  • Before -> after (what was allowed/blocked, now): before, those paths always redacted and only the Files view could be switched off; now they do not redact unless the owner turns redaction on, while blocking gates, refusal gates and the exfil-URL shape rules still apply.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): credentials show up in chat, channels, prompts and logs while the owner believes redaction is on; a path that opened a seam wrongly could also relax a refusal gate.
  • Evidence checked (which sandbox result proves it): a real gateway run from source on loopback with fake credentials shows each path visible with the setting off and hidden with it on; unit tests pin the gates, the shape rules and a governed host staying ON.
  • No regression:
    • Tools still work (which tools/commands were run, result): the gateway booted and served chat, file read, logs and replay in the smoke run; pytest over redaction, display, persistence, posture and exfil suites passed.
    • Backward compatible (old config / old data / old callers still work, how checked): old records read the same, seams_enabled is ignored, and the engine PUT still works; checked by tests for a record without the field and a legacy field beside enabled.
    • Existing tests (which suites passed on this head): redaction, credential_redaction_switch, engine selector, security posture, gate liveness, display and persistence suites, plus vitest settings, hooks and i18n.
  • How to undo: turn the toggle on, or set DEFAULT_REDACTION_ENABLED to True, or revert this commit.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Dispositions for the review round on 069a1eb (fixes are in 0268909):

  • fixed, GPT F2: the stream no longer returns text before the exfil shape rules; the StreamRedactor shortcut is removed, so cross-chunk buffering and the URL shape rules still run.
  • fixed, GPT F3: in_bypassed_seam() now also requires the published verdict to be off, so a turn opened while off redacts the moment it is published on (test_a_seam_opened_while_off_redacts_after_the_setting_turns_on).
  • fixed, GPT F4: the display caches fold the published position into engine_mark() and engine_generation(); the transcript caches already keyed on it.
  • fixed, GPT F5: the elicitation taint check and redact_log_via_context run inside always_scan().
  • fixed, Opus serverState: a reconnecting document that finds redaction ON purges file bodies even when never flipped, because the default is now OFF.
  • fixed, CI: exfil.py was over the 2,000-line cap, so _credential_clean moved to exfil_credential_clean.py; the test file no longer carries a flagged word in its name.
  • rebutted, GPT F1 and Opus blocks 1: redaction on channel egress, the chat stream and logs is exactly what the maintainer ordered ("redaction OFF by default, one master switch", with chat, channel egress and logs named in Add one owner setting that turns credential redaction off on every path #31895). It is not an owner-view bypass: refusal gates, blocking gates and the exfil shape rules stay on, and a governed host stays ON. The default is one constant, DEFAULT_REDACTION_ENABLED.
  • needs-a-decision (maintainer): (a) First Principles wants an accepted RFC for default-off plus the one switch over every path; (b) Opus notes docs/decisions/2026-10-20-redaction-classifies-by-what-a-value-can-do.md records "Secret ... Always redact the value" and wants a superseding decision entry. Both are the maintainer's to write or to clear with an override; I have not written either.
  • not taken, UX notes: the sentence stays an info tip like the Browser settings, and the allowed-hosts paragraph keeps its wording (out of the goal).

@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 0268909
  • What rule changed: credential redaction is now ONE owner setting (enabled in credential_redaction.json), default OFF in the constant DEFAULT_REDACTION_ENABLED, read by the chat, transcript, channel, ACP prompt, log and Files view paths and the credential rules of the exfil-URL pass.
  • Before -> after (what was allowed/blocked, now): before, those paths always redacted and only the Files view could be switched off; now they do not redact unless the owner turns redaction on, while blocking gates, refusal gates and the exfil-URL shape rules still apply.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): credentials show up in chat, channels, prompts and logs while the owner believes redaction is on; a path that opened a seam wrongly could also relax a refusal gate.
  • Evidence checked (which sandbox result proves it): a real gateway run from source on loopback with fake credentials shows each path visible with the setting off and hidden with it on; unit tests pin the gates, the shape rules and a governed host staying ON.
  • No regression:
    • Tools still work (which tools/commands were run, result): the gateway booted and served chat, file read, logs and replay in the smoke run; pytest over redaction, display, persistence, posture and exfil suites passed.
    • Backward compatible (old config / old data / old callers still work, how checked): old records read the same, seams_enabled is ignored, and the engine PUT still works; checked by tests for a record without the field and a legacy field beside enabled.
    • Existing tests (which suites passed on this head): redaction, credential_redaction_switch, engine selector, security posture, gate liveness, display and persistence suites, plus vitest settings, hooks and i18n.
  • How to undo: turn the toggle on, or set DEFAULT_REDACTION_ENABLED to True, or revert this commit.

@bolichen97
bolichen97 enabled auto-merge (squash) November 14, 2026 23:50
@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 152417c
  • What rule changed: credential redaction is now ONE owner setting (enabled in credential_redaction.json), default OFF in the constant DEFAULT_REDACTION_ENABLED, read by the chat, transcript, channel, ACP prompt, log and Files view paths and the credential rules of the exfil-URL pass.
  • Before -> after (what was allowed/blocked, now): before, those paths always redacted and only the Files view could be switched off; now they do not redact unless the owner turns redaction on, while blocking gates, refusal gates and the exfil-URL shape rules still apply.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): credentials show up in chat, channels, prompts and logs while the owner believes redaction is on; a path that opened a seam wrongly could also relax a refusal gate.
  • Evidence checked (which sandbox result proves it): a real gateway run from source on loopback with fake credentials shows each path visible with the setting off and hidden with it on; unit tests pin the gates, the shape rules and a governed host staying ON.
  • No regression:
    • Tools still work (which tools/commands were run, result): the gateway booted and served chat, file read, logs and replay in the smoke run; pytest over redaction, display, persistence, posture and exfil suites passed.
    • Backward compatible (old config / old data / old callers still work, how checked): old records read the same, seams_enabled is ignored, and the engine PUT still works; checked by tests for a record without the field and a legacy field beside enabled.
    • Existing tests (which suites passed on this head): redaction, credential_redaction_switch, engine selector, security posture, gate liveness, display and persistence suites, plus vitest settings, hooks and i18n.
  • How to undo: turn the toggle on, or set DEFAULT_REDACTION_ENABLED to True, or revert this commit.

@bolichen97
bolichen97 force-pushed the bolichen97/redaction-master-switch branch from 0268909 to 152417c Compare November 15, 2026 00:02
@bolichen97

Copy link
Copy Markdown
Contributor Author

Dispositions for the round on 0268909 (fixes are in 152417c):

  • fixed, GPT (cache race, two keys): both transcript cache builds now refuse to store when the published setting changed during the build (test_a_transcript_build_that_spans_a_change_is_not_cached).
  • fixed, GPT (stream discard with redaction off): StreamRedactor has a bypassed path that holds and discards nothing credential-shaped, still judges each address whole (the run after the last blank stays buffered) through the stream's own redactor, so the URL shape rules apply (TestBypassedStream).
  • rebutted, GPT/Opus default-on and channel egress: unchanged from the previous round, this is the maintainer's order and the table in the description is the disclosure.
  • rebutted, GPT (a running turn that opened ON ignores an ON-to-OFF change): the turn keeps redacting until its next turn. That is the safe direction and applies the change at the next turn boundary; I did not widen the scope to mid-turn changes.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 15, 2026
@bolichen97
bolichen97 force-pushed the bolichen97/redaction-master-switch branch from 152417c to 1dac9df Compare November 15, 2026 00:13
@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 1dac9df
  • What rule changed: credential redaction is now ONE owner setting (enabled in credential_redaction.json), default OFF in the constant DEFAULT_REDACTION_ENABLED, read by the chat, transcript, channel, ACP prompt, log and Files view paths and the credential rules of the exfil-URL pass.
  • Before -> after (what was allowed/blocked, now): before, those paths always redacted and only the Files view could be switched off; now they do not redact unless the owner turns redaction on, while blocking gates, refusal gates and the exfil-URL shape rules still apply.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): credentials show up in chat, channels, prompts and logs while the owner believes redaction is on; a path that opened a seam wrongly could also relax a refusal gate.
  • Evidence checked (which sandbox result proves it): a real gateway run from source on loopback with fake credentials shows each path visible with the setting off and hidden with it on; unit tests pin the gates, the shape rules and a governed host staying ON.
  • No regression:
    • Tools still work (which tools/commands were run, result): the gateway booted and served chat, file read, logs and replay in the smoke run; pytest over redaction, display, persistence, posture and exfil suites passed.
    • Backward compatible (old config / old data / old callers still work, how checked): old records read the same, seams_enabled is ignored, and the engine PUT still works; checked by tests for a record without the field and a legacy field beside enabled.
    • Existing tests (which suites passed on this head): redaction, credential_redaction_switch, engine selector, security posture, gate liveness, display and persistence suites, plus vitest settings, hooks and i18n.
  • How to undo: turn the toggle on, or set DEFAULT_REDACTION_ENABLED to True, or revert this commit.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Dispositions for the UX BLOCK and the new Opus items on 152417c (fixes are in 1dac9df):

  • fixed, UX: the sentence is now visible under the label and names messaging channels and the agent's prompt ("Hides keys, tokens and passwords in chat, messaging channels, the agent's prompt, files and logs."), in all 12 catalogs; screenshots refreshed.
  • rebutted, Opus (exfil credential rules stand down): the maintainer listed the exfil-URL pass among the paths the switch governs; the shape rules stay on and the table says which URL cases that leaves.
  • rebutted, Opus (old enabled: false record widens, and the two capability rows cover more than before): disclosed under Backwards compatibility; a governed host needs both rows, which is stricter than either row was alone.

@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 merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 15, 2026
@bolichen97
bolichen97 force-pushed the bolichen97/redaction-master-switch branch from 1dac9df to fdd9ebe Compare November 15, 2026 00:30
@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: fdd9ebe
  • What rule changed: credential redaction is now ONE owner setting (enabled in credential_redaction.json), default OFF in the constant DEFAULT_REDACTION_ENABLED, read by the chat, transcript, channel, ACP prompt, log and Files view paths and the credential rules of the exfil-URL pass.
  • Before -> after (what was allowed/blocked, now): before, those paths always redacted and only the Files view could be switched off; now they do not redact unless the owner turns redaction on, while blocking gates, refusal gates and the exfil-URL shape rules still apply.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): credentials show up in chat, channels, prompts and logs while the owner believes redaction is on; a path that opened a seam wrongly could also relax a refusal gate.
  • Evidence checked (which sandbox result proves it): a real gateway run from source on loopback with fake credentials shows each path visible with the setting off and hidden with it on; unit tests pin the gates, the shape rules and a governed host staying ON.
  • No regression:
    • Tools still work (which tools/commands were run, result): the gateway booted and served chat, file read, logs and replay in the smoke run; pytest over redaction, display, persistence, posture and exfil suites passed.
    • Backward compatible (old config / old data / old callers still work, how checked): old records read the same, seams_enabled is ignored, and the engine PUT still works; checked by tests for a record without the field and a legacy field beside enabled.
    • Existing tests (which suites passed on this head): redaction, credential_redaction_switch, engine selector, security posture, gate liveness, display and persistence suites, plus vitest settings, hooks and i18n.
  • How to undo: turn the toggle on, or set DEFAULT_REDACTION_ENABLED to True, or revert this commit.

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.

Add one owner setting that turns credential redaction off on every path

4 participants