Fence
Sandbox CLI commands with network/filesystem restrictions
Get picks like this daily. Today's launch numbers, the top launches, AI and tech news, and a daily opportunity pick, straight to your inbox.
Want to reach these readers? Sponsor an issue.
Hi HN!Fence wraps any command in a sandbox that blocks network by default and restricts filesystem writes. Useful for running semi-trusted code (package installs, build scripts, unfamiliar repos) with controlled side effects, or even just blocking tools that phone home.> fence curl https://example.com # -> blocked> fence -t code -- npm install # -> template with registries allowed> fence -m -- npm install # -> monitor mode: see what gets blockedOne use-case is to use it with AI coding agents to reduce the risk of running agents with fewer interactive permission prompts:> fence -t code -- claude --dangerously-skip-permissionsYou can import existing Claude Code permissions with `fence import --claude`.Fence uses OS-native sandboxing (macOS sandbox-exec, Linux bubblewrap) + local HTTP/SOCKS proxies for domain filtering.Why I built this: I work on Tusk Drift, a system to record and replay real traffic as API tests (https://github.com/Use-Tusk/tusk-drift-cli). I needed a way to sandbox the service under test during replays to block localhost outbound connections (Postgres, Redis) and force the app to use mocks instead of real services. I quickly realized that this could be a general purpose tool that would also be useful as a permission manager across CLI agents.Limitations: Not strong containment against malware. Proxy-based filtering requires programs to respect `HTTP_PROXY`.Curious if others have run into similar needs, and happy to answer any questions!
HN · launched Jan 20, 2026 · 78 upvotes (top 13%) · 0 views
Niche: code execution sandboxes · 37 launches, 0 in the last 7 days · Explore this niche →
Category and tags
- Security
- Dev tools
- Developer
- Not AI
- Hobby / open-source project
Visit website ↗ Source listing ↗
More like this: all 37 launches in code execution sandboxes →
Could you build this?
Partial A basic CLI wrapper is easy to vibe code, but low-level sandbox isolation of arbitrary binaries across OS platforms requires deep operating system security internals.
What it would actually take: Fence must leverage OS-native isolation primitives: Linux namespaces, cgroups, and seccomp-bpf filters (or `landlock`), and macOS Sandbox (`sandbox-exec` / seatbelt APIs or Endpoint Security framework). Implementing granular network interception and filesystem cow/virtualization without requiring root access requires low-level C or Rust systems programming.
Discussion
20 comments analyzed.
Competitors mentioned: sandbox-runtime (Anthropic), sandvault (MacOS limited user account approach), clodpod (MacOS virtual machine approach), Steam pressure-vessel containers
Concerns raised: Nested bubblewrap sandboxes don't work (namespace nesting limitations), Domain filtering relies on HTTP_PROXY (malware could ignore it), OS sandboxes aren't VM-level isolation (kernel exploits possible), No resource limits or content inspection, Uncertainty about Fargate/ECS/Lambda deployment support
Feature requests: Deny-by-default read access mode with system path allowlist, Resource limits (CPU, memory, fork bomb protection), Extend to API calls and token budget restrictions, Clearer macOS documentation in README
Competitors
Other products that read as similar to this one : 413 launches clear the similarity bar, closest 8 shown.
Attention rank: #71 of 414 (itself plus its competitors, highest first, normalized so YC and Product Hunt are compared fairly).
Launched 83 days after the earliest competitor.
- Zerobox · hn · 2026-03-30 · 141 upvotes · similarity 0.54
- A context-aware permission guard for Claude Code · hn · 2026-03-11 · 127 upvotes · similarity 0.52
- Bx · hn · 2026-04-07 · 8 upvotes · similarity 0.49
- yolonot · ph · 2026-11-11 · 2 upvotes · similarity 0.48
- Claw Patrol, a security firewall for agents · hn · 2026-06-09 · 112 upvotes · similarity 0.47
- CargoWall · hn · 2026-03-31 · 14 upvotes · similarity 0.45
- CapLock · ph · 2026-09-28 · 1 upvotes · similarity 0.45
- Tui2web · hn · 2026-09-25 · 7 upvotes · similarity 0.45
The niche, labels, vibe code rating and competitor comparison on this page are analysis by Nicheloom. If you use them, please credit nicheloom.com. How you may use our data.