Skip to content
BENIBIX Learn

denyRead vs Read Permission Rule

People think a denyRead entry stops Claude from reading a file. It only stops shell commands in the sandbox, such as cat. Claude's own Read tool runs outside the sandbox and follows Read rules. A Read deny rule does more. It blocks the tool. With the sandbox on, it is copied into denyRead as well.

AI⌨️ Claude Code

sandbox.filesystem.denyRead

A list of paths sandboxed commands may not read.

sandbox.filesystem.denyRead is a settings key that hides paths from reading. Commands in the sandbox cannot read the paths it lists. By default they can read most things, even secret files such as ~/.aws/credentials. Use this key to hide those. Lists from all files are joined, and the paths from your Read deny rules are added too.

Example
Emma learns a sandboxed script could still read her SSH keys. She adds ~/.ssh to denyRead, and the keys are hidden.
Why it matters
The sandbox can read a lot by default. Secret files must be named here to be hid.
Full entry
AI⌨️ Claude Code

Read Permission Rule

A rule that stops Claude from reading a file, like your keys.

A Read permission rule matches the files Claude may read. It is written as Read and a path, such as Read(./.env) or Read(./secrets/**). As a deny rule it keeps Claude's file tools away from that path. It also blocks Edit and Write there, and it tries to cover Grep, Glob and @file mentions too. A .claudeignore file does nothing, so put those paths here.

Example
Lucy's project has a .env file with live keys. She denies Read(./.env), and Claude can no longer open it.
Why it matters
A file Claude reads goes into the chat. A deny rule keeps a secret from ever getting there.
Full entry

In one line

sandbox.filesystem.denyRead
A list of paths sandboxed commands may not read.
Read Permission Rule
A rule that stops Claude from reading a file, like your keys.