FIELD MANUAL / AI AGENTS ON MAC
Run AI agents on your Mac without losing files, keys or sleep
Practical guides on agent permissions, sandboxes, incidents and Mac malware.
zsh — ~/projects/shop
~/shop $ claude
> clean up the build folder
Claude wants to delete old output.
Allow Claude to run `rm -rf build/`? (y/n)
y yes n no esc stop
With --dangerously-skip-permissions this question is never asked.
§ 01
START HERE
Start here
01Agent permissions
What the agent may do without asking, and how to keep that safe.02Sandboxing
Docker, devcontainer and other ways to fence an agent in.03Is it safe?
Claude Code, Cursor, GitHub Copilot.04Incidents and recovery
Agent deleted files, undo, git restore, Time Machine.05Threats
Prompt injection, MCP, leaked keys.06Mac security
Check for viruses, remove malware, firewall.§ 02
TOOL
How risky is your agent setup?
Two taps. No data leaves this page.
risk-check · 2 stepsClaude CodeCursorCodexGemini CLI / Asks before each actionAuto-accepts editsSkips all permissions, on my main MacInside a sandbox, container or VM
LOWAsks before each action: You see each command before it runs. Read the prompt before you press y, and keep the project in git.
MEDIUMAuto-accepts edits: File edits go through without a question. Commit before you start so you can roll back, and keep secrets out of the project folder.
HIGHSkips all permissions, on my main Mac: Nothing asks you before a command runs. Run it only in a container or VM with no secrets, not on your main Mac.
LOWInside a sandbox, container or VM: Low if nothing secret is inside. Check that your keys, ~/.ssh and cloud credentials are not mounted into the container or VM.
Get the free coreQuiet until it matters. You decide.
§ 03
INCIDENT
Something already went wrong?
$ route-1Agent deleted files →Stop the agent and stop writing to the disk, then look in this order: Git, the rewind menu, the Trash and Time Machine.$ route-2Key leaked →Revoke or rotate the key first, then check what it did, then cap spending.$ route-3Installed a bad package →If you think it ran, look for known traces first and replace credentials from a clean device second.$ route-4Mac acting strange →Think back over what you opened or pasted, then check Activity Monitor, Login Items and your extensions.
RECOMMENDED TOOL / ARTIFICIAL IMMUNITY
Security for Macs that run AI agents.
- 01The free, open-source core watches Claude Code, Cursor, Codex, MCP servers, VS Code tasks, git hooks, package scripts and every program start on your Mac.
- 02It runs deterministic rules on your Mac, has no model inside, and sends nothing off the Mac.
- 03Only what is bad and certain reaches you.
- 04It reports what it finds and stops nothing, so you decide what to do.
§ 04
LATEST
Latest guides
--dangerously-skip-permissions: what it does and how to keep your Mac safeAgent permissions6 minIs my Mac hacked? How to tell and what to do firstMac security6 minLeaked API key: what to do in the first hourThreats4 minClaude Code deleted my files: how to get them back and stop it happening againIncidents & recovery7 minClaude Code sandbox: how to isolate it on a Mac (and when to use a VM)Sandboxing6 minDo I need antivirus for my Mac? What macOS covers and where it stopsMac security5 min