Skip to content

fix: keep the key when redacting an authorization bearer header - #32367

Merged
bolichen97 merged 1 commit into
mainfrom
fix/13873-bearer-redaction-keeps-key
Nov 8, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/13873-bearer-redaction-keeps-key

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #21488 by @dodgeblaster.

Problem / Motivation

Goal: Redacting an Authorization: Bearer header replaces only the token, so a JSON or header document that holds one still parses after redaction.

The dashboard Files view shows Invalid JSON: for a valid file such as ~/.kiro/settings/mcp.json when a remote MCP server carries headers.Authorization. Redaction turns {"Authorization": "Bearer <tok>"} into {"[REDACTED: credential]"}, which is not JSON. The secret was removed correctly; the shape around it was destroyed.

Why it matters

Anyone whose config, log or chat text carries a Bearer header sees a corrupted-looking file in the Files view and loses the field name in every redacted copy (chat, transcripts, logs). It reads like a broken config when the file on disk is fine.

Not a goal

What changed (motivation → approach → change)

A redacted Bearer header keeps its name and scheme: {"Authorization": "Bearer <tok>"} becomes {"Authorization": "Bearer [REDACTED: credential]"}, and the Files view renders it as a tree.

The Bearer branch in redaction_patterns.py started its match at the header name, and pass 1 of _credential_redaction_plan in redaction.py replaced every match whole. That branch now names its non-secret prefix (header name, separator, optional quote, Bearer scheme) in a bearer_prefix group, and pass 1 starts the redacted span where that group ends. Every other branch has no such group and is redacted whole, as before. The rule is still classified from the whole match, and a record's removed value is now exactly the token.

The dashboard's sub-agent output stream (handlers/core.py) holds a poll's last line while it lands inside a credential match, so a token on the line after its kept label is never sent apart from it and its tail stays redacted.

The output is the issue's expected shape with the Bearer scheme word kept, which is not secret. security.md records what survives and the stream's hold rule, and the package line budget in test_security_gate_liveness.py moves to the measured size.

Backwards compatibility

Compatible: every input that was redacted is still redacted and its token is still gone; only the non-secret Authorization: Bearer prefix now stays in the output.

Removes nothing: the redacted output gains the header prefix and loses no record, key or capability.

Tests

  • test_security.py: a raw Bearer header redacts to exactly Authorization: Bearer [REDACTED: credential]; the JSON form json.loads back with the key kept and re-redacting it changes nothing; a Bearer JWT is one match with the prefix kept.
  • test_credential_prefilter.py: every non-Bearer corpus shape still equals the by-value legacy oracle exactly; each Bearer shape equals it exactly once its kept prefix is folded back into the tag.
  • test_coder_session_browse.py, test_stream_redactor_aws_keyed.py, test_cron_script_sessions.py, test_agent_stream_tail.py: expectations that encoded the old whole-match output now state the kept prefix; the cron example of a key-spanning credential moves to an AWS key.
  • test_agent_stream_tail.py: an SD-JWT cut by a poll inside its signature, on the line after its label, streams as one redacted frame with none of the disclosure; it fails without the stream's hold.

Determinism: test_a_value_cut_between_two_reads_is_redacted_whole green 20 times at -n0 and 10 times at -n 4 --dist loadgroup --max-worker-restart=2 beside test_core_handlers_facade.py and test_dashboard_handlers_core_coverage_agent_settings.py; test_agent_stream_tail.py green in a shuffled order (seed 31038).

Proof: PROVEN test/test_agent_stream_tail.py::test_a_value_cut_between_two_reads_is_redacted_whole[bearer-token-cut-after-its-label], test/test_agent_stream_tail.py::test_a_value_cut_between_two_reads_is_redacted_whole[bearer-token-on-the-line-after-its-label], test/test_agent_stream_tail.py::test_a_value_cut_between_two_reads_is_redacted_whole[bearer-token-read-after-its-label-line-ends], test/test_agent_stream_tail.py::test_a_value_cut_between_two_reads_is_redacted_whole[bearer-token-cut-in-a-line-too-long-to-hold], test/test_agent_stream_tail.py::test_a_value_cut_between_two_reads_is_redacted_whole[bearer-token-cut-from-its-kept-label-waits-whole] (head ac8ec52)

