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 MLOps-Courses/agentops-open-course --skill agent-guardrailsgit clone --depth 1 https://github.com/MLOps-Courses/agentops-open-courseWrote 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/mlops-courses/agentops-open-course/agent-guardrails)<a href="https://agentmods.dev/skills/mlops-courses/agentops-open-course/agent-guardrails"><img src="https://agentmods.dev/badge/skills/mlops-courses/agentops-open-course/agent-guardrails.svg" alt="Measured on agentmods" 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.00071 | $0.00643 |
| Opus 5 | $0.00036 | $0.00321 |
| Sonnet 5 | $0.00014 | $0.00129 |
| Haiku 4.5 | $0.00007 | $0.00064 |
Grade A, and why
agent-guardrails scanned grade A with 0 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 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 37 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent Guardrails
Put a guardrail at each boundary an untrusted signal can cross: input, model, tool, and output. No single layer is trusted alone — the containment story holds because they overlap.
When to use
- The agent can call tools that change state (restart, resolve, refund, deploy).
- Tool or retrieval output is attacker-influenceable and could carry injected instructions.
- User prompts or tool results may contain PII that must not reach the model or storage.
- You need an incident lever to freeze all writes through a fast process or configuration rollout.
Steps
- Validate tool arguments at the boundary. Parse and reject malformed or out-of-policy arguments before a tool runs — never pass raw model output straight into an action.
- Redact PII before the model and before persistence. Keep deterministic in-process masking on every path. Add a gateway webhook for semantic named entities only as defense in depth; bound it and fail closed. Treat streaming as a weaker boundary because entities can span chunks.
- Spotlight untrusted tool output. Normalize (NFKC), neutralize known injection markers, and wrap free-text tool results in a marked prefix so the model treats them as data, not instructions. This is best-effort defense-in-depth, not a guarantee.
- Require attributable human approval for writes. Gate every state-changing tool on a human confirmation that carries the approver's identity and rationale, and record who approved, why, and the decision context in the same transaction as the mutation.
- Ship a kill-switch. Read one flag (e.g.
AGENT_WRITES_DISABLED) at process startup and refuse every model-callable write before persistence; guarded actions should stop before approval. Document the restart or workload rollout needed to apply it.
Reference implementation
From the AgentOps Open Course, installable with npx skills add MLOps-Courses/agentops-open-course:
agents/go/policy/pii.go— deterministic request, response, tool, note, and audit redaction.agents/go/piiwebhook/— bounded model-backed person, location, and organization masking for agentgateway.agents/go/tools/action.go— attributable confirmation and theAGENT_WRITES_DISABLEDkill-switch.- Course chapters
4.5. Guardrailsand4.6. Security.
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 · 37 lines · 71 tokens per session scan A 114998370dc1
agent-guardrails is a skill published in the GitHub repository MLOps-Courses/agentops-open-course (2 stars, last pushed 4d ago), licensed MIT. It adds 71 tokens to every session and 643 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
skill-release-gate
Evaluate an Agent Skill bundle for structural integrity, trigger quality, artifact improvement, script correctness, safety, installed-tree integrity, and target-host portability before release.
migration-review
Review database migration files when a change adds or modifies paths under migrations/. Use it before merge to collect forward, rollback, locking, and data-safety evidence.
routing-policy-change
Modifies routing policy after signal extraction, including matched-decision logic, candidate-model selection, and downstream looper behavior. Use when changing decision predicates, thresholds, priorities, model ranking, cost or latency routing, or other post-signal routing policy.
project-change
Handles a focused repository change when no specialized primary skill applies. Use when changed-file routing selects this fallback for a feature, fix, refactor, documentation update, or subsystem-local task.
deck-course-module
A course or workshop slide template with persistent learning goals, teaching pages, multiple-choice self-tests, and a wrap-up.
detecting-container-drift-at-runtime
Detect unauthorized modifications to running containers by monitoring for binary execution drift, file system changes, and configuration deviations from the original container image.