Skip to content

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

Merged
bolichen97 merged 1 commit into
release/0.13.0from
crew/rc3-37408
Nov 16, 2026
Merged

bolichen97 merged 1 commit into
release/0.13.0from
crew/rc3-37408

Conversation

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Problem / Motivation

Goal: v0.13.0-rc.3 ships the single credential-redaction switch from #37408, so 0.13 users get the value-only rule table and the default-off owner setting.

#37408 merged to main as 028c39db49 after release/0.13.0 was cut, so the 0.13 line still runs the old regex and URL passes that rewrite certificates, public keys and whole links.

Why it matters

The release owner chose to take #37408 into 0.13 before rc.3 is tagged. Without this pick, 0.13 stable ships the behaviour #37408 removes on main, and the two lines disagree on the redaction setting's API and defaults.

Not a goal

What changed (motivation → approach → change)

Backport to release/0.13.0 for v0.13.0-rc.3. One commit: git cherry-pick -x 028c39db49 (main's squash of #37408) onto 061d2ffa31. Conflicts and how each was resolved:

The TestSshFloorNestingDepth::test_the_gate_refuses_a_nest_past_the_bound_without_an_exception failure on #37408's PR runs was not caused by #37408. #37875 (the 32-substitution cap, main only) made that 128-level case hit the cap first; #37964 updated the test on main before #37408 merged. Neither #37875 nor #37964 is on release/0.13.0, so the branch's test still expects sandbox-escape-ssh-self and passes with this pick.

The original description of #37408 follows, unchanged.

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

Backports #37408 to release/0.13.0 (v0.13.0-rc.3). Part of #22552. Refs #31895 #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

Admin merge authorized by bolichen (watch holder), 2026-11-16

…ks (#37408)

One owner setting turns credential redaction on or off on every path
(chat, transcripts, the live stream, channel egress, the ACP prompt
replay, logs, the Files view and the URL pass). It is OFF by default,
written in one constant (redaction_switch.DEFAULT_REDACTION_ENABLED),
and governed by capabilities.credential_redaction_off, whose meaning
widens from the Files view to the whole setting. The seams row is
retired: its grant grants nothing, and its deny, nested or flat, still
denies the setting beside a grant. The decision is recorded in
docs/decisions/2026-11-15-credential-redaction-off-by-default.md, and a
boot that reads OFF from the default writes one SEL record. The owner's
OFF applies only to what the owner alone sees (redaction_seams.
owner_alone): channel posts, non-owner sockets, SSE readers and HTTP
requests, and Stop hook payloads stay redacted whatever the setting.

The rule table is the only engine, with no regex detection. Passes 1
to 3, the residual fixed branches, the token-parameter pass, the engine
selector, compat.use_rule_table(), the code-text scope and the
whole-URL rewrite are removed; a URL keeps its shape and only the
secret value inside it is masked. Rows read vendor formats by prefix,
length, charset and checksum (Telegram, Discord, npm, PyPI and OpenAI
project tokens among them), an explicit list of well-known credential
names, Basic and Bearer headers, API-key headers, session cookies,
curl -u, URL userinfo, the token URL parameter, signature params,
webhook secrets and base64 or percent-encoded credentials. A name or
format the table does not list is a known gap. The blocked-link card and
per-workspace allowed hosts stay, as a rendering decision over the
unaltered text, matched on the destination the renderer decodes.
Every refusal gate decides on security.exfil.refuses: a credential read
in full whatever the setting, or a URL the exfil scan flags. Safety
decisions, the upload and outbox checks and every security event log
row scan in full whatever the setting. The stream never masks less than
batch: an open encoded run that reads as text is held until it ends.
An older build's suspicious-URL records round-trip unchanged and are
never sent. Settings shows one toggle, locked under policy.

Part of #22552
Closes #31895
Refs #31690 #31692 #29423

(cherry picked from commit 028c39d)
@KiroCrewCaptain
KiroCrewCaptain requested a review from a team as a code owner November 16, 2026 16:52
@KiroCrewCaptain
KiroCrewCaptain requested review from bolichen97 and removed request for a team November 16, 2026 16:52
@github-actions

github-actions Bot commented Nov 16, 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

  • @KiroCrewCaptain posted a complete reasoning template for 4e8c8ed.

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🔴 BLOCK

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

First-Principles-Verdict: BLOCK

product-shape change without accepted RFC: on 0.13, credential redaction goes from on by default to off by default for every user, and now covers every redaction path. The base commit has no non-draft RFC and no override recording that.

What this change ships

Inventory (10 items) — 7 justified

Intent: ship #37408's single redaction switch and rule-table-only engine on the 0.13 line before rc.3. This is an ADDITION (a backport).

  1. Credential redaction is now OFF by default (base: "default ON") — unjustified: product shape, no recorded decision
  2. The owner's switch now governs chat, the model, logs and the owner's DM, not just the Files view — unjustified: product shape, no recorded decision
  3. The engine selector and the "AI model and server logs" card are removed; a single "Redact credentials" toggle replaces them — unjustified: removes capability, no recorded decision
  4. The regex and URL passes are gone; the rule table is the only engine — justified
  5. 38 labelled-secret names and new token-format rows are added — justified
  6. URLs are never replaced whole; links that look like exfiltration render as a Blocked link chip — justified
  7. The credential_redaction_seams_off scope is retired, and its deny is still honoured — justified
  8. A boot SEL record is written when OFF comes only from the default — justified
  9. SEL and admission gates scan in full whatever the switch says — justified
  10. The import-budget test ceilings rise by 1 per server — justified

Blockers

  • product-shape change without accepted RFC: redaction off by default and widened to every path — unjustified
    Trigger: the diff adds DEFAULT_REDACTION_ENABLED = False and deletes the base spec's "keystone credential_redaction.json, default ON". The only covering RFC on the base list, rfc-redaction-structured-engine-default-on.md, is draft. docs/decisions/2026-11-15-credential-redaction-off-by-default.md is added by this diff, so the base does not carry it.
    Outcome: every 0.13 user loses default credential masking in chat, model context and logs, and no decision recorded on release/0.13.0 says so.
    Clears when: an RFC covering the default-off, all-paths redaction switch is merged non-draft on the base, followed by a push or rebase, or a maintainer posts /ai-review override first-principles 4e8c8ed8de2a8f3e10d308d67a0c4384015a8d1c product-shape: <decision>.

[FIRST-PRINCIPLES-REVIEWED] 4e8c8ed

Description read

[DESCRIPTION-READ] f36611f2de034c3f0aa3bafebe92f8c549f20bf6310e6470d7efcb193a3c9253

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

@github-actions

Copy link
Copy Markdown
Contributor

Security Scope Review -- 🔴 could not complete (fails closed)

No scope verdict for 4e8c8ed8de2a8f3e10d308d67a0c4384015a8d1c (the candidate stage failed). This lane fails CLOSED: an unmeasured tightening must not read as "nothing newly refused". See the job logs, then re-run -- or record /ai-review override scope 4e8c8ed8de2a8f3e10d308d67a0c4384015a8d1c <class>: <reason> if a human has judged the scope by hand.

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — 🔴 changes requested (blocking)

GPT 6.1 found at least one blocking issue that must be resolved before merging 4e8c8ed8de2a8f3e10d308d67a0c4384015a8d1c. 3 of 3 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands.

This comment is updated in place on each push.

BLOCKING -- src/kiro_crew/security/redaction_structured/identifiers.py:211 -- HTML-encoded token parameters escape redaction

key = pos + 4 if text[pos - 1] == "&" and text.startswith("amp;", pos) else pos
Trigger: An assistant Markdown link containing ?x=1&#38;token=<value>, ?to&#107;en=<value>, or ?token&#61;<value> reaches redact_credentials and the dashboard display battery; both leave a 24-character bearer value unchanged.
Outcome: The blocked-link scan also returns no record. Markdown decodes the references into a live token-bearing link, exposing the credential to non-owner readers despite mandatory redaction.
Anchor: backend-security-controls
Fix: Identify credential parameters in the renderer-decoded destination, preserving source offsets so only their values are masked.

BLOCKING -- src/kiro_crew/security/redaction_structured/headers.py:108 -- Unfinished header values bypass the streaming buffer bound

if i == n and not final: raise _Open
Trigger: A non-owner socket receives X-Api-Key: or Cookie: session= followed by delimiter-free chunks. _streamed_frame feeds them to StreamRedactor; the header reader remains undecided, preventing the holdback floor from releasing the buffer.
Outcome: Twelve 1-KiB chunks retain over 12 KiB and emit no content. Further chunks continue growing and rescanning the retained prefix, so the socket’s stream-count cap does not bound memory or scanning work.
Anchor: a-bound-bounds-every-field-it-retains
Fix: Bound unfinished values; after the bound, emit a mask and discard continuation until the corresponding value delimiter.

BLOCKING -- docs/decisions/2026-11-15-credential-redaction-off-by-default.md:5 -- Superseding the recorded decision requires a maintainer review override

Supersedes: 2026-10-20-redaction-classifies-by-what-a-value-can-do.md
Trigger: On an ungoverned home without a stored choice, _read_stored selects the new OFF default; gateway publication makes owner output seams bypass credential redaction.
Outcome: Owner surfaces receive credentials unmasked, reversing the recorded “Always redact the value” behavior. The base rule explicitly flags superseding entries until a maintainer overrides the review finding, even when the entry cites maintainer evidence.
Anchor: recorded-decisions-are-not-regressions
Fix: Obtain the explicit maintainer review override covering this supersession and its accompanying behavior change.

[BLOCK-MERGE] 4e8c8ed
[GPT-REVIEWED] 4e8c8ed

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1: the separator check at identifiers.py:211 only recognises &amp;. A numeric entity like &#38;, or an entity inside the key or =, gets past it, and markdown turns these back into a live link. A model can produce this with no special input, for example under prompt injection, so it is not an extreme combination.
F2: headers.py:108 raises _Open for any unfinished value, and the _Open handler at headers.py:364 records it in opens. In stream.py, _commit caps the output cut at open_from, and that cap has no size bound. The only release is flush. A long base64 run after Cookie: session= is ordinary model output, so a FLAG rationale does not hold.
F3: the decision entry at 2026-11-15-credential-redaction-off-by-default.md:5 really does supersede an earlier one and makes OFF the default. The base rule needs a maintainer override for that, and adjudication cannot supply one.

[ADJUDICATION] 4e8c8ed8de2a8f3e10d308d67a0c4384015a8d1c total=0 uphold=0 downgrade=0
[GPT-ADJUDICATED] 4e8c8ed8de2a8f3e10d308d67a0c4384015a8d1c

[ADJUDICATION-FENCED] 4e8c8ed8de2a8f3e10d308d67a0c4384015a8d1c fenced=3 flagged=0
UPHOLD-FENCED F1 src/kiro_crew/security/redaction_structured/identifiers.py:211 -- Only `&amp;` is recognised as a separator, so an entity-encoded `token` parameter goes unmasked, and model output (for example under prompt injection) can contain one without any extreme condition.
UPHOLD-FENCED F2 src/kiro_crew/security/redaction_structured/headers.py:108 -- `_Open` holds the stream cut at `open_from` (stream.py `_commit`) with no size bound until flush, and a long delimiter-free header value is ordinary model output, not an impossible input.
UPHOLD-FENCED F3 docs/decisions/2026-11-15-credential-redaction-off-by-default.md:5 -- The entry supersedes a recorded decision and turns redaction off by default, which the base rule clears only through a maintainer's explicit review override.
[GPT-ADJUDICATED-FENCED] 4e8c8ed8de2a8f3e10d308d67a0c4384015a8d1c

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

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator Author

Sensitive change review

  • Head commit: 4e8c8ed
  • Scope: backport of feat(security): one redaction switch, rule table only, value-only masks #37408 (main 028c39db49, last reviewed head f0d49b7f8f) to release/0.13.0 by git cherry-pick -x. The security, sandbox and redaction files are feat(security): one redaction switch, rule table only, value-only masks #37408's own; the only hand-resolved conflicts are test files (import-budget ceilings and three deleted tests; see the PR body).
  • What rule changed: Credential redaction is one owner switch, off by default, governed by capabilities.credential_redaction_off (widened meaning). 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). Detection is the rule table alone: vendor formats by prefix, length, charset and checksum, plus an explicit list of 38 well-known names; a URL parameter after a &amp; separator is read as after &. Every refusal gate in this repository decides on security.exfil.refuses. App egress (ctx.scrub.outbound) replaces a link the dashboard would block with the old placeholder, by the chip's own decision. A non-owner socket's and SSE reader's stream redactor runs whatever the setting reads. Every render memo, preview cache, sidebar row memo, shared slot-list pass and transcript entry cache keys on whether its redaction pass stands down, so an owner-only result is never served to a non-owner. Every channel post (each transport send, the Slack renderers, the mirror echo, bridged notifications) runs inside the CHANNELS seam, so a chat turn's linked-thread post never stands down. Every gate in this repository that refused on redacted text now decides on refuses() whatever the setting; redact_exfiltration_urls stays value-only, so a benign long URL raises no notice. A non-owner socket at its stream cap withholds the slices of one more stream (its saved rows show it at the end) rather than drop a redactor. A blocked link is its chip in a formatted markdown card too, and a chat widget opens no link the reply's blocked-link records name (nor any web link while the reply is still streaming). A Slack file title is redacted inside CHANNELS whatever seam calls it. A subagent completion row carries its blocked-link records, so its card draws a blocked link as the chip. A webhook URL with an explicit port (hooks.slack.com:443) has its secret path segment masked like the portless one, and a URL longer than the URL row reads still has its userinfo password and webhook secret masked. Only a placeholder this redactor writes, byte for byte, is skipped as one, so a key body wrapped to look like a placeholder is still read. A top-level raw anchor or image matching a blocked-link record is its chip, never live. The status stream (/api/stream) sends any reader but the owner each event with every string value redacted in full. A non-owner socket gets every frame but a streamed slice redacted in full whatever the setting reads, so a frame built from what was read while it was off cannot carry a credential past a change to on. An older transcript's suspicious-URL placeholder is shown as the address its records kept, so today's decisions apply; the saved row is unchanged, and a regenerated reply's stashed older text keeps those records. A policy naming only retired rows still governs.
  • Before -> after (what was allowed/blocked, now): Before, redaction always ran and rewrote certificates, keys, identifiers and whole URLs. Now, with OFF, only the owner's own surfaces pass text as written. A channel or group post, a non-owner socket, SSE reader or HTTP request, a Stop hook payload, every SEL row and every safety decision stay redacted, and turning the switch on mid-reply releases nothing to a non-owner. With ON, only credential values the table reads are masked. Gates refuse a flagged URL payload, as on main, except the refusal sites in the adopted apps pptx-maker and spec-builder until their app PRs land (fix: refuse a flagged URL by the gateway's exfil scan, not only a rewrite KiroCrewCaptain/kirocrew-app-pptx-maker#8, fix: refuse a flagged URL by the gateway's exfil scan, not only a rewrite KiroCrewCaptain/kirocrew-app-spec-builder#10).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): leaks a secret. A credential format or name the table does not list shows with the switch ON; these are listed as known gaps by maintainer order.
  • Evidence checked (which sandbox result proves it): feat(security): one redaction switch, rule table only, value-only masks #37408's own evidence on main (daily-use smoke on three real gateways at 67e9cd7, verifier corpus 0 of 43 leaks missed) applies to the same source; on this head, the denied-commands, ssh and redaction suites pass: test/*denied_commands*, test/*redact*, test/*ssh* (5819 passed, 2 skipped), and test/test_denied_commands_security_ssh_self.py with test/test_mcp_listing_import_budget.py (399 passed).
  • No regression:
    • Tools still work (which tools/commands were run, result): the gate's ssh floor and deny tests (5819 passed) and the backend scoped suite for every touched area (7557 passed; the 42 failures are file_explorer, auto_improvement and code_review_sage tests that fail the same way on the release base 061d2ffa31 on this host).
    • Backward compatible (old config / old data / old callers still work, how checked): same contract as feat(security): one redaction switch, rule table only, value-only masks #37408 on main (PR body, Backwards compatibility); a v0.13.0-rc.1 record reads as the one setting; the retired policy row loads and its deny denies (test_credential_redaction_switch.py, in the scoped run).
    • Existing tests (which suites passed on this head): local on this head: isort, flake8, mypy, the black ratchet, docs lint, vendor manifest, comment-history, brand, harness parity, feature map, changelog, decisions, focus cue, memory-store seam, subprocess encoding, sync-io and loop-lock gates all pass; the scoped backend suite as above. CI Backend, Frontend and E2E suites run on this head.
  • How to undo: the owner turns the switch ON; to ship ON, flip DEFAULT_REDACTION_ENABLED; or revert this commit on release/0.13.0.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 16, 2026
@bolichen97
bolichen97 merged commit e1e6924 into release/0.13.0 Nov 16, 2026
89 of 99 checks passed
@bolichen97
bolichen97 deleted the crew/rc3-37408 branch November 16, 2026 20:09
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator Author

/ai-review override first-principles 4e8c8ed owner-decision: The maintainer decided redaction is one owner switch, off by default, governed by capabilities.credential_redaction_off, widened to all redaction; the decision record ships in this PR. Decision: #37408 (comment) Backport of #37408 to release/0.13.0 for v0.13.0-rc.3. Override authorized by bolichen (watch holder), 2026-11-16.

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator Author

/ai-review override gpt 4e8c8ed owner-decision: Maintainer decisions: entity-encoded parameters (F1) are listed detection gaps; the superseding decision record (F3) ships here. F2, the unbounded hold on an unfinished header value, is accepted risk for rc.3 (fails closed, no leak); fix tracked in #38085 for 0.13.1. Decision: #37408 (comment) Backport of #37408 to release/0.13.0 for v0.13.0-rc.3. Override authorized by bolichen (watch holder), 2026-11-16.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@KiroCrewCaptain recorded a owner-decision release (class owner-decision) for the gpt AI finding on 4e8c8ed8de2a8f3e10d308d67a0c4384015a8d1c.

Maintainer decisions: entity-encoded parameters (F1) are listed detection gaps; the superseding decision record (F3) ships here. F2, the unbounded hold on an unfinished header value, is accepted risk for rc.3 (fails closed, no leak); fix tracked in #38085 for 0.13.1. Decision: #37408 (comment) Backport of #37408 to release/0.13.0 for v0.13.0-rc.3. Override authorized by bolichen (watch holder), 2026-11-16.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@KiroCrewCaptain recorded a owner-decision release (class owner-decision) for the first-principles AI finding on 4e8c8ed8de2a8f3e10d308d67a0c4384015a8d1c.

The maintainer decided redaction is one owner switch, off by default, governed by capabilities.credential_redaction_off, widened to all redaction; the decision record ships in this PR. Decision: #37408 (comment) Backport of #37408 to release/0.13.0 for v0.13.0-rc.3. Override authorized by bolichen (watch holder), 2026-11-16.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: GPT 6.1. Re-run the lane's latest workflow run for 4e8c8ed8de2a8f3e10d308d67a0c4384015a8d1c manually from the Actions tab.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: First Principles Review. Re-run the lane's latest workflow run for 4e8c8ed8de2a8f3e10d308d67a0c4384015a8d1c manually from the Actions tab.

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 16, 2026
@KiroCrewCaptain KiroCrewCaptain mentioned this pull request Nov 16, 2026
5 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants