ai-coding-agent-guardrails

ai-coding-agent-guardrails is a skill for Claude Code, Codex from BagelHole/DevOps-Security-Agent-Skills. It costs 43 tokens per session (8,497 once invoked), scanned C, original, MIT.

A set of safeguards for AI coding agents such as Claude Code, Cursor, Copilot, and Codex. It covers limiting permissions, protecting secrets, isolating execution, requiring code review, and keeping audit records.

In plain words
What is it for?
Use it when introducing coding agents to a team, allowing them to work with production repositories, or letting them create changes and pull requests automatically.
Why use it?
It reduces the chance that generated code exposes credentials, introduces vulnerabilities, bypasses review, or changes sensitive systems without oversight.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md; positional $N argument; mentions Claude Code.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 .tools/scan_agent_output.py $STAGED_FILES.

Good fit Use it when introducing coding agents to a team, allowing them to work with production repositories, or letting them create changes and pull requests automatically.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/BagelHole/DevOps-Security-Agent-Skills
agentmods
npx agentmods add skills/bagelhole/devops-security-agent-skills/ai-coding-agent-guardrails

Made for: Claude Code, Codex.

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 ai-coding-agent-guardrails

README.md
[![agentmods](https://agentmods.dev/badge/skills/bagelhole/devops-security-agent-skills/ai-coding-agent-guardrails/github.svg)](https://agentmods.dev/skills/bagelhole/devops-security-agent-skills/ai-coding-agent-guardrails)
Your own site
<a href="https://agentmods.dev/skills/bagelhole/devops-security-agent-skills/ai-coding-agent-guardrails"><img src="https://agentmods.dev/badge/skills/bagelhole/devops-security-agent-skills/ai-coding-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 ai-coding-agent-guardrails

Your own site · 80×15
<a href="https://agentmods.dev/skills/bagelhole/devops-security-agent-skills/ai-coding-agent-guardrails"><img src="https://agentmods.dev/badge/skills/bagelhole/devops-security-agent-skills/ai-coding-agent-guardrails.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,497 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. 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.00043 $0.08497
Opus 5 $0.00022 $0.04248
Sonnet 5 $0.00009 $0.01699
Haiku 4.5 $0.00004 $0.00850

Measured 9d ago against content hash 0842ee19de8b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade C, and why

ai-coding-agent-guardrails scanned grade C with 2 findings 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 9d 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 deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- NEVER execute `rm -rf`, `DROP TABLE`, `kubectl delete`, or `terraform destroy` commands

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- "curl"
security/ai/ai-coding-agent-guardrails/SKILL.md · 1,139 lines

How it starts

The opening of the file, as written. The whole thing — 1,139 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AI Coding Agent Guardrails

Secure the use of AI coding agents across engineering teams. This skill covers permission boundaries, secret protection, sandbox isolation, code review gates, and audit trails for Claude Code, Cursor, Copilot, and Codex.


When to Use

Apply these guardrails when:

  • Onboarding AI coding agents into an engineering team for the first time
  • Developers are using Claude Code, Cursor, Copilot, or Codex to generate production code
  • Agents have access to repositories containing secrets, infrastructure configs, or sensitive business logic
  • Your compliance framework (SOC 2, ISO 27001, FedRAMP) requires controls around automated code generation
  • Autonomous or semi-autonomous agents are creating pull requests without direct human typing
  • You need to enforce consistent security policies across multiple agents and team members

Signs you need tighter guardrails:

  • Agents have committed secrets or credentials to version control
  • Agent-generated code has introduced vulnerabilities caught late in the pipeline
  • No clear audit trail distinguishes human-written from AI-generated code
  • Developers are bypassing code review for "simple" agent changes
  • Agents are executing arbitrary shell commands in production-connected environments

Permission Boundaries

CLAUDE.md Configuration

Create a CLAUDE.md at the repository root to restrict Claude Code behavior:

# CLAUDE.md

## Restrictions

- NEVER read or output contents of .env, .env.*, secrets.yaml, or any file matching *.pem, *.key
- NEVER execute `rm -rf`, `DROP TABLE`, `kubectl delete`, or `terraform destroy` commands
- NEVER push directly to main or master branches
- NEVER modify files in the infrastructure/, terraform/, or .github/workflows/ directories without explicit user approval
- NEVER install new dependencies without listing them first for review
- NEVER access or display API keys, tokens, passwords, or connection strings

## Allowed Operations

- Read and modify application source code in src/, lib/, and tests/
- Run test suites with `npm test`, `pytest`, `go test`
- Run linters with `eslint`, `ruff`, `golangci-lint`
- Create new branches with prefix `ai/` or `agent/`
- Create and modify files in docs/ directory

## Code Standards

- All new functions must include docstrings or JSDoc comments
- All new code must have corresponding unit tests
- Follow existing code style and patterns in the repository
- Maximum file length: 500 lines. Suggest splitting if exceeded.

Read the full file on GitHub · 1,139 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. 9d ago First seen · 1,139 lines · 43 tokens per session scan C 0842ee19de8b

Subscribe to this mod's changes

ai-coding-agent-guardrails is a skill published in the GitHub repository BagelHole/DevOps-Security-Agent-Skills (1,084 stars, last pushed 3mo ago), licensed MIT. It adds 43 tokens to every session and 8,497 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). 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

implementing-aws-config-rules-for-compliance

Implementing AWS Config rules for continuous compliance monitoring of AWS resources, deploying managed and custom rules aligned to CIS and PCI DSS frameworks, configuring automatic remediation with SSM Automation, and aggregating compliance data across accounts.

adriannoes/awesome-agentic-ai · 53 tokens

ec2

AWS EC2 virtual machine management — instances, security groups, key pairs, AMIs, EBS volumes, Auto Scaling Groups, Spot Instances, Session Manager, placement groups, and instance lifecycle automation. Trigger on ANY of these, even when EC2 isn't named explicitly: - Launching or provisioning: "spin up a server"…

itsmostafa/aws-agent-skills · 320 tokens

eventbridge

AWS EventBridge serverless event bus for event-driven architectures. Use when creating rules, configuring event patterns, setting up scheduled events, integrating with SaaS, or building cross-account event routing.

itsmostafa/aws-agent-skills · 41 tokens

s3

AWS S3 object storage for bucket management, object operations, and access control. Use when creating buckets, uploading files, configuring lifecycle policies, setting up static websites, managing permissions, or implementing cross-region replication.

itsmostafa/aws-agent-skills · 45 tokens

sqs

AWS SQS message queue service for decoupled architectures. Use when creating queues, configuring dead-letter queues, managing visibility timeouts, implementing FIFO ordering, or integrating with Lambda.

itsmostafa/aws-agent-skills · 39 tokens

dynamodb

Use when modeling or operating a DynamoDB table: deriving partition/sort keys from access patterns, single-table vs table-per-entity, adding a GSI/LSI, on-demand vs provisioned capacity, or diagnosing hot-partition throttling. NOT relational schema/SQL/EXPLAIN (that is postgresdb), NOT aggregation-pipeline document…

ericrisco/rsc-harness · 82 tokens