Skip to content

fix(suggestions): redact complete quoted credential values - #594

Merged
tt-a1i merged 3 commits into
openpi-dev:mainfrom
ooiuuii:fix/suggestions-quoted-secret-redaction
Sep 21, 2026
Merged

tt-a1i merged 3 commits into
openpi-dev:mainfrom
ooiuuii:fix/suggestions-quoted-secret-redaction

Conversation

@ooiuuii

@ooiuuii ooiuuii commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Problem

The opt-in suggestion transcript redactor can retain a credential suffix when a labelled value contains quoted whitespace or punctuation. For example, password="north south") next=visible used to retain south in context sent to the suggestion model.

Fixes #593.

Value

Standalone quoted labelled credentials are masked as complete values before next-action prediction. Ordinary adjacent text stays available, without claiming complete secret detection or general shell parsing.

Approach

  • Accept complete quoted values, including escaped quotes/backslashes, at existing token boundaries and closing ), ], . punctuation. Closing punctuation sequences must themselves end at a token boundary.
  • Keep punctuation-joined shell segments such as password="north"."south" on the whole-token fallback; do not expose previously masked suffixes.
  • Preserve recognized labels, other redaction passes, transcript budgets, and lifecycle.
  • Exercise the actual serializer with tool-result and native Bash SessionEntries, both quote styles, adjacent headers, unquoted credentials, and unlabelled prose.

Validation

Latest head: 2c3c3ab64165d4b89e82f23ba630dc9299f65fb5.

  • Original quoted-value regressions fail before the fix. Maintainer follow-up added 12 punctuation regressions that failed on the prior matcher and now pass.
  • Scoped review caught a newly introduced punctuation-joined segment regression; four additional RED cases led to the token-end constraint. The final structured review reports no actionable findings.
  • Node 22.22.3 suggestions tests: 71/71; Bun 1.3.14 suggestions tests: 71/71.
  • bun run check and git diff --check: passed.
  • Full local repository attempt: 1,580 passed / 5 failed / 10 skipped in the first Node group. Four unchanged Web HTTP tests passed in isolation; the unchanged reused-PID setup-config lock test still timed out. The runner did not reach serial background-terminal tests or Vitest. This is not a full-suite pass and no unrelated assertions or timeouts were changed.
  • Fresh GitHub CI is tracked separately; no claim of all-green CI until it completes.

All credentials in tests are synthetic. No live suggestion-model request was made.

Impact

  • User-visible commands, settings, tools, runtime ownership, and persisted Session history: unchanged.
  • Model context: complete quoted labelled values are masked at the covered boundaries.
  • The review follow-up changes only the existing matching rule/comment and serializer regressions (two files, +20/-2 from the reviewed head).
  • Known boundary: ambiguous nested shell wrappers with whitespace may retain the same partial value as main. This is best-effort redaction, not an arbitrary shell parser; a compatibility regression ensures a later credential header is still masked.

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The new quoted-value branch still misses common punctuation boundaries and falls back to token redaction, which leaks part of a whitespace-containing credential into the model transcript. Please broaden the safe closing boundary and add punctuation regressions.

Comment thread extensions/suggestions/src/transcript.ts Outdated

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

审查提交:4fd50fee11628d48e2abf93662596d791c96c5f6

需要修改后再合并。

具体问题

P1 — 带空格的引号凭据后接右括号或句点时仍泄露尾部 · extensions/suggestions/src/transcript.ts:79

Exact-head repro: password="north south") next=ok -> password=[REDACTED] south") next=ok; ] and . also leak. Existing review remains valid.

验证范围

18 transcript tests pass; 3 additional repros confirm leakage. repro.log/test.log

限制与后续

No live suggestion-model call.

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-reviewed 2c3c3ab. The reported quoted-credential leak before closing parentheses, brackets and periods is fixed, with regression coverage that also preserves masking of adjacent shell segments. All 38 transcript tests passed locally and current CI is green. This supersedes my previous request for changes.

@tt-a1i
tt-a1i merged commit 7ce0a3f into openpi-dev:main Sep 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(suggestions): quoted credential suffixes survive transcript redaction

2 participants