Guardrails policy checks
A policy check is a typed question whose instructions + criteria are your rules (“refunds over $50 need a manager,” “do not quote medical dosage”). Jev scores compliance; code enforces it. This is the second layer after the Noul screen.
Unofficial. Official “how to build”: keep deterministic rules in code when you can; use System One for common-sense over unstructured text. We do not certify GDPR/HIPAA. No keys sold.
Pattern
- Put policy text and the artifact (draft reply, tool args) in structured
state. - One Noul per atomic rule: “Does
draftviolatepolicy.refund_capgivenorder.total?” - AND/OR in code. Do not hide five rules in one vague Score.
- Money and dates: extract numbers in code; ask Jev only about the semantic remainder (jaggedness).
violations = [
name for name, noul in answers.items()
if noul.noul >= T_VIOLATION
]
if violations:
return review(violations)
Use-case map “Universal Verification” also lists citation errors, tool-call mistakes, and response-quality failures — same shape, different instructions.
Worked sketch: marketplace listing copy
A seller assistant drafts a product listing. The Noul screen already ran on the prompt. This layer asks whether the draft breaks written marketplace rules. Domain is catalog copy, not a refund desk.
{
"draft": "Clinically proven to reverse arthritis in 7 days. Ships tomorrow from our EU warehouse.",
"policy": {
"no_medical": "No disease-treatment claims.",
"no_invented_sla": "Do not invent ship-by dates.",
"no_competitor": "Do not name or smear competing brands."
},
"facts": { "ship_days_extracted": null }
}
| Id | Type | Rule |
|---|---|---|
medical_claim |
Noul | Does draft claim to treat a disease vs policy.no_medical? |
invented_sla |
Noul | Does draft invent a ship date when facts.ship_days_extracted is null? |
competitor_smear |
Noul | Does draft name or smear a competitor vs policy.no_competitor? |
AND in code. A listing that fails any Noul at T_VIOLATION goes to review; it is not “published with a warning Score.” Pin jev-1.13.0 after you fit τ. TypeSafe’s published list price for jev-1.13 is $0.042 / M input tokens (vendor claim — confirm on the models page).
Official cookbook Guardrails for LLMs shows hazard Nouls plus a harm Score on messages. Cite it; do not paste their sample prompts. This page is the policy-as-criteria slice of the same pack.
When not to use (honest limits)
- Policy text in
statecan itself be attacked (injected “ignore the policy”). - A Noul of 0.01 is not a legal opinion and is not a compliance certificate.
- If a regex or allow-list can enforce the rule (
ship_days_extracted is None), skip Jev. - Jaggedness: no math, dates, or generation. Extract numbers in code; another model writes the rewrite.
See the two-layer pack when you also need the inbound screen. See input contracts for what may enter state.
FAQ
One Score for “compliant”? No. Atomic Nouls per rule, AND/OR in code. Confidence exists on Choice/Score only — Noul is a 0–1 probability.
Does a 200 with low Nouls mean we are HIPAA/GDPR certified? No. Schema-safe ≠ certified. Legal review is a different product.
Where do I put the first-layer jailbreak screen? On the decision workflow. This page is layer B.
Should I retry a 422 while tuning criteria? No. Official SDKs retry 429/529 only. Fix the named field — invalid input.
Hub: Use cases. Sibling: guardrail glossary. Official: docs.typesafe.ai.
Disclaimer
This is an independent unofficial site and is not affiliated with TypeSafe AI; official documentation is available at https://docs.typesafe.ai. Never treat jev.pro as TypeSafe official documentation. We do not sell, issue, or proxy API keys.