Skip to content

fix(security): redact both of two credentials written back to back - #23326

Open
JLargent42 wants to merge 1 commit into
mainfrom
fix/redact-glued-credentials
Open

JLargent42 wants to merge 1 commit into
mainfrom
fix/redact-glued-credentials

Conversation

@JLargent42

@JLargent42 JLargent42 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: When two credentials are written back to back with nothing between them, both are redacted whole.

The credential redactor kept most of the second of two glued credentials. A branch's body class can hold the leading characters of the next credential's prefix: a GitHub token body ends on the next token's ghp, and an sk- key body ends on the next JWT's header or a PEM block's -----BEGIN. The first match then stops short inside the second credential, and the scan resumed after it, past the second one's start.

Why it matters

A reply, tool output or log line that prints two credentials back to back kept one of them nearly whole. Each credential alone, or with a space between, was already fully redacted.

Not a goal

What changed (motivation → approach → change)

Pass 1 of the batch redactor now scans with _credential_matches(text, glued=True). After each match, _glued_matches probes every credential start inside it, nested ones included, and yields any match that runs past its end; the splice in _credential_redaction_plan redacts only the part past the previous span, so each credential gets its own tag.

Case How a probe reads it
Ordinary token or key matched through a window past the span that widens only while the match reaches its edge
Link with a password its scheme start is a candidate on its own and is matched to the end of its authority, so the last @ is found as the plain scan finds it
JWT its eyJ start is a candidate on its own and is read whole, however long its claims
PEM block matched to its END marker; the marker lookup is shared across the scan
Field label inside a value a field label whose separator the value took stays part of the value when the value is an AWS field's own or no token text follows it, and so does an AWS field name that ends an AWS field's own value before a space; a field after a Bearer token whose padding took only its separator is redacted

Each match runs at most 8 probes that extend nothing; after that only PEM, Bearer and AWS field starts are probed, still one window at a time, and the rest of a non-space run is redacted whole, so the bound fails closed. Starts are searched one window at a time, so the scan stays linear. Callers that do not pass glued=True (deploy scan, design-tweak preview, stream cut points) see exactly the matches they saw before.

The glued scan adds no regex (review 5883359647). src/kiro_crew/security/redaction_patterns.py runs the existing _CREDENTIAL_PATTERNS and reads everything else in plain code: field names, URI schemes and the PEM END marker as string literals with str.find/startswith, separators and value runs by a small loop, token and guard characters as frozensets, and Authorization through the pre-filter's existing case-folding anchors. A Discord or link-token start glued behind a token character is matched on a slice of the text (at most five segment runs) where those branches' start lookbehinds see nothing, in place of the three glued pattern copies. The security spec (docs/system-specs/modules/security.md) describes the glued pass.

Backwards compatibility

Compatible: text without two glued credentials redacts as before; glued credentials now redact fully. One case can redact more than main: once a match spends its 8 probes with its run of non-space text still going, the rest of that run is redacted whole. That errs toward redacting too much, never too little. A Discord or link token that starts exactly where a fixed-length key ends is now redacted as well.

One behaviour from #21573 changes, by the owner's decision (largjaco, 2026-11-04): an AWS field name glued onto the end of an AWS value, with its separator after a space (aws_access_key_id=AKIA...aws_session_token = <value>), is now probed as a field of its own, so <value> is redacted. Main keeps it. Text with the same shape that only looks like such a field (SessionToken=<long value>AccessKeyId : visible text) loses the word after the colon. The streaming redactor reads it the same way (src/kiro_crew/security/text_redaction.py, _glued_key_tail): when an AWS key name ends the batch match it sits in, the stream commits the credential before it, which redacts on its own, and holds the name in the existing AWS discard. The next chunk keeps the name as a label if its separator follows, and otherwise drops it with the value it ended. Streamed and stored output therefore stay equal, as test_stream_redactor_aws_keyed.py asserts again.

Removes nothing: no key, function, record or route is removed.

Tests

  • test/test_credential_redaction_glued.py (new): same-rule, key-then-JWT and different-rule pairs; three in a row; a credential behind nested matches and past the probe budget; a glued AWS label value (with or without spaces around its separator), Bearer header, JWT with long claims, link password (including one whose @ lies past the window) and PEM block (short, long, and after nine nested tokens); a label value the previous match swallowed stays visible; an AWS field inside a Bearer header glued after a credential, with a value starting in %2F, is redacted; and linear-time checks for each adversarial shape a review raised, each under a timeout that the quadratic form exceeds.
  • test/test_credential_redaction_glued.py also pins a glued link token followed by . (probed and abutting paths) and a glued AWS field name whose separator follows a space (" = ", " =", " : "); each fails on the code before its fix.
  • test/test_stream_redactor_aws_keyed.py: the fix(security): hold a streamed AWS key-value pair past the 512 floor #21573 case keeps main's out == redact(...) equality, now over five tails (three separators, two without one) and a short and a past-the-ceiling value; the three separator tails fail on the stream without _glued_key_tail.
  • test/test_credential_redaction_glued.py also pins a label repeated 64,000 times after the probe budget is spent (aws_secret_access_key, SessionToken, case-folded AUTHORIZATION); each times out at 60 s when the spaced-start search reads to the span's end.
  • test/test_credential_prefilter.py: the glued ghp_ pair moves from the legacy-equivalent corpus to LEGACY_DIVERGENT_SHAPES (legacy keeps the second body, the live pass removes it), and the by-span reference oracle models the glued splice.
  • test/test_chat_runner_coverage.py: the cases that used glued tokens to trigger the save-time withhold now assert that no 12-character window of any token body, the sample key, or a password survives in the saved segment or its link records; the forged-placeholder case keeps its withhold assertion as its own test. test_each_removed_value_is_checked_on_its_own (added on main by fix(security): redact a streamed link cut inside its query as one link #20805) used a glued ghp_ pair to reach the withhold; the whole-text pass now redacts that pair as two credentials, so it asserts the saved text carries one tag per token and none of the three tokens.
  • test/test_credential_glued_plain_readers.py (new): holds every plain-code reader to the regex spelling it replaced, kept only in the test as an oracle, over a seeded random corpus; checks _glued_match against the old glued pattern copies (and that the corpus reaches the sliced path and finds Discord starts); and checks over every code point that str.lower and re.IGNORECASE fold the same characters onto the letters of Bearer.
  • test/test_security_regex_linearity.py and the security package line budget in test/test_security_gate_liveness.py follow the new code.

Revert proof: restoring only the two production files turns 9 of the new file's tests red, and the no-END-marker linearity test times out without the shared marker lookup. Determinism: the new file passes repeated and shuffled runs.

Manual verification

N/A — unit coverage sufficient: the change is in the pure-text redaction pass, driven directly by the tests above.

Related Issues

Closes #21595

Sibling sweep

Swept: git grep -n "_credential_matches(" -- src/
Sibling: src/kiro_crew/deploy/scan.py -- not affected -- reports each match it finds, a glued second credential's prefix is already flagged by the first
Sibling: src/kiro_crew/apps/builtins/design_tweak/backend/preview_files.py -- not affected -- answers only whether any credential is present
Sibling: src/kiro_crew/security/text_redaction.py -- not affected -- uses match spans as cut points; the batch pass it hands text to is the one fixed here

Pattern harvest

Not generalizable: the defect is specific to resuming a leftmost-longest scan after a match whose body class overlaps another branch's prefix; the fix sits in the one shared scanner.

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

@JLargent42
JLargent42 requested review from a team and KiroCrewCaptain as code owners October 23, 2026 04:22
@github-actions

github-actions Bot commented Oct 23, 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

  • src/kiro_crew/security/text_redaction.py

  • @JLargent42 posted a complete reasoning template for 8f989f3.

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

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 8f989f325b765861db7d685f19d652315a62cbd0 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 Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

The leak is real and stays inside pass 1 of the batch redactor. Callers that don't pass glued=True get the same matches as before. The single behaviour that changes (the AWS field-name tail) is listed and accepted by the owner.

Notes

  • _URI_SCHEMES and _AWS_LABELS copy literals out of _CREDENTIAL_PATTERNS by hand. The oracle in test_credential_glued_plain_readers.py is also a hand copy, so a scheme or label added to the live pattern later won't be probed in the glued scan, and no test will fail. Derive the tuples from the pattern, or assert that each one appears in _CREDENTIAL_PATTERNS.pattern.
  • ends is a shared cache of seven unnamed positions (ends[0] through ends[6]) that four functions write. Each slot's meaning is only written down in comments. A small named-field holder would keep the next person from reusing the wrong slot.

[DESIGN-REVIEWED] 8f989f3

Description read

[DESCRIPTION-READ] 3e78da8c570f3c3191add11d110b5e7f1c3aa1c7dfc009ee3aa3f373e3581870

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

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

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

First-Principles-Verdict: PASS

Nothing blocks. The glued-pair defect is pinned by a test that fails on base: the legacy oracle keeps "b" * 36. The one decision this reverses is disclosed. It rests on an owner ruling that is not recorded in the repository.

Notes

  • Item 5 — inherited: the deleted pin said "Releasing it must not remember an open label, or the next word after a colon would be dropped as if it were a value" (assert out.endswith(": visible text")). The description owns the reversal: "by the owner's decision (largjaco, 2026-11-04)". I could not find that ruling anywhere I can read: no docs/decisions/ entry, no linked issue.
    Subtraction: drop the _find_spaced_start AWS-label-after-space probe and text_redaction._glued_key_tail, and restore the deleted pin, unless the ruling is linkable. The ghp/sk/JWT/PEM glued fix does not depend on either.

What this change ships

Inventory (7 items) — 6 justified

Intent: when two credentials are written back to back, both are fully redacted in replies, logs and saved chat. This is a FIX.

  1. The second of two glued credentials (ghp_…ghp_…, sk- then JWT or PEM) is now redacted whole, with its own tag — justified
  2. A Discord token or link token that starts exactly where a fixed-length key ends is now redacted — justified
  3. When a match spends its 8 probes, the rest of that run of non-space text is redacted whole (fails closed) — justified
  4. Saved chat segments that used to be withheld for glued tokens are now saved with one tag per token — justified
  5. An AWS field name glued onto the end of an AWS value, with its separator after a space, now has its value redacted, and the word after a look-alike's colon is dropped — inherited, reverses the fix(security): hold a streamed AWS key-value pair past the 512 floor #21573 pin
  6. The streaming redactor holds a glued AWS key name until the next chunk, so streamed output still equals stored output — justified
  7. Pass 1 alone takes a new glued=True mode; every other _credential_matches caller is unchanged — justified

[FIRST-PRINCIPLES-REVIEWED] 8f989f3

Description read

[DESCRIPTION-READ] 1db40ec9d7c73fb5beb8ce678a0a6f5279db2f6d484bb6a8ad3dec18829c08cb

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 added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 8f989f3

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

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

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 8f989f3

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

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- ✅ PASS

Which legitimate operations does 8f989f325b765861db7d685f19d652315a62cbd0 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): 13 classified, 0 newly refused, 12 still allowed.
  • ubuntu-latest (platform posix): 13 classified, 0 newly refused, 12 still allowed.
  • windows-latest (platform windows): 7 classified, 0 newly refused, 6 still allowed.

