Examples
AI Safety Shield
Prompt injection detection, PII redaction, and GDPR/HIPAA compliance checks.
Try it
Loading example…
Use the quick test buttons to try injection attacks, SSN/credit card detection, and GDPR/HIPAA compliance checks. Toggle redaction to see raw vs. masked text.
How it works
Every message passes through three layers of guardrails using built-in detection from @directive-run/ai.
- Prompt Injection – 16 built-in regex patterns detect override attempts, jailbreaks, and role manipulation
- PII Detection – SSN, credit card (Luhn), email, phone, and address detection with typed redaction
- Compliance – GDPR blocks personal data (email, phone), HIPAA blocks PHI (SSN, medical IDs, DOB)
Source code
main.ts
// Source file "main.ts" not found

