Skip to main content

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.

  1. Prompt Injection – 16 built-in regex patterns detect override attempts, jailbreaks, and role manipulation
  2. PII Detection – SSN, credit card (Luhn), email, phone, and address detection with typed redaction
  3. Compliance – GDPR blocks personal data (email, phone), HIPAA blocks PHI (SSN, medical IDs, DOB)

Source code

main.ts
// Source file "main.ts" not found

Stay in the loop. Sign up for our newsletter.

We care about your data. We'll never share your email.

Powered by Directive. This signup uses a Directive module with facts, derivations, constraints, and resolvers – zero useState, zero useEffect. Read how it works