Agent access and safety
Where the agent’s file edits land depends on the Agent access setting.
| Setting | Where edits land |
|---|---|
| Work on a copy | Drafted in a git worktree under .sparse/runs/<id>/. Your checkout stays untouched until you accept them. |
| Ask first | In place, on your real files. The default for new installs. Commands outside an allowlist are refused rather than run automatically. |
| Full access | In place, on your real files. |
In every setting you still get a diff, validator results and a report.
- The Ask first allowlist is a best-effort guardrail, not a boundary. It can be worked around, and it doesn’t block network access.
- Full access is remembered with an HMAC seal in the Sparse home. The seal is best-effort too:
settings-seal.keyis readable by the same user, so it stops a casual rewrite of the settings file but not a process that can read the key. - Sparse won’t
git initor mirror protected locations such as your home directory. - An upgraded install keeps its current mode.
Folder trust
Section titled “Folder trust”Repo instruction files (AGENTS.md, CLAUDE.md, .cursorrules, .cursor/rules, and project .sparse rules, skills and subagents) load only after you trust that folder.
sparse trust # trust this foldersparse trust list # trusted folderssparse trust status # this folder's statussparse untrust # stop trusting this folderHeadless runs (sparse run, sparse agent and the other mode commands) treat the repo as untrusted unless you pass --trust.
Trust decisions live in ~/.sparse/trust.json. On Linux, when user namespaces are allowed, the agent’s shell runs in a mount namespace where that file is read-only. On macOS and elsewhere, commands that name the trust store are refused and file tools can’t write it, but the shell isn’t mount-protected.