Skip to content

CM-73723: Judge sensitive-path reads by the sensitive-path thresholds - #567

Closed
Altruistus wants to merge 3 commits into
mainfrom
CM-73723-sensitive-path-guardrail-thresholds
Closed

Altruistus wants to merge 3 commits into
mainfrom
CM-73723-sensitive-path-guardrail-thresholds

Conversation

@Altruistus

Copy link
Copy Markdown
Collaborator

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:
    • Block verdict: deny, with block reason sensitive_path.
    • Secrets under the block floor: ask, with block reason sensitive_path.
    • No secrets: allowed, same as the secret guardrails.
  • Other files still go to 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.
  • Removed the path-only block/warn (file_read.path_action) and the extra second hook event it emitted in Report mode.
  • build_ai_guardrails_scan_parameters / _scan_path_for_secrets take an optional guardrail that sets detection_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

pytest passes (1322 passed, 1 skipped). Ruff lint and format checks are clean.

🤖 Generated with Claude Code

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>
@Altruistus Altruistus self-assigned this Oct 5, 2026
Altruistus and others added 2 commits October 5, 2026 16:02
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>
@Altruistus Altruistus closed this Oct 6, 2026
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.

1 participant