Guide

How to reduce what your AI coding agent can access

Published

AI coding agents are useful because they can run commands on your machine. That same power means they can read files you didn’t mean to share and send data to websites. These steps reduce the risk without making the tools useless.

1. Keep permission prompts on

Claude Code, Codex and Cursor can all ask before running a command. Keep that on, and read the whole command before you approve it, especially anything using curl, wget, ssh, scp, or a script that makes network requests. Look for:

If something looks wrong, deny it and tell the agent why.

2. Don’t use modes that skip confirmation

Each tool has a way to run without asking, for example Claude Code’s --dangerously-skip-permissions flag, Codex’s --dangerously-bypass-approvals-and-sandbox (or --yolo), and Cursor’s Run Everything mode. These modes are meant for disposable environments. On your everyday machine, they remove your last chance to catch a leak.

If you allow some commands to run automatically, keep the list short and leave out anything that can reach the network.

3. Use the tool’s sandbox

Some agents can restrict which files and network hosts their commands can reach:

Turn these on where available, and leave network access off unless a task needs it.

4. Run the agent in a container or VM

For unfamiliar code, or when you want to let an agent run freely, put it somewhere that doesn’t hold your personal data:

Don’t mount your home directory, SSH keys or cloud credentials into the container unless the task needs them.

5. Keep personal data out of reach

6. Test your setup

Settings are easy to get wrong. Run the Agent Leak Test to see what your agent actually sends to a website that asks for a contact email.

Does your AI agent leak your email?

Find out in about a minute. Free, no sign-up, results deleted after 1 hour.

Run the Agent Leak Test