Prisma
GuidesHow-to Guides

Policy Metrics

Encode your organization's rules as policy metrics using the 4-prompt pattern.

A policy metric turns one of your organization's rules — a compliance requirement, a quality standard, a process guideline — into an automated validator. It's the standard way to use Prisma, and the 4-prompt pattern is the abstraction that makes it work.

This is the canonical guide to authoring policy metrics. It covers the 4-prompt pattern in depth, then builds complete metrics for three regulated industries: financial services, healthcare, and insurance. To learn how to attach metrics to a run alongside built-in evaluators, see Validations.

Prerequisites

The 4-prompt pattern

Every policy metric is defined by four prompts that form a two-pass pipeline: an initial pass classifies the interaction, and a re-evaluation pass fires only when the first pass is uncertain.

A definitive classification at any stage ends the validation. Only ambiguous escalates — first to re-evaluation, then, if still unresolved, to a human. Those expert decisions become the {context} that re-evaluation reuses on future borderline cases, so the ambiguous rate falls over time.

Prompt reference

PromptWhen it firesWhat it doesPlaceholders
evaluation_system_promptEvery interactionSets the validator's role, domain expertise, and classification criteria — its "job description".{evaluation_options}
evaluation_human_promptEvery interactionPresents the specific interaction to classify. Must contain {query}.{query}, {response}, {evaluation_options}, {reference}
reeval_system_promptOnly when the first pass is ambiguousStricter, more specific guidance for the second pass.{evaluation_options}
reeval_human_promptOnly when the first pass is ambiguousRe-presents the interaction with context from past human reviews. Must contain {query}.{query}, {response}, {context}

Placeholders

Prisma substitutes these when it runs your prompts:

  • {query} — the input side of the interaction (customer message, patient question, user request). The only required placeholder — it must appear in both human prompts. When you're reviewing a whole conversation rather than a single turn, put the entire transcript here and skip {response} (see below).
  • {response} — the output side (agent reply, advisor response, system answer). Optional: omit it for whole-transcript or input-only checks where there's no distinct response to score.
  • {reference} — optional ground-truth or policy-correct answer to compare against. Include it in evaluation_human_prompt when you have one.
  • {evaluation_options} — your evaluation_options list, formatted for the validator. Prisma populates it automatically.
  • {context} — decisions from past human reviews of similar interactions, injected into reeval_human_prompt. This is the feedback loop: expert calls on past ambiguous cases become guidance for future validations.

Options and scoring

  • evaluation_options — 2 to 5 labels, unique (case-insensitive). Never include ambiguous — Prisma adds it automatically and uses it to route low-confidence cases to re-evaluation, then to a human.
  • score_assignments — maps every option to a value from 0.0 to 1.0. This turns labels into a metric you can track and aggregate. Don't score ambiguous. A common scheme: best outcome 1.0, a gray-but-definitive outcome 0.5, worst outcome 0.0.

Finance: regulatory disclosures (step by step)

Let's build a disclosure-compliance metric for financial services. Advisors must include specific regulatory disclosures when discussing investments, performance data, or recommendations. This metric validates whether those disclosures are present.

Step 1: Choose your options and scores

evaluation_options=["compliant", "partial", "missing_disclosure"]
score_assignments={"compliant": 1.0, "partial": 0.5, "missing_disclosure": 0.0}

Three options is a good starting point for compliance metrics:

  • compliant — all required disclosures are present and clearly stated.
  • partial — some disclosures are present but others are missing, or disclosures are buried in a way that reduces their visibility.
  • missing_disclosure — the response discusses investments or performance but omits one or more required disclosures entirely.

Why three instead of two? A binary compliant / non_compliant split loses nuance. partial distinguishes "technically incomplete" from "clearly non-compliant" — and the scores (1.0 / 0.5 / 0.0) let you weight them. All three are definitive; only ambiguous (added automatically) triggers re-evaluation and human review.

Step 2: Write the evaluation system prompt

This is the validator's "job description." Be specific about the domain, the rules, and what each option means.

evaluation_system_prompt=(
    "You are a financial regulatory compliance reviewer. Your task is to "
    "determine whether advisor responses include all required regulatory "
    "disclosures when discussing investments, performance data, or financial "
    "recommendations.\n\n"
    "Required disclosures include (when applicable):\n"
    "- Past performance is not indicative of future results\n"
    "- Investment involves risk, including possible loss of principal\n"
    "- Consult a qualified financial advisor before making decisions\n"
    "- Securities are not FDIC insured\n\n"
    "Classify the response into one of these categories: {evaluation_options}\n\n"
    "- compliant: All applicable disclosures are present and clearly stated.\n"
    "- partial: Some disclosures are present but others are missing, or "
    "disclosures are buried in a way that reduces their visibility.\n"
    "- missing_disclosure: The response discusses investments or performance "
    "but omits one or more required disclosures entirely."
),