Manual verification

Ran the issue's headless repro: redact_credentials on the sample mcp.json returns {"headers": {"Authorization": "Bearer [REDACTED: credential]"}}, and json.loads accepts it.

Related Issues

Closes #13873

Sibling sweep

Swept: git grep -nF '[:=]\s*' -- src/kiro_crew/security/redaction_patterns.py
Sibling: src/kiro_crew/security/redaction_patterns.py:73 -- tracked in #22576
Sibling: src/kiro_crew/security/text_redaction.py -- not affected -- its fail-closed ceiling drops the whole over-long value on purpose

Pattern harvest

Not generalizable: the Bearer branch is the only key-anchored credential branch outside the AWS key-value ones, which #22576 tracks.

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
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 7, 2026 13:55
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 7, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) November 7, 2026 14:14
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security/redaction.py

  • src/kiro_crew/security/redaction_patterns.py

  • @KiroCrewCaptain: missing the ## Sensitive change review heading

How to clear this check:

  1. The PR author posts the template below as a PR comment, with
    every field filled (N/A needs a reason). Keep the
    Head commit line: it must name the current head SHA.
  2. The check turns green within a minute, with no push.
  3. A new push resets this check: post it again for the new head.

Only the author's comment counts this way. A reviewer can instead
paste the filled template into an "Approve" review on this head.
Merging still needs a reviewer's approval.

## Sensitive change review
- Head commit: ac8ec522ff2a03ee15864b1cbc0b7a18e7cb745a
- What rule changed:
- Before -> after (what was allowed/blocked, now):
- Worst case if wrong (breaks commands / leaks secret / locks user out):
- Evidence checked (which sandbox result proves it):
- No regression:
  - Tools still work (which tools/commands were run, result):
  - Backward compatible (old config / old data / old callers still work, how checked):
  - Existing tests (which suites passed on this head):
- How to undo:

@bolichen97
bolichen97 force-pushed the fix/13873-bearer-redaction-keeps-key branch from d3af236 to 2f5c14e Compare November 7, 2026 17:12
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in test/test_security_gate_liveness.py and docs/system-specs/modules/security.md since this head's CI ran (f58c3cf -> 26d3928); CI re-running.

The new head also fixes the red test_agent_stream_tail.py cases: they encoded the old whole-match output and now state the kept Authorization: Bearer prefix. The sub-agent output stream holds a poll's last line while a credential match spans the cut, so a token on the line after its kept label is still redacted whole; a new case pins it.

[operator: bolichen97]

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

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision ac8ec522ff2a03ee15864b1cbc0b7a18e7cb745a touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

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

First-Principles-Verdict: PASS

Nothing blocks. Issue #13873 is the evidence for the fix. The stream hold exists only because of the kept prefix, and the new parametrized case fails without it.

What this change ships

Inventory (5 items) — 4 justified

Intent: a config, log or chat text holding an Authorization: Bearer header should still parse after redaction (a FIX).

  1. A redacted Bearer header now keeps Authorization: Bearer and only the token becomes the tag, everywhere redaction output appears — justified
  2. The redaction warning now reports the token's length, not the whole match's — rides along, harm-free
  3. The sub-agent output stream holds a poll's last line while a credential match spans it, so the token's tail is never sent unredacted — justified
  4. The deleted assert "Bearer" not in result pin and the cron Bearer example are reversed or moved, citing file viewer: credential redaction consumes the JSON key, so any file holding an Authorization header renders as "Invalid JSON" #13873 — justified
  5. The package line budget rises by 4 and the security spec is updated — justified