No candidate flipped from allowed to refused.

Scope-Verdict: PASS

Reason: The stricter piece is the output-redaction scan in pass 1 (_credential_matches(..., glued=True)). It now also redacts a second credential written directly after the first, plus the leftover part of a run once the probe budget runs out. Those extra spans only appear where pass 1 already matched something, so the shell deny composite's "redactor changed the value" checks (in exfil.py) give the same answer as before. The new redactions in chat output, persisted text and streamed output are not something the classifier can measure, so I've listed them under UNADJUDICATED.

TIGHTENING: Pass-1 credential redaction, _pattern_pass → _credential_matches(text, glued=True) → _glued_matches / _abutting_match, plus the stream redactor's _glued_key_tail discard. The one threat it refuses: a credential glued to the one before it, where the first match's body takes the second's prefix and the second's body leaks in plain text. From the hunk: + # A credential glued to the one before it starts inside that span; / + # only its part past the span is still in plaintext. / + start = max(m.start(), kept, taken[-1][1] if taken else -1).

ADJUDICATED: 19 candidates, 0 confirmed newly-refused

PLATFORM COVERAGE: I wrote posix, windows and any rows. The diff assumes nothing about paths, separators, interpreters or executable names. Its readers work on literal text (Authorization/Bearer, AWS field names, PEM headers, URI schemes, eyJ). So the platform rows check that each tokenizer still allows those words when they show up in ordinary commands:

  • posix: $VAR and ${VAR} spellings in curl Bearer headers, aws configure set, a postgres URI, a redis URI, a PEM-producing openssl, a dashboard ?token=$VAR probe, and an ARN built from variables.
  • windows: %VAR% spellings, the curl.exe, psql.exe and .venv\Scripts\python.exe names, a drive-letter clone target, and & command chaining.
  • any: only the platform-neutral kirocrew token.

No platform the diff assumes is left without a row.

UNADJUDICATED:

  • Guard: redaction._pattern_pass (pass 1 of redact_credentials), reached through _credential_matches(text, glued=True) → _glued_matches → _probe_at / _glued_match. When _GLUED_PROBES (8) runs out, it falls back to redacting the rest of the run (_Span(text, end, ends[2])).
    • Call paths: agent chat output (chat_runner segment save and the per-delta pass); file-diff chip bodies, which chat_turn/file_changes.py::_flush_file_changes redacts in place before saving, so a false positive there can't be undone; artifact serialization; and StreamRedactor.feed, through the new _glued_key_tail commit/discard.
    • Inputs I would have submitted, written out because they aren't shell rows:
      • Long hyphenated or slash-separated values that follow an AWS SessionToken= label and contain more than 8 start-like substrings. These would hit the run-redaction fallback after the probe budget, which removes text up to the next whitespace even when nothing after the first value is a credential.
      • Prose where an AWS field name ends a value and the next line starts with : (the new test parameter "\n= visible text"). The batch pass now reads that as a new labelled field and redacts the visible word after it.
      • Markdown or JSON where an Authorization: Bearer header directly follows a redacted credential with no space.
      • Text where a postgres:// or https:// scheme is glued to the end of a token-class run, such as a URL in backticks right after a hash.
    • Each of these is a possible over-redaction, not a refusal I can confirm. The deny composite is not affected: the exfil.py _credential_clean / _blocked_link_safe_domain checks only care whether the output differs from the input, and a glued span only exists where pass 1 already changed the output.
  • Guard: the stream-side discard StreamRedactor / _glued_key_tail (self._discarding, self._discard_kind = True, ("aws-keyed",)).
    • Call path: streamed chat deltas.
    • Inputs: a value ending in AccessKeyId, then a chunk break, then ordinary prose that starts with whitespace and :. The discard could drop the prose word the way it drops a value. The diff's own test pins that streamed output matches batch output, but nothing here can say whether that batch reading is the right one for legitimate prose.

[SCOPE-REVIEWED] 8f989f3

@JLargent42
JLargent42 force-pushed the fix/redact-glued-credentials branch from d17a3c9 to d148b41 Compare October 23, 2026 05:18
@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: d148b41
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output; now both are replaced, each with its own credential tag. Text without glued credentials redacts exactly as before, and every other caller of the plain scan is unchanged.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential once the probe budget is spent (the rest of that non-space run is replaced), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. The new regression tests in test/test_credential_redaction_glued.py fail on the base code for every glued shape (tokens, JWT with long claims, AWS labels with and without spaces, Bearer header, link password, PEM block), and pass on this head; linear-time tests cover each adversarial input shape raised in review.
  • No regression:
    • Tools still work (which tools/commands were run, result): redaction is pure text processing; the stream redactor tests (test_stream_redactor_aws_keyed.py and the chat runner save-time tests) pass, so streamed and saved replies keep their pinned behaviour.
    • Backward compatible (old config / old data / old callers still work, how checked): no config or stored data format changes; deploy scan, design-tweak preview and stream cut points call the plain scan without glued=True and see the same matches, checked by their existing tests passing.
    • Existing tests (which suites passed on this head): the credential prefilter, PEM linearity, regex linearity, facade mirror, security gate liveness, redaction notice and all test_security*.py suites (6,427 passed locally), plus isort, flake8, mypy, black (py310 target), semgrep and docs lint.
  • How to undo: revert the single commit; the plain scan path is untouched, so pass 1 returns to its previous behaviour with no data migration.

@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 Oct 23, 2026
@JLargent42

Copy link
Copy Markdown
Contributor Author
  • fixed: span=712f553b6342 a spaced AWS label glued after a token

Fixed in d148b41: the space exception now applies only when the outer match is itself an AWS field value, so a token whose body took the field name no longer makes that field value text.
Regression test test_a_spaced_aws_label_glued_after_a_token_redacts covers " : ", tab-equals and " =" separators; the pinned stream case that keeps a swallowed field name visible still passes.

@JLargent42

Copy link
Copy Markdown
Contributor Author
  • fixed: span=96812b7b6cc9 a glued JWT whose claims run past the search window

Fixed in d148b41: an eyJ start inside the match is a candidate on its own, independent of the windowed search, and its probe reads the JWT whole rather than through the window.
Regression test test_a_glued_jwt_whose_payload_runs_past_the_window_redacts uses a JWT with a long claims payload; test_scan_stays_linear_on_many_eyj_starts_inside_spans bounds the added probes.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 6833d9b
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output; now both are replaced, each with its own credential tag. Text without glued credentials redacts exactly as before, and every other caller of the plain scan is unchanged.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential once the probe budget is spent (the rest of that non-space run is replaced), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. The new regression tests in test/test_credential_redaction_glued.py fail on the base code for every glued shape (tokens, JWT with long claims, AWS labels with and without spaces, Bearer header, link password, PEM block), and pass on this head; linear-time tests cover each adversarial input shape raised in review.
  • No regression:
    • Tools still work (which tools/commands were run, result): redaction is pure text processing; the stream redactor tests (test_stream_redactor_aws_keyed.py and the chat runner save-time tests) pass, so streamed and saved replies keep their pinned behaviour.
    • Backward compatible (old config / old data / old callers still work, how checked): no config or stored data format changes; deploy scan, design-tweak preview and stream cut points call the plain scan without glued=True and see the same matches, checked by their existing tests passing.
    • Existing tests (which suites passed on this head): the credential prefilter, PEM linearity, regex linearity, facade mirror, security gate liveness, redaction notice and all test_security*.py suites (6,428 passed locally), plus isort, flake8, mypy, black (py310 target), semgrep and docs lint.
  • How to undo: revert the single commit; the plain scan path is untouched, so pass 1 returns to its previous behaviour with no data migration.

@JLargent42
JLargent42 force-pushed the fix/redact-glued-credentials branch from d148b41 to 6833d9b Compare October 23, 2026 05:32
@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 Oct 23, 2026
@JLargent42
JLargent42 force-pushed the fix/redact-glued-credentials branch from 6833d9b to 660c991 Compare October 23, 2026 06:10
@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 660c991
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output; now both are replaced, each with its own credential tag. Text without glued credentials redacts exactly as before, and every other caller of the plain scan is unchanged.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential once the probe budget is spent (the rest of that non-space run is replaced), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. The new regression tests in test/test_credential_redaction_glued.py fail on the base code for every glued shape (tokens, JWT with long claims, AWS labels with and without spaces, Bearer header, link password, PEM block), and pass on this head; linear-time tests cover each adversarial input shape raised in review.
  • No regression:
    • Tools still work (which tools/commands were run, result): redaction is pure text processing; the stream redactor tests (test_stream_redactor_aws_keyed.py and the chat runner save-time tests) pass, so streamed and saved replies keep their pinned behaviour.
    • Backward compatible (old config / old data / old callers still work, how checked): no config or stored data format changes; deploy scan, design-tweak preview and stream cut points call the plain scan without glued=True and see the same matches, checked by their existing tests passing.
    • Existing tests (which suites passed on this head): the credential prefilter, PEM linearity, regex linearity, facade mirror, security gate liveness, redaction notice and all test_security*.py suites (6,431 passed locally), plus isort, flake8, mypy, black (py310 target), semgrep and docs lint.
  • How to undo: revert the single commit; the plain scan path is untouched, so pass 1 returns to its previous behaviour with no data migration.

@JLargent42

Copy link
Copy Markdown
Contributor Author
  • fixed: span=96812b7b6cc9 the probe-budget fallback consumed the next credential anchor

Fixed in 660c991: the fail-closed rest is redacted but no longer skipped, so the scan resumes inside it and a credential that starts there (a Bearer header after the glued run) is matched whole.
The rest is yielded once per run, keeping the scan linear, and a match wholly inside an already redacted span is skipped in the splice.
Regression tests test_a_credential_starting_inside_the_fail_closed_rest_still_redacts and test_scan_stays_linear_on_many_exhausted_matches_in_one_run.

@JLargent42

Copy link
Copy Markdown
Contributor Author
  • fixed: span=712f553b6342 a large JWT with many inner eyJ runs spent the probe budget

Fixed in 6833d9b: only the first eyJ of a segment run is probed, so a large ordinary token no longer exhausts the budget and the text glued after it stays readable.
Regression test test_a_large_jwt_with_many_inner_eyj_runs_keeps_the_text_after_it; the Opus lane passed on 6833d9b.

