Repository navigation
CM-73723: Judge sensitive-path reads by the sensitive-path thresholds - #567
Closed
Altruistus wants to merge 3 commits into
Closed
Altruistus wants to merge 3 commits into
Altruistus wants to merge 3 commits into
Conversation
A sensitive path is now scanned for secrets under its own guardrail (detection_source=sensitive_path), so scan-service applies that guardrail's per-agent mode and report/block floors - the same verdict rule the secret guardrails use. A sensitive file with no secrets is allowed, and the separate path-only block/warn (path_action) is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scan helpers take a required guardrail instead of deriving detection_source from the event type, and the get_effective_mode helper left unused by the path_action removal is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
The Read sensitive path guardrail now uses report/block thresholds the same way as Secret in prompt and Secret in file read.
Changes
handle_before_read_file: a path that matches the sensitive-path globs is scanned for secrets under its own guardrail (detection_source=sensitive_path). Scan-service applies that guardrail's per-agent mode and report/block floors, and the CLI follows the verdict:Blockverdict: deny, with block reasonsensitive_path.sensitive_path.secrets_in_file(only when its cell is not Off). Setting Secret in file read to Off does not switch off the sensitive-path scan.file_read.path_action) and the extra second hook event it emitted in Report mode.build_ai_guardrails_scan_parameters/_scan_path_for_secretstake an optionalguardrailthat setsdetection_source.Behavior change
Before, a sensitive-path match in Block mode was denied whatever the file contained. Now it is denied only when a secret in the file meets the block floor, and a sensitive file with no secrets is allowed and not flagged.
Merge order
Merge after ai-security-manager!136 (sensitive_path floors in the resolved config). Merging earlier is safe: scan-service falls back to the Info floors, so any secret in a sensitive file still blocks under a Block cell.
Tests
pytestpasses (1322 passed, 1 skipped). Ruff lint and format checks are clean.🤖 Generated with Claude Code