# sandbox.filesystem.denyRead

> A list of paths sandboxed commands may not read.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** denyRead

## Think of it like

It is like a locked diary in a room the child may play in. They can see the room, not the diary.

## Definition

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.

## Example code

```json
{
  "sandbox": {
    "filesystem": {
      "denyRead": ["~/.aws", "~/.ssh"]
    }
  }
}
```

Hide cloud keys and SSH keys from every command.

## Why it matters

The sandbox can read a lot by default. Secret files must be named here to be hid.

## Common mistake

Thinking the sandbox hides secrets on its own. Reading is open by default, so list them here.

## Three principles

- **Never read here.** Listed paths.
- **Read is open by default.** Even secrets.
- **Lists join.** Plus Read denies.

## Related terms

- [sandbox.filesystem.allowRead](https://learn.benibix.com/term/ai/sandbox-allow-read-setting)
- [sandbox.credentials](https://learn.benibix.com/term/ai/sandbox-credentials-setting)
- [Read Permission Rule](https://learn.benibix.com/term/ai/read-permission-rule)

## Told apart from

- [denyRead vs sandbox.credentials](https://learn.benibix.com/compare/sandbox-deny-read-setting-vs-sandbox-credentials-setting): People think both keys just hide a secret file. denyRead blocks a path, so a command cannot read it at all. sandbox.credentials can do that too. It can also mask a secret: the command sees a stand-in, and the proxy puts the real value back on the way out. Mask is for a secret a command must use but should not see.
- [denyRead vs Read Permission Rule](https://learn.benibix.com/compare/sandbox-deny-read-setting-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.

---

Source: https://learn.benibix.com/term/ai/sandbox-deny-read-setting
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
