VibeCoding implements Linux process-level sandbox isolation through bubblewrap (bwrap) to protect system security.
A sandbox is a security mechanism that restricts a program's file system and network access permissions.
┌─────────────────────────────────────────────────────────────┐
│ Sandbox Overview │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────────┐│
│ │ Sandboxed Process ││
│ │ ││
│ │ Project Directory ││
│ │ ┌─────────────────────────────────────────────────┐ ││
│ │ │ RW/RO access │ ││
│ │ └─────────────────────────────────────────────────┘ ││
│ │ ││
│ │ System Directories ││
│ │ ┌─────────────────────────────────────────────────┐ ││
│ │ │ RO access only │ ││
│ │ └─────────────────────────────────────────────────┘ ││
│ │ ││
│ │ Network ││
│ │ ┌─────────────────────────────────────────────────┐ ││
│ │ │ Blocked (standard/strict) │ ││
│ │ └─────────────────────────────────────────────────┘ ││
│ │ ││
│ └─────────────────────────────────────────────────────────┘│
│ │
└─────────────────────────────────────────────────────────────┘
| Level | Mode | File System | Network | Use Case |
|---|---|---|---|---|
| none | YOLO | Full access | Allowed | System administration, network operations |
| standard | Agent | Project R/W, System R/O | Disabled | Daily development |
| strict | Plan | Project R/O, System R/O | Disabled | Code review, analysis |
| Feature | none | standard | strict |
|---|---|---|---|
| Read project files | ✓ | ✓ | ✓ |
| Write project files | ✓ | ✓ | ✗ |
| Read system files | ✓ | ✓ | ✓ |
| Write system files | ✓ | ✗ | ✗ |
| Network access | ✓ | ✗ | ✗ |
| Install packages | ✓ | ✗ | ✗ |
| Modify configuration | ✓ | ✗ | ✗ |
Purpose: Read-only analysis and planning
vibecoding --mode plan
vibecoding -M planFeatures:
- Project directory: Read-only
- System directory: Read-only
- Network: Disabled
Use Cases:
- Code review
- Project analysis
- Learning codebase
- Creating development plans
Purpose: Standard development tasks
vibecoding --mode agent --sandbox
vibecoding -M agent --sandboxFeatures:
- Project directory: Read/write
- System directory: Read-only
- Network: Disabled
Use Cases:
- Writing code
- Modifying files
- Running tests
- Building projects
Purpose: Full access
vibecoding --mode yolo
vibecoding -M yoloFeatures:
- Project directory: Full access
- System directory: Full access
- Network: Allowed
Use Cases:
- System administration
- Installing packages
- Network requests
- Cross-project operations
Risks:
- May modify system files
- May execute dangerous commands
- May expose sensitive information
Gateway, Hermes, and A2A can expose HTTP/WebSocket entry points. Treat these services as remote code-execution surfaces whenever tools can run in agent or yolo mode.
- Gateway: enable
auth.enabledbefore exposing beyond loopback; startup warns when Gateway listens beyond loopback inyolomode without authentication. - A2A: standalone A2A binds to
127.0.0.1by default. Use--host 0.0.0.0only for intentional exposure, and configure an auth token. - Hermes WebSocket: send tokens with
Authorization: Bearer <token>during the WebSocket handshake. Query-string tokens are accepted only for compatibility. - Working directories: use
allowedWorkDirs/allowed_work_dirsto restrict per-request or per-platform working directories.
Provider API keys can be loaded from shell commands with apiKey: "!command", but this is disabled by default. Enable it only for trusted local config:
export VIBECODING_ALLOW_SHELL_CONFIG=1Prefer environment-variable references such as ${DEEPSEEK_API_KEY} for shared configs.
# Enable sandbox
vibecoding --sandbox
# Disable sandbox
vibecoding --no-sandbox
# Combine with mode
vibecoding --sandbox --mode plan{
"sandbox": {
"enabled": true,
"level": "standard",
"allowNetwork": false
}
}export VIBECODING_SANDBOX=truebubblewrap is a lightweight Linux sandbox tool that uses Linux namespaces for process isolation.
# Debian/Ubuntu
sudo apt install bubblewrap
# Fedora/RHEL
sudo dnf install bubblewrap
# Arch Linux
sudo pacman -S bubblewrap
# Verify installation
bwrap --version┌─────────────────────────────────────────────────────────────┐
│ bwrap Namespaces │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────────┐│
│ │ Mount Namespace ││
│ │ /project → RW/RO (depending on level) ││
│ │ /usr → RO ││
│ │ /lib → RO ││
│ │ /etc → RO ││
│ └─────────────────────────────────────────────────────────┘│
│ │
│ ┌─────────────────────────────────────────────────────────┐│
│ │ Network Namespace ││
│ │ No network access (standard/strict) ││
│ └─────────────────────────────────────────────────────────┘│
│ │
│ ┌─────────────────────────────────────────────────────────┐│
│ │ PID Namespace ││
│ │ Process isolation ││
│ └─────────────────────────────────────────────────────────┘│
│ │
└─────────────────────────────────────────────────────────────┘
# Standard sandbox
bwrap \
--ro-bind /usr /usr \
--ro-bind /lib /lib \
--ro-bind /lib64 /lib64 \
--ro-bind /bin /bin \
--ro-bind /etc /etc \
--bind /home/user/project /home/user/project \
--tmpdir /tmp \
--proc /proc \
--dev /dev \
--chdir /home/user/project \
--unshare-net \
--unshare-pid \
--die-with-parent \
-- sh -c "go build ./..."
# Strict sandbox
bwrap \
--ro-bind /usr /usr \
--ro-bind /lib /lib \
--ro-bind /home/user/project /home/user/project \
--tmpdir /tmp \
--proc /proc \
--dev /dev \
--chdir /home/user/project \
--unshare-net \
--unshare-pid \
--die-with-parent \
-- sh -c "go vet ./..."type Manager struct {
level Level
workdir string
allowNetwork bool
}
type Level int
const (
LevelNone Level = iota // Unrestricted
LevelStandard // Standard sandbox
LevelStrict // Strict sandbox
){
"sandbox": {
"enabled": true,
"level": "standard",
"allowNetwork": false,
"allowDevices": false,
"extraBinds": [
"/path/to/extra:/mnt/extra"
]
}
}| Field | Type | Default | Description |
|---|---|---|---|
enabled |
bool | false | Enable sandbox |
level |
string | "standard" | Sandbox level |
allowNetwork |
bool | false | Allow network |
allowDevices |
bool | false | Allow device access |
extraBinds |
[]string | [] | Extra bind mounts |
# Set alias in shell configuration
alias vibecoding='vibecoding --sandbox'| Task | Recommended Mode | Reason |
|---|---|---|
| Reading code | Plan | Read-only, safest |
| Modifying code | Agent | Project R/W, no network |
| Running tests | Agent | Needs execution permission |
| Installing dependencies | YOLO | Needs network |
| System administration | YOLO | Needs full permissions |
The following operations should be reviewed by humans:
- Deleting files
- Modifying system configuration
- Executing unknown scripts
- Accessing sensitive data
# Commit regularly
git add .
git commit -m "save progress"
# Use branches
git checkout -b feature/new-feature# Run from project root directory
cd /home/user/project
vibecoding --sandbox| Operation | none | standard | strict |
|---|---|---|---|
| Install system software | ✓ | ✗ | ✗ |
| Access network | ✓ | ✗ | ✗ |
| Modify system files | ✓ | ✗ | ✗ |
| Access other projects | ✓ | ✗ | ✗ |
| Docker operations | ✓ | ✗ | ✗ |
- Startup time: ~10-50ms increase
- Memory overhead: Negligible
- I/O performance: Minimal impact
| Platform | Support |
|---|---|
| Linux | ✓ Full support |
| macOS | ✗ Not supported |
| Windows | ✗ Not supported (WSL usable) |
- Project file corruption: Agent mode can modify project files
- Symbolic link attacks: Symbolic links in project may point outside
- Resource exhaustion: May consume excessive CPU/memory
- Information leakage: Project files may contain sensitive information
# 1. Use version control
git init
git add .
git commit -m "initial"
# 2. Regular backups
cp -r project project.backup
# 3. Limit resources
timeout 300 vibecoding --sandbox
# 4. Check symbolic links
find . -type l -lsVibeCoding v0.0.4 introduces an Agent mode approval mechanism for enhanced security.
In Agent mode, executing bash commands requires user approval:
- Whitelist check: Command prefix matches
bashWhitelistentry → Auto-approve - Blacklist check: Command prefix matches
bashBlacklistentry → Always require approval - Default behavior: Non-whitelisted commands → Require user y/n approval
{
"approval": {
"bashWhitelist": ["go ", "make ", "git ", "npm ", "yarn "],
"bashBlacklist": ["rm -rf", "sudo"]
}
}[
"go ",
"make ",
"git ",
"npm ",
"yarn ",
"node ",
"python ",
"pip "
]┌─────────────────────────────────────────────────────────────┐
│ Approval Flow │
├─────────────────────────────────────────────────────────────┤
│ │
│ Agent requests bash command execution │
│ │ │
│ ▼ │
│ Check mode │
│ ├─ Plan mode → Deny (read-only) │
│ ├─ Agent mode → Continue checking │
│ └─ YOLO mode → Auto-approve │
│ │
│ In Agent mode: │
│ ├─ Non-bash tool → Auto-approve │
│ ├─ Command matches whitelist → Auto-approve │
│ └─ Otherwise → Require user approval │
│ │
│ User approval: │
│ ├─ Enter y/yes → Execute command │
│ └─ Enter n/no → Deny execution │
│ │
└─────────────────────────────────────────────────────────────┘
- Keep default whitelist: Only allow common safe commands
- Add blacklist: Add dangerous commands like
rm -rf,sudoto blacklist - Regular review: Check approval logs to understand Agent-executed commands
- Combine with sandbox: Use
--sandboxto limit file system access
vibecoding --debugIn debug mode, all executed commands are output to stderr:
[DEBUG] Executing: go build ./...
[DEBUG] Sandbox: bwrap --ro-bind /usr /usr ...
[DEBUG] Exit code: 0
# Save logs
vibecoding --debug 2>vibecoding.log
# Analyze logs
grep "Executing:" vibecoding.logError: bwrap: command not found
Solution:
# Install bwrap
sudo apt install bubblewrap
# Or disable sandbox
vibecoding --no-sandboxError: bwrap: Permission denied
Solution:
- Check if bwrap is correctly installed
- Confirm user has permission to execute bwrap
- Check file system permissions
Error: network is unreachable
Solution:
- Use YOLO mode
- Or configure
allowNetwork: true
Error: Read-only file system
Solution:
- Use Agent mode (standard)
- Or use YOLO mode (none)
- Check file permissions