safety-guardrails

safety-guardrails is a skill for Claude Code, Codex from andreaswasita/copilot-agents-dojo. It costs 15 tokens per session (1,224 once invoked), scanned C, original, MIT.

A pre-flight safety check for shell commands and Git working-tree operations. It flags commands and file states that look destructive, but it does not block execution or replace human approval.

In plain words
What is it for?
Use it before commands such as recursive deletion, force-pushing, hard resets, disk formatting, or bulk file changes. It also checks for mass deletions and other unsafe working-tree conditions.
Why use it?
It helps catch obvious risks before deleting files, overwriting data, or changing Git history. This adds a warning step to automated work where someone may not inspect every command.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it before commands such as recursive deletion, force-pushing, hard resets, disk formatting, or bulk file changes. It also checks for mass deletions and other unsafe working-tree conditions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/andreaswasita/copilot-agents-dojo/safety-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 andreaswasita/copilot-agents-dojo --skill safety-guardrails
Clone the repo
git clone --depth 1 https://github.com/andreaswasita/copilot-agents-dojo

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 safety-guardrails

README.md
[![agentmods](https://agentmods.dev/badge/skills/andreaswasita/copilot-agents-dojo/safety-guardrails/github.svg)](https://agentmods.dev/skills/andreaswasita/copilot-agents-dojo/safety-guardrails)
Your own site
<a href="https://agentmods.dev/skills/andreaswasita/copilot-agents-dojo/safety-guardrails"><img src="https://agentmods.dev/badge/skills/andreaswasita/copilot-agents-dojo/safety-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 safety-guardrails

Your own site · 80×15
<a href="https://agentmods.dev/skills/andreaswasita/copilot-agents-dojo/safety-guardrails"><img src="https://agentmods.dev/badge/skills/andreaswasita/copilot-agents-dojo/safety-guardrails.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 15 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,224 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 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.00015 $0.01224
Opus 5 $0.00008 $0.00612
Sonnet 5 $0.00003 $0.00245
Haiku 4.5 $0.00002 $0.00122

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

Security

Grade C, and why

safety-guardrails scanned grade C 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 12d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/safety_guard.py, scripts/safety-guard.ps1, scripts/safety-guard.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Gives the agent two invokable preflight checks before a dangerous action: a command guard that flags obviously-destructive commands (`rm -rf /`, force-push, `reset --hard`, `dd`, `mkfs`), and a tree guard that flags an u
skills/safety-guardrails/SKILL.md · 89 lines

How it starts

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

Safety Guardrails Skill

Gives the agent two invokable preflight checks before a dangerous action: a command guard that flags obviously-destructive commands (rm -rf /, force-push, reset --hard, dd, mkfs), and a tree guard that flags an unsafe working-tree state (mass deletions, or a dirty tree when a clean one is required). This is a heuristic speed bump, not a sandbox — it cannot parse shell grammar or stop execution, so it complements, never replaces, human confirmation.

When to Use

  • Before running any command that deletes, overwrites, or rewrites history.
  • Before a risky git operation (force-push, hard reset, history rewrite).
  • Before a bulk file operation, to confirm the working tree is in a safe state.
  • When a user-supplied or generated command "looks" destructive — check it first.
  • As a standing habit in autonomous loops where no human reviews each command.
  • NOT as a security boundary — it is trivially bypassed (see Pitfalls).

Prerequisites

  • The powershell Copilot tool to run the guard scripts.
  • Python 3 on PATH (the guards share one stdlib core; the .sh/.ps1 are thin wrappers).
  • git available for the tree guard (it degrades to a skip outside a repo).

How to Run

Use the powershell tool to invoke the guard before the risky action:

# Command guard — exit 1 means STOP and confirm
bash skills/safety-guardrails/scripts/safety-guard.sh command "rm -rf /"

# Tree guard — flag mass deletions or (optionally) any dirty tree
bash skills/safety-guardrails/scripts/safety-guard.sh tree --require-clean

On Windows, call the parity wrapper safety-guard.ps1 with the same verbs. Exit codes: 0 no concern, 1 flagged (stop and confirm), 2 usage error.

Quick Reference

Guard Flags Example trigger
command recursive force-delete of a root/home/system path rm -rf /, rm -rf ~
command force-push / history rewrite git push --force, git filter-branch
command irreversible reset / clean git reset --hard, git clean -fdx
command disk/device destruction dd of=/dev/sda, mkfs, > /dev/sdb
command over-permissive mode chmod -R 777 .
tree mass staged/pending deletions (≥ threshold) a refactor that removed many files
tree dirty tree when --require-clean uncommitted edits before a hard reset

Read the full file on GitHub · 89 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 89 lines · 15 tokens per session scan C 13089c1d3e75

Subscribe to this mod's changes

safety-guardrails is a skill published in the GitHub repository andreaswasita/copilot-agents-dojo (53 stars, last pushed 5d ago), licensed MIT. It adds 15 tokens to every session and 1,224 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

chatbot

Use when a support or sales bot on a live website must behave: persona/system prompt, grounding so it cannot invent prices or policy, jailbreak and injection defense, the human handoff, launch metrics and kill switch. NOT the agent loop or RAG index under it (that is building-agents), NOT a human answering one ticket…

ericrisco/rsc-harness · 78 tokens

agent-safety

Use when bounding an LLM agent that already runs — scoping its task domain, gating tools to least privilege, defending against prompt injection in untrusted web/email/RAG text, requiring human approval on irreversible actions, capping runtime and cost, or triaging what it already did. NOT building the loop, tools, or…

ericrisco/rsc-harness · 79 tokens

compliance

Use when scoping which regulatory frameworks bind a business — SOC 2, ISO 27001, HIPAA, PCI DSS, EU AI Act, DORA, NIS2 — building a control register with owners and evidence, or standing up the cadence that keeps it audit-ready. NOT drafting privacy-policy/ROPA/DPA or ToS text (that is gdpr-privacy, terms-conditions)…

ericrisco/rsc-harness · 96 tokens

conducting-cyber-risk-assessment-with-nist-800-30

Conduct a defensible cybersecurity risk assessment using the NIST SP 800-30 Rev 1 methodology: prepare scope and a risk model, identify threat sources and threat events, identify vulnerabilities and predisposing conditions, determine likelihood and impact, compute risk, and communicate results as a prioritized risk…

adriannoes/awesome-agentic-ai · 219 tokens

git-guardrails

Use this skill to enforce strict safety boundaries on git operations, branch management, and destructive shell commands. Prevents accidental force pushes, hard resets, secret commits, unstashed code loss, and unauthorized production branch modifications.

karthikrshet/aiskills · 50 tokens

implementing-gdpr-data-protection-controls

The General Data Protection Regulation (EU) 2016/679 (GDPR) is the EU's comprehensive data protection law governing the collection, processing, storage, and transfer of personal data. This skill cover.

adriannoes/awesome-agentic-ai · 52 tokens