Design decisions:

  • List the specific rules. Don't say "include required disclosures." State exactly which ones. The validator needs the same rulebook your compliance team uses.
  • Define every option. Vague options produce inconsistent results.
  • Use {evaluation_options} in context to reinforce the link between rules and classifications.

Step 3: Write the evaluation human prompt

This structures the interaction for the validator. Keep it clean and consistent.

evaluation_human_prompt=(
    "Review the following financial services interaction for disclosure "
    "compliance.\n\n"
    "Customer inquiry:\n{query}\n\n"
    "Advisor response:\n{response}\n\n"
    "Classify the response as one of: {evaluation_options}\n\n"
    "List which disclosures are present, which are missing, and provide "
    "your classification."
),

Design decisions:

  • Label sections clearly ("Customer inquiry:" / "Advisor response:") so it's obvious which side is which.
  • Ask for reasoning before the label. Forcing the analysis first produces more consistent classifications.
  • Keep the template consistent across every interaction.

Step 4: Write the re-evaluation system prompt

This fires only when the first pass returned ambiguous. Make it stricter.

reeval_system_prompt=(
    "You are a senior financial regulatory compliance reviewer performing "
    "a second-pass review. Apply disclosure requirements strictly. If a "
    "response discusses any aspect of investment performance, risk, or "
    "recommendations without ALL applicable disclosures clearly stated, "
    "classify it as missing_disclosure or partial -- not compliant.\n\n"
    "You have access to decisions from previous human compliance reviews "
    "to calibrate your judgment on borderline cases.\n\n"
    "Classify the response into one of these categories: {evaluation_options}"
),

Design decisions:

  • Escalate the seniority to signal a higher-stakes pass.
  • Tighten the criteria. The first prompt says "when applicable"; this one says "if a response discusses ANY aspect."
  • Reference the review context so the validator uses {context} effectively.

Step 5: Write the re-evaluation human prompt

This includes {context} — decisions from past human reviews.

reeval_human_prompt=(
    "Re-evaluate this financial services interaction for disclosure compliance "
    "using context from previous human reviews.\n\n"
    "Customer inquiry:\n{query}\n\n"
    "Advisor response:\n{response}\n\n"
    "Relevant past compliance review decisions:\n{context}\n\n"
    "Based on the interaction and past review history, provide your final "
    "classification with specific disclosure findings."
),

The complete metric

from palqee_prisma_ai import Evaluators

disclosure_compliance = Evaluators.custom(
    name="disclosure-compliance",
    evaluation_options=["compliant", "partial", "missing_disclosure"],
    score_assignments={"compliant": 1.0, "partial": 0.5, "missing_disclosure": 0.0},
    evaluation_system_prompt=(
        "You are a financial regulatory compliance reviewer. Your task is to "
        "determine whether advisor responses include all required regulatory "
        "disclosures when discussing investments, performance data, or financial "
        "recommendations.\n\n"
        "Required disclosures include (when applicable):\n"
        "- Past performance is not indicative of future results\n"
        "- Investment involves risk, including possible loss of principal\n"
        "- Consult a qualified financial advisor before making decisions\n"
        "- Securities are not FDIC insured\n\n"
        "Classify the response into one of these categories: {evaluation_options}\n\n"
        "- compliant: All applicable disclosures are present and clearly stated.\n"
        "- partial: Some disclosures are present but others are missing, or "
        "disclosures are buried in a way that reduces their visibility.\n"
        "- missing_disclosure: The response discusses investments or performance "
        "but omits one or more required disclosures entirely."
    ),
    evaluation_human_prompt=(
        "Review the following financial services interaction for disclosure "
        "compliance.\n\n"
        "Customer inquiry:\n{query}\n\n"
        "Advisor response:\n{response}\n\n"
        "Classify the response as one of: {evaluation_options}\n\n"
        "List which disclosures are present, which are missing, and provide "
        "your classification."
    ),
    reeval_system_prompt=(
        "You are a senior financial regulatory compliance reviewer performing "
        "a second-pass review. Apply disclosure requirements strictly. If a "
        "response discusses any aspect of investment performance, risk, or "
        "recommendations without ALL applicable disclosures clearly stated, "
        "classify it as missing_disclosure or partial -- not compliant.\n\n"
        "You have access to decisions from previous human compliance reviews "
        "to calibrate your judgment on borderline cases.\n\n"
        "Classify the response into one of these categories: {evaluation_options}"
    ),
    reeval_human_prompt=(
        "Re-evaluate this financial services interaction for disclosure compliance "
        "using context from previous human reviews.\n\n"
        "Customer inquiry:\n{query}\n\n"
        "Advisor response:\n{response}\n\n"
        "Relevant past compliance review decisions:\n{context}\n\n"
        "Based on the interaction and past review history, provide your final "
        "classification with specific disclosure findings."
    ),
)

