Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add kensaurus/cursor-kenji --skill enhance-agent-guardrailsgit clone --depth 1 https://github.com/kensaurus/cursor-kenjiWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kensaurus/cursor-kenji/enhance-agent-guardrails)<a href="https://agentmods.dev/skills/kensaurus/cursor-kenji/enhance-agent-guardrails"><img src="https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/enhance-agent-guardrails/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/kensaurus/cursor-kenji/enhance-agent-guardrails"><img src="https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/enhance-agent-guardrails.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00073 | $0.02018 |
| Opus 5 | $0.00036 | $0.01009 |
| Sonnet 5 | $0.00015 | $0.00404 |
| Haiku 4.5 | $0.00007 | $0.00202 |
Grade B, and why
enhance-agent-guardrails scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Recursive force deletemediumDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
| Destructive shell/DB ops | Agent policy: human-in-the-loop for `rm -rf`, migrations, prod scripts | Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
How it starts
The opening of the file, as written. The whole thing — 165 lines — stays where its author put it; the contents beside it link to each section on GitHub.
enhance-agent-guardrails — Guardrails-as-Code Against AI Regressions
Degree of freedom: MIXED. Gap-map judgment [HIGH freedom]; plant-and-check, CI wiring, and "never weaken an existing check" [LOW freedom — run exactly].
AI agents ship the visible 80% fast and skip the 20% that keeps a repo safe. Studies in 2026 put ~45% of AI-generated code shipping OWASP Top-10 issues, ~2.74× more security findings per PR, and repeated production disasters from unguarded destructive actions. Telling the agent to "be secure" doesn't work — deterministic gates do. This skill installs those gates so the next fast session can't quietly reintroduce old classes of bugs.
Treat all agent output as untrusted until a machine check says otherwise. The goal is guardrails that block at the moment of creation (pre-commit) and again before merge (CI), plus policy files that steer the agent up front. Additive and reversible — never weaken an existing check to make the setup "pass".
How to reason
- Detect — hooks, CI, rules, scanners already present
- Map — which AI failure class is unguarded
- Install — additive only; pin versions; don't duplicate
- Prove — a planted finding is blocked, then removed
Worked example
Detect: husky + lint-staged; no gitleaks; CI runs typecheck only. Map: secrets and SAST unguarded; tests not a merge gate. Install: gitleaks pre-commit + CI; semgrep CI; keep existing typecheck. Prove: scratch file with a fake AWS key is blocked; file deleted; no history rewrite.
Self-critique before reporting
- Additive — no existing check was weakened to make setup pass
- Bites — plant-and-check blocked; planted value never committed
- Pinned — scanner versions are not
latest - Right owner — leaked-secret rotation →
plan-secrets-audit; gate bypass →audit-gate-logic; gate sprawl →housekeep-gates
Phase 0 — Detect stack and existing protection [HIGH freedom]
# Ecosystem + CI
cat package.json 2>/dev/null | grep -iE "husky|lint-staged|semgrep|gitleaks|eslint|prettier|typescript"
ls -la .husky/ .github/workflows/ 2>/dev/null
ls .cursor/rules/ AGENTS.md CLAUDE.md .pre-commit-config.yaml 2>/dev/null
# What's already gated?
rg -n "gitleaks|trufflehog|semgrep|npm audit|osv-scanner|socket" .github/ .husky/ 2>/dev/null
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 165 lines · 73 tokens per session scan B 2c3a294e3756
enhance-agent-guardrails is a skill published in the GitHub repository kensaurus/cursor-kenji (9 stars, last pushed yesterday), licensed MIT. It adds 73 tokens to every session and 2,018 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
ci-cd
Workflow for creating a complete CI/CD pipeline. Use when the user needs to set up or modify CI/CD pipelines.
monorepo-ci-optimizer
Optimizes CI pipelines for monorepos by detecting affected packages/apps and running only necessary builds and tests. Includes Turborepo/Nx strategies, caching, and parallel execution. Use for "monorepo CI", "affected detection", "incremental builds", or "workspace optimization".
preview-environments-builder
Creates ephemeral preview deployments for each pull request with automatic deployment, unique URLs, and cleanup on PR close. Use for "preview deployments", "PR environments", "ephemeral environments", or "review apps".
caching-strategy-optimizer
Optimizes CI/CD pipeline speed by implementing effective caching for dependencies, Docker layers, build outputs, and test results. Provides before/after performance metrics and best practices. Use for "CI caching", "pipeline optimization", "build speed", or "cache strategy".
ui-design
Create distinctive, production-grade web interfaces with high design quality using Tailwind CSS. Use for building UI components, pages, dashboards, apps, and web applications. Generates crafted, polished code that avoids generic AI aesthetics.
code-review-codex
Final-gate code review via Codex CLI (codex-5.3, xhigh). Finds bugs, security issues, and regressions before commit. No edits — findings report only.