Skip to main content
POST https://api.prysm1.com/v2/compliance/preview · Requires authentication
A pure dry-run of compliance routing: it classifies the prompt locally and applies your policy as a hard exclusion filter, then returns exactly what would happen — without calling any model. Because nothing is executed, it costs nothing and works even when no provider keys are configured. Use it to prove, before a cent is spent, that a request would only ever be routed to approved providers.
This endpoint lives under /v2, not /v1. The SDKs target it automatically with client.compliance_preview(...) (Python) / client.compliancePreview(...) (Node).

Authorization

Authorization
string
required
Your secret key as a bearer token: Bearer prysm_sk_...

Body

prompt
string
The text to classify and gate. Provide either prompt or messages.
messages
array
An OpenAI-style conversation; the last user message is classified. Used if prompt is omitted.
compliance
object
The Policy-as-Code spec. Every field is optional; an all-empty policy is inert (pass-through). See compliance routing for the model.
brain_config
object
A BRAIN.md config whose compliance: block supplies the policy. Used when compliance is omitted; falls back to the server-discovered BRAIN.md.

Response

active
boolean
Whether a policy was in force. false means inert — all models eligible, and only the classification fields plus note are returned.
ok
boolean
true if at least one approved model can serve the request. false is a hard stop — the policy excludes every model.
policy
object
The compiled policy, echoed back (allowlist/denylist, jurisdictions, residency, required frameworks & certifications, blocked data classes, zero-retention).
detected_classes
string[]
Sensitive data classes found in the text, e.g. ["PII","FINANCIAL"]. Empty if none.
classification
object
Per-class detail: each detected class maps to the kinds that matched (e.g. { "FINANCIAL": ["iban","credit_card"] }). Pattern matches only — never executed.
allowed_models
string[]
Model ids that survive the policy and could serve the request.
excluded_models
object
Map of excluded model id → list of human-readable reasons (e.g. jurisdiction 'US' not in ['EU']).
compliance_cost_premium
object
What staying compliant costs versus the cheapest unrestricted model.
decision
object
The full exclusion decision: policy, policy_active, detected_classes, allowed, allowed_count, excluded, excluded_count, matrix_version.
sample_attestation
string
A sample SHA-256 compliance receipt (sha256:...) for the cheapest compliant model — present when ok is true. The same shape attaches to real runs’ PrysmProof.
matrix_version
string
The Regulatory Compliance Matrix version used, e.g. rcm-2026.06-baseline.
note
string
Present only when active is false — explains the pass-through.

Errors

StatuserrorMeaning
401Missing or invalid API key.
422Neither prompt nor messages resolved to any text.
from prysm import Prysm

client = Prysm()
p = client.compliance_preview(
    "summarize this report",
    compliance={"jurisdiction": ["EU"], "frameworks": ["GDPR"], "data_residency": ["EU"]},
)
print(p["allowed_models"])
print(p["compliance_cost_premium"])
{
  "active": true,
  "ok": true,
  "policy": {
    "active": true,
    "allowed_jurisdictions": ["EU"],
    "data_residency": ["EU"],
    "required_frameworks": ["GDPR"],
    "block_data_classes": []
  },
  "detected_classes": [],
  "classification": {},
  "allowed_models": ["mistral-nemo", "mistral-medium-3"],
  "excluded_models": {
    "gpt-5.2": ["jurisdiction 'US' not in ['EU']"],
    "claude-sonnet-4.5": ["jurisdiction 'US' not in ['EU']"]
  },
  "compliance_cost_premium": {
    "compliant_available": true,
    "cheapest_unrestricted": "mistral-nemo",
    "unrestricted_min_usd_mtok": 0.02,
    "cheapest_compliant": "mistral-nemo",
    "compliant_min_usd_mtok": 0.02,
    "premium_usd_mtok": 0.0,
    "premium_pct": 0.0
  },
  "decision": {
    "policy": "policy",
    "policy_active": true,
    "detected_classes": [],
    "allowed": ["mistral-nemo", "mistral-medium-3"],
    "allowed_count": 2,
    "excluded": {
      "gpt-5.2": ["jurisdiction 'US' not in ['EU']"]
    },
    "excluded_count": 17,
    "matrix_version": "rcm-2026.06-baseline"
  },
  "sample_attestation": "sha256:a1b2c3d4e5f60718",
  "matrix_version": "rcm-2026.06-baseline"
}