Healthcare: clinical communication guidelines

Healthcare advisors must follow strict communication guidelines: use appropriate qualifiers ("may," "could," "consult your doctor"), refer to specialists when a question exceeds their scope, and never provide a diagnosis via chat. This metric validates adherence.

from palqee_prisma_ai import Evaluators

clinical_communication = Evaluators.custom(
    name="clinical-communication",
    evaluation_options=["compliant", "needs_specialist_review", "guideline_violation"],
    score_assignments={
        "compliant": 1.0,
        "needs_specialist_review": 0.5,
        "guideline_violation": 0.0,
    },
    evaluation_system_prompt=(
        "You are a healthcare communication compliance reviewer. Your task is "
        "to determine whether a health advisor's response follows clinical "
        "communication guidelines.\n\n"
        "The guidelines require:\n"
        "1. APPROPRIATE QUALIFIERS: The advisor uses hedging language such as "
        "'may,' 'could,' 'it is possible,' or 'consult your doctor' when "
        "discussing symptoms, conditions, or treatments. Absolute statements "
        "about medical outcomes are prohibited.\n"
        "2. SCOPE BOUNDARIES: When a question involves diagnosis, prescription "
        "recommendations, or specialist-level clinical judgment, the advisor "
        "must refer the patient to a qualified healthcare professional rather "
        "than attempting to answer directly.\n"
        "3. NO DIAGNOSIS VIA CHAT: The advisor must never state or imply a "
        "diagnosis. Phrases like 'you have,' 'this is likely,' or 'it sounds "
        "like you are experiencing [condition]' are violations.\n"
        "4. EMPATHY AND CLARITY: The advisor responds with empathy, avoids "
        "medical jargon without explanation, and provides clear next steps.\n\n"
        "Classify the response into one of these categories: {evaluation_options}\n\n"
        "- compliant: All four guidelines are followed.\n"
        "- needs_specialist_review: A gray area where compliance cannot be "
        "confidently determined without clinical expertise.\n"
        "- guideline_violation: One or more guidelines are clearly violated -- "
        "absolute medical claims, a diagnosis, or a failure to refer."
    ),
    evaluation_human_prompt=(
        "Review the following healthcare interaction for compliance with "
        "clinical communication guidelines.\n\n"
        "Patient message:\n{query}\n\n"
        "Advisor response:\n{response}\n\n"
        "Classify the response as one of: {evaluation_options}\n\n"
        "For each guideline (qualifiers, scope boundaries, no diagnosis, "
        "empathy/clarity), state whether it was followed or violated, then "
        "provide your classification."
    ),
    reeval_system_prompt=(
        "You are a senior clinical communication compliance reviewer performing "
        "a second-pass review. Apply the guidelines strictly.\n\n"
        "Pay particular attention to implicit diagnoses -- statements that stop "
        "short of saying 'you have X' but still lead the patient to a specific "
        "conclusion. These are the most common borderline violations.\n\n"
        "You have access to decisions from previous clinical reviews to "
        "calibrate your judgment.\n\n"
        "Classify the response into one of these categories: {evaluation_options}"
    ),
    reeval_human_prompt=(
        "Re-evaluate this healthcare interaction for compliance with clinical "
        "communication guidelines, using context from previous clinical reviews.\n\n"
        "Patient message:\n{query}\n\n"
        "Advisor response:\n{response}\n\n"
        "Relevant past clinical review decisions:\n{context}\n\n"
        "Based on the interaction and review history, provide your final "
        "classification. Cite specific phrases that comply with or violate "
        "each guideline."
    ),
)

What this metric catches

InteractionExpected resultWhy
Patient asks about headache causes; advisor says "there are several possible causes, and I'd recommend discussing this with your doctor"compliantAppropriate qualifier, refers to doctor, no diagnosis
Patient describes chest pain; advisor says "this sounds like it could be angina -- you should take aspirin"guideline_violationImplies diagnosis, recommends treatment without referral
Patient asks about a medication interaction; advisor says "interactions between these may vary -- I'd suggest confirming with your pharmacist"compliantQualifier, refers to specialist, no diagnosis

Insurance: claims handling process

Claims agents must follow a structured triage process: assess damage, verify coverage, then communicate timelines. Skipping steps — or committing to a timeline before verifying coverage — creates regulatory and legal exposure. This metric validates the sequence.

from palqee_prisma_ai import Evaluators

