← Open Source
fencesandbox

fence

Lightweight, container-free sandbox for running commands with network and filesystem restrictions.

InfrastructureOrchestrationGo
Open on GitHub
Momentum
+0stars in 24 hours0.0%
992
Stars
44
Forks
+4
This week
17
Contributors
Created 2025-12-18 · Updated 2026-10-15 · #12184 today
Top developers

fencesandbox/fence is ranked 12,184 with 992 stars.

Same-category comparison

fencesandbox/fence is ranked 12,184 among these 8 peers; keras-team/keras-hub is ranked 12,174.

Same-category comparison
NameRankMetrics
N4darae/shrt12,130
Language:
Go
Stars:
1,002
Forks:
69
Description:
A contract-driven gRPC regression harness for AI coding agents, with human-approved baselines. Snapshot the valid call chains of an API so an agent can look one up instead of tracing for it. gRPC today, OpenAPI next.
PINTO0309/onnx2tf12,143
Language:
Python
Stars:
999
Forks:
105
Description:
A tool for converting ONNX files to LiteRT/TFLite/TensorFlow, PyTorch native code (nn.Module), TorchScript (.pt), state_dict (.pt), Exported Program (.pt2), and Dynamo ONNX. It also supports direct conversion from LiteRT to PyTorch.
microsoft/T-MAC12,163
Language:
C++
Stars:
996
Forks:
91
Description:
Low-bit LLM inference on CPU/NPU with lookup table.
keras-team/keras-hub12,174
Language:
Python
Stars:
994
Forks:
371
Description:
Pretrained model hub for Keras 3.
xing61/zzz-api12,208
Stars:
990
Forks:
83
senstella/parakeet-mlx12,220
Language:
Python
Stars:
987
Forks:
62
Description:
An implementation of the Nvidia's Parakeet models for Apple Silicon using MLX.
KenyonY/openai-forward12,221
Language:
Python
Stars:
986
Forks:
308
Description:
· OpenAI API Reverse Proxy.
Nya-Foundation/NyaProxy12,222
Language:
Python
Stars:
986
Forks:
20
Description:
NyaProxy acts like a smart, central manager for accessing various online services (APIs) – think AI tools (like OpenAI, Gemini, Anthropic), image generators, or almost any web service that uses access keys. It helps you use these services more reliably, efficiently, and securely.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguageGo
CategoryInfrastructure
SubcategoryOrchestration
KeywordsAgent sandbox
Stars992
Forks44
Contributors17
Created date2025-12-18
Updated date2026-10-15
Stars in 1 day0
Stars in 7 days4
Rank12,184
Previous rank6,126
Rank change-6,058
7-day stars rank6,271
Previous 7-day stars rank6,273
7-day stars rank change2
Total stars rank11,216
Previous total stars rank11,192
Total stars rank change-24
README summary

Fence wraps commands in a sandbox that blocks network access by default and restricts filesystem operations based on configurable rules. It's most useful for running semi-trusted code (package installs, build scripts, CI jobs, unfamiliar repos) with controlled side effects, and it can also complement AI coding agents as defense-in-depth. Fence is also a permission manager for your CLI agents. **Works with popular coding agents like Claude Code, Codex, Amp, Gemini CLI, GitHub Copilot, OpenCode, Factory (Droid) CLI

, and many more** - see agents. If you installed with Homebrew from the old Tusk tap, switch to the new tap: If you installed with , reinstall from the new module path: **macOS / Linux:** **Homebrew (macOS):** **Nix (macOS, Linux, Windows (WSL)):** This runs it directly from the repository, without installing . If you want to install it, follow the guidelines from NixOS or nix-darwin. Other installation methods **Go install:** **Build from source:** **Additional requirements for Linux:** (for sandboxing) (for network bridging) (optional

, for filesystem violation visibility when monitoring with ) Usage Basic [! TIP] Need to pass flags to the command you are running? Use to separate Fence flags from command flags, for example: Configuration When is not provided, Fence first looks for (or ) in the current directory and parent directories. Both extensions are treated as JSONC (comments and trailing commas are allowed). See configuration reference for more details. For repo-local overrides on top of each user's normal Fence config, use: Use to

specify a different config. Inspect the active config without running a command: prints the config chain to and the fully resolved config as plain JSON to , so you can pipe the JSON to tools like . Create a starter config with sensible defaults: Import from Claude Code Features **Network isolation** - All outbound blocked by default; allowlist domains via config **Filesystem restrictions** - Control read/write access paths **Command blocking** - Deny dangerous commands like , **SSH Command Filtering** - Control which hosts and commands are

allowed over SSH **Built-in templates** - Pre-configured rulesets for common workflows **Violation monitoring** - Real-time logging of blocked requests ( ) **Cross-platform** - macOS (sandbox-exec) + Linux (bubblewrap) Fence can be used as a Go package or CLI tool. Documentation Full docs are hosted at **fencesandbox. Quick links: Quickstart (source) Configuration Reference (source) Agent Hooks (source) Security Model (source) Go Library Usage (source) Architecture (source) Attribution Inspired by Anthropic's sandbox-runtime.

Frequently asked questions

How many stars and forks are recorded?

