Fence is a sandboxing tool that restricts network and filesystem access for arbitrary commands. It's most useful for running semi-trusted code (package installs, build scripts, CI jobs, unfamiliar repos) with controlled side effects.
- Quickstart - Install fence and run your first sandboxed command in 5 minutes
- Why Fence - What problem it solves (and what it doesn't)
- Concepts - Mental model: OS sandbox + local proxies + config
- Troubleshooting - Common failure modes and fixes
- Using Fence with AI agents - Defense-in-depth and policy standardization
- Recipes - Common workflows (npm/pip/git/CI)
- Templates - Copy/paste templates you can start from
- README - CLI usage
- Library Usage (Go) - Using Fence as a Go package
- Configuration - How to configure Fence
- Config JSON Schema - Editor validation and autocomplete for
fence.json - Architecture - How fence works under the hood
- Security model - Threat model, guarantees, and limitations
- Linux security features - Landlock, seccomp, eBPF details and fallback behavior
- Testing - How to run tests and write new ones
- Benchmarking - Performance overhead and profiling
See examples/ for runnable demos.
# Block all network (default)
fence <command>
# Use custom config
fence --settings ./fence.json <command>
# Debug mode (verbose output)
fence -d <command>
# Monitor mode (show blocked requests)
fence -m <command>
# Expose port for servers
fence -p 3000 <command>
# Run shell command
fence -c "echo hello && ls"