Occlude
Book a call

What AI coding agents' ignore settings actually block

Cursor, Claude Code, Copilot, Devin Desktop and Codex each let you keep files from their agent. What each covers, in the vendor's words, and where it stops.

Every major AI coding tool now has a setting that keeps files away from its agent, and every vendor documents where that setting stops. Most stop at the agent's terminal: a setting the agent's file tool respects does not stop cat or a script. This page puts five of them side by side, quotes each vendor on its own limit, and answers the question that usually follows: can you keep an agent inside one folder?

A grid of five tools against three questions. Cursor's ignore file covers the file tool but not terminal commands. Claude Code's deny rules cover the file tool, terminal commands only with its OS-level controls turned on, and can be set centrally. Copilot's content exclusion covers context and is set centrally. Devin Desktop's ignore file covers the file tool but not shell commands. Codex permission profiles cover the commands it runsA grid of five tools against three questions. Cursor's ignore file covers the file tool but not terminal commands. Claude Code's deny rules cover the file tool, terminal commands only with its OS-level controls turned on, and can be set centrally. Copilot's content exclusion covers context and is set centrally. Devin Desktop's ignore file covers the file tool but not shell commands. Codex permission profiles cover the commands it runs
Each tool's setting, by what its vendor says it covers. Not described means the documentation does not say, not that it cannot.

Side by side

ToolSettingSet byWhat the vendor says about its limit
Cursor.cursorignore, and the agent's Read Access settingEach developer, per project"The terminal and MCP server tools used by Agent cannot block access to code governed by .cursorignore"
Claude CodeRead(path) deny rules, and OS-level controls for shell commandsA developer, or the organisation through managed settingsDeny rules "don't apply to arbitrary subprocesses that read or write files indirectly"
GitHub CopilotContent exclusionRepository, organisation and enterprise administrators, on Business and Enterprise"Content exclusion is not a filesystem security boundary"
Devin Desktop, formerly Windsurf.devinignoreEach developer, per projectThe agent block "does not apply to shell commands or to search tools"
CodexPermission profiles, with "deny" on a pathA developer, in config.tomlA profile applies to the tool calls Codex runs under it

Cursor

.cursorignore takes .gitignore syntax and keeps matching files from the agent, Tab and @ mentions. Cursor is direct about the rest: "The terminal and MCP server tools used by Agent cannot block access to code governed by .cursorignore", and "complete protection isn't guaranteed due to LLM unpredictability."

Claude Code

A Read deny rule in settings.json stops Claude Code's own file tools, and the shell commands it recognises as reading a file, such as cat and head:

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

The documentation is specific about what that does not cover. The rules "don't apply to a command that reads files without naming them, such as grep -r pattern . run from the directory that holds the file. They also don't apply to arbitrary subprocesses that read or write files indirectly, like a Python or Node script that opens files itself." For those, Claude Code offers OS-level controls on shell commands, and an organisation can require all of it through managed settings. A .claudeignore file, which several popular posts recommend, "has no effect". There is a walkthrough in How to stop Claude Code from reading a file.

GitHub Copilot

Content exclusion is set by administrators on Copilot Business and Enterprise, per repository or across an organisation. Since 2 September 2026, GitHub says, "The GitHub Copilot app and Copilot CLI now respect content exclusion policies". GitHub also says plainly what it is not: "Content exclusion is not a filesystem security boundary and cannot guarantee prevention of every form of file access", and it does not apply to "repositories located on remote filesystems".

Devin Desktop

Devin Desktop, the editor that was Windsurf, reads .devinignore. Matching files are not indexed, and its agent avoids them, but its documentation says that block "does not apply to shell commands or to search tools".

Codex

Codex takes a permission profile in ~/.codex/config.toml. A path set to "deny" cannot be read by the commands Codex runs under that profile:

default_permissions = "project-edit"

[permissions.project-edit.filesystem]
":minimal" = "read"

[permissions.project-edit.filesystem.":workspace_roots"]
"." = "write"
"**/*.env" = "deny"

Like Claude Code's OS-level controls, it applies to the commands themselves rather than to one tool. It is set by each developer in their own configuration.

Can I keep an agent inside one folder?

Opening a folder is not enough. When a Cursor user found the agent reading files in a parent directory, Cursor's staff answered: "By default the agent's Read Access is set to System, so it can read files outside the open folder without asking." Their fix is a setting, not a prompt: in Cursor Settings, under Agents, Execution and Approvals, set Read Access to Workspace, so "reading a file outside the folder then needs your approval".

ToolKeep the agent to one folder
CursorRead Access set to Workspace; terminal commands need a run mode that restricts them too
Claude Codepermissions.blockReadsOutsideWorkingDirectories, which makes "the file tools refuse reads outside the working directories in every permission mode"
CodexA permission profile that grants :minimal and the workspace roots only, as in the example above
CopilotNot described
Devin DesktopNot described

What the settings have in common

Each is a rule inside the agent, on a machine that holds the whole repository. The agent's tools are asked to look away from files that are on the disk next to them. Where the tool is the only route, that works. Where the agent can also run a shell, a test or a script, the vendors say it does not.

For a secret, that is often acceptable: put it in a secrets manager and the file is not there at all. For source code the agent must build against, the file has to be on the disk, so the rule is the only thing between the agent and the code.

Where Occlude fits

Occlude moves the line out of the agent. The agent works in a workspace in your cloud where files outside its task are not on the side it can reach, while the build still reads them. Its file tool, search and terminal get the same answer, No such file or directory, because no setting is being asked to look away. Agents over MCP has the configuration for each of the five, and Where your code goes says what can still leave.

Occlude is a product to run, and for a secret or two it is more than you need. The settings above are free and they are a good first step.

Sources

Each page last read on 28 November 2026.

Want to go through this for your codebase?

All posts