HeadlinesBriefing favicon HeadlinesBriefing.com

Fence CLI Sandbox: Block Network and Filesystem Access

Hacker News: Front Page •
×

Fence is a new CLI tool that wraps commands in a sandbox, blocking network access by default and restricting filesystem writes. It's designed for running semi-trusted code—like package installs or unfamiliar repos—with controlled side effects. The tool uses OS-native sandboxing on macOS and Linux, plus local proxies for domain filtering.

The creator built Fence while working on Tusk Drift, a system for replaying real traffic as API tests. They needed to sandbox services during replays to block localhost connections and force mock usage. This experience revealed a broader need for a permission manager across CLI agents, especially for reducing risk with AI coding tools.

Fence offers a 'monitor mode' to see what gets blocked and can import existing Claude Code permissions. While not strong containment against malware, it's a practical solution for developers managing tool dependencies and network behavior. It addresses a common pain point in modern development workflows where automated agents and scripts require careful oversight.