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 patricio0312rev/skillset --skill guardrails-safety-filter-buildergit clone --depth 1 https://github.com/patricio0312rev/skillsetWrote 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/patricio0312rev/skillset/guardrails-safety-filter-builder)<a href="https://agentmods.dev/skills/patricio0312rev/skillset/guardrails-safety-filter-builder"><img src="https://agentmods.dev/badge/skills/patricio0312rev/skillset/guardrails-safety-filter-builder/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.
<a href="https://agentmods.dev/skills/patricio0312rev/skillset/guardrails-safety-filter-builder"><img src="https://agentmods.dev/badge/skills/patricio0312rev/skillset/guardrails-safety-filter-builder.svg" alt="Reviewed on agentmods" width="80" 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.00052 | $0.01312 |
| Opus 5 | $0.00026 | $0.00656 |
| Sonnet 5 | $0.00010 | $0.00262 |
| Haiku 4.5 | $0.00005 | $0.00131 |
Grade A, and why
guardrails-safety-filter-builder 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 12d 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.
This is a copy
100% identical to guardrails-safety-filter-builder — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 227 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Guardrails & Safety Filter Builder
Build comprehensive safety systems for LLM applications.
Safety Layers
- Input filtering: Block malicious prompts
- Output filtering: Redact sensitive data
- Topic constraints: Policy-based refusals
- PII detection: Mask personal information
- Prompt injection: Detect manipulation attempts
PII Detection & Redaction
import re
from presidio_analyzer import AnalyzerEngine
from presidio_anonymizer import AnonymizerEngine
analyzer = AnalyzerEngine()
anonymizer = AnonymizerEngine()
def redact_pii(text: str) -> str:
# Detect PII
results = analyzer.analyze(
text=text,
language='en',
entities=["EMAIL_ADDRESS", "PHONE_NUMBER", "CREDIT_CARD", "SSN"]
)
# Anonymize
anonymized = anonymizer.anonymize(text, results)
return anonymized.text
# Example: "My email is [email protected]" → "My email is <EMAIL_ADDRESS>"
Prompt Injection Detection
def detect_prompt_injection(user_input: str) -> bool:
"""Detect common prompt injection patterns"""
patterns = [
r'ignore (previous|above) instructions',
r'disregard (all|any) (prior|previous)',
r'you are now',
r'new instructions',
r'system:',
r'override',
]
for pattern in patterns:
if re.search(pattern, user_input, re.IGNORECASE):
return True
return False
# Block if detected
if detect_prompt_injection(user_input):
return "I cannot process that request."
Topic Constraints
# Define allowed/disallowed topics
POLICY = {
"allowed_topics": [
"product_features",
"troubleshooting",
"billing",
"account_management"
],
"disallowed_topics": [
"medical_advice",
"legal_advice",
"financial_advice",
"politics",
"violence"
],
"requires_disclaimer": [
"security_practices",
"data_privacy"
]
}
# Classify topic
def classify_topic(query: str) -> str:
classification_prompt = f"""
Classify this query into one of these topics:
{', '.join(POLICY['allowed_topics'] + POLICY['disallowed_topics'])}
Query: {query}
Return only the topic name.
"""
return llm(classification_prompt)
# Check policy
def check_policy(query: str) -> dict:
topic = classify_topic(query)
if topic in POLICY["disallowed_topics"]:
return {
"allowed": False,
"reason": f"Cannot provide {topic}",
"refusal": REFUSAL_TEMPLATES[topic]
}
return {"allowed": True, "topic": topic}
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.
- 12d ago First seen · 227 lines · 52 tokens per session scan A eab4365c265b
guardrails-safety-filter-builder is a skill published in the GitHub repository patricio0312rev/skillset (6 stars, last pushed 8mo ago), licensed MIT. It adds 52 tokens to every session and 1,312 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to guardrails-safety-filter-builder, differing in 0 lines, and is treated as a copy.
Other skills, from other repositories
llm-app-patterns
Production-ready patterns for building LLM applications. Covers RAG pipelines, agent architectures, prompt IDEs, and LLMOps monitoring. Use when designing AI applications, implementing RAG, building agents, or setting up LLM observability.
prompt-optimization
Improve a prompt on the evaluations workbench through a measured loop. Score the baseline first, then duplicate the target column, form a hypothesis from failing rows, edit the copy's prompt draft, run, compare pass rate and cost, and repeat until the numbers hold. Use when the user asks to optimize or improve a…
enhance-prompt
Transforms vague UI ideas into polished, Stitch-optimized prompts. Enhances specificity, adds UI/UX keywords, injects design system context, and structures output for better generation results.
prompt-engineer
Writes, refactors, and evaluates prompts for LLMs — generating optimized prompt templates, structured output schemas, evaluation rubrics, and test suites. Use when designing prompts for new LLM applications, refactoring existing prompts for better accuracy or token efficiency, implementing chain-of-thought or few-shot…
seedance-vocab-en
This skill should be used when an English Seedance 2.0 prompt needs clearer production wording, less generic prose, or precise vocabulary for camera, lighting, motion, VFX, audio, and constraints. Route blocked prompts through seedance-filter for context and boundary review.
ideogram4
Prompting patterns for Ideogram 4 text-to-image — best-in-class in-image text rendering and exact color/layout control via structured JSON captions. Use when generating images that need legible on-image text (title cards, thumbnails, logos, signage, CTAs), precise brand colors, or controlled spatial layout. Triggers…