[FIRST-PRINCIPLES-REVIEWED] ac8ec52

Description read

[DESCRIPTION-READ] c18c8ff2d83b1dd2622010cc4e1c6a5f725cae3eb04ab463da40c7ba99be1647

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

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the change only shrinks the redacted span to the token itself. Every derived alternation compiles its own copy of bearer_prefix, and the other consumers still redact the whole match, which errs toward over-redaction.

Notes

[DESIGN-REVIEWED] ac8ec52

Description read

[DESCRIPTION-READ] 12936477b0a6b74fb3f3594ca8a13cd4b948f45d5208423f60697e824984f719

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] ac8ec52

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

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- ✅ PASS

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

Verdict basis: adjudicated, zero confirmed regressions.

Security scope review -- adjudicated candidates

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

No candidate flipped from allowed to refused.

Scope-Verdict: PASS

Reason: The shell deny composite cannot newly refuse anything because of this change. Adding the named group bearer_prefix leaves the set of strings _CREDENTIAL_PATTERNS matches the same, so _contains_fixed_credential and the exfil redact_credentials(x) != x checks give the same answers. Only the size of the redacted span changes. The one guard that did get stricter is the subagent SSE hold in api_session_agent_stream, and the classifier cannot judge it. It is named under UNADJUDICATED and does not block.

TIGHTENING: The subagent output SSE tail now holds more of its output -- it holds back the whole poll when a credential match crosses the line cut, in addition to the existing "apart != together" test: if sent + _redacted(text[cut:]) != whole or (whole != text and any(m.start() < cut < m.end() for m in iter_credential_matches(text))): cut, sent = 0, "". The threat it refuses is a Bearer token, cut away from its now-kept Authorization: Bearer label, being sent in two pieces that each redact the same apart, so part of the token leaks.

ADJUDICATED: 11 candidates, 0 confirmed newly-refused (the harness gave no confirmed rows)

PLATFORM COVERAGE: posix and windows. The diff adds no assumptions about paths, interpreters or environment variables, since the redaction regex and the SSE hold work on text only. Even so, the Bearer-header curl call, the source search and the targeted pytest runs were each written in both spellings: $GITHUB_TOKEN and %GITHUB_TOKEN%, curl and curl.exe, grep and findstr, / and \ separators. That checks that the exfil tier, which reads _CREDENTIAL_PATTERNS, still treats a Bearer header carrying a variable reference the same on both hosts. Every assumed platform has a candidate.

UNADJUDICATED: Guard: the hold predicate in dashboard/handlers/core.py::api_session_agent_stream. Call path: a subagent's result file grows, then ResultTail reads it on each poll, then text = held + chunk, then the predicate above. When it fires, sent is "" and everything waits until the next poll, the last read, or _AGENT_STREAM_HOLD_MAX. Past that limit the held text is redacted and sent as one piece, and after that the stream sends only event: done. Legitimate inputs I would have submitted, to see whether they now stall the stream:
(a) a subagent that prints a long multi-line JWT or SD-JWT under a Bearer label as it works, so the match crosses the cut on every poll;
(b) a multi-line PEM private-key block that spans many polls. The full-block PEM branch matches across newlines, so the new m.start() < cut < m.end() test holds the whole block, and every line after it in the same reads, until the END marker arrives;
(c) a long subagent log containing one early credential match that a later line extends.
In each case the output is held rather than lost. The cost is that live output is delayed, or the stream ends once the hold passes _AGENT_STREAM_HOLD_MAX. Nothing can confirm this as a regression here, and an operator watching the subagent card would see the cost as "output paused". A second item has no verdict either: the Bearer value-only span changes the redacted text that chat_turn/file_changes.py::_flush_file_changes saves in place, and an equality fixed-point check in the chat segment save (_saved_text_shows_more) now compares that text with the label kept. Neither is a shell command line.

[SCOPE-REVIEWED] ac8ec52

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] ac8ec52

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

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

