Agentfence — AI skill for Claude Code
Policy firewall for the shell commands AI coding agents run: Claude Code & Cursor hooks that block rm -rf ~, force-push to main, curl bash, DROP TABLE and secret exfiltration.
How to install Agentfence
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open hamarshehmhmd/agentfence and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Agentfence does
Policy firewall for the shell commands AI coding agents run: Claude Code & Cursor hooks that block rm -rf ~, force-push to main, curl bash, DROP TABLE and secret exfiltration.
Alternatives in AI
- Main — Open-source SaaS framework (React + Firebase + Stripe) with built-in Claude Code AI skills 550 ★
- Table Skills — 自用 AI Skills 合集:项目交接与网页替身,让长任务接续更清楚,让独立重任务交给网页 ChatGPT 512 ★
- Hol Guard — Open-source antivirus for AI agents: block risky tools, secret access, prompt injection, malicious packages, M 485 ★
README
agentfence
[](https://github.com/hamarshehmhmd/agentfence/actions/workflows/ci.yml) [](LICENSE)  
curl -fsSL https://raw.githubusercontent.com/hamarshehmhmd/agentfence/main/install.sh | sh
Installs the CLI and registers the hook for Claude Code and Cursor (user-level, merged into your existing settings, safe to re-run). Prefer not to pipe to sh? `pipx install git+https://github.com/hamarshehmhmd/agentfence` (or `uv tool install git+https://github.com/hamarshehmhmd/agentfence`), then `agentfence install claude --user` / `agentfence install cursor --user`. [Read install.sh](install.sh) first if you like.

**A policy firewall for the shell commands AI coding agents run.** It plugs into Claude Code and Cursor as a hook and checks every command *before* it executes. `rm -rf ~`, `git push --force origin main`, `curl … | bash`, `DROP TABLE` and `cat .env | curl …` get blocked. Commands that are risky but sometimes legitimate (`terraform destroy`, `git reset --hard`, reading `.env`) wait for a human. Everything else runs as normal.
Zero dependencies (Python ≥ 3.11 standard library only), licensed under AGPL-3.0 (commercial licenses available on request).
$ agentfence check -- "npm test && git push --force origin main"
DENY npm test && git push --force origin main
-> force-push to protected branch main [git.force-push: deny]
The problem
Coding agents now run shell commands on developers' laptops, often in auto-approve or "YOLO" mode. The built-in permission systems match command *prefixes*, not what a command
Related Skills
Shield
Local guardrails for AI coding agents. Wraps any MCP server and blocks destructive tool calls — DROP TABLE, rm
Shellbouncer
A firewall for AI coding agents. One policy file blocks rm -rf ~, curl sh and .env leaks in Claude Code, Codex
Lean Guard
A policy layer for AI coding agents, written and proved in Lean 4. Every Claude Code tool call is checked by a
ADHX
/plugin marketplace add itsmemeworks/adhx or curl -sL https://raw.githubusercontent.com/itsmemeworks/adhx/main
BulkheadScope
Sandbox policy reality-check and least-privilege minimizer for AI coding agents. Merges every permission layer
Declaude
Remove Claude/AI attribution from a GitHub repo in one command clean commit history, force-push, and refresh t
Related Agents
Linux Systems Engineer
Use when working on bare-metal or edge Linux configuration — systemd service units and drop-ins, kernel sysctl
Lms Security Scanner
Autonomous security scanner for the LMS-TMS. Checks TLS, security headers, DB-port internet exposure, firewall
Senior Security Engineer
Senior security engineer covering application security (OWASP-style threat modeling, secure coding, auth desig