fencesandbox/fence has 992 stars and 44 forks.

What is the repository rank?

fencesandbox/fence is ranked 12,184.

What language and category are recorded?

fencesandbox/fence has 992 stars, uses Go and belongs to Infrastructure.

Which repository is closest in rank?

fencesandbox/fence is compared with keras-team/keras-hub, ranked 12,174 with 994 stars.

README

Fence wraps commands in a sandbox that blocks network access by default and restricts filesystem operations based on configurable rules. It's most useful for running semi-trusted code (package installs, build scripts, CI jobs, unfamiliar repos) with controlled side effects, and it can also complement AI coding agents as defense-in-depth.

# Block all network access (default)
fence curl https://example.com  # → 403 Forbidden

# Allow specific domains
fence -t code npm install  # → uses 'code' template with npm/pypi/etc allowed

# Block dangerous commands
fence -c "rm -rf /"  # → blocked by command deny rules
 ![Fence Claude Code demo](assets/demo.gif) 

Fence is also a permission manager for your CLI agents. Works with popular coding agents like Claude Code, Codex, Amp, Gemini CLI, GitHub Copilot, OpenCode, Factory (Droid) CLI, and many more - see agents.md.

Install

[!NOTE] Fence has moved from github.com/Use-Tusk/fence to github.com/fencesandbox/fence. If you installed with Homebrew from the old Tusk tap, switch to the new tap:

brew uninstall use-tusk/tap/fence
brew untap use-tusk/tap
brew tap fencesandbox/tap
brew install fencesandbox/tap/fence

If you installed with go install, reinstall from the new module path:

go install github.com/fencesandbox/fence/cmd/fence@latest

macOS / Linux:

curl -fsSL https://cli.fencesandbox.com/install.sh | sh

Homebrew (macOS):

brew tap fencesandbox/tap
brew install fencesandbox/tap/fence

Nix (macOS, Linux, Windows (WSL)):

nix run nixpkgs#fence -- --help

This runs it directly from the repository, without installing fence. If you want to install it, follow the guidelines from NixOS or nix-darwin.

Other installation methods

Go install:

go install github.com/fencesandbox/fence/cmd/fence@latest

Build from source:

git clone https://github.com/fencesandbox/fence
cd fence
go build -o fence ./cmd/fence

Additional requirements for Linux:

  • bubblewrap (for sandboxing)
  • socat (for network bridging)
  • bpftrace (optional, for filesystem violation visibility when monitoring with -m)

Usage

Basic

# Run command with all network blocked (no domains allowed by default)
fence curl https://example.com

# Run with shell expansion
fence -c "echo hello && ls"

# Enable debug logging
fence -d curl https://example.com

# Use a template
fence -t code -- claude  # Runs Claude Code using `code` template config

# Monitor mode (shows violations)
fence -m npm install

# Send Fence's own monitor/debug logs to a file
fence -m --fence-log-file /tmp/fence.log -- claude
tail -f /tmp/fence.log

# Inspect the config inheritance chain and active merged config
fence config show

# Show all commands and options
fence --help

[!TIP] Need to pass flags to the command you are running? Use -- to separate Fence flags from command flags, for example:

fence -- claude --dangerously-skip-permissions

Configuration

When --settings is not provided, Fence first looks for fence.jsonc (or fence.json) in the current directory and parent directories. If none is found, it falls back to ~/.config/fence/fence.{jsonc,json}. Both extensions are treated as JSONC (comments and trailing commas are allowed). See configuration reference for more details.

{
  "$schema": "https://raw.githubusercontent.com/fencesandbox/fence/main/docs/schema/fence.schema.json",
  "extends": "code",
  "network": { "allowedDomains": ["private.company.com"] },
  "filesystem": { "allowWrite": ["."] },
  "command": { "deny": ["git push", "npm publish"] }
}

For repo-local overrides on top of each user's normal Fence config, use:

{
  "extends": "@base",
  "filesystem": { "allowWrite": ["."] }
}

Use fence --settings ./custom.json to specify a different config.

Inspect the active config without running a command:

fence config show
fence config show --settings ./custom.json
fence config show --template code

fence config show prints the config chain to stderr and the fully resolved config as plain JSON to stdout, so you can pipe the JSON to tools like jq.

Create a starter config with sensible defaults:

# Creates config at the default path with:
# { "extends": "code" }
fence config init

# Include scaffold arrays as editable hints
fence config init --scaffold

Import from Claude Code

fence import --claude --save

Features

  • Network isolation - All outbound blocked by default; allowlist domains via config
  • Filesystem restrictions - Control read/write access paths
  • Command blocking - Deny dangerous commands like rm -rf /, git push
  • SSH Command Filtering - Control which hosts and commands are allowed over SSH
  • Built-in templates - Pre-configured rulesets for common workflows
  • Violation monitoring - Real-time logging of blocked requests (-m)
  • Cross-platform - macOS (sandbox-exec) + Linux (bubblewrap)

Fence can be used as a Go package or CLI tool.

Documentation

Full docs are hosted at fencesandbox.com/docs.

Quick links:

Attribution

Inspired by Anthropic's sandbox-runtime.

Nearby in the ranking
Similar items