@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 7, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] The remaining CI reds on 2f5c14e are main's, not this change's, so this PR waits instead of pushing:

Once those are fixed on main, this branch rebases onto main and CI re-runs. It still needs a human review and a Sensitive Change sign-off.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/13873-bearer-redaction-keeps-key branch from 2f5c14e to e97b354 Compare November 7, 2026 23:12
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 7, 2026
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 7, 2026
@bolichen97

bolichen97 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Rebased onto main 0b75594 to clear the conflict; head e97b354. The only CI reds on this head are not this change's:

Local GPT and Opus reviews of the rebased commit found nothing.

AI-assisted, posted on behalf of bolichen97

The bearer branch of the credential patterns matched the header name,
separator, quote and scheme together with the token, and pass 1
replaced the whole match. A JSON document holding
{"Authorization": "Bearer <tok>"} collapsed to a bare tag, so the
dashboard Files view reported a valid file as Invalid JSON.

The branch now names its non-secret prefix in a bearer_prefix group
and pass 1 starts the redacted span at its end, so only the token is
replaced and the document still parses.

The sub-agent output stream sends a poll up to its last line only
when both halves redact the same as the whole. With the label kept, a
token cut from it on the next line could pass that check and lose its
anchor, so the stream also holds while a credential match spans the
cut.

Builds on #21488 by @dodgeblaster.

Closes #13873

Co-authored-by: Gary Jennings <garysjennings@gmail.com>
@bolichen97
bolichen97 force-pushed the fix/13873-bearer-redaction-keeps-key branch from e97b354 to ac8ec52 Compare November 8, 2026 01:49
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 8, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving. On head ac8ec52 the review confirmed these behaviours. The Bearer branch gains one named bearer_prefix group, and pass 1 starts its span where that group ends. Every other branch has no such group, so it falls back to m.start() and is redacted whole, as before. Raw, JSON, curl, JWT and newline Bearer inputs all lose the token, and the JSON form now parses. Mutation runs show the tests catch this change: reverting the span start turns 35 tests red, and deleting the new stream hold in core.py turns the SD-JWT case red.

Security: the token is still removed in every shape tested, and a second redaction pass changes nothing. Rules are still classified from the whole match, so no tier moves. The new capture group has no consumer that uses group indices, findall or split. Keeping the label opened one new leak: in the dashboard SSE stream, an SD-JWT disclosure could stream on the next poll. The new hold in core.py closes it. The hold is bounded by _AGENT_STREAM_HOLD_MAX and never fires on the last poll. The other match consumers still use the whole match, which removes more text than needed but exposes no token.

Done well: the fix stays at the root (one group, one span-start line), it follows the recorded "label kept, value replaced" decision, and the prefilter oracle was split honestly instead of loosened.

Optional:

  • This PR and #32401 break test_a_credential_spanning_a_key_and_its_value_still_sends_valid_json (test/test_cron_script_sessions.py:350) once both are on main, whichever lands first. Its pytest.raises(json.JSONDecodeError) step stops holding, and merge-tree will not show it. Name the landing order in one body. The PR that lands second should rewrite that precondition.
  • A separate StreamRedactor leak exists on main and is unchanged here: if a chunk ends on the closing quote of "Bearer <token>", the token streams unredacted. It deserves its own issue with that reproduction.
  • When this lands, #21488 can be closed as superseded, with credit to dodgeblaster.

@bolichen97
bolichen97 merged commit 3a5c452 into main Nov 8, 2026
112 of 116 checks passed
@bolichen97
bolichen97 deleted the fix/13873-bearer-redaction-keeps-key branch November 8, 2026 03:20
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 8, 2026
buluoray added a commit that referenced this pull request Nov 8, 2026
The bearer branch of the credential patterns matched the header name,
separator, quote and scheme together with the token, and pass 1
replaced the whole match. A JSON document holding
{"Authorization": "Bearer <tok>"} collapsed to a bare tag, so the
dashboard Files view reported a valid file as Invalid JSON.