@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention labels Oct 23, 2026
@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 50a0b6b
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them. This head is rebased onto main f33f25b and fixes the Opus 5.5 finding on 78e22a8: when a glued hit is rejected by _validated_match (a JWT-shaped hit whose header is not JSON, or the CDK ARN case), the retry now uses copies of the glued pattern (_CREDENTIAL_PATTERNS_GLUED_SANS_JWT / _SANS_TELEGRAM, built by the same one-branch string removal as the plain copies), so a link token glued after another credential and followed by . keeps its start guard dropped and redacts whole. Both copies are listed in the redaction facade manifest. The plain scan and every caller that does not pass glued=True are unchanged.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output, and on 78e22a8 a glued link token followed by . still kept its secret segment; now both credentials are replaced, each with its own tag. Text without glued credentials redacts as before, including main's CDK ARN exemption. The package line budget is the true count, 34,320 (33,959 on main plus 361).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential once the probe budget is spent (the rest of that non-space run is replaced), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. test_a_glued_link_token_followed_by_a_dot_redacts_whole (probed and abutting cases) in test/test_credential_redaction_glued.py fails on 78e22a8 and passes on this head.
  • No regression:
    • Tools still work (which tools/commands were run, result): black, isort and flake8 on the changed files are clean; scripts/check_comment_history.py (base f33f25b) and scripts/check_file_line_cap.py pass.
    • Backward compatible (old config / old data / old callers still work, how checked): _credential_matches and _validated_match keep their signatures (glued is keyword-only and defaults to False); test_redaction_facade.py, test_redaction_mirror_parity.py and test_facade_mirror_guards.py pass.
    • Existing tests (which suites passed on this head): 1,022 tests in 14 files pass locally at -n 2: test_facade_mirror_guards, test_credential_redaction_glued, test_security_gate_liveness, test_security_regex_linearity, test_credential_prefilter, test_chat_runner_coverage, test_credential_patterns, test_redaction_facade, test_redaction_mirror_parity, test_redaction_composed_pass, test_log_redaction, test_arn_redaction, test_redaction_jwt_scan_linear and test_redaction_pem_scan_linear.
  • How to undo: revert this PR's single commit; pass 1 goes back to the plain scan with main's JWT and ARN rejections.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Opus 5.5 finding on 50a0b6b (redaction_patterns.py:729, an AWS field name glued onto the end of another AWS value, separator after a space): confirmed, and it needs a maintainer decision before a push.

  • Reproduced on 50a0b6b: aws_access_key_id=AKIAIOSFODNN7EXAMPLEaws_session_token = <value> keeps <value>. Main f33f25b keeps it too, so this is a glued gap main already has, not one this PR opens.
  • Dropping the clause (and the now-unused _AWS_SEPARATOR_RE) redacts it: [REDACTED: credential][REDACTED: credential]. A regression test for " = ", " =" and " : " fails 3 of 3 on 50a0b6b and passes with the change.
  • The conflict: main's test_stream_redactor_aws_keyed.py::test_a_key_name_ending_a_long_value_leaves_no_label_open (fix(security): hold a streamed AWS key-value pair past the 512 floor #21573) pins the other reading. SessionToken=<long value>AccessKeyId then : visible text must keep : visible text, and the stream output must equal the batch output. With the clause dropped, batch redacts visible and the stream, which has already released the head past its ceiling, keeps it, so that test fails. The two inputs have the same shape, so no plain check tells them apart.
  • Options: (a) drop the clause and change the fix(security): hold a streamed AWS key-value pair past the 512 floor #21573 test so a value released past the ceiling may keep a word the batch pass redacts (stream keeps main's behaviour there, batch redacts more); (b) also hold a trailing field name in the stream so both redact, which reverses the fix(security): hold a streamed AWS key-value pair past the 512 floor #21573 rule; (c) keep the clause and leave this shape as main has it, tracked separately.

The change is ready locally and is not pushed, so the head stays 50a0b6b.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: b0b6160
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them. This head applies the owner's decision (a) on the Opus 5.5 finding on 50a0b6b: the clause that kept an AWS field name glued onto the end of an AWS value as part of that value when its separator followed a space is removed, together with the now-unused _AWS_SEPARATOR_RE, so aws_access_key_id=AKIA...aws_session_token = <value> redacts <value>. It is rebased onto main 03dc8a1 with no conflicts.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output, and on 50a0b6b an AWS field glued after an AWS value with a spaced separator kept its value; now both are replaced, each with its own tag. One shape redacts more than main: SessionToken=<long value>AccessKeyId : visible text loses the word after the colon in the batch pass. Text without glued credentials redacts as before, including main's CDK ARN exemption. The package line budget is the true count, 34,863; main has not changed the security package since that was measured.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential (a word after a field-name-shaped suffix, or the rest of a non-space run once the probe budget is spent), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. The glued-AWS regression test in test/test_credential_redaction_glued.py (" = ", " =", " : ") fails 3 of 3 on 50a0b6b and passes on this head. test/test_stream_redactor_aws_keyed.py::test_a_key_name_ending_a_long_value_leaves_no_label_open now asserts that neither the batch nor the stream output leaks the value and that the text after the redacted word survives.
  • No regression:
    • Tools still work (which tools/commands were run, result): black (--target-version py310), isort and flake8 on the changed files are clean; scripts/check_comment_history.py with COMMENT_HISTORY_BASE_REF=origin/main passes.
    • Backward compatible (old config / old data / old callers still work, how checked): _credential_matches and _validated_match keep their signatures (glued is keyword-only and defaults to False), so the deploy scan, design-tweak preview and stream cut points are unchanged.
    • Existing tests (which suites passed on this head): 1,015 tests pass locally at -n 2 across test_credential_redaction_glued, test_stream_redactor_aws_keyed, test_credential_prefilter, test_chat_runner_coverage, test_security_regex_linearity, test_facade_mirror_guards and test_security_gate_liveness.
  • How to undo: revert this PR's single commit; pass 1 goes back to the plain scan with main's JWT and ARN rejections.

@JLargent42

Copy link
Copy Markdown
Contributor Author
  • fixed: src/kiro_crew/security/redaction_patterns.py:729 an AWS field name glued onto the end of another AWS value, separator after a space

    Fixed in b0b6160 by the owner's decision (largjaco, option (a) of the earlier comment): the clause that kept such a field name as part of the previous value is removed, with the now-unused _AWS_SEPARATOR_RE. aws_access_key_id=AKIAIOSFODNN7EXAMPLEaws_session_token = <value> now redacts to [REDACTED: credential][REDACTED: credential].
    The new regression test in test/test_credential_redaction_glued.py covers " = ", " =" and " : "; it fails 3 of 3 on 50a0b6b and passes on this head.
    As decided, main's test_stream_redactor_aws_keyed.py::test_a_key_name_ending_a_long_value_leaves_no_label_open is relaxed: SessionToken=<long value>AccessKeyId : visible text no longer has to keep visible. It now asserts that neither the batch nor the stream output leaks the value and that the text after that word survives. The PR body's Backwards compatibility section states the change.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD for human security review at b0b61607f1b1df58d2e72ecc6cde90958ab04a9f (policy: credential redaction).

