enhance-agent-guardrails

enhance-agent-guardrails is a skill for Claude Code from kensaurus/cursor-kenji. It costs 73 tokens per session (2,018 once invoked), scanned B, original, MIT.

A set of automated checks and policy files that block common unsafe coding-agent mistakes, such as leaked secrets, injection problems, untested code, and destructive actions.

In plain words
What is it for?
Use it when adding pre-commit or continuous-integration security checks and other safeguards against recurring AI-generated code regressions.
Why use it?
It turns safety expectations into checks that run when code is created and before it is merged, so they do not depend only on the agent remembering instructions.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

Part of the cursor-kenji plugin — 121 skills, 54 commands, 6 agents, 3 MCP servers shipped together

Good fit Use it when adding pre-commit or continuous-integration security checks and other safeguards against recurring AI-generated code regressions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kensaurus/cursor-kenji/enhance-agent-guardrails
Install

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.

Any agent
npx skills add kensaurus/cursor-kenji --skill enhance-agent-guardrails
Clone the repo
git clone --depth 1 https://github.com/kensaurus/cursor-kenji

Made for: Claude Code.

Or install cursor-kenji, the plugin that ships this one along with the rest of its 121 skills, 54 commands, 6 agents, 3 MCP servers.

Wrote 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.

agentmods badge for enhance-agent-guardrails

README.md
[![agentmods](https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/enhance-agent-guardrails/github.svg)](https://agentmods.dev/skills/kensaurus/cursor-kenji/enhance-agent-guardrails)
Your own site
<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.

agentmods 80×15 button for enhance-agent-guardrails

Your own site · 80×15
<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>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,018 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 6d ago against content hash 2c3a294e3756, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

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.

skills/enhance-agent-guardrails/SKILL.md · 165 lines

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

  1. Detect — hooks, CI, rules, scanners already present
  2. Map — which AI failure class is unguarded
  3. Install — additive only; pin versions; don't duplicate
  4. 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

Read the full file on GitHub · 165 lines

Changes

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.

  1. 6d ago First seen · 165 lines · 73 tokens per session scan B 2c3a294e3756

Subscribe to this mod's changes

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.

Related

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.

girijashankarj/cursor-handbook · 27 tokens

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".

patricio0312rev/skills · 65 tokens

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".

patricio0312rev/skills · 46 tokens

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".

patricio0312rev/skills · 59 tokens

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.

jaansokk/cursor_tools · 46 tokens

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.

jaansokk/cursor_tools · 45 tokens