feat: centralize redaction and data minimization for all egress paths (#19) - #62
Closed
TINGyu123644 wants to merge 1 commit into
Closed
TINGyu123644 wants to merge 1 commit into
TINGyu123644 wants to merge 1 commit into
Conversation
…paths (helsome#19) - Create unified redaction module as single source of truth: - patterns.ts: all secret detection patterns (API keys, Bearer, JWT, GitHub tokens, LangSmith keys, connection strings, URL query secrets, base64 blobs) - redactor.ts: Redactor class with privacy levels (minimal/standard/full), deep object sanitization, portfolio payload downgrade - canary.ts: CanaryScanner for leak detection in tests/CI - Consolidate existing scattered redaction logic: - diagnostics/redact.ts now re-exports from unified module - evaluation/redactor.ts now re-exports from unified module - All secrets are now redacted from one shared rule set - Covered egress paths: logs, diagnostics bundle, telemetry, traces, eval artifacts, error serialization, report export - Sanitize nested tool args/results, HTTP errors, URL query parameters - Canary scanner: inject fake secrets into test context, scan all produced artifacts to prove 0 leaks Closes helsome#19
helsome
requested changes
Sep 11, 2026
helsome
left a comment
Owner
There was a problem hiding this comment.
当前先不通过,缺少可审核的测试报告。这个 PR 涉及统一脱敏/隐私边界,属于需要明确验证证据的改动。
请在 PR 描述或评论中补充实际测试报告,至少包含:
- 实际执行的命令;
- Bun/OS 等关键环境信息;
- 每组测试的 pass/fail 数量;
- 若存在失败,说明是否可在当前 main 复现;
- 针对本 PR 的脱敏用例结果:Authorization/Cookie/API key/connection string/嵌套 tool args/result/error/URL query 等;
- CanaryScanner 或等价泄漏检查的实际执行结果。
不要求为了这个 PR 搭完整生产 E2E,但需要证明新增隐私规则确实跑过、结果可复现。补齐测试报告后再 review。
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Centralize redaction and data minimization for all data egress paths (issue #19).
Changes
New: Unified Redaction Module
Single source of truth for all secret redaction across the codebase:
patterns.ts— All secret detection patterns in one place:redactor.ts— Core Redactor class:minimal(names/status only),standard(content after redaction),full(complete trace, still credential-redacted)canary.ts— CanaryScanner for leak detection:Consolidation
diagnostics/redact.ts— now re-exports from unified module (backward compatible)evaluation/redactor.ts— now re-exports from unified module (backward compatible)Acceptance Criteria Coverage
Privacy Levels
minimalstandardfullCloses #19