An agent with a shell is powerful. Sandboxing is how you let it work without giving it the keys to everything.
Define the allowed set
Start with a short list of commands the agent needs, such as the Angular CLI build, test, and lint commands. Require approval for everything else.
Isolate the environment
Run the agent in a container, virtual machine, or restricted user account. Mount only the project directory. Keep your home directory, SSH keys, cloud credentials, and other projects out of reach.
Control the network
Block outbound access by default and allow only what is necessary, such as your package registry. This limits both data exfiltration and malicious downloads.
Protect secrets
Do not place secrets in files or environment variables the agent can read. Use dummy values during development, and keep real credentials in a separate system.
Review and revert
Run the agent on a branch. Inspect diffs before merging. Version control provides a simple undo.
Log activity
Record commands and outcomes so you can reconstruct what happened if something goes wrong.
Takeaway
Combine isolation, least privilege, and review. The goal is that even a confused or manipulated agent can do only limited harm.
Continue with the book
Explore the full treatment, worked examples, and exercises in Local AI Agents for Angular Teams.
Adapted from Local AI Agents for Angular Teams, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.
