Global Agent Guardrails

Configure the shared guard against catastrophic shell commands in local AI agents. Use when changing block patterns, adding an agent or machine, or investigating why a command was or wasn't blocked.

4,336 stars 628 forksAI, LLMs & Agents

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add davidondrej/skills --skill global-agent-guardrails
Manual install
git clone --depth 1 https://github.com/davidondrej/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/skills/global-agent-guardrails ~/.claude/skills/global-agent-guardrails

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Global Agent Guardrails

Block catastrophic shell commands before a coding agent runs them. One patterns file feeds a shared hook script, or a small native adapter, for each agent. This guards against accidents, not malicious agents: obfuscation like `python -c "shutil.rmtree(...)"` slips past any regex.

This is a generic recipe built on each tool's public hook system. [Cloudroom](https://www.cloudroom.dev/security) ships a built-in Command Guard based on this design, on by default.

## File map

```
~/.agents/hooks/dangerous-patterns.txt   # THE denylist: one POSIX-ERE regex per line, # comments
~/.agents/hooks/deny-dangerous.sh        # shared guard: hook JSON on stdin -> exit 2 blocks
~/.agents/hooks/test-guard.sh            # test suite: run after ANY pattern change
~/.config/opencode/plugins/command-guard.ts   # OpenCode adapter (throws to block)
~/.pi/agent/extensions/command-guard.ts       # Pi adapter (returns {block:true})
~/.hermes/plugins/command-guard/              # Hermes plugin (returns {"action":"block"})
```

## Check installation

```bash
ls ~/.agents/hooks/deny-dangerous.sh ~/.agents/hooks/dangerous-patterns.txt
~/.agents/hooks/test-guard.sh   # must end "failed: 0"
```

If missing, rebuild from the script below and the wiring table.

## Guard script

`deny-dangerous.sh` reads the hook JSON on stdin, pulls out the command, and tests it against every pattern. Its core:
Read the full skill on GitHub

Details

Skill name
global-agent-guardrails
Path
skills/global-agent-guardrails/SKILL.md
License
MIT
Repo updated
17 November 2026

FAQ

What does the Global Agent Guardrails skill do?

Configure the shared guard against catastrophic shell commands in local AI agents. Use when changing block patterns, adding an agent or machine, or investigating why a command was or wasn't blocked.

How do I install the Global Agent Guardrails skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add davidondrej/skills --skill global-agent-guardrails. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Global Agent Guardrails popular?

It lives in davidondrej/skills, which has 4,336 GitHub stars and 628 forks.

Related skills

Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.