The branch now names its non-secret prefix in a bearer_prefix group
and pass 1 starts the redacted span at its end, so only the token is
replaced and the document still parses.

The sub-agent output stream sends a poll up to its last line only
when both halves redact the same as the whole. With the label kept, a
token cut from it on the next line could pass that check and lose its
anchor, so the stream also holds while a credential match spans the
cut.

Builds on #21488 by @dodgeblaster.

Closes #13873

Co-authored-by: Gary Jennings <garysjennings@gmail.com>
(cherry picked from commit 3a5c452)

Original author: @bolichen97 (picked by hand: conflict only in docs/system-specs/modules/security.md test/test_security_gate_liveness.py)
buluoray added a commit that referenced this pull request Nov 8, 2026
The bearer branch of the credential patterns matched the header name,
separator, quote and scheme together with the token, and pass 1
replaced the whole match. A JSON document holding
{"Authorization": "Bearer <tok>"} collapsed to a bare tag, so the
dashboard Files view reported a valid file as Invalid JSON.

The branch now names its non-secret prefix in a bearer_prefix group
and pass 1 starts the redacted span at its end, so only the token is
replaced and the document still parses.

The sub-agent output stream sends a poll up to its last line only
when both halves redact the same as the whole. With the label kept, a
token cut from it on the next line could pass that check and lose its
anchor, so the stream also holds while a credential match spans the
cut.

Builds on #21488 by @dodgeblaster.

Closes #13873

Co-authored-by: Gary Jennings <garysjennings@gmail.com>
(cherry picked from commit 3a5c452)

Original author: @bolichen97 (picked by hand: conflict only in docs/system-specs/modules/security.md test/test_security_gate_liveness.py)
buluoray added a commit that referenced this pull request Nov 8, 2026
The bearer branch of the credential patterns matched the header name,
separator, quote and scheme together with the token, and pass 1
replaced the whole match. A JSON document holding
{"Authorization": "Bearer <tok>"} collapsed to a bare tag, so the
dashboard Files view reported a valid file as Invalid JSON.

The branch now names its non-secret prefix in a bearer_prefix group
and pass 1 starts the redacted span at its end, so only the token is
replaced and the document still parses.

The sub-agent output stream sends a poll up to its last line only
when both halves redact the same as the whole. With the label kept, a
token cut from it on the next line could pass that check and lose its
anchor, so the stream also holds while a credential match spans the
cut.

Builds on #21488 by @dodgeblaster.

Closes #13873

Co-authored-by: Gary Jennings <garysjennings@gmail.com>
(cherry picked from commit 3a5c452)

Original author: @bolichen97 (picked by hand: conflict only in docs/system-specs/modules/security.md test/test_security_gate_liveness.py)
buluoray added a commit that referenced this pull request Nov 8, 2026
The bearer branch of the credential patterns matched the header name,
separator, quote and scheme together with the token, and pass 1
replaced the whole match. A JSON document holding
{"Authorization": "Bearer <tok>"} collapsed to a bare tag, so the
dashboard Files view reported a valid file as Invalid JSON.

The branch now names its non-secret prefix in a bearer_prefix group
and pass 1 starts the redacted span at its end, so only the token is
replaced and the document still parses.

The sub-agent output stream sends a poll up to its last line only
when both halves redact the same as the whole. With the label kept, a
token cut from it on the next line could pass that check and lose its
anchor, so the stream also holds while a credential match spans the
cut.

Builds on #21488 by @dodgeblaster.

Closes #13873

Co-authored-by: Gary Jennings <garysjennings@gmail.com>
(cherry picked from commit 3a5c452)