This PR changes what the credential redactor removes. Pass 1 now also redacts a credential glued to the one before it, clipping each overlap so spans stay disjoint (redaction.py#L1081-L1099), and the glued scan fails toward redacting the rest of a run once its probe budget is spent (redaction_patterns.py#L639-L762). This head also applies the owner's option (a): the spaced-separator AWS clause is gone, and main's #21573 stream test is relaxed so batch may redact one word the stream keeps. Our review policy reserves changes like this for a maintainer.

I found no concrete defect. Callers that do not pass glued=True keep main's scan. The frontend mirror gap is tracked in #28366. All current-head lanes pass, checks are green and the branch merges cleanly. Our r138 change request at 13061b1 is resolved and can be dismissed.

AI findings judged non-blocking:

— crew-pr-reviewer (r146)

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 87201f4
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them. An AWS field name glued onto the end of an AWS value with its separator after a space is probed as a field of its own, so aws_access_key_id=AKIA...aws_session_token = <value> redacts <value>. This head is the previous head b0b6160 rebased onto main 4b820ae. The only conflict was the security package line budget in test/test_security_gate_liveness.py, where main had raised it by one for the Railway consent host; both notes are kept and the budget is set to the re-measured total.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output; now both are replaced, each with its own tag. One shape redacts more than main: SessionToken=<long value>AccessKeyId : visible text loses the word after the colon in the batch pass. Text without glued credentials redacts as before, including main's CDK ARN exemption. The package line budget is the true count after the rebase, 34,721 (main is 34,376; this change adds 345).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential (a word after a field-name-shaped suffix, or the rest of a non-space run once the probe budget is spent), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. The production files and tests are unchanged by the rebase: git range-diff of b0b6160 against this head differs only in the line-budget note and number. The glued-credential tests in test/test_credential_redaction_glued.py pass on this head.
  • No regression:
    • Tools still work (which tools/commands were run, result): black, isort and flake8 on the changed files are clean; scripts/check_comment_history.py with COMMENT_HISTORY_BASE_REF=origin/main passes.
    • Backward compatible (old config / old data / old callers still work, how checked): _credential_matches and _validated_match keep their signatures (glued is keyword-only and defaults to False), so the deploy scan, design-tweak preview and stream cut points are unchanged.
    • Existing tests (which suites passed on this head): 1,186 tests pass locally at -n 2 across test_credential_redaction_glued, test_stream_redactor_aws_keyed, test_credential_prefilter, test_chat_runner_coverage, test_security_regex_linearity, test_arn_redaction, test_link_token_dot_boundary, test_log_redaction, test_facade_mirror_guards and test_security_gate_liveness.
  • How to undo: revert this PR's single commit; pass 1 goes back to the plain scan with main's JWT and ARN rejections.

@JLargent42

Copy link
Copy Markdown
Contributor Author

CI note for head 87201f4: Backend Lint & Type Check (3.12) fails on src/kiro_crew/apps/routes_registry.py:239 and :376 (F821 undefined name was_installed). This PR does not touch that file. The same error is on main: the CI workflow failed on main 4b820ae and 142d40e, and #30762 / #30764 are open to fix it. Coverage Gate fails closed because lint failed, so no tests were measured. A re-run reuses the same merge commit and cannot clear this. Once the main fix merges, this PR needs a rebase onto it to go green; the diff itself needs no change.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: f74ea1d
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them. An AWS field name glued onto the end of an AWS value with its separator after a space is probed as a field of its own, so aws_access_key_id=AKIA...aws_session_token = <value> redacts <value>. This head is the previous head b0b6160 rebased onto main 4b820ae. The only conflict was the security package line budget in test/test_security_gate_liveness.py, where main had raised it by one for the Railway consent host; both notes are kept and the budget is set to the re-measured total. This head also fixes the GPT 6.1 finding on 87201f4 (redaction_patterns.py:712): an eyJ right after a . (a SendGrid or Discord last segment) no longer marks its whole segment run as probed, because the link token's dot-boundary guard can reject it while the run's next eyJ, a glued link token's real start, is not guarded. That next eyJ is now probed and stands for the rest of the run.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output; now both are replaced, each with its own tag. One shape redacts more than main: SessionToken=<long value>AccessKeyId : visible text loses the word after the colon in the batch pass. Text without glued credentials redacts as before, including main's CDK ARN exemption. A link token glued after a dot-guarded eyJ segment now redacts whole; before this head its 43-character signature stayed visible. The package line budget is the true count, 34,725 (main is 34,376; this change adds 349).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential (a word after a field-name-shaped suffix, or the rest of a non-space run once the probe budget is spent), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. The production files and tests are unchanged by the rebase: git range-diff of b0b6160 against this head differs only in the line-budget note and number. The new test_a_link_token_glued_after_a_dot_guarded_eyj_segment_redacts_whole fails on 87201f4 for the SendGrid and Discord prefixes (the signature leaks) and passes on this head, with a JWE-tail case as extra coverage; test_scan_stays_linear_on_many_dot_guarded_eyj_runs keeps 20,000 dotted eyJ runs linear.
  • No regression:
    • Tools still work (which tools/commands were run, result): black, isort and flake8 on the changed files are clean; scripts/check_comment_history.py with COMMENT_HISTORY_BASE_REF=origin/main passes.
    • Backward compatible (old config / old data / old callers still work, how checked): _credential_matches and _validated_match keep their signatures (glued is keyword-only and defaults to False), so the deploy scan, design-tweak preview and stream cut points are unchanged.
    • Existing tests (which suites passed on this head): 1,190 tests pass locally at -n 2 across test_credential_redaction_glued, test_stream_redactor_aws_keyed, test_credential_prefilter, test_chat_runner_coverage, test_security_regex_linearity, test_arn_redaction, test_link_token_dot_boundary, test_log_redaction, test_facade_mirror_guards and test_security_gate_liveness.
  • How to undo: revert this PR's single commit; pass 1 goes back to the plain scan with main's JWT and ARN rejections.

@JLargent42

Copy link
Copy Markdown
Contributor Author

CI note for head f74ea1d (also applies to 87201f4): Backend Lint & Type Check (3.12) fails on src/kiro_crew/apps/routes_registry.py:239 and :376 (F821 undefined name was_installed). This PR does not touch that file. The same error is on main: the CI workflow failed on main 4b820ae and 142d40e, and #30762 / #30764 are open to fix it. Coverage Gate fails closed because lint failed, so no tests were measured. A re-run reuses the same merge commit and cannot clear this. Once the main fix merges, this PR needs a rebase onto it to go green; the diff itself needs no change.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 7498c33
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them. An AWS field name glued onto the end of an AWS value with its separator after a space is probed as a field of its own, so aws_access_key_id=AKIA...aws_session_token = <value> redacts <value>. An eyJ right after a . (a SendGrid or Discord last segment) does not mark its whole segment run as probed, because the link token's dot-boundary guard can reject it while the run's next eyJ, a glued link token's real start, is not guarded; that next eyJ is probed and stands for the rest of the run. This head is f74ea1d rebased onto main ccf5db7 with no conflicts, to pick up main's was_installed lint fix (fix(apps): read was_installed again before a registry install #30762). Main grew the security package by 44 lines in that time (shell_normalizer_walk.py), so the package line budget is re-measured.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output; now both are replaced, each with its own tag. One shape redacts more than main: SessionToken=<long value>AccessKeyId : visible text loses the word after the colon in the batch pass. Text without glued credentials redacts as before, including main's CDK ARN exemption. A link token glued after a dot-guarded eyJ segment redacts whole. The package line budget is the true count, 34,769 (main is 34,420; this change adds 349).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential (a word after a field-name-shaped suffix, or the rest of a non-space run once the probe budget is spent), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. The rebase did not change the patch: git patch-id --stable of f74ea1d and the rebased commit match, and the only later edit is the line-budget note and number. test_a_link_token_glued_after_a_dot_guarded_eyj_segment_redacts_whole fails on 87201f4 for the SendGrid and Discord prefixes and passes on this head; test_scan_stays_linear_on_many_dot_guarded_eyj_runs keeps 20,000 dotted eyJ runs linear.
  • No regression:
    • Tools still work (which tools/commands were run, result): black, isort and flake8 on the changed files (and flake8 on src/kiro_crew/apps/routes_registry.py) are clean; scripts/check_comment_history.py with COMMENT_HISTORY_BASE_REF=origin/main passes.
    • Backward compatible (old config / old data / old callers still work, how checked): _credential_matches and _validated_match keep their signatures (glued is keyword-only and defaults to False), so the deploy scan, design-tweak preview and stream cut points are unchanged.
    • Existing tests (which suites passed on this head): 1,190 tests pass locally at -n 2 across test_credential_redaction_glued, test_stream_redactor_aws_keyed, test_credential_prefilter, test_chat_runner_coverage, test_security_regex_linearity, test_arn_redaction, test_link_token_dot_boundary, test_log_redaction, test_facade_mirror_guards and test_security_gate_liveness.
  • How to undo: revert this PR's single commit; pass 1 goes back to the plain scan with main's JWT and ARN rejections.

@JLargent42

Copy link
Copy Markdown
Contributor Author

@iamwhatever the three points in your change request at 13061b1 are addressed on head 7498c33:

  • Frontend mirror follow-up: Frontend credential sanitizer keeps most of a second token glued to the first #28366 is open and linked under Not a goal in the description.
  • Rebase: the branch is rebased onto main ccf5db7; the package line budget in test/test_security_gate_liveness.py keeps main's notes and is set to the measured 34,769.
  • Wording: Backwards compatibility no longer says "byte-for-byte as before"; it says text without glued credentials redacts as before and names the case that can redact more than main.

Could you re-review?

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 4fabc6c
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them. An AWS field name glued onto the end of an AWS value with its separator after a space is probed as a field of its own, so aws_access_key_id=AKIA...aws_session_token = <value> redacts <value>. An eyJ right after a . (a SendGrid or Discord last segment) does not mark its whole segment run as probed; the run's next eyJ, a glued link token's real start, is probed instead. This head is 7498c33 rebased onto main 38a8ef5 because the PR was DIRTY. The only conflict was the package line budget in test/test_security_gate_liveness.py: main's notes are kept and the budget is re-measured.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output; now both are replaced, each with its own tag. One shape redacts more than main: SessionToken=<long value>AccessKeyId : visible text loses the word after the colon in the batch pass. Text without glued credentials redacts as before, including main's CDK ARN exemption. The package line budget is the true count, 35,082 (main is 34,733; this change adds the same 349 lines as before the rebase).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential (a word after a field-name-shaped suffix, or the rest of a non-space run once the probe budget is spent), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. The rebase did not change the patch outside the conflict: per-file git patch-id --stable of 7498c33 and 4fabc6c match for all eight other files, and test/test_security_gate_liveness.py differs only in the budget note's two numbers (34,769 -> 35,082, main's 34,420 -> 34,733) and the budget constant.
  • No regression:
    • Tools still work (which tools/commands were run, result): black and isort on the changed files are clean, scripts/check_black_formatting.py passes, flake8 is clean, and scripts/check_comment_history.py with COMMENT_HISTORY_BASE_REF=origin/main passes.
    • Backward compatible (old config / old data / old callers still work, how checked): _credential_matches and _validated_match keep their signatures (glued is keyword-only and defaults to False), so the deploy scan, design-tweak preview and stream cut points are unchanged.
    • Existing tests (which suites passed on this head): 1,019 tests pass locally at -n 2 across test_credential_redaction_glued, test_credential_prefilter, test_stream_redactor_aws_keyed, test_security_regex_linearity, test_chat_runner_coverage, test_facade_mirror_guards and test_security_gate_liveness.
  • How to undo: revert this PR's single commit; pass 1 goes back to the plain scan with main's JWT and ARN rejections.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 057a7c1
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them. An AWS field name glued onto the end of an AWS value with its separator after a space is probed as a field of its own, so aws_access_key_id=AKIA...aws_session_token = <value> redacts <value>. An eyJ right after a . (a SendGrid or Discord last segment) does not mark its whole segment run as probed; the run's next eyJ, a glued link token's real start, is probed instead. This head is 4fabc6c rebased onto main e6524c8 because the PR was DIRTY. The only conflict was the package line budget in test/test_security_gate_liveness.py: main's notes are kept and the budget is re-measured.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output; now both are replaced, each with its own tag. One shape redacts more than main: SessionToken=<long value>AccessKeyId : visible text loses the word after the colon in the batch pass. Text without glued credentials redacts as before, including main's CDK ARN exemption. The package line budget is the true count, 35,126 (main is 34,777; this change adds the same 349 lines as before the rebase).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential (a word after a field-name-shaped suffix, or the rest of a non-space run once the probe budget is spent), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. The rebase did not change the patch outside the conflict: git patch-id --stable of 4fabc6c and 057a7c1 over every file except test/test_security_gate_liveness.py match, and that file differs only in the budget note's two numbers (35,102 -> 35,126, main's 34,753 -> 34,777), main's new note kept above it, and the budget constant.
  • No regression:
    • Tools still work (which tools/commands were run, result): black, isort and flake8 on the changed files are clean, and scripts/check_comment_history.py with COMMENT_HISTORY_BASE_REF=origin/main passes.
    • Backward compatible (old config / old data / old callers still work, how checked): _credential_matches and _validated_match keep their signatures (glued is keyword-only and defaults to False), so the deploy scan, design-tweak preview and stream cut points are unchanged.
    • Existing tests (which suites passed on this head): 1,019 tests pass locally at -n 2 across test_credential_redaction_glued, test_credential_prefilter, test_stream_redactor_aws_keyed, test_security_regex_linearity, test_chat_runner_coverage, test_facade_mirror_guards and test_security_gate_liveness.
  • How to undo: revert this PR's single commit; pass 1 goes back to the plain scan with main's JWT and ARN rejections.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: af76cd4
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them. An AWS field name glued onto the end of an AWS value with its separator after a space is probed as a field of its own, so aws_access_key_id=AKIA...aws_session_token = <value> redacts <value>. An eyJ right after a . (a SendGrid or Discord last segment) does not mark its whole segment run as probed; the run's next eyJ, a glued link token's real start, is probed instead. This head is 057a7c1 rebased onto main 73e3275 because the PR was DIRTY. Main's fix: keep the key when redacting an authorization bearer header #32367 (pass 1 keeps the Bearer header's bearer_prefix and redacts only the token) and fix: stop redacting hostnames that contain eyJ as a jwt #31997 (jwt_header.is_jwt_header) touch the same lines; both are kept, see Evidence.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output; now both are replaced, each with its own tag. A Bearer header keeps its Authorization: Bearer label as on main, so Authorization: Bearer <jwt> tail becomes Authorization: Bearer [REDACTED: credential] tail. A Bearer header glued straight after another credential keeps only the part of its label past that credential's span (ghp_...Authorization: Bearer <tok> becomes [REDACTED: credential]: Bearer [REDACTED: credential]). One shape redacts more than main: SessionToken=<long value>AccessKeyId : visible text loses the word after the colon in the batch pass. Text without glued credentials redacts as on main, including main's CDK ARN exemption. The package line budget is the true count, 35,496 (main is 35,146; this change adds 350 lines).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential (a word after a field-name-shaped suffix, or the rest of a non-space run once the probe budget is spent), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. Five files conflicted, and git range-diff of 057a7c1 against this head shows only these resolutions: (1) redaction._credential_redaction_plan starts each pass-1 span at the largest of the match start, the end of bearer_prefix (read only when the match's pattern has that group, since the glued scan also yields _RUN_REST_RE and other matches without it), and the end of the previous span; (2) the same expression in the reference oracle in test/test_credential_prefilter.py; (3) _validated_match calls main's is_jwt_header(header) in place of the PR's header.find("eyJ", 1) == -1 and not _is_json_object_segment(header), which main moved into that function; (4) the PR's paragraph in docs/system-specs/modules/security.md sits at the same anchor in main's rewritten Bearer bullet; (5) the line budget, main's notes kept. Two glued tests now expect main's kept Authorization: Bearer label in front of the tag, and one new test pins the glued-before-Bearer case.
  • No regression:
    • Tools still work (which tools/commands were run, result): black, isort and flake8 on the changed files are clean, and scripts/check_comment_history.py with COMMENT_HISTORY_BASE_REF=origin/main passes.
    • Backward compatible (old config / old data / old callers still work, how checked): _credential_matches and _validated_match keep their signatures (glued is keyword-only and defaults to False), so main's iter_credential_matches, the deploy scan, design-tweak preview and stream cut points still run the plain scan.
    • Existing tests (which suites passed on this head): 2,108 tests pass locally at -n 2 across 27 files, among them test_credential_redaction_glued, test_credential_prefilter, test_credential_prefilter_anchors, test_stream_redactor_aws_keyed, test_security_regex_linearity, test_chat_runner_coverage, test_agent_stream_tail, test_security, test_jwt_header, test_log_redaction, test_redaction_mirror_parity, test_display_redaction_prefix_snapshot, test_security_stream_redaction, test_split_credential_boundary and test_security_gate_liveness.
  • How to undo: revert this PR's single commit; pass 1 goes back to main's plain scan with its Bearer label kept and its JWT and ARN rejections.

