Use cases· Last updated

RAG policy checks with Jev

Retrievers hope. After retrieval, Jev marks relevance, contradiction, or injection; code keeps, flags, or drops passages before a generator sees them.

This unofficial page is the policy checks slice of the RAG passage decisions pack. Intent: apply the Jev (TypeSafe System One) decision model to RAG passage decisions policy checks. Primary search language: RAG Jev policy checks. Confirm patterns on docs.typesafe.ai. This site does not sell, issue, or proxy TypeSafe keys. Use a credential you already have from the console or a documented gateway.

Independent angle (cover ≠ clone): Filter/rerank recipes with failure modes; cite vs generate boundary. We cover the intent, not a rival rerank-passages-score URL tree.

RAG use-case context

A policy check is a typed question whose instructions + criteria are your rules about the query + retrieved passage. Jev scores compliance; the retrieval filter enforces. This is not a certification, and it is not a photocopy of a rival “policy engine” page — we keep rules atomic and ANDed in code.

Hub: Classifying RAG passages. Compare, when the other tool is the real job: RAG pipelines.

Policy Checks inputs

Put policy text and the artifact in structured state (never hope the model memorized last quarter’s PDF):

{
  "query": "What is the refund window for pro plans?",
  "passage": { "id": "doc-88#p3", "text": "Pro subscribers may request a refund within 14 days." },
  "corpus": { "trust": "internal_kb" }
}

Name query, passage.text.

Decision signals and actions

Id Rule Enforce
no_external_pii Drop passages that leak personal data into the generator Noul
injection_drop Hidden “ignore the user” text never reaches the LLM Noul
cite_or_abstain If no passage clears T_REL, the generator must abstain code

Typical primitives on the same request:

Id Type Job
relevant Noul Does passage.text answer query?
contradiction Noul Does it contradict other kept passages you include?
injection Noul Hidden instructions / prompt injection in the passage?
support Score How completely does it support an extractive answer?
violations = [name for name, ans in policy_nouls.items() if ans.noul >= T_VIOLATION]
if violations:
    return review(violations)

Do not treat a Noul of 0.5 as a “medium” RAG passage decisions score — it means yes and no are equally likely. Conjunctions stay in your code.

Guardrails and escalation

Policy-in-state can be attacked (“ignore the policy”). High-risk showing a passage to a customer-facing answerer still needs deterministic checks. TypeSafe’s confidence-gated examples use a lower bar for recoverable reads than for irreversible actions. Those numbers are illustrations. For RAG passage decisions, treat feed_to_answerer as the high bar (showing a passage to a customer-facing answerer). Tune on labels — see offline evaluation.

Evaluation and rollout notes

Gold labels are policy-versioned. A criteria edit without replay is how silent false-allows ship. Pin jev-1.13.0 (the versioned id) after you fit thresholds. jev-latest and the marketing line jev-1.13 can move. Log the response model. TypeSafe’s published list price for jev-1.13 is $0.042 per million input tokens (vendor claim — confirm on the models page); output tokens are free on that same page. Unused distractors still bill as input.

Official Python and JavaScript SDKs read TYPESAFE_API_KEY and retry documented 429/529. This site does not sell, issue, or proxy TypeSafe keys. Use a credential you already have from the console or a documented gateway.

Pack map

Slice Page
Graph and primitives decision workflow
What may enter state input contracts
What to gather first evidence collection
Atomic rules you are here
Act / review / abstain confidence thresholds
Reviewer payload human handoff
What to persist audit trail
How it breaks failure modes
Labeled replay evaluation
Shadow → canary production rollout

FAQ

One Score for “compliant”? No. Atomic Nouls per rule, AND/OR in code. Money and dates: extract in code first (jaggedness).

If a regex can enforce it, should I still call Jev? Skip Jev. Official “how to build” guidance: keep deterministic rules in code when you can.

Where is the rest of the RAG pack? Start with RAG decision workflow and RAG human handoff. Cluster hub: Use cases.

Should Jev generate the RAG answer? No. Classify or score passages; another model (or extractive code) writes. That is the cite-vs-generate boundary.

Do we publish rerank lifts? No. TypeSafe’s cookbooks may show measurements — treat those as vendor figures and re-run on your corpus.

What this page does not claim

Disclaimer

This is an independent unofficial site and is not affiliated with TypeSafe AI; official documentation is available at https://docs.typesafe.ai.

Primary documentation: https://docs.typesafe.ai. Hub: Use cases.

Sources

Public TypeSafe or adjacent documentation only. No private claims.