- Home
- Skills
- Doanchienthangdev
- Omgkit
- Guardrails Safety
guardrails-safety_skill
- JavaScript
2
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill doanchienthangdev/omgkit --skill guardrails-safety- SKILL.md3.9 KB
Overview
This skill protects AI applications with layered guardrails for inputs and outputs, focusing on toxicity, PII, prompt injection, and constitutional AI policies. It provides detection, sanitization, and revision mechanisms to reduce misuse and harmful behavior. The goal is to keep models compliant, safe, and auditable while preserving useful functionality.
How this skill works
Input guardrails run classifiers and pattern detectors to flag toxicity, find and redact PII, and detect injection attempts before the model sees user content. Output guardrails evaluate responses for toxicity, factuality against context, and citation validity, and can block or flag problematic outputs. A constitutional filter applies safety principles via critique-and-revise loops to rewrite responses that violate defined rules.
When to use it
- Before sending user text to a model to prevent harmful prompts or leaked sensitive data
- When returning model responses to users to ensure no toxic or fabricated content is delivered
- During deployment of high-risk features such as code generation, medical or legal advice
- When compliance and auditability are required (PII protection, logging of blocked events)
- While running adversarial testing or red-team scenarios to validate defenses
Best practices
- Apply defense in depth: combine toxicity models, regex detectors, and constitutional review
- Log all blocked and sanitized events for auditing and continuous improvement
- Fail closed: block or quarantine outputs when safety checks are uncertain
- Continuously update and expand detection patterns and thresholds based on adversarial testing
- Run regular adversarial and regression tests to validate changes to guardrails
Example use cases
- Sanitizing chat inputs to remove emails, phone numbers, and credit card numbers before processing
- Blocking or rewriting prompts that try to bypass instructions using injection patterns
- Preventing a model from giving harmful instructions by applying constitutional principles and revising unsafe responses
- Checking generated content against source documents to flag potential hallucinations or bad citations
- Instrumenting customer-facing assistants with safety logging and automatic redaction for compliance
FAQ
Pattern-based detection scans normalized text for common injection phrases like ‘ignore previous instructions’, new persona claims, or directive overrides, and flags or blocks them before model processing.
What happens to detected PII?
PII is identified by regex patterns and either redacted from the text or logged and quarantined according to policy; redaction markers replace sensitive tokens to prevent leakage.
How does the constitutional filter work?
A critic model checks responses against a set of safety principles; if a violation is detected, a reviser model rewrites the response to comply while retaining intent and usefulness.