@Zedmor

Zedmor commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Code change approver recommendation: A person should decide

Automated, not a person, and not a review: a maintainer still decides.

decider-v3c@217fe607 · p_defect 0.15 · router R0 (approves only when p_defect <= 0.12, on changes of at most 400 changed lines) · head af76cd404f · 1222 changed lines

Why: the decider approves but is not confident enough to auto-approve (p_defect 0.15 > 0.12).

Fixes the batch redactor so that when two credentials are written back to back, both are redacted whole. The glued scan is opt-in (glued=True) and only pass 1 of _credential_redaction_plan uses it. The other _credential_matches/iter_credential_matches callers (deploy scan, design-tweak preview, stream cut points, _contains_credential_pattern) keep the plain scan. The pass-1 splice clips each glued match to the previous span's end, so taken stays sorted and non-overlapping, and the record label is clipped to match. The glued pattern is built by string replacement, and both lookbehinds it removes exist verbatim in the source; the Discord and link-token tests would catch a replacement that did nothing. Every behaviour change errs toward redacting more: the fallback after 8 probes that extend nothing, tokens starting where a fixed-length key ends, and the #21573 reversal the owner approved. The relaxed stream test is not a new leak, because the stream keeps what main already kept. Extensive tests cover the new behaviour and linear time, and the spec is updated in the same commit. The only test failure in CI is a timing check on the unrelated shell self-module scan. The CodeQL

