Skip to content
youdede

Sensitive file access guard

SecurityHookv1.0.0

A framework-agnostic deterministic policy core with a Claude Code PreToolUse adapter. It inspects bounded structured paths, static shell file operands, and filesystem aliases without reading file contents or exposing submitted paths.

Runs on

Scope
$npx @youdede/toolkit add sensitive-file-access-guard --target claude-code

What it does

Block deterministic access to credential files, private keys, and environment secret files.

When it fires

  • implementation
  • operations

How it behaves

Evaluate file-access intent and bounded filesystem alias metadata before a protected operation runs.

It does not read, print, copy, redact, or transform the contents of protected files.

It does not treat a non-match as proof that a path or command is safe.

It does not accept project-controlled configuration or a hidden bypass for protected paths.

Configuration

targets/claude-code/sensitive-file-access-guard.mjsnode · read-only

Version
1.0.0
Requires
Shell command guard
Licence
RiskThis automatic gate blocks deterministic access to credential files, private keys, and environment secret files; a false denial can interrupt legitimate work, but it does not execute the blocked action.
Medium
ModeHow it works: fixed rules, model instructions, or both.
Deterministic only
Behaviour
Enforces, blocks on violation
On failure
Denies and blocks
LatencyTo block access to credential files, the entrypoint may list repository files with a bounded local git subprocess before returning.
Bounded
Data retentionWhether data remains after use and who manages its storage.
Not retained
In packs
  • Secure agent boundaries

Often used with

All in Security