Skip to content
BENIBIX Learn

denyRead vs sandbox.credentials

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.

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

sandbox.credentials

The key that hides or masks secrets from sandboxed commands.

sandbox.credentials is a settings key that guards your secrets. It keeps secret files and environment variables from commands in the sandbox. Each entry names a file path or a variable name, with a mode. deny hides the secret. mask shows the command a stand-in, and the proxy puts the real value back on the way out. mask works only from user or managed settings.

Example
Jack's tests need to call GitHub but should never see his token. He masks GITHUB_TOKEN, so the call works and the token stays hidden.
Why it matters
A command that can read a secret can also send it away.
Full entry

In one line

sandbox.filesystem.denyRead
A list of paths sandboxed commands may not read.
sandbox.credentials
The key that hides or masks secrets from sandboxed commands.