Original author: @bolichen97 (picked by hand: conflict only in docs/system-specs/modules/security.md test/test_security_gate_liveness.py)
buluoray added a commit that referenced this pull request Nov 8, 2026
The bearer branch of the credential patterns matched the header name,
separator, quote and scheme together with the token, and pass 1
replaced the whole match. A JSON document holding
{"Authorization": "Bearer <tok>"} collapsed to a bare tag, so the
dashboard Files view reported a valid file as Invalid JSON.

The branch now names its non-secret prefix in a bearer_prefix group
and pass 1 starts the redacted span at its end, so only the token is
replaced and the document still parses.

The sub-agent output stream sends a poll up to its last line only
when both halves redact the same as the whole. With the label kept, a
token cut from it on the next line could pass that check and lose its
anchor, so the stream also holds while a credential match spans the
cut.

Builds on #21488 by @dodgeblaster.

Closes #13873

Co-authored-by: Gary Jennings <garysjennings@gmail.com>
(cherry picked from commit 3a5c452)

Original author: @bolichen97 (picked by hand: conflict only in docs/system-specs/modules/security.md test/test_security_gate_liveness.py)
buluoray added a commit that referenced this pull request Nov 8, 2026
The bearer branch of the credential patterns matched the header name,
separator, quote and scheme together with the token, and pass 1
replaced the whole match. A JSON document holding
{"Authorization": "Bearer <tok>"} collapsed to a bare tag, so the
dashboard Files view reported a valid file as Invalid JSON.

The branch now names its non-secret prefix in a bearer_prefix group
and pass 1 starts the redacted span at its end, so only the token is
replaced and the document still parses.

The sub-agent output stream sends a poll up to its last line only
when both halves redact the same as the whole. With the label kept, a
token cut from it on the next line could pass that check and lose its
anchor, so the stream also holds while a credential match spans the
cut.

Builds on #21488 by @dodgeblaster.

Closes #13873

Co-authored-by: Gary Jennings <garysjennings@gmail.com>
(cherry picked from commit 3a5c452)

Original author: @bolichen97 (picked by hand: conflict only in docs/system-specs/modules/security.md test/test_security_gate_liveness.py)
buluoray added a commit that referenced this pull request Nov 8, 2026
The bearer branch of the credential patterns matched the header name,
separator, quote and scheme together with the token, and pass 1
replaced the whole match. A JSON document holding
{"Authorization": "Bearer <tok>"} collapsed to a bare tag, so the
dashboard Files view reported a valid file as Invalid JSON.

The branch now names its non-secret prefix in a bearer_prefix group
and pass 1 starts the redacted span at its end, so only the token is
replaced and the document still parses.

The sub-agent output stream sends a poll up to its last line only
when both halves redact the same as the whole. With the label kept, a
token cut from it on the next line could pass that check and lose its
anchor, so the stream also holds while a credential match spans the
cut.

Builds on #21488 by @dodgeblaster.

Closes #13873

Co-authored-by: Gary Jennings <garysjennings@gmail.com>
(cherry picked from commit 3a5c452)

Original author: @bolichen97 (picked by hand: conflict only in docs/system-specs/modules/security.md test/test_security_gate_liveness.py)
iamwhatever pushed a commit to hickoxd/KiroCrew that referenced this pull request Nov 8, 2026
Since kirodotdev#32367 the redactor keeps the Authorization header name and redacts only the token, so the split-bearer expectations now include the header. The Codex native card tests from kirodotdev#23094 now pass the card_output_len and streams this PR makes required, and count only titled tool rows, since a call's result row now reaches the card too.
iamwhatever pushed a commit to hickoxd/KiroCrew that referenced this pull request Nov 8, 2026
Since kirodotdev#32367 the redactor keeps the Authorization header name and redacts only the token, so the split-bearer expectations now include the header. The Codex native card tests from kirodotdev#23094 now pass the card_output_len and streams this PR makes required, and count only titled tool rows, since a call's result row now reaches the card too.
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.

file viewer: credential redaction consumes the JSON key, so any file holding an Authorization header renders as "Invalid JSON"

2 participants