If this recommendation is wrong, reply here; the replies are how the approver is evaluated.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: bdaff84
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them. An AWS field name glued onto the end of an AWS value with its separator after a space is probed as a field of its own, so aws_access_key_id=AKIA...aws_session_token = <value> redacts <value>. An eyJ right after a . (a SendGrid or Discord last segment) does not mark its whole segment run as probed; the run's next eyJ, a glued link token's real start, is probed instead. This head is 057a7c1 rebased onto main 73e3275, then onto 166ee78 because the PR went DIRTY again (only the line budget conflicted the second time). Main's fix: keep the key when redacting an authorization bearer header #32367 (pass 1 keeps the Bearer header's bearer_prefix and redacts only the token) and fix: stop redacting hostnames that contain eyJ as a jwt #31997 (jwt_header.is_jwt_header) touch the same lines; both are kept, see Evidence.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output; now both are replaced, each with its own tag. A Bearer header keeps its Authorization: Bearer label as on main, so Authorization: Bearer <jwt> tail becomes Authorization: Bearer [REDACTED: credential] tail. A Bearer header glued straight after another credential keeps only the part of its label past that credential's span (ghp_...Authorization: Bearer <tok> becomes [REDACTED: credential]: Bearer [REDACTED: credential]). One shape redacts more than main: SessionToken=<long value>AccessKeyId : visible text loses the word after the colon in the batch pass. Text without glued credentials redacts as on main, including main's CDK ARN exemption. The package line budget is the true count, 35,510 (main is 35,160; this change adds 350 lines).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential (a word after a field-name-shaped suffix, or the rest of a non-space run once the probe budget is spent), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. Five files conflicted, and git range-diff of 057a7c1 against this head shows only these resolutions: (1) redaction._credential_redaction_plan starts each pass-1 span at the largest of the match start, the end of bearer_prefix (read only when the match's pattern has that group, since the glued scan also yields _RUN_REST_RE and other matches without it), and the end of the previous span; (2) the same expression in the reference oracle in test/test_credential_prefilter.py; (3) _validated_match calls main's is_jwt_header(header) in place of the PR's header.find("eyJ", 1) == -1 and not _is_json_object_segment(header), which main moved into that function; (4) the PR's paragraph in docs/system-specs/modules/security.md sits at the same anchor in main's rewritten Bearer bullet; (5) the line budget, main's notes kept. The second rebase (af76cd4 -> this head) changes only the budget note's base number and the constant, per git range-diff. Two glued tests now expect main's kept Authorization: Bearer label in front of the tag, and one new test pins the glued-before-Bearer case.
  • No regression:
    • Tools still work (which tools/commands were run, result): black, isort and flake8 on the changed files are clean, and scripts/check_comment_history.py with COMMENT_HISTORY_BASE_REF=origin/main passes.
    • Backward compatible (old config / old data / old callers still work, how checked): _credential_matches and _validated_match keep their signatures (glued is keyword-only and defaults to False), so main's iter_credential_matches, the deploy scan, design-tweak preview and stream cut points still run the plain scan.
    • Existing tests (which suites passed on this head): 2,108 tests pass locally at -n 2 across 27 files, among them test_credential_redaction_glued, test_credential_prefilter, test_credential_prefilter_anchors, test_stream_redactor_aws_keyed, test_security_regex_linearity, test_chat_runner_coverage, test_agent_stream_tail, test_security, test_jwt_header, test_log_redaction, test_redaction_mirror_parity, test_display_redaction_prefix_snapshot, test_security_stream_redaction, test_split_credential_boundary and test_security_gate_liveness.
  • How to undo: revert this PR's single commit; pass 1 goes back to main's plain scan with its Bearer label kept and its JWT and ARN rejections.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: c77c494
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them. An AWS field name glued onto the end of an AWS value with its separator after a space is probed as a field of its own, so aws_access_key_id=AKIA...aws_session_token = <value> redacts <value>. An eyJ right after a . (a SendGrid or Discord last segment) does not mark its whole segment run as probed; the run's next eyJ, a glued link token's real start, is probed instead. This head is 057a7c1 rebased onto main 73e3275, then onto 166ee78 and 5d9c274 because the PR went DIRTY again each time (the line budget, and on the last rebase the Bearer bullet in docs/system-specs/modules/security.md that main's fix(security): let Outlook's own webLink through the link guard #34034 edited). Main's fix: keep the key when redacting an authorization bearer header #32367 (pass 1 keeps the Bearer header's bearer_prefix and redacts only the token) and fix: stop redacting hostnames that contain eyJ as a jwt #31997 (jwt_header.is_jwt_header) touch the same lines; both are kept, see Evidence.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output; now both are replaced, each with its own tag. A Bearer header keeps its Authorization: Bearer label as on main, so Authorization: Bearer <jwt> tail becomes Authorization: Bearer [REDACTED: credential] tail. A Bearer header glued straight after another credential keeps only the part of its label past that credential's span (ghp_...Authorization: Bearer <tok> becomes [REDACTED: credential]: Bearer [REDACTED: credential]). One shape redacts more than main: SessionToken=<long value>AccessKeyId : visible text loses the word after the colon in the batch pass. Text without glued credentials redacts as on main, including main's CDK ARN exemption. The package line budget is the true count, 35,576 (main's code is 35,226 under its 35,227 budget; this change adds 350 lines).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential (a word after a field-name-shaped suffix, or the rest of a non-space run once the probe budget is spent), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. Five files conflicted, and git range-diff of 057a7c1 against this head shows only these resolutions: (1) redaction._credential_redaction_plan starts each pass-1 span at the largest of the match start, the end of bearer_prefix (read only when the match's pattern has that group, since the glued scan also yields _RUN_REST_RE and other matches without it), and the end of the previous span; (2) the same expression in the reference oracle in test/test_credential_prefilter.py; (3) _validated_match calls main's is_jwt_header(header) in place of the PR's header.find("eyJ", 1) == -1 and not _is_json_object_segment(header), which main moved into that function; (4) the PR's paragraph in docs/system-specs/modules/security.md sits at the same anchor in main's rewritten Bearer bullet; (5) the line budget, main's notes kept. The later rebases change only the budget note and constant and re-insert the same docs paragraph at the same anchor in main's bullet, per git range-diff; the docs line equals main's plus that paragraph. Two glued tests now expect main's kept Authorization: Bearer label in front of the tag, and one new test pins the glued-before-Bearer case.
  • No regression:
    • Tools still work (which tools/commands were run, result): black, isort and flake8 on the changed files are clean, and scripts/check_comment_history.py with COMMENT_HISTORY_BASE_REF=origin/main passes.
    • Backward compatible (old config / old data / old callers still work, how checked): _credential_matches and _validated_match keep their signatures (glued is keyword-only and defaults to False), so main's iter_credential_matches, the deploy scan, design-tweak preview and stream cut points still run the plain scan.
    • Existing tests (which suites passed on this head): 2,108 tests pass locally at -n 2 across 27 files, among them test_credential_redaction_glued, test_credential_prefilter, test_credential_prefilter_anchors, test_stream_redactor_aws_keyed, test_security_regex_linearity, test_chat_runner_coverage, test_agent_stream_tail, test_security, test_jwt_header, test_log_redaction, test_redaction_mirror_parity, test_display_redaction_prefix_snapshot, test_security_stream_redaction, test_split_credential_boundary and test_security_gate_liveness.
  • How to undo: revert this PR's single commit; pass 1 goes back to main's plain scan with its Bearer label kept and its JWT and ARN rejections.

@KiroCrewCaptain

KiroCrewCaptain commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider thinks the change is probably fine but estimates a 20% chance that this change introduces a defect, above the 12% limit for approving on its own.

The PR makes the batch redactor (pass 1) scan with _credential_matches(text, glued=True), so two credentials written back to back are both redacted whole. Credentials glued inside the previous match are trimmed to the part past it, which keeps spans in order and non-overlapping and redacts no fewer bytes than main. Only _pattern_pass uses the glued scan; the internal structured-detector path goes through it too, and all other callers (deploy scan, preview, stream cut points) see exactly main's matches. When the probe budget runs out, the rest of the run is redacted and the scan resumes inside it, so it fails closed. The stream side (_glued_key_tail) restores the strict out == redact(...) equality over five tails, which resolves the earlier blocking AI finding. The quadratic-scan finding from the earlier GPT review is addressed by a windowed spaced-start search plus 60 s timeout tests. The hand-written readers are tested against the regex spellings they replace. The security spec is updated, and every file stays under the 1,600-line cap. I found no concrete defect; the residual risk comes from the code's complexity in a security-critical path.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit 8f989f325b · 1713 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: b63bb3d
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them. An AWS field name glued onto the end of an AWS value with its separator after a space is probed as a field of its own, so aws_access_key_id=AKIA...aws_session_token = <value> redacts <value>. An eyJ right after a . (a SendGrid or Discord last segment) does not mark its whole segment run as probed; the run's next eyJ, a glued link token's real start, is probed instead. This head is 057a7c1 rebased onto main 73e3275, then onto 166ee78, 5d9c274, d80dd05 and 4de745e because the PR went DIRTY again each time (the line budget; the Bearer bullet in docs/system-specs/modules/security.md that main's fix(security): let Outlook's own webLink through the link guard #34034 edited; and main's feat(security): add structured credential detectors behind an internal switch #29369, which moved pass 1 into redaction._pattern_pass, where the glued splice now sits unchanged, with the test_security_regex_linearity source check pointing at that function). Main's fix: keep the key when redacting an authorization bearer header #32367 (pass 1 keeps the Bearer header's bearer_prefix and redacts only the token) and fix: stop redacting hostnames that contain eyJ as a jwt #31997 (jwt_header.is_jwt_header) touch the same lines; both are kept, see Evidence.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output; now both are replaced, each with its own tag. A Bearer header keeps its Authorization: Bearer label as on main, so Authorization: Bearer <jwt> tail becomes Authorization: Bearer [REDACTED: credential] tail. A Bearer header glued straight after another credential keeps only the part of its label past that credential's span (ghp_...Authorization: Bearer <tok> becomes [REDACTED: credential]: Bearer [REDACTED: credential]). One shape redacts more than main: SessionToken=<long value>AccessKeyId : visible text loses the word after the colon in the batch pass. Text without glued credentials redacts as on main, including main's CDK ARN exemption. The package line budget is the true count, 36,154 (main is 35,804; this change adds 350 lines).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential (a word after a field-name-shaped suffix, or the rest of a non-space run once the probe budget is spent), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. Five files conflicted, and git range-diff of 057a7c1 against this head shows only these resolutions: (1) redaction._credential_redaction_plan starts each pass-1 span at the largest of the match start, the end of bearer_prefix (read only when the match's pattern has that group, since the glued scan also yields _RUN_REST_RE and other matches without it), and the end of the previous span; (2) the same expression in the reference oracle in test/test_credential_prefilter.py; (3) _validated_match calls main's is_jwt_header(header) in place of the PR's header.find("eyJ", 1) == -1 and not _is_json_object_segment(header), which main moved into that function; (4) the PR's paragraph in docs/system-specs/modules/security.md sits at the same anchor in main's rewritten Bearer bullet; (5) the line budget, main's notes kept. The later rebases change only the budget note and constant and re-insert the same docs paragraph at the same anchor in main's bullet, per git range-diff; the docs line equals main's plus that paragraph. Two glued tests now expect main's kept Authorization: Bearer label in front of the tag, and one new test pins the glued-before-Bearer case.
  • No regression:
    • Tools still work (which tools/commands were run, result): black, isort and flake8 on the changed files are clean, and scripts/check_comment_history.py with COMMENT_HISTORY_BASE_REF=origin/main passes.
    • Backward compatible (old config / old data / old callers still work, how checked): _credential_matches and _validated_match keep their signatures (glued is keyword-only and defaults to False), so main's iter_credential_matches, the deploy scan, design-tweak preview and stream cut points still run the plain scan.
    • Existing tests (which suites passed on this head): 2,703 tests pass locally at -n 2 across 33 files, adding main's structured-detector suites (test_redaction_structured*, test_redaction_compat_property, test_stream_table_parity), among them test_credential_redaction_glued, test_credential_prefilter, test_credential_prefilter_anchors, test_stream_redactor_aws_keyed, test_security_regex_linearity, test_chat_runner_coverage, test_agent_stream_tail, test_security, test_jwt_header, test_log_redaction, test_redaction_mirror_parity, test_display_redaction_prefix_snapshot, test_security_stream_redaction, test_split_credential_boundary and test_security_gate_liveness.
  • How to undo: revert this PR's single commit; pass 1 goes back to main's plain scan with its Bearer label kept and its JWT and ARN rejections.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Design Review notes at b63bb3d (both non-blocking; the lane passed):

  • The seven-slot ends cache in _glued_matches: left as is, as answered at 69ec1a0 (issuecomment-6583465206). Each slot is named in the comment above ends = [...] in _credential_matches; moving them into a dataclass would touch every probe site without changing behaviour, so it fits a follow-up better than this fix.
  • Stream and batch output for SessionToken=<long value>AccessKeyId : visible text: the two can differ there, and the batch side redacts more. test_a_key_name_ending_a_long_value_leaves_no_label_open in test/test_stream_redactor_aws_keyed.py states this in its docstring and checks that neither output keeps the value, and the PR description's Backwards compatibility section names the case. A sentence in docs/system-specs/modules/security.md is not added in this head: a doc-only push would restart every lane on this sensitive path. I will add it if a reviewer wants it before merge.

@JLargent42

Copy link
Copy Markdown
Contributor Author

@iamwhatever your three points from the r138 change request at 13061b1, checked again on head b63bb3d:

CI is green on this head with readiness: passed, and the Security Scope Review passed. Could you re-review?

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Request changes at b63bb3d for one point.

The goal is right, and it isn't added strictness. Two credentials written back to back should both be redacted, not just the first. Redacting more of a secret is data safety, not a refusal, and callers that don't pass glued=True keep the old scan.

Please don't solve it with new regex. This repo doesn't take new regex in product code, and security/redaction_patterns.py adds 13 new compiled patterns that main doesn't have:

  • _CREDENTIAL_PATTERNS_GLUED, _CREDENTIAL_PATTERNS_GLUED_SANS_JWT and _CREDENTIAL_PATTERNS_GLUED_SANS_TELEGRAM
  • _AWS_LABEL_PREFIX_RE and _AWS_VALUE_RUN_RE
  • _BEARER_PREFIX_RE, _SPACED_START_RE, _URI_START_RE and _AUTHORITY_END_RE
  • _PEM_END_RE, _RUN_REST_RE, _TOKEN_CHAR_RE and _GUARD_CHAR_RE

_TELEGRAM_DIGITS_RE already exists on main, so moving it is fine. Most of the new ones are character-class or literal checks that plain code covers:

  • _TOKEN_CHAR_RE and _GUARD_CHAR_RE are single-character tests. Use a frozenset of allowed characters and ch in ALLOWED.
  • _RUN_REST_RE, _AWS_VALUE_RUN_RE and _AUTHORITY_END_RE find the end of a run. Use a small loop that scans until a character in a stop set (whitespace, ", ', ,, } or /).
  • _PEM_END_RE compiles pem_scan.END, the PEM end marker. Find that marker as a plain string with text.find(...), and check the label after it by hand.
  • _BEARER_PREFIX_RE, _AWS_LABEL_PREFIX_RE, _SPACED_START_RE and _URI_START_RE match known labels and schemes. Lower-case a bounded window and compare it with startswith against a tuple of literals, then skip the optional quote, : or =, and whitespace by hand.
  • The three _CREDENTIAL_PATTERNS_GLUED* variants: run the existing credential patterns as they are, and do the glued split in code at each match boundary, rather than compiling new alternations.

Existing patterns the PR doesn't add are out of scope. The tests in test_credential_redaction_glued.py should keep passing as written once the scanning is plain code.

This is a separate point from iamwhatever's open request (the follow-up issue for the frontend mirror). All 109 checks are green.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 9ae95d5
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them. An AWS field name glued onto the end of an AWS value with its separator after a space is probed as a field of its own, so aws_access_key_id=AKIA...aws_session_token = <value> redacts <value>. An eyJ right after a . (a SendGrid or Discord last segment) does not mark its whole segment run as probed; the run's next eyJ, a glued link token's real start, is probed instead. This head is 057a7c1 rebased onto main 73e3275, then onto 166ee78, 5d9c274, d80dd05, 4de745e and a5815c1 because the PR went DIRTY again each time (the line budget; the Bearer bullet in docs/system-specs/modules/security.md that main's fix(security): let Outlook's own webLink through the link guard #34034 edited; and main's feat(security): add structured credential detectors behind an internal switch #29369, which moved pass 1 into redaction._pattern_pass, where the glued splice now sits unchanged, with the test_security_regex_linearity source check pointing at that function). Main's fix: keep the key when redacting an authorization bearer header #32367 (pass 1 keeps the Bearer header's bearer_prefix and redacts only the token) and fix: stop redacting hostnames that contain eyJ as a jwt #31997 (jwt_header.is_jwt_header) touch the same lines; both are kept, see Evidence.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output; now both are replaced, each with its own tag. A Bearer header keeps its Authorization: Bearer label as on main, so Authorization: Bearer <jwt> tail becomes Authorization: Bearer [REDACTED: credential] tail. A Bearer header glued straight after another credential keeps only the part of its label past that credential's span (ghp_...Authorization: Bearer <tok> becomes [REDACTED: credential]: Bearer [REDACTED: credential]). One shape redacts more than main: SessionToken=<long value>AccessKeyId : visible text loses the word after the colon in the batch pass. Text without glued credentials redacts as on main, including main's CDK ARN exemption. The package line budget is the true count, 36,174 (main is 35,824; this change adds 350 lines).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential (a word after a field-name-shaped suffix, or the rest of a non-space run once the probe budget is spent), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. Five files conflicted, and git range-diff of 057a7c1 against this head shows only these resolutions: (1) redaction._credential_redaction_plan starts each pass-1 span at the largest of the match start, the end of bearer_prefix (read only when the match's pattern has that group, since the glued scan also yields _RUN_REST_RE and other matches without it), and the end of the previous span; (2) the same expression in the reference oracle in test/test_credential_prefilter.py; (3) _validated_match calls main's is_jwt_header(header) in place of the PR's header.find("eyJ", 1) == -1 and not _is_json_object_segment(header), which main moved into that function; (4) the PR's paragraph in docs/system-specs/modules/security.md sits at the same anchor in main's rewritten Bearer bullet; (5) the line budget, main's notes kept. The later rebases change only the budget note and constant and re-insert the same docs paragraph at the same anchor in main's bullet, per git range-diff; the docs line equals main's plus that paragraph. Two glued tests now expect main's kept Authorization: Bearer label in front of the tag, and one new test pins the glued-before-Bearer case.
  • No regression:
    • Tools still work (which tools/commands were run, result): black, isort and flake8 on the changed files are clean, and scripts/check_comment_history.py with COMMENT_HISTORY_BASE_REF=origin/main passes.
    • Backward compatible (old config / old data / old callers still work, how checked): _credential_matches and _validated_match keep their signatures (glued is keyword-only and defaults to False), so main's iter_credential_matches, the deploy scan, design-tweak preview and stream cut points still run the plain scan.
    • Existing tests (which suites passed on this head): 2,703 tests pass locally at -n 2 across 33 files, adding main's structured-detector suites (test_redaction_structured*, test_redaction_compat_property, test_stream_table_parity), among them test_credential_redaction_glued, test_credential_prefilter, test_credential_prefilter_anchors, test_stream_redactor_aws_keyed, test_security_regex_linearity, test_chat_runner_coverage, test_agent_stream_tail, test_security, test_jwt_header, test_log_redaction, test_redaction_mirror_parity, test_display_redaction_prefix_snapshot, test_security_stream_redaction, test_split_credential_boundary and test_security_gate_liveness.
  • How to undo: revert this PR's single commit; pass 1 goes back to main's plain scan with its Bearer label kept and its JWT and ARN rejections.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: ab12860
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them. An AWS field name glued onto the end of an AWS value with its separator after a space is probed as a field of its own, so aws_access_key_id=AKIA...aws_session_token = <value> redacts <value>. An eyJ right after a . (a SendGrid or Discord last segment) does not mark its whole segment run as probed; the run's next eyJ, a glued link token's real start, is probed instead. This head is 057a7c1 rebased onto main 73e3275, then onto 166ee78, 5d9c274, d80dd05, 4de745e and a5815c1 because the PR went DIRTY again each time, then once more cleanly onto b7a4e1e to pick up main's harness-table fix for test_reply_format_once (the previous head's only red check, not this change's code); git patch-id --stable is identical across that last rebase (the line budget; the Bearer bullet in docs/system-specs/modules/security.md that main's fix(security): let Outlook's own webLink through the link guard #34034 edited; and main's feat(security): add structured credential detectors behind an internal switch #29369, which moved pass 1 into redaction._pattern_pass, where the glued splice now sits unchanged, with the test_security_regex_linearity source check pointing at that function). Main's fix: keep the key when redacting an authorization bearer header #32367 (pass 1 keeps the Bearer header's bearer_prefix and redacts only the token) and fix: stop redacting hostnames that contain eyJ as a jwt #31997 (jwt_header.is_jwt_header) touch the same lines; both are kept, see Evidence.
  • Before -> after (what was allowed/blocked, now): before, the second of two glued credentials kept most of its body in the output; now both are replaced, each with its own tag. A Bearer header keeps its Authorization: Bearer label as on main, so Authorization: Bearer <jwt> tail becomes Authorization: Bearer [REDACTED: credential] tail. A Bearer header glued straight after another credential keeps only the part of its label past that credential's span (ghp_...Authorization: Bearer <tok> becomes [REDACTED: credential]: Bearer [REDACTED: credential]). One shape redacts more than main: SessionToken=<long value>AccessKeyId : visible text loses the word after the colon in the batch pass. Text without glued credentials redacts as on main, including main's CDK ARN exemption. The package line budget is the true count, 36,174 (main is 35,824; this change adds 350 lines).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): over-redaction of readable text glued to a credential (a word after a field-name-shaped suffix, or the rest of a non-space run once the probe budget is spent), or a glued credential shape not covered still leaving part of its body visible as it did before this change. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. Five files conflicted, and git range-diff of 057a7c1 against this head shows only these resolutions: (1) redaction._credential_redaction_plan starts each pass-1 span at the largest of the match start, the end of bearer_prefix (read only when the match's pattern has that group, since the glued scan also yields _RUN_REST_RE and other matches without it), and the end of the previous span; (2) the same expression in the reference oracle in test/test_credential_prefilter.py; (3) _validated_match calls main's is_jwt_header(header) in place of the PR's header.find("eyJ", 1) == -1 and not _is_json_object_segment(header), which main moved into that function; (4) the PR's paragraph in docs/system-specs/modules/security.md sits at the same anchor in main's rewritten Bearer bullet; (5) the line budget, main's notes kept. The later rebases change only the budget note and constant and re-insert the same docs paragraph at the same anchor in main's bullet, per git range-diff; the docs line equals main's plus that paragraph. Two glued tests now expect main's kept Authorization: Bearer label in front of the tag, and one new test pins the glued-before-Bearer case.
  • No regression:
    • Tools still work (which tools/commands were run, result): black, isort and flake8 on the changed files are clean, and scripts/check_comment_history.py with COMMENT_HISTORY_BASE_REF=origin/main passes.
    • Backward compatible (old config / old data / old callers still work, how checked): _credential_matches and _validated_match keep their signatures (glued is keyword-only and defaults to False), so main's iter_credential_matches, the deploy scan, design-tweak preview and stream cut points still run the plain scan.
    • Existing tests (which suites passed on this head): 2,791 tests pass locally at -n 2 across 34 files (test_reply_format_once included), adding main's structured-detector suites (test_redaction_structured*, test_redaction_compat_property, test_stream_table_parity), among them test_credential_redaction_glued, test_credential_prefilter, test_credential_prefilter_anchors, test_stream_redactor_aws_keyed, test_security_regex_linearity, test_chat_runner_coverage, test_agent_stream_tail, test_security, test_jwt_header, test_log_redaction, test_redaction_mirror_parity, test_display_redaction_prefix_snapshot, test_security_stream_redaction, test_split_credential_boundary and test_security_gate_liveness.
  • How to undo: revert this PR's single commit; pass 1 goes back to main's plain scan with its Bearer label kept and its JWT and ARN rejections.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 164a5d6
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back with nothing between them. Behaviour is the same as the previous head ab12860. This head answers bolichen97's review 5883359647: the 13 regexes the glued scan added are gone, and src/kiro_crew/security/redaction_patterns.py gains no re.compile and no re.* call (git diff origin/main -- src adds 0). The scan runs the existing _CREDENTIAL_PATTERNS and reads the rest in plain code: field names, URI schemes and the PEM END marker as string literals, separators and value runs by a small loop, token and guard characters as frozensets, and Authorization through the pre-filter's existing (?i:…) anchors so its case folding stays the engine's. In place of the three glued pattern copies, a Discord or link-token start glued behind a token character is matched on a slice of at most five segment runs, where those branches' start lookbehinds see nothing. Rebased onto main 51349e1 (the PR was DIRTY); the only conflict was the line budget note, and main's notes are kept.
  • Before -> after (what was allowed/blocked, now): unchanged from ab12860. Before, the second of two glued credentials kept most of its body in the output; now both are replaced, each with its own tag. A Bearer header keeps its Authorization: Bearer label as on main. Text without glued credentials redacts as on main. The package line budget is the true count, 36,486 (main is 35,901; this change adds 585 lines, 235 more than the regex version, because the readers are now plain code).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): a plain-code reader that disagrees with the regex it replaced would probe a glued credential at the wrong place, leaving part of its body visible as before this PR, or would redact readable text glued to a credential. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. The new test/test_credential_glued_plain_readers.py keeps each replaced spelling only in the test, as an oracle, and checks every reader against it at every position of a seeded random corpus of the pieces those spellings care about: _aws_label_end, _bearer_prefix_end, _uri_scheme_end, _pem_end_at and _run_end per position; _find_spaced_start, _find_uri_start and _find_pem_end per random window; and _glued_match and _find_glued_discord_start against the old glued pattern copies, asserting the corpus reaches the sliced path and finds Discord starts. A last check over every code point shows str.lower and re.IGNORECASE fold the same characters onto each letter of Bearer, the one word read by str.lower. All 694 lines of test/test_credential_redaction_glued.py pass unchanged except test_the_start_lookahead_covers_every_start_literal, which read the removed patterns' text and now reads the literal tuples.
  • No regression:
    • Tools still work (which tools/commands were run, result): black, isort and flake8 on the changed files are clean, mypy on src/kiro_crew/security/ is clean, scripts/check_comment_history.py with COMMENT_HISTORY_BASE_REF=origin/main passes, and diff_signals.py --check-body passes.
    • Backward compatible (old config / old data / old callers still work, how checked): _credential_matches, _validated_match and iter_credential_matches keep their signatures; without glued=True every hit is still a plain re.Match, so the deploy scan, design-tweak preview and stream cut points run the plain scan as before.
    • Existing tests (which suites passed on this head): locally at -n 2, 8,245 tests across the redaction, credential, security and chat-runner suites pass, and 16,386 across the 199 test files that touch the facade manifest, _EXPORTS, iter_credential_matches or redaction_patterns pass too, including test_security_gate_liveness (budget), test_security_regex_linearity and every linear-time check in test_credential_redaction_glued.
  • How to undo: revert this PR's single commit; pass 1 goes back to main's plain scan with its Bearer label kept and its JWT and ARN rejections.

@JLargent42

Copy link
Copy Markdown
Contributor Author

@bolichen97 your review 5883359647 at b63bb3d is addressed on head 164a5d6 (rebased onto main 51349e1). src/kiro_crew/security/redaction_patterns.py now adds no re.compile and no re.* call; git diff origin/main -- src adds 0. Each pattern you listed:

  • _TOKEN_CHAR_RE, _GUARD_CHAR_RE: frozensets _TOKEN_CHARS / _GUARD_CHARS, tested with ch in.
  • _RUN_REST_RE, _AWS_VALUE_RUN_RE, _AUTHORITY_END_RE: one loop, _run_end(text, pos, stops), which scans to whitespace or a stop character ("',} for the AWS value, / for the authority, none for the rest). The fail-closed rest is yielded as a small _Span with no match.
  • _PEM_END_RE: _pem_end_at / _find_pem_end find -----END with str.find and check the [A-Z ]*PRIVATE KEY----- label by hand.
  • _AWS_LABEL_PREFIX_RE, _URI_START_RE, _SPACED_START_RE: startswith / find over literal tuples (_AWS_LABELS, _URI_SCHEMES, _SPACED_STARTS), with the optional quote, :/= and whitespace skipped by hand in _separator_end.
  • _BEARER_PREFIX_RE: _bearer_prefix_end. I didn't lower-case a window for Authorization, because the note above _CREDENTIAL_PREFILTER_AUTHORIZATION_RE records that str.lower and re.IGNORECASE disagree on ı/İ there. It goes through those existing anchors instead, so the folding stays the engine's. Bearer is compared lowered, which is safe because no letter in it has such a case.
  • _CREDENTIAL_PATTERNS_GLUED*: gone. The scan runs _CREDENTIAL_PATTERNS (and its existing sans-JWT copy) as they are. Only a start at M/N/O/eyJ behind a token character goes through _glued_match, which matches it on a slice of at most five segment runs so the Discord and link-token start lookbehinds see nothing. Those glued Discord starts are found from the existing _CREDENTIAL_PREFILTER_DISCORD_RE anchor.

test/test_credential_redaction_glued.py passes as written, except test_the_start_lookahead_covers_every_start_literal, which parsed the removed patterns' text and now reads the literal tuples. The new test/test_credential_glued_plain_readers.py keeps the old spellings only as test oracles and checks every reader against them over a seeded random corpus, plus the Bearer fold over every code point. Plain code costs 235 more lines than the regex version, so the security package budget is now 36,486 (main 35,901 + 585). SCR for this head: issuecomment-6849647475.

@bolichen97

Copy link
Copy Markdown
Contributor

Following up on 164a5d6. The regex point from my request-changes is fixed: the 13 compiled patterns are gone, and every pattern still used is one main already has. Two of the lane findings hold up in the code, and one of them comes from the string rewrite I asked for, so here is how I'd fix each without regex.

1. GPT 6.1: quadratic scan after the probe budget runs out. It holds, and the rewrite caused it.
redaction_patterns.py, _glued_matches:

start = _find_spaced_start(text, pos, min(len(text), end + _START_LOOKAHEAD))

_find_spaced_start runs one text.find per entry of _SPACED_STARTS, plus _find_authorization, each to end + _START_LOOKAHEAD, and then pos = start + 1. With one label repeated (say aws_secret_access_key 16,000 times), that label's find returns at once, but the other labels' finds scan to the end of the span on every step. That makes it O(n²). The old _SPACED_START_RE.search stopped at the first alternative it hit, so it didn't have this cost.
Fix, no regex: give each literal its own cached next hit, as ends already does for PEM. Keep a small dict {literal: next_index} across the loop. Re-run text.find(literal, pos, limit) for a literal only when pos has moved past its cached index, and take the minimum. Each literal's search then walks the span once, so the scan stays linear and finds the same leftmost start the regex did. Bounding the search to one _GLUED_WINDOW past pos and stepping window by window, as GPT suggests, works too.

2. Opus 5.5: stream and batch disagree, and the equality test was loosened. It holds, but the rewrite didn't cause it.
test/test_stream_redactor_aws_keyed.py, test_a_key_name_ending_a_long_value_leaves_no_label_open:

- assert out == redact(head + ": visible text")
+ assert out.endswith(" text") and batch.endswith(" text")

redact() now reads glued labels (_pattern_pass → _credential_matches(text, glued=True)), but StreamRedactor still cuts with the plain scan. So for SessionToken=<value>AccessKeyId : visible text, the batch redacts the word after AccessKeyId : and the stream keeps it. Live output and stored output then differ. Please keep the equality: have the stream's AWS-label cut read the same glued way, so it holds that label as an anchor, and restore out == redact(...). This one is about the glued feature itself, not the string matching.

3. Security Scope Review: no finding. Its posted verdict is PASS, with 0 candidates newly refused on any platform. It names the redaction surface as unadjudicated, which is expected for an output-redaction change. I see nothing to fix there.

No approval from me yet. I'll re-review once 1 and 2 are in and the lanes are green.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 8f989f3
  • What rule changed: pass 1 of the batch credential redactor now also redacts a credential that starts inside the previous match and runs past its end, as when two credentials are written back to back. The glued scan adds no regex: it runs the existing _CREDENTIAL_PATTERNS and reads the rest in plain code (review 5883359647, unchanged from 164a5d6). This head adds the two fixes from bolichen97's follow-up (issuecomment-6850467595), which match the GPT 6.1 and Opus 5.5 blocking findings on 164a5d6. (1) After the probe budget is spent, _glued_matches searches spaced starts one _GLUED_WINDOW at a time instead of to the span's end, so a label repeated through a long span is linear again. (2) The stream redactor (src/kiro_crew/security/text_redaction.py) reads a glued AWS key name the way the batch pass does. When the name ends the batch match it sits in, and the text before it still redacts as that match without it (_glued_key_tail), the stream commits that credential and holds only the name in the existing AWS discard. There, label_backoff keeps it as a label if its separator follows, label_awaiting_separator waits on a little whitespace, and anything else drops it with the value it ended. Same base as 164a5d6 (main 51349e1); the PR is not DIRTY, so there was no rebase.
  • Before -> after (what was allowed/blocked, now): for SessionToken=<value>AccessKeyId : visible text split before the colon, the stream used to keep : visible text while the stored batch text redacted visible. Now both read [REDACTED: credential][REDACTED: credential] text, short or past the ceiling. With no separator after the name (AccessKeyId and more text), both read [REDACTED: credential] and more text, as before. The 336,346-character input from the GPT finding took 7.8 s locally on 164a5d6. A 64,000-repeat version now takes 0.5 to 2 s, and times out at 60 s on the old search. The package line budget is the true count, 36,525 (main 35,901, +624).
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the stream commits text before a held key name that the batch would have redacted together with it. That is guarded: the commit happens only when a plain match in the committed text covers the same credential from its start to the key, so the committed part redacts on its own, and only when the whole buffer would have been committed anyway. Otherwise, over-redaction of a word after a glued key name's separator, the same as the batch pass does. No command, tool or login path is affected; the change only rewrites output text.
  • Evidence checked (which sandbox result proves it): no sandbox rule is touched. test_a_key_name_ending_a_value_streams_as_the_batch_pass_reads_it asserts out == redact(text) for five tails (: , :, \n= , no separator, ,) times a short and a past-the-ceiling value. The three separator tails fail on the previous stream code (6 of 10 red), and all 10 pass now. test_scan_stays_linear_on_a_repeated_label_after_the_probe_budget covers aws_secret_access_key, SessionToken and AUTHORIZATION: all three time out at 60 s on 164a5d6 and pass in under 2 s here. test_credential_glued_plain_readers.py still holds every plain-code reader to the regex it replaced.
  • No regression:
    • Tools still work (which tools/commands were run, result): black, isort and flake8 on the changed files are clean, mypy on src/kiro_crew/security/ is clean, scripts/check_comment_history.py with COMMENT_HISTORY_BASE_REF=origin/main passes, and diff_signals.py --check-body passes.
    • Backward compatible (old config / old data / old callers still work, how checked): no signature changes. _glued_key_tail acts only when the stream already found an AWS key name inside a batch match, and only that name is held; every other stream path is as before.
    • Existing tests (which suites passed on this head): locally at -n 2, 8,690 tests across the redaction, credential, stream, security and chat-runner suites pass, plus 2,818 across all 32 test files that use StreamRedactor, text_redaction or stream_aws_anchor, and test_security_gate_liveness with the new budget.
  • How to undo: revert this PR's single commit; pass 1 and the stream go back to main.

@JLargent42

Copy link
Copy Markdown
Contributor Author

@bolichen97 both points from issuecomment-6850467595 are in head 8f989f3. It's the same base (main 51349e1), with no rebase since the PR isn't DIRTY.

1. Quadratic after the probe budget (GPT 6.1). I took the windowed option. Once the probes are spent, _glued_matches now searches spaced starts one _GLUED_WINDOW at a time, the way the unexhausted path already did, and steps on past empty windows. It finds the same leftmost start below the span's end. New test test_scan_stays_linear_on_a_repeated_label_after_the_probe_budget uses GPT's input shape at 64,000 repeats of aws_secret_access_key, SessionToken and AUTHORIZATION. All three time out at 60 s on 164a5d6 and pass in 0.5 to 2 s now.

2. Stream and batch agree again (Opus 5.5). test_stream_redactor_aws_keyed.py asserts out == redact(head + tail) again, now as test_a_key_name_ending_a_value_streams_as_the_batch_pass_reads_it over five tails (: , :, \n= , no separator, ,) times a short and a past-the-ceiling value. On the stream side, text_redaction._glued_key_tail covers an AWS key name that ends the batch match it sits in, as long as the text before it still redacts as that match without it. For that case, the stream commits the credential before the name and holds only the name in the existing AWS discard. From there label_backoff keeps it as a label if its separator follows, label_awaiting_separator waits on a little whitespace, and anything else drops it with the value it ended, which is how the batch reads the whole text. The three separator tails fail on the previous stream code (6 of 10 red), and all 10 pass now.

Budget: 36,525 (main 35,901 + 624). SCR for this head: issuecomment-6851012153.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Credential redaction keeps most of a second token glued to the first

5 participants