PII Detection
PIIEvaluator scans LLM outputs for personally identifiable information using regex patterns. Zero API calls — suitable for air-gapped environments.
Basic usage
Jurisdiction-specific patterns
PIIEvaluator(jurisdiction="hipaa") with an upstream de-identification step.
Custom patterns
Redacting PII from reports
By default, matched PII is shown in the reason field. To mask it in audit logs:What’s detected
| Pattern | Examples |
|---|---|
email | user@company.com |
phone_us | 555-123-4567, (800) 555-0100 |
phone_intl | +44 7911 123456 |
ssn | 123-45-6789 |
credit_card | 4111 1111 1111 1111 |
iban | DE89370400440532013000 |
ip_address | 192.168.1.1 |
date_of_birth | DOB: 12/05/1985 |
passport | AB1234567 |
address | 123 Main Street |
eu_vat (GDPR) | DE123456789 |
bank_account (CCPA) | 12345678901234 |
Structured Output Validation
SchemaEvaluator validates that LLM outputs conform to a defined structure. Works with Pydantic models and JSON Schema dicts. Reports per-field failures — not just valid/invalid.
StructEval (2025) found GPT-4 fails complex structured extraction ~12% of the time. This evaluator catches those failures in your specific pipeline.
Pydantic model
JSON Schema
Handling markdown code fences
SchemaEvaluator automatically strips markdown code fences from outputs:
Compliance Audit Trail
ComplianceReporter writes a tamper-evident NDJSON log of every eval run, with SHA-256 hashing and regulatory control annotations.
Basic usage
Framework mappings
| Evaluator | Control |
|---|---|
faithfulness, hallucination | Article 9(4)(a) — Accuracy & reliability |
pii_detection | Article 9(4)(b) — Privacy & data governance |
schema_compliance, not_empty | Article 9(4)(c) — Robustness & output consistency |
toxicity, bias | Article 9(6) — Bias & discrimination monitoring |
task_completion, tool_call_accuracy | Article 9(5) — Task performance logging |
Verifying integrity
Audit record format
Each NDJSON line:Full compliance pipeline
CI/CD Integration
./audit-logs/ are the compliance artifacts — store them alongside your release artifacts.
