Understand the execution boundary

Lesson 19 of 35 · Working with AI coding agents

A shell runs commands as a process on some computer. Unless an independent restriction applies, that process can use the operating-system permissions of its account. It may launch other programs, read accessible files, and use available network connections. A friendly-looking test command can therefore do much more than display a test result.

An approval prompt governs a request handled by the agent application. A sandbox is an environment with enforced limits on what processes can reach or change. They answer different questions:

agent proposes action -> application permission check -> process runs
                                                      -> OS / sandbox limits
                                                      -> files, network, accounts

A successful permission check does not create isolation. Conversely, a sandbox does not decide whether the action serves your goal. Use both where appropriate.

Inspect what crosses the boundary

A container or virtual machine can provide isolation, but its actual configuration matters. Suppose a container has a writable mount of your entire home directory. A process inside it can alter that mounted content if its permissions allow it. A network connection and a production token may also let it change a remote database, even if the local filesystem is isolated. A virtual machine is not automatically safe if it has the same credentials or shared folders.

For unfamiliar code, prefer a disposable environment with a limited project copy, a non-privileged account, no unnecessary credentials, and restricted network access where feasible. Identify writable mounts and reachable services; take suitable backups outside the environment. Check the actual isolation settings and product documentation. Isolation reduces exposure; it is not a guarantee against every failure.

Other ways code runs

Plugins, custom tools, install hooks and scripts may execute code under an application or separate process identity. A plugin might run at startup or observe tool calls, depending on its implementation. A rule for the shell tool may not intercept code run through those other routes. Review each component’s actual execution and access, rather than treating the agent’s tool list as the whole boundary.