Skip to content

SOU-70: client-side context redaction#12

Merged
tsouth89 merged 3 commits into
mainfrom
feat/sdk-context-redaction
Jul 11, 2026
Merged

SOU-70: client-side context redaction#12
tsouth89 merged 3 commits into
mainfrom
feat/sdk-context-redaction

Conversation

@tsouth89

@tsouth89 tsouth89 commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add scrub_context / dangerous_context_keys mirroring backend _CONTEXT_DENYLIST (case-insensitive; also drop _bw* keys)
  • Auto-scrub context in BurnwatchClient.record() before buffering so secrets never leave the process
  • Export helpers from the package root; unit + integration tests

Closes #2
Closes Linear SOU-70

Test plan

  • Local: pytest -q — 26 passed
  • CI green on PR
  • CodeRabbit review addressed before merge

Mirror the backend denylist so secret-shaped keys never leave the process; scrub automatically in record() and expose scrub_context for callers.
@tsouth89

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@tsouth89, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 1 minute

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 37e04f10-c27c-43fd-bb5b-062cd6ef53e9

📥 Commits

Reviewing files that changed from the base of the PR and between 3ae43e7 and 9fe9411.

📒 Files selected for processing (2)
  • burnwatch/redact.py
  • tests/test_redact.py
📝 Walkthrough

Walkthrough

Adds client-side context redaction using a case-insensitive denylist and _bw prefix filtering. BurnwatchClient.record() now scrubs context before buffering and omits empty results. The redaction helpers are exported at package level. Tests cover dangerous keys, empty results, nested dictionaries, sorted key detection, and client buffering integration.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly matches the main change: client-side context redaction in Burnwatch.
Description check ✅ Passed The description is directly related to the PR and accurately summarizes the added redaction, exports, and tests.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 34c5581f-5cf1-4bbf-868d-243e8f693148

📥 Commits

Reviewing files that changed from the base of the PR and between 1ded675 and 3ae43e7.

📒 Files selected for processing (4)
  • burnwatch/__init__.py
  • burnwatch/client.py
  • burnwatch/redact.py
  • tests/test_redact.py

Comment thread burnwatch/redact.py Outdated
tsouth89 added 2 commits July 11, 2026 18:49
Align with denylist matching so keys like _BW_meta cannot bypass client-side redaction.
@tsouth89

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tsouth89
tsouth89 merged commit 42f26b4 into main Jul 11, 2026
3 checks passed
@tsouth89
tsouth89 deleted the feat/sdk-context-redaction branch July 11, 2026 22:52
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.

Add a redaction helper for context metadata

1 participant