Running an AI Coding Agent on Your Own Machine: What It Can Reach
Running an AI coding agent locally feels like the private option. Your code does not go to a hosted sandbox, and the files stay on your disk.
That part is true. But “local” also means the agent runs as you. Every file your account can read, it can read too, and every command you can run, it can try.
I have spent the last weeks letting agents work on real repositories, unattended, on my own Mac. This post is what I learned about drawing the line between “the agent can work” and “the agent can reach everything”.
Local processing keeps your files away from other people’s servers. It does not keep them away from the process you just started.
What an agent can reach by default
When you start Claude Code, Codex or any other CLI agent in a terminal, it inherits your user account. In practice that usually includes:
- Credentials in your home directory:
~/.ssh, cloud CLI logins (~/.aws,~/.config/gcloud), the GitHub CLI token, package registry tokens in~/.npmrc. - Environment variables: whatever your shell exported, often API keys.
- The agent’s own login files: the session or API key it uses to talk to its provider.
- The network: it can fetch, post and push unless something stops it.
- Your git remote: if you can push, so can a command the agent runs.
None of this needs a bug. It is just how a process on your machine works. The question is only how much of it the task actually needs. For “fix this failing test”, the answer is: almost none of it.
Six limits I now set before letting an agent work
1. Give the agent its own config directory
Do not let a coding agent share your everyday login state. Sign it in once, in a directory that belongs to that agent only, so its credentials are separate from yours and easy to revoke.
2. Deny reads of credential paths
Most agents now support a native sandbox or a permission file. Use it to deny reads of ~/.ssh, cloud CLI folders, your keychain, and any file you know holds a secret. A deny list is not perfect isolation (a secret stored somewhere unexpected is still readable), but it removes the obvious targets.
3. Strip secrets from the environment
Start the agent with only the variables it needs. A GITHUB_TOKEN exported for another script will otherwise be visible to every command the agent runs, including test scripts it just wrote.
4. Run tests without network
The agent’s tests should not need the internet. Install dependencies first, then run the checks offline in a sandbox. If a test suddenly needs to call out, you want that to fail loudly, not succeed quietly.
5. Never let the agent push
Commits and pushes should come from a step you control, not from the agent’s shell. Remove push credentials from the agent’s environment and make pushes fail inside its session. Then the worst case of a bad run is a messy local branch, not a change on your remote.
6. Keep a human on the merge
A green test suite is evidence, not proof. Have a second model (ideally from another provider) review the change, and keep the final merge as a click you make yourself, at least until you have a track record on that repository.
Why this fits a local-first workflow
The idea behind VaultTools is simple: a file that never leaves your device cannot leak from someone else’s server. The VaultTools MCP server applies the same idea to agents: they pass file paths to local tools, and the processing stays on your machine.
But local-first only works if the local side is controlled too. An agent that can read your SSH keys and push to any remote has turned “nothing leaves my machine” into “anything can leave my machine, through my own account”. The MCP safety notes cover the file-tool side of this; the six limits above cover the coding-agent side.
Where these limits come from
I learned most of this while building Provefab, a tool I use to turn labelled GitHub issues into pull requests on my own machine. It runs the agent in its own config directory, denies reads of known credential files, runs checks offline in a sandbox, does every commit and push itself, and leaves the merge to a person. Each of those rules exists because I watched an unattended run get close to something it did not need.
You do not need Provefab to apply them. Most agent CLIs now expose enough settings to do it by hand: a separate profile, a deny list, a clean environment, offline tests, no push credentials, and a human merge.
A quick checklist
Before your next unattended agent session, check:
- The agent has its own login, separate from yours
- Reads of
~/.ssh, cloud CLI folders and the keychain are denied - The environment carries no token the task does not need
- Tests run offline, in a sandbox
- The agent cannot push
- A person merges
Six lines. They cost an hour to set up once, and they decide what a bad run can actually touch.