Quick Start
Get up and running with Shai in minutes.
Installation
Choose your preferred installation method:
Verify Installation
1shai --versionYou should see the version number printed to the console.
Your First Sandbox
Let’s start a basic sandbox to understand how Shai works.
1. Navigate to Your Project
1cd ~/projects/my-app2. Start Shai
1shaiThis opens a sandboxed shell with:
- Your workspace mounted read-only at
/src - Network access restricted to common package registries and APIs
- Running as non-root user
shai
3. Explore the Sandbox
Inside the sandbox, try these commands:
1# View your code (read-only)
2ls /src
3
4# Try to create a file (this will fail)
5echo "test" > /src/file.txt
6# Output: cannot create /src/file.txt: Read-only file system
7
8# Check network restrictions
9curl https://github.com
10# Works! (GitHub is in the default allowlist)
11
12# Exit the sandbox
13exitMaking Directories Writable
To allow modifications to specific directories, use the -rw (or --read-write) flag:
Single Directory
1shai -rw src/componentsThis mounts src/components as writable while keeping the rest of your workspace read-only.
Multiple Directories
1shai -rw src/components -rw tests/unitYou can specify multiple -rw flags to make multiple directories writable.
Running AI Agents
The real power of Shai comes from running AI agents inside the sandbox.
Launch an Agent After Bootstrap
1shai -rw src/auth -- claude-code --dangerously-bypass-approvals-and-sandboxWhat this does:
- Creates a sandbox with
src/authwritable - After sandbox setup completes, launches
claude-code - The agent runs inside the controlled environment
Without a Command
If you don’t specify a command after --, Shai drops you into an interactive shell where you can manually run agents:
1shai -rw src/components
2# Now inside sandbox
3claude-codeWhy --dangerously-bypass-approvals-and-sandbox?
Many AI agents have their own sandboxing. When running inside Shai, you can disable the agent’s built-in sandbox since Shai provides superior isolation that is consistent across agents.
Common Workflows
Frontend Development
1shai -rw src -rw public -- claude-codeBackend Development
1shai -rw internal/api -rw tests -- codexRunning Tests
1shai -- npm testTests can read your code but won’t modify it.
Inspecting the Sandbox
Want to see what Shai is doing? Use verbose mode:
1shai -rw src/components --verboseThis shows:
- Bootstrap script details
- Resource decisions (which resource sets are applied)
- Network firewall rules
- Mount points
Next Steps
Now that you’ve got Shai running, dive deeper:
Troubleshooting
Docker Not Running
Error: Cannot connect to Docker daemonSolution: Start Docker Desktop or the Docker daemon.
Permission Denied
Error: permission denied while trying to connect to the Docker daemon socketSolution: Add your user to the docker group:
1sudo usermod -aG docker $USERThen log out and back in.
More Help
See the Troubleshooting guide for more common issues and solutions.