guard

guard is a skill for Claude Code from sharpdeveye/maestro. It costs 26 tokens per session (669 once invoked), scanned A, original, MIT.

A workflow guide for adding safety boundaries such as input checks, permission limits, output filtering, and cost controls.

In plain words
What is it for?
Use it when deploying an AI workflow, handling sensitive information, or limiting what an agent may receive and do.
Why use it?
It helps prevent malicious inputs, data leaks, unauthorised actions, runaway costs, and unsafe agent behaviour.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Good fit Use it when deploying an AI workflow, handling sensitive information, or limiting what an agent may receive and do.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sharpdeveye/maestro/guard
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 sharpdeveye/maestro --skill guard
Clone the repo
git clone --depth 1 https://github.com/sharpdeveye/maestro

Made for: Claude Code.

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 guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/sharpdeveye/maestro/guard/github.svg)](https://agentmods.dev/skills/sharpdeveye/maestro/guard)
Your own site
<a href="https://agentmods.dev/skills/sharpdeveye/maestro/guard"><img src="https://agentmods.dev/badge/skills/sharpdeveye/maestro/guard/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 guard

Your own site · 80×15
<a href="https://agentmods.dev/skills/sharpdeveye/maestro/guard"><img src="https://agentmods.dev/badge/skills/sharpdeveye/maestro/guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 669 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00026 $0.00669
Opus 5.5 $0.00010 $0.00268
Sonnet 5.5 $0.00005 $0.00134
Haiku 4.5 $0.00003 $0.00067

Measured 1mo ago against content hash be9fb3cf991a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

guard 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 1mo 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.

source/skills/guard/SKILL.md · 100 lines

How it starts

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

MANDATORY PREPARATION

Invoke /agent-workflow — it contains workflow principles, anti-patterns, and the Context Gathering Protocol. Follow the protocol before proceeding — if no workflow context exists yet, you MUST run /teach-maestro first.

Consult the guardrails-safety reference in the agent-workflow skill for the full defense-in-depth framework.


Add safety boundaries to a workflow. Guards protect against malicious inputs, unintended outputs, data leakage, cost explosion, and all the ways an autonomous system can go wrong in the real world.

Threat Assessment

Before adding guards, understand what you're protecting against:

Threat Risk Level Guard Type
Prompt injection High Input sanitization, instruction hierarchy
PII leakage High Output filtering, data masking
Cost explosion High Token budgets, rate limits
Unauthorized actions Medium Permission scoping, confirmation gates
Hallucination Medium Source attribution, fact checking
Service abuse Medium Rate limiting, authentication

Guard Implementation

Input Guards

Before processing any input:
1. Validate against schema (reject malformed)
2. Check size limits (reject oversized)
3. Sanitize for injection patterns
4. Rate limit check (reject if exceeded)
5. Authentication/authorization check

Output Guards

Before returning any output:
1. Schema validation (format correct?)
2. PII scan (names, emails, SSNs, etc.)
3. Content policy check
4. Confidence threshold check
5. Source attribution present?

Cost Guards

Before every model/API call:
1. Check remaining budget
2. Estimate request cost
3. If estimate > remaining budget → reject or use cheaper alternative
4. After call → update spent amount
5. Circuit breaker check (too many failures?)

Permission Guards

For every tool call:
1. Is this tool allowed for this user/context?
2. Is this a destructive operation? → require confirmation
3. Is this accessing data the user is authorized for?
4. Log the access for audit trail

Read the full file on GitHub · 100 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. 1mo ago First seen · 100 lines · 26 tokens per session scan A be9fb3cf991a

Subscribe to this mod's changes

guard is a skill published in the GitHub repository sharpdeveye/maestro (591 stars, last pushed 5mo ago), licensed MIT. It adds 26 tokens to every session and 669 once invoked, about $0.0001 per session on Opus 5.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-30.