claims_handling = Evaluators.custom(
    name="claims-handling",
    evaluation_options=["process_followed", "incomplete", "step_skipped"],
    score_assignments={"process_followed": 1.0, "incomplete": 0.5, "step_skipped": 0.0},
    evaluation_system_prompt=(
        "You are an insurance claims process compliance reviewer. Your task is "
        "to determine whether a claims agent followed the correct triage process "
        "during a customer interaction.\n\n"
        "The required claims triage process has three steps, in order:\n"
        "1. DAMAGE ASSESSMENT: The agent gathers details about the damage or "
        "loss -- what happened, when, extent of damage, and any documentation.\n"
        "2. COVERAGE VERIFICATION: Before making any commitments, the agent "
        "verifies the customer's policy coverage. The agent must NOT discuss "
        "payout amounts, approval likelihood, or timelines until coverage is "
        "confirmed.\n"
        "3. TIMELINE COMMUNICATION: After verifying coverage, the agent "
        "communicates the expected timeline as a range (e.g., '5-10 business "
        "days'), not a specific date.\n\n"
        "Classify the response into one of these categories: {evaluation_options}\n\n"
        "- process_followed: All three steps are present in the correct order.\n"
        "- incomplete: The agent started correctly but the interaction ended "
        "before all steps were completed, or a step was only partially addressed.\n"
        "- step_skipped: One or more required steps are entirely missing -- most "
        "critically, discussing payouts or timelines before verifying coverage."
    ),
    evaluation_human_prompt=(
        "Review the following insurance claims interaction for compliance with "
        "the claims triage process.\n\n"
        "Customer message:\n{query}\n\n"
        "Agent response:\n{response}\n\n"
        "Classify the response as one of: {evaluation_options}\n\n"
        "For each step (damage assessment, coverage verification, timeline "
        "communication), state whether it was completed, skipped, or partially "
        "addressed. Then provide your classification."
    ),
    reeval_system_prompt=(
        "You are a senior insurance claims process reviewer performing a "
        "second-pass review. Apply the triage requirements strictly.\n\n"
        "The most critical compliance point is ordering: coverage must be "
        "verified BEFORE any timeline or payout discussion. An agent who says "
        "'you should have your check within two weeks' before confirming the "
        "policy covers the claim has committed a process violation, even if "
        "they verify coverage later.\n\n"
        "You have access to decisions from previous claims process reviews to "
        "calibrate your judgment.\n\n"
        "Classify the response into one of these categories: {evaluation_options}"
    ),
    reeval_human_prompt=(
        "Re-evaluate this insurance claims interaction for compliance with the "
        "claims triage process, using context from previous process reviews.\n\n"
        "Customer message:\n{query}\n\n"
        "Agent response:\n{response}\n\n"
        "Relevant past claims process review decisions:\n{context}\n\n"
        "Based on the interaction and review history, provide your final "
        "classification. Pay specific attention to the ordering of steps."
    ),
)

Apply your metrics

Attach metrics to a run the same way you attach any evaluator — pass them to init(). Each validates independently, so an interaction can be compliant on disclosures but step_skipped on claims handling.

import palqee_prisma_ai

palqee_prisma_ai.init(
    "multi-industry-compliance",
    evaluators=[
        disclosure_compliance,
        clinical_communication,
        claims_handling,
    ],
)

Once attached, Prisma validates every instrumented interaction against each metric server-side — no per-call code in your app. In practice you'd usually apply industry-specific metrics to the relevant project; combining them suits shared-services teams handling multiple regulated domains. For built-in evaluators, input_mapping, and updating evaluators on a running session, see Validations.

Tips for effective metrics

Choosing options

  • Use 3–5 options. Two (pass/fail) force hard calls on borderline cases; more than five create overlapping categories.
  • Name options clearly — lowercase with underscores, self-explanatory (missing_disclosure, not fail_type_1; process_followed, not yes).
  • Make options mutually exclusive. If the validator could reasonably assign two, tighten the definitions in the system prompt.
  • Include a "gray area" option (partial, incomplete, needs_specialist_review) so borderline cases have a definitive home — and score it in the middle (e.g. 0.5).

Writing prompts

  • Be specific about the rules. List exact criteria, numbered and named — the same rulebook your compliance team uses.
  • Define every option in the system prompt. A one-line definition each prevents drift.
  • Ask for reasoning before the classification in the human prompt.
  • Make re-evaluation stricter. The first pass gets latitude; the second narrows the gray area.

Testing your metrics

Start with 10–20 interactions where you already know the expected result. Validate them and compare. If the metric disagrees with your team on more than a few, the prompts need refinement — usually the option definitions are too vague or the rules aren't specific enough.

Next steps

  • Human Review — how expert decisions on ambiguous cases feed {context} and make metrics sharper over time
  • Validations — attach metrics, mix with built-ins, map inputs
  • Policy Metrics (concept) — the thinking behind the two-pass design

On this page