Skip to content

spec: multiline + command-keyed redaction (#10027)#10225

Open
lonexreb wants to merge 1 commit intowarpdotdev:masterfrom
lonexreb:spec/10027-multiline-redaction
Open

spec: multiline + command-keyed redaction (#10027)#10225
lonexreb wants to merge 1 commit intowarpdotdev:masterfrom
lonexreb:spec/10027-multiline-redaction

Conversation

@lonexreb
Copy link
Copy Markdown
Contributor

@lonexreb lonexreb commented May 6, 2026

Spec for #10027. Two new redaction mechanisms: command-keyed output rules (e.g. kubectl get secret redacts entire block output) and multiline-bracketed rules (e.g. PEM BEGIN/END blocks). Defaults for common DevOps cases shipped in V1.

Closes (spec-only) #10027.

@cla-bot cla-bot Bot added the cla-signed label May 6, 2026
@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label May 6, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 6, 2026

@lonexreb

I'm starting a first review of this spec-only pull request.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This spec defines command-keyed output redaction and multiline delimiter redaction for agent context. The direction is aligned with the stated secret-redaction gaps, but several requirements are ambiguous enough to produce incomplete or unsafe implementations.

Concerns

  • Command matching is specified too narrowly for common kubectl get secret forms and does not define normalization or argument-order coverage for default rules.
  • Multiline redaction scope conflicts with the acceptance criterion for pasted private-key blocks versus the explicit output-side-only V1 scope.
  • Default override semantics are under-specified, including precedence, identity, and disable behavior.

Security

  • The buffer-cap behavior must explicitly keep redaction active after the cap is reached until the end delimiter or block flush; otherwise oversized secret blocks can leak lines after the capped buffer is replaced.

Verdict

Found: 0 critical, 4 important, 1 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread specs/GH10027/SPEC.md

```toml
[[redaction.command_output_rules]]
command_pattern = "^kubectl\\s+get\\s+secret\\b"
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.

⚠️ [IMPORTANT] The default command regex only covers literal kubectl get secret; specify normalization or default patterns for common secret reads like kubectl get secrets, kubectl -n prod get secret, and context/namespace flags before get.

Comment thread specs/GH10027/SPEC.md
start_pattern = "-----BEGIN [A-Z ]+PRIVATE KEY-----"
end_pattern = "-----END [A-Z ]+PRIVATE KEY-----"
replacement = "[redacted: PEM key block]"
inclusive = true # include the BEGIN/END lines in the redaction
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.

💡 [SUGGESTION] The config exposes inclusive, but the behavior only defines inclusive = true; either define exclusive-boundary behavior or omit the option from V1.

Comment thread specs/GH10027/SPEC.md
### B5 — Performance bound

Multiline buffering is capped at `WARP_REDACTION_MAX_BUFFER_BYTES`
(default 1 MiB). If the buffer fills before `end_pattern` matches,
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.

⚠️ [IMPORTANT] [SECURITY] After the buffer cap is reached, require the redactor to stay in a redacted/discarding state until end_pattern or block flush; replacing only the buffered bytes can leak subsequent lines from an oversized secret block.

Comment thread specs/GH10027/SPEC.md
- A1. With default rules: running `kubectl get secret foo -o yaml`
shows real output in the terminal but the agent context shows
the replacement string.
- A2. With default rules: pasting a private-key block redacts the
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.

⚠️ [IMPORTANT] This acceptance criterion conflicts with V1 being output-side only: pasting a key is input-path behavior unless the spec defines a rendered-output path; align the scope and acceptance test.

Comment thread specs/GH10027/SPEC.md
the replacement string.
- A2. With default rules: pasting a private-key block redacts the
entire BEGIN..END range, not just the first line.
- A3. User-defined rule in TOML overrides defaults at the same
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.

⚠️ [IMPORTANT] Override semantics are not precise enough to implement: define precedence, whether equality is by rule name or exact pattern string, and how users disable a default rather than replace it.

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

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant