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.5 | $0.00021 | $0.00525 |
| Sonnet 5.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 3mo 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.
- 3mo 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 (7 stars, last pushed 10mo ago), licensed MIT. It adds 52 tokens to every session and 1,312 once invoked, about $0.0002 per session on Opus 5.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.
guardrails-safety-filter-builder compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| guardrails-safety-filter-builderpatricio0312rev/skillset | Skill | 7 | 10mo ago | MIT | A | 52 | Claude Code, Codex |
| llm-app-patternsdavila7/claude-code-templates | Skill | 35k | today | MIT | A | 54 | Claude Code, Codex |
| enhance-promptgoogle-labs-code/stitch-skills | Skill | 15k | today | Apache-2.0 | A | 41 | Claude Code |
| prompt-engineerJeffallan/claude-skills | Skill | 13k | today | MIT | A | 93 | Claude Code |
| prompt-optimizationlangwatch/langwatch | Skill | 5.1k | today | Apache-2.0 | A | 105 | Claude Code, Codex |
| prompt-library-for-startupsaws/agent-toolkit-for-aws | Skill | 3.6k | today | Apache-2.0 | A | 244 | Claude Code |
| hve-buildermicrosoft/hve-core | Skill | 1.7k | today | MIT | A | 54 | Claude Code |