> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Protect files with .inlayignore

> Keep vendor code and generated files readable while blocking Inlay from editing them.

Add a `.inlayignore` file at the project root to stop Inlay from editing selected files. Inlay can still read, search, and reference them. Use it for vendor code, SDKs, and generated output that you want Inlay to consult but not change.

```text .inlayignore theme={"theme":"css-variables"}
# Vendor code
vendor/
third_party/

# Generated files
generated/
build/
*.elf
*.hex
*.bin
```

> [!WARNING]
>
> `.inlayignore` restricts Inlay's own edits. It doesn't hide files, and it isn't a filesystem sandbox. Build tools and scripts can still write to matching paths.

## Write patterns

Patterns use gitignore syntax:

| Pattern | Matches |
| - | - |
| `vendor/` | Any directory named `vendor`, at any depth, and everything in it. |
| `*.bin` | Files ending in `.bin` at any depth. |
| `src/**/*.h` | Header files anywhere under `src`. |
| `/build` | `build` only in the directory that contains the rule file. |
| `!config/public.json` | Allows a path that an earlier rule blocked. |
| `# comment` | A comment. Blank lines are ignored. |

To allow a few files in an otherwise protected directory, protect the directory's contents rather than the directory itself:

```text theme={"theme":"css-variables"}
config/*
!config/public.json
!config/schema.json
```

Within one file, a `!` rule can't re-allow a file whose parent directory is blocked. `config/` followed by `!config/public.json` keeps `public.json` protected.

Matching is case-insensitive on macOS and Windows, and case-sensitive on Linux.

## Use rules for one package

A `.inlayignore` in a subdirectory applies to paths below that directory:

```text packages/legacy/.inlayignore theme={"theme":"css-variables"}
generated/
*.lock
```

Inlay applies rule files from the project root down to the file's directory. A rule in a closer file overrides a broader one, so a nested `!` rule can allow a path that the root file blocks. When a pattern behaves unexpectedly, check the nested files on the path.

## How it relates to .gitignore

The two files are independent:

* `.gitignore` doesn't protect files from Inlay's edits. If Git ignores generated output that Inlay shouldn't change, list it in `.inlayignore` too.
* `.inlayignore` doesn't change what Git tracks, and you can commit it so everyone who opens the project gets the same protection.
* In a Git repository, Inlay's file and text search follow `.gitignore`, so ignored files may not appear in search results. `.inlayignore` has no effect on search. Inlay can still open an ignored file when you name its path.

## What is blocked

| Action | Matching paths |
| - | - |
| Read, search, and reference | Allowed |
| Edit, write, or delete | Blocked |
| Saving a file that Inlay downloads from the web | Blocked |
| Shell commands that write to the path directly, such as `>` redirects, `cp`, `mv`, `rm`, `touch`, `tee`, or `sed -i` | Blocked |
| Builds, custom programs, and scripts that write files indirectly | Not detected |
| Commands you run yourself with `!` in the chat input | Not covered |

The block applies in every approval mode, including **Skip all approvals**. Rules also apply to the target of a symbolic link, so a link inside the project can't be used to edit a protected file.

To prevent every program from writing to a path, use operating-system permissions or a separate controlled environment.

## When an edit is blocked

The action shows **Blocked: .inlayignore**, and Inlay stops to ask how you want to proceed. There's no one-time approval that lets the edit through.

To permit the edit:

1. Ask Inlay which rule blocked the path, if it isn't clear.
2. Narrow or remove that rule, or add a `!` exception.
3. Ask Inlay to retry.

Changes to `.inlayignore` apply right away. You don't need to restart the conversation.

## Troubleshoot

| Symptom | Cause and fix |
| - | - |
| A protected file is still visible to Inlay. | Expected. The restriction applies to edits, not reads. |
| A rule doesn't match. | Check that the file is inside the active project, that the pattern is relative to the rule file's directory, and whether a nested file overrides it. |
| A build changed a protected file. | Builds and scripts can write files that Inlay doesn't detect. Use operating-system permissions if this matters. |
| A path through a symbolic link is blocked. | The link's target matches a rule. Rules apply to the resolved target. |
| A file doesn't appear in Inlay's search results. | `.gitignore` may exclude it. Give Inlay the file's path. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.