Concepts
The RAIL Score API is built around four core primitives. Understanding these makes the rest of the SDK and API reference much easier to navigate.
Evaluation
How the RAIL Score API analyses content across 8 responsible-AI dimensions. Understand basic vs deep mode, what each dimension measures, and how scores are calculated.
Safe Regeneration
The evaluate → check → regenerate feedback loop. RAIL scores your content, identifies which dimensions fall below your thresholds, then rewrites the content to fix them — automatically.
Middleware
Drop-in provider wrappers that intercept every LLM response and attach RAIL scores before returning it to your application — no manual eval calls required.
Policy Engine
Declarative rules that translate RAIL scores into actions. Define thresholds per dimension and specify what happens when they fail — block, warn, flag, or allow — at the call level or across a full session.
How They Fit Together
These four concepts form a layered system — each one builds on the previous:
Already understand the concepts?