# Read Permission Rule

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

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** Read(./.env), Read deny rule

## Think of it like

It is like a lock on one drawer. The rest of the desk stays open.

## Definition

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.

## Example code

```json
{
  "permissions": {
    "deny": ["Read(./.env)", "Read(./.env.*)", "Read(./secrets/**)"]
  }
}
```

Keep secrets out of the chat.

## Why it matters

A file Claude reads goes into the chat. A deny rule keeps a secret from ever getting there.

## Common mistake

Writing a .claudeignore file. Claude Code ignores it. Use Read deny rules instead.

## Three principles

- **Read and a path.** Read(./.env).
- **Blocks edits too.** Same path.
- **No .claudeignore.** Use this.

## Related terms

- [Edit Permission Rule](https://learn.benibix.com/term/ai/edit-permission-rule)
- [Read Tool](https://learn.benibix.com/term/ai/read-tool)
- [Permission Path Pattern](https://learn.benibix.com/term/ai/permission-path-pattern)

## Told apart from

- [Read Permission Rule vs Edit Permission Rule](https://learn.benibix.com/compare/read-permission-rule-vs-edit-permission-rule): People think a Read deny rule only stops reading, and an Edit rule is needed to stop changes. A Read deny rule stops both. Claude cannot read the path, and cannot edit or write it either. An Edit rule only covers changes, so a file can be readable but locked. To hide a secret, deny Read. To keep a file safe but in view, deny Edit.
- [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.

![Four ways to start a path in a Read or Edit rule, and where each one points.](https://learn.benibix.com/diagrams/permission-path-anchors.svg)

---

Source: https://learn.benibix.com/term/ai/read-permission-rule
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-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
