Repository navigation
fix(audit): scrub the five provider key shapes in both capture paths - #507
Merged
Merged
Conversation
PR #495 added DLP rules for OpenRouter, Groq, Replicate, Perplexity and xAI keys, but the capture scrubbers did not know those shapes, so a key captured in a command or in nested arguments was stored as sent. Add the five patterns to both the recorder and the hook scrub lists (the mirror test keeps them in sync) and scrub the full command before truncating to COMMAND_MAX_LEN so a token cut at the storage cap cannot survive half masked. README collected-test count 3034 -> 3044. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <[email protected]>
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.
PR #495 added DLP rules for OpenRouter, Groq, Replicate, Perplexity and xAI keys, but the capture scrubbers did not know those shapes, so a key captured in a command or nested arguments was stored as sent.
Changes:
core/audit/redaction.py) and the hook (hooks/ingest.py) scrub lists; the mirror test keeps them in sync.COMMAND_MAX_LEN, so a token cut at the storage cap cannot survive half masked.Verification (run locally in the worktree,
PYTHONPATH=apps/orchestrator):pytest tests/test_redaction.py91 passedpytest tests/test_readme_claims.py tests/test_redaction.py107 passedagentmetry benchmark112 cases, 18 rules, 61/61 firings, 0 missed, 0 false positives (unchanged)git diff --checkclean