Skip to content
BENIBIX Learn

sandbox.filesystem.denyRead

AI⌨️ Claude CodeConfiguration

Also known as denyRead

A list of paths sandboxed commands may not read.

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.

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.

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 code

json
{
  "sandbox": {
    "filesystem": {
      "denyRead": ["~/.aws", "~/.ssh"]
    }
  }
}
Hide cloud keys and SSH keys from every command.

Common mistake

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

Key takeaways

  1. 1
    Never read here. Listed paths.
  2. 2
    Read is open by default. Even secrets.
  3. 3
    Lists join. Plus Read denies.

Compare