← 开源
fencesandbox

fence

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

InfrastructureOrchestrationGo
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
992
Star
44
Fork
+4
本周
17
贡献者
创建于 2025-12-18 · 更新于 2026-10-15 · 今日第 12184 名
主要开发者

fencesandbox/fence 排名第 12,184,有 992 个星标。

同类别比较

fencesandbox/fence 排名第 12,184,此处有 8 个同类条目;keras-team/keras-hub 排名第 12,174。

同类别比较
名称排名指标
N4darae/shrt12,130
语言:
Go
星标数:
1,002
分叉数:
69
简介:
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
语言:
Python
星标数:
999
分叉数:
105
简介:
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
语言:
C++
星标数:
996
分叉数:
91
简介:
Low-bit LLM inference on CPU/NPU with lookup table
keras-team/keras-hub12,174
语言:
Python
星标数:
994
分叉数:
371
简介:
Pretrained model hub for Keras 3.
xing61/zzz-api12,208
星标数:
990
分叉数:
83
简介:
企业级稳定的OpenAI、Claude、Gemini等的API接口-For企业和开发者。OpenAI的api proxy,支持ChatGPT的API调用,支持Anthropic claude的官方接口形式,支持Google gemini的官方接口形式,支持:gpt-5,sora。不需要openai Key, 不需要买openai的账号,不需要美元的银行卡,通通不用的,直接调用就行,稳定好用!!智增增
senstella/parakeet-mlx12,220
语言:
Python
星标数:
987
分叉数:
62
简介:
An implementation of the Nvidia's Parakeet models for Apple Silicon using MLX.
KenyonY/openai-forward12,221
语言:
Python
星标数:
986
分叉数:
308
简介:
🚀 大语言模型高效转发服务 · An efficient forwarding service designed for LLMs. · OpenAI API Reverse Proxy
Nya-Foundation/NyaProxy12,222
语言:
Python
星标数:
986
分叉数:
20
简介:
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.
关键参数与规格
关键参数与规格
参数值
语言Go
类别Infrastructure
子类别Orchestration
关键词Agent sandbox
星标数992
分叉数44
贡献者17
创建日期2025-12-18
更新日期2026-10-15
1 天星标数0
7 天星标数4
排名12,184
上次排名6,126
排名变化-6,058
7 天星标排名6,271
上次 7 天星标排名6,273
7 天星标排名变化2
总星标排名11,216
上次总星标排名11,192
总星标排名变化-24
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. 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.

常见问题

记录了多少星标和分叉?

fencesandbox/fence 有 992 个星标和 44 个分叉。

仓库排名是多少?

fencesandbox/fence 排名第 12,184。

记录的语言和类别是什么?

fencesandbox/fence 有 992 个星标,语言为 Go,类别为 Infrastructure。

哪个仓库排名最接近?

fencesandbox/fence 与 keras-team/keras-hub 比较,后者排名第 12,174,有 994 个星标。

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.

排名相邻
同类项目