agent-guardrails
Stop AI agents from secretly bypassing your rules. Mechanical enforcement with git hooks, secret detection, deployment verification, and import registries. Born from real production incidents: server crashes, token leaks, code rewrites. Works with Claude Code, Clawdbot, Cursor. Install once, enforce forever.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/olmmlo-cmd/agent-guardrailsAgent Guardrails
Mechanical enforcement for AI agent project standards. Rules in markdown are suggestions. Code hooks are laws.
Quick Start
cd your-project/
bash /path/to/agent-guardrails/scripts/install.sh
This installs the git pre-commit hook, creates a registry template, and copies check scripts into your project.
Enforcement Hierarchy
- Code hooks (git pre-commit, pre/post-creation checks) — 100% reliable
- Architectural constraints (registries, import enforcement) — 95% reliable
- Self-verification loops (agent checks own work) — 80% reliable
- Prompt rules (AGENTS.md, system prompts) — 60-70% reliable
- Markdown rules — 40-50% reliable, degrades with context length
Tools Provided
Scripts
| Script | When to Run | What It Does |
|---|---|---|
install.sh | Once per project | Installs hooks and scaffolding |
pre-create-check.sh | Before creating new .py files | Lists existing modules/functions to prevent reimplementation |
post-create-validate.sh | After creating/editing .py files | Detects duplicates, missing imports, bypass patterns |
check-secrets.sh | Before commits / on demand | Scans for hardcoded tokens, keys, passwords |
create-deployment-check.sh | When setting up deployment verification | Creates .deployment-check.sh, checklist, and git hook template |
install-skill-feedback-loop.sh | When setting up skill update automation | Creates detection, auto-commit, and git hook for skill updates |
Assets
| Asset | Purpose |
|---|---|
pre-commit-hook | Ready-to-install git hook blocking bypass patterns and secrets |
registry-template.py | Template __init__.py for project module registries |
References
| File | Contents |
|---|---|
enforcement-research.md | Research on why code > prompts for enforcement |
agents-md-template.md | Template AGENTS.md with mechanical enforcement rules |
deployment-verification-guide.md | Full guide on preventing deployment gaps |
skill-update-feedback.md | Meta-enforcement: automatic skill update feedback loop |
SKILL_CN.md | Chinese translation of this document |
Usage Workflow
Setting up a new project
bash scripts/install.sh /path/to/project
Before creating any new .py file
bash scripts/pre-create-check.sh /path/to/project
Review the output. If existing functions cover your needs, import them.
After creating/editing a .py file
bash scripts/post-create-validate.sh /path/to/new_file.py
Fix any warnings before proceeding.
Setting up deployment verification
bash scripts/create-deployment-check.sh /path/to/project
This creates:
.deployment-check.sh- Automated verification scriptDEPLOYMENT-CHECKLIST.md- Full deployment workflow.git-hooks/pre-commit-deployment- Git hook template
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-olmmlo-cmd-agent-guardrails": {
"enabled": true,
"auto_update": true
}
}
}Tags
Related Skills
doctorbot-ci-validator
Stop failing in production. Validate your GitHub Actions, GitLab CI & Keep workflows offline with surgical precision. Born from Keep bounty research, perfected for agents.
obsidian-cli
Skill for the official Obsidian CLI (v1.12+). Complete vault automation including files, daily notes, search, tasks, tags, properties, links, bookmarks, bases, templates, themes, plugins, sync, publish, workspaces, and developer tools.
onlyclaw-social-commerce
在只来龙虾平台以龙虾身份自动发帖带货、读取帖子、检索帖子、点赞评论,支持关联商品/店铺/Skill、封面与视频(先上传再发帖),实现 AI Agent 24h 社交电商自动运营
autodream-core
通用记忆整理引擎 — 基于适配器模式的跨平台记忆整理技能。自动去重、合并、删除过时条目。| Universal Memory Consolidation Engine — Adapter-based cross-platform memory organization. Auto-dedup, merge, prune stale entries.
arc-shield
Output sanitization for agent responses - prevents accidental secret leaks