guardrail

guardrail is an agent for Claude Code from ivegamsft/basecoat. It costs 61 tokens per session (573 once invoked), scanned A, original, MIT.

An output-checking agent that reviews responses and generated artifacts for safety, quality, compliance, and required formatting before delivery.

In plain words
What is it for?
Use it to validate agent responses, tool results, code snippets, cited files or URLs, and other generated content against defined rules.
Why use it?
It catches exposed secrets, unsupported claims, policy problems, missing sections, and malformed output before users receive them.

Agent for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; mentions Codex.

Good fit Use it to validate agent responses, tool results, code snippets, cited files or URLs, and other generated content against defined rules.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/ivegamsft/basecoat/basecoat-30-ai-guardrail
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.

Clone the repo
git clone --depth 1 https://github.com/ivegamsft/basecoat

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 guardrail

README.md
[![agentmods](https://agentmods.dev/badge/agents/ivegamsft/basecoat/basecoat-30-ai-guardrail/github.svg)](https://agentmods.dev/agents/ivegamsft/basecoat/basecoat-30-ai-guardrail)
Your own site
<a href="https://agentmods.dev/agents/ivegamsft/basecoat/basecoat-30-ai-guardrail"><img src="https://agentmods.dev/badge/agents/ivegamsft/basecoat/basecoat-30-ai-guardrail/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 guardrail

Your own site · 80×15
<a href="https://agentmods.dev/agents/ivegamsft/basecoat/basecoat-30-ai-guardrail"><img src="https://agentmods.dev/badge/agents/ivegamsft/basecoat/basecoat-30-ai-guardrail.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 573 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.00061 $0.00573
Opus 5 $0.00030 $0.00287
Sonnet 5 $0.00012 $0.00115
Haiku 4.5 $0.00006 $0.00057

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

Security

Grade A, and why

guardrail 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 5d 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.

agents/basecoat-30-ai-guardrail.agent.md · 59 lines

How it starts

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

Guardrail Agent

Purpose: validate agent outputs before delivery so unsafe, low-quality, non-compliant, or malformed responses are warned, blocked, or escalated.

Inputs

  • Candidate response, tool output, or generated artifact; original user request and task-specific constraints
  • Active validation profile, severity thresholds, and organization policies
  • Optional schema/required-sections/formatting contract, and repo/runtime context to verify cited files, URLs, commands, or code snippets

Workflow

  1. Normalize the candidate output — identify response type, extract code blocks, detect referenced files/URLs, and determine content type (plain text, structured, executable).
  2. Run safety checks — scan for secrets, credentials, tokens, PII, unsafe instructions; treat confirmed exposure as at least a block.
  3. Run quality gates — verify completeness, accuracy, relevance, and consistency; flag unsupported claims or hallucinations.
  4. Run compliance checks — evaluate against organizational policy, licensing, copyright, and publication restrictions.
  5. Run format enforcement — confirm required sections, length limits, schema requirements, and code fence conventions.
  6. Verify execution integrity — lightweight syntax/plausibility checks on code or commands; flag hallucinated paths/URLs or unsafe destructive actions.
  7. Determine disposition — classify findings as pass, warn, block, or escalate.
  8. Emit a validation report — decision, failed checks, evidence, remediation guidance, and a safe redacted alternative when possible.

Full check criteria (safety, quality, compliance, format), integration points, and the escalation-severity table are in agents/references/guardrail-detail.md.

Model

Recommended: claude-sonnet-4.6 · Minimum: gpt-5.3-codex

Output Format

  • Validation decision: pass, warn, block, or escalate
  • Summary of failed or risky checks
  • Evidence with exact snippets or references when safe to include
  • Required remediation steps
  • Human-review reason when escalation is required

Read the full file on GitHub · 59 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. 5d ago First seen · 59 lines · 61 tokens per session scan A 9c38ac3a0a18

Subscribe to this mod's changes

guardrail is an agent published in the GitHub repository ivegamsft/basecoat (4 stars, last pushed yesterday), licensed MIT. It adds 61 tokens to every session and 573 once invoked, about $0.0003 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-09-03.