Code Execution
Agent Nine can run shell commands on your machine (Code mode) or in a cloud sandbox (Chat mode).
Code Mode (Local)
In Code mode, commands run directly on your machine with full access to your project files, tools, and environment.
Bash (Linux / macOS)
Run the testsCheck if the project compilesInstall the dependencies and start the dev serverPowerShell (Windows)
Get-ChildItem -Recurse *.ts | Measure-ObjectRun npm testSame security protections apply for both shells.
Chat Mode (Cloud Sandbox)
In Chat mode, code runs in an isolated cloud sandbox:
- Separate container for each session
- Pre-installed runtimes: Python, Node.js, Go, Rust, Java
- No access to your local files
- Safe for experimentation — nothing affects your machine
Write a Python script that generates a Fibonacci sequenceCreate a React component and show me the resultSecurity
Agent Nine protects you from dangerous commands:
| Category | Examples | Behavior |
|---|---|---|
| Destructive | rm -rf /, git reset --hard, DROP TABLE | Blocked with warning |
| Irreversible | git push --force, npm publish | Requires explicit approval |
| Safe / read-only | git status, ls, cat, grep | Auto-approved |
Dangerous patterns are detected even when disguised:
- Encoded commands (base64, hex)
- Commands inside scripts
- Piped sequences that end in destructive operations
Timeouts
| Duration | |
|---|---|
| Default | 2 minutes |
| Maximum | 10 minutes |
| Background | No timeout (you'll be notified when done) |
Long-running commands can be started in the background — Agent Nine will continue chatting and notify you when the command finishes.
Permissions
| Mode | Behavior | Best for |
|---|---|---|
| Default | Asks before running every command | Beginners, sensitive projects |
| Session-approved | Approve once, auto-run similar commands | Regular development |
| Auto | Auto-run everything except destructive commands | Power users |
Read-only commands (git status, ls, cat, grep, find) are always auto-approved regardless of permission mode.
Tips
- Be specific — "run
npm testin the backend folder" is better than "test it" - Chain tasks — "install dependencies, run tests, then fix any failures"
- Background execution — for long builds or deployments, Agent Nine runs them in the background
- Review output — Agent Nine shows you the full command output and explains errors
