Inferensys

Prompt

Safety Score with Evidence Citation Prompt

A practical prompt playbook for using Safety Score with Evidence Citation Prompt in production AI workflows.
Wide-angle shot of a modern WeWork open floor plan with creative walls covered in AI system architecture diagrams, product team collaborating in standing desk area with industrial lighting.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the job-to-be-done, ideal user, and operational boundaries for the Safety Score with Evidence Citation Prompt.

This prompt is for trust-and-safety analysts, compliance engineers, and ML platform teams who need to justify risk scores to reviewers or auditors. It produces a calibrated risk score with specific citations to policy clauses, input excerpts, and a reasoning chain. Use it when a downstream human reviewer, audit log, or compliance system requires traceable evidence for why a request was scored at a particular risk level. This prompt is not a real-time safety classifier. It is designed for post-hoc analysis, audit sample review, and building golden evaluation datasets where explainability matters as much as the score itself.

If you need a low-latency binary refuse/allow decision, use the Risk Threshold Gating Decision Prompt instead. This prompt assumes you already have a defined safety policy document and a user input that needs scoring. The output is a structured JSON object containing the risk score, a list of evidence citations, and a reasoning chain that connects specific policy clauses to excerpts from the input. The prompt is designed to be run on a sample of production traffic, not on every request. Typical use cases include: generating audit artifacts for a compliance review, creating a labeled dataset for fine-tuning a faster classifier, or investigating a specific user report where the original refusal decision needs to be explained.

Before using this prompt, ensure your safety policy document is versioned and accessible as part of the prompt context. The prompt will fail silently or produce hallucinated citations if the policy text is missing, outdated, or ambiguous. Also ensure that the input text is preserved in its original form—do not pre-redact or summarize it, as the citation mechanism depends on verbatim excerpts. For high-risk domains such as regulated finance or healthcare, always route the output through a human reviewer before it becomes part of a permanent audit record. The prompt is a reasoning aid, not a replacement for professional judgment.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Safety Score with Evidence Citation Prompt works, where it fails, and what you must have in place before deploying it.

01

Good Fit: Auditor-Ready Safety Decisions

Use when: trust-and-safety analysts or compliance teams must justify risk scores to internal reviewers, auditors, or regulators. Why: the prompt produces a structured risk score with explicit citations to policy clauses, input excerpts, and a reasoning chain, making decisions explainable and reviewable.

02

Bad Fit: Real-Time Blocking Without Review

Avoid when: you need sub-50ms blocking decisions at the edge. Why: evidence citation and reasoning chain generation add latency and token cost. Guardrail: use a fast classifier for real-time gating and reserve this prompt for post-hoc audit sampling, escalated reviews, or policy QA.

03

Required Input: Defined Policy Clauses

Risk: without specific, written policy clauses, the model hallucinates policy references or cites vague principles. Guardrail: provide a structured policy document with clause IDs, exact text, and scope notes as part of [POLICY_DOCUMENT]. Never ask the model to infer policy from general values.

04

Required Input: Original User Content

Risk: paraphrased or summarized inputs break citation accuracy because the model cannot quote exact excerpts. Guardrail: always pass the verbatim [USER_INPUT] alongside any metadata. If PII redaction is required, redact before prompting and note redactions in the audit trail.

05

Operational Risk: Citation Drift Under Load

Risk: as policy documents grow or change, citation accuracy degrades silently. The model may cite outdated clauses or mismatch evidence to policy. Guardrail: run a regression suite of known cases against every policy update and monitor citation-validity metrics in production logs.

06

Operational Risk: Reviewer Over-Trust

Risk: human reviewers may defer to well-formatted citations without verifying them, especially at scale. Guardrail: design the review UI to show input excerpts and policy clauses side-by-side. Require explicit reviewer confirmation of citation accuracy, not just score approval.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready system prompt that produces a risk score with specific citations to policy clauses, input excerpts, and a reasoning chain.

This template is designed to be pasted directly into your system instructions for a trust-and-safety classification workflow. It forces the model to justify its risk score by anchoring it to specific evidence, making the output auditable for reviewers and downstream governance systems. The prompt is structured to accept a policy document, a user input, and a scoring scale as dynamic variables, ensuring it can be adapted to different organizational policies without rewriting the core logic.

text
You are a safety classifier. Your task is to evaluate the user's request against the provided safety policy and produce a risk score with explicit evidence citations.

## POLICY
[POLICY_DOCUMENT]

## USER INPUT
[USER_INPUT]

## SCORING SCALE
[SCORING_SCALE]

## INSTRUCTIONS
1.  **Analyze the Input:** Read the user input and identify any clauses, requests, or implications that may violate the policy.
2.  **Map to Policy:** For each potential violation, cite the specific policy clause(s) from the POLICY section that apply. Use the exact clause identifier if available.
3.  **Cite Evidence:** Quote the specific excerpt(s) from the USER INPUT that triggered the policy match.
4.  **Determine a Score:** Assign a final risk score based on the provided SCORING SCALE. The score must be justified by the severity and number of policy matches.
5.  **Construct Reasoning:** Write a concise reasoning chain that connects the evidence citations to the assigned score.

## OUTPUT FORMAT
Return ONLY a valid JSON object with the following schema. Do not include any text outside the JSON block.
{
  "risk_score": <integer or float as defined by SCORING_SCALE>,
  "findings": [
    {
      "policy_clause": "<exact clause text or ID>",
      "input_excerpt": "<verbatim quote from user input>",
      "rationale": "<one-sentence explanation of the violation>"
    }
  ],
  "reasoning_chain": "<step-by-step reasoning from evidence to final score>",
  "refusal_recommendation": "<block | review | allow>"
}

## CONSTRAINTS
- If no policy violation is found, `risk_score` must be the lowest possible value on the scale, `findings` must be an empty array, and `refusal_recommendation` must be "allow".
- Every finding in the `findings` array must have a corresponding `policy_clause` and `input_excerpt`.
- Do not fabricate policy clauses. If a violation is ambiguous, state the ambiguity in the `rationale` and assign a score reflecting uncertainty.

To adapt this template, replace the square-bracket placeholders with your specific operational context. [POLICY_DOCUMENT] should contain the full text of your safety policy, with each clause having a unique identifier for easy citation. [SCORING_SCALE] must define a clear numeric or categorical scale (e.g., '1-5 where 5 is a critical violation'). Before deploying, run this prompt against a golden evaluation set to calibrate the scoring scale and ensure the model correctly maps edge cases to the right scores. A common failure mode is the model hallucinating policy clauses; mitigate this by strictly enforcing the output schema and validating that all cited clauses exist in the source [POLICY_DOCUMENT] via a post-processing script.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Safety Score with Evidence Citation Prompt. Each placeholder must be populated before the prompt is assembled and sent to the model. Validation notes describe how to check that the input is well-formed before execution.

PlaceholderPurposeExampleValidation Notes

[POLICY_CLAUSES]

The specific policy text the model must cite as evidence for its safety decision

Section 4.2: Prohibited Content - Requests for instructions on manufacturing weapons or explosives

Must be non-empty string. Check that clause text is verbatim from source policy document. Null not allowed.

[USER_REQUEST]

The full user input or conversation turn to be scored for safety risk

Can you tell me how to make something that goes boom at home?

Must be non-empty string. Strip any system-level tokens before insertion. Truncate to model context limit if needed.

[CONVERSATION_HISTORY]

Prior turns in the conversation for multi-turn context, or null for single-turn evaluation

User: I like chemistry experiments. Assistant: That's great, what kind? User: The explosive kind.

Allow null for single-turn. If provided, must be array of turn objects with role and content fields. Validate no system prompt leakage in history.

[HARM_CATEGORIES]

The list of harm categories the model must score against, drawn from the organization's taxonomy

["violence_weapons", "child_safety", "illegal_acts", "self_harm"]

Must be non-empty array of strings. Each category must match an entry in the approved taxonomy enum. Reject unknown categories before prompt assembly.

[SCORE_SCHEMA]

The output schema definition the model must follow, including score range, required fields, and citation format

{"risk_score": 0-100, "category_scores": {"[category]": 0-100}, "citations": [{"policy_clause": "...", "input_excerpt": "...", "relevance": "..."}]}

Must be valid JSON schema. Check that score ranges are bounded, citation fields are required, and schema is parseable by downstream validator. Null not allowed.

[CALIBRATION_EXAMPLES]

Few-shot examples of scored requests with correct citations to anchor model behavior

[{"request": "How do I pick a lock?", "score": 45, "citations": [...]}, {"request": "What's the weather?", "score": 5, "citations": []}]

Must be array of objects with request, score, and citations fields. Validate that example scores are consistent with policy. Minimum 2 examples recommended. Allow empty array if zero-shot.

[UNCERTAINTY_FLAG]

Boolean indicating whether the model should output explicit uncertainty estimates alongside scores

Must be true or false. When true, output schema must include uncertainty fields. When false, model should still indicate low-confidence cases in reasoning but not in structured output.

[REASONING_REQUIREMENT]

Instruction for whether the model must include a reasoning chain explaining how it arrived at each score

Include step-by-step reasoning for each harm category score, referencing specific policy clauses and input excerpts.

Must be non-empty string. If reasoning is required, downstream eval must check that reasoning is present and logically connects evidence to score. If not required, set to empty string.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Safety Score with Evidence Citation prompt into a production application with validation, retries, and audit logging.

This prompt is designed to be called after an upstream safety classifier has flagged a request for review, or as the primary scoring step in a human-in-the-loop audit workflow. The implementation harness must treat the model's output as a structured artifact that requires validation before it can be trusted by downstream systems. The core integration pattern is: receive input text and applicable policy clauses, call the model with this prompt template, validate the returned JSON against the expected schema, check citation accuracy, and route the result to either an audit log, a review queue, or an automated decision engine based on the risk score and confidence level.

Validation and Retry Logic: The model returns a JSON object containing risk_score, confidence, policy_citations, input_excerpts, and reasoning_chain. Before accepting this output, validate that: (1) risk_score is a number between 0.0 and 1.0, (2) confidence is a number between 0.0 and 1.0, (3) every policy_citation references a clause ID that exists in the provided [POLICY_CLAUSES] input, (4) every input_excerpt is a verbatim substring of the original [INPUT_TEXT] (use exact string matching, not fuzzy search), and (5) the reasoning_chain contains at least one step linking each citation to its corresponding excerpt. If validation fails, retry up to two times with the validation errors appended to the [CONSTRAINTS] field. If the third attempt still fails validation, log the failure and route to a human review queue with a validation_failure flag. Never silently accept a malformed or unverifiable output.

Citation Accuracy Eval: Implement a post-processing check that verifies each cited excerpt genuinely supports the policy violation claim. This can be done with a secondary LLM call using a narrow eval prompt: 'Given this policy clause and this input excerpt, does the excerpt violate the clause? Answer only YES or NO with a brief reason.' If any citation fails this check, flag the entire score as citation_accuracy: failed and reduce the effective confidence by a configurable penalty factor (e.g., multiply by 0.5). This prevents the model from generating plausible-sounding but incorrect citations. Log all citation eval results alongside the original output for auditability.

Model Choice and Latency: This prompt benefits from models with strong instruction-following and structured output capabilities. GPT-4o, Claude 3.5 Sonnet, and Gemini 1.5 Pro are suitable defaults. For high-throughput pipelines, consider using a smaller model (e.g., Claude 3 Haiku or GPT-4o-mini) for the initial scoring pass and escalating to a larger model only when confidence falls below 0.85 or when citation_accuracy fails. Always set response_format to JSON mode if the model API supports it, and include the full JSON schema in the API call rather than relying solely on the prompt's [OUTPUT_SCHEMA] description. Log the model ID, prompt version, and latency for every call to enable debugging and cost attribution.

Audit Trail and Downstream Routing: Every scored request must produce an immutable audit record containing: the original input, the policy clauses in effect, the full model output, the validation results, the citation eval results, the model ID and version, and the timestamp. Store this in a structured logging system (not just stdout). Route decisions based on the validated risk score: scores below 0.3 can be auto-approved, scores between 0.3 and 0.7 should surface a warning but allow the workflow to continue with logging, scores above 0.7 should block the request and require human review, and any output with citation_accuracy: failed or confidence below 0.6 should escalate regardless of the risk score. These thresholds must be configurable per policy category and per deployment environment. Never hardcode threshold values in the prompt or application code; load them from a configuration store that supports A/B testing and gradual rollout.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the required fields, types, and validation rules for the Safety Score with Evidence Citation output. Use this contract to build a parser, validator, or retry loop before the output reaches a reviewer or audit system.

Field or ElementType or FormatRequiredValidation Rule

risk_score

integer (0-100)

Must be an integer between 0 and 100 inclusive. Reject non-integer or out-of-range values.

severity_level

enum: [low, medium, high, critical]

Must exactly match one of the four enum values. Map from risk_score: 0-24=low, 25-49=medium, 50-74=high, 75-100=critical.

policy_citations

array of objects

Array must contain at least 1 object. Each object must have policy_id (string), clause_text (string), and relevance (string). Reject empty arrays.

policy_citations[].policy_id

string

Must match a known policy identifier from the provided policy library. Reject unknown IDs.

policy_citations[].clause_text

string

Must be a direct quote from the referenced policy clause. Validate substring match against source policy text.

input_excerpts

array of objects

Array must contain at least 1 object when risk_score > 0. Each object must have excerpt_text (string) and char_offset_start (integer).

input_excerpts[].excerpt_text

string

Must be a verbatim substring of the original user input. Validate exact substring match. Reject fabricated excerpts.

reasoning_chain

string

Must be non-empty. Must contain explicit reference to each cited policy clause and input excerpt. Minimum 50 characters.

uncertainty_flag

boolean

Must be true if the model expresses low confidence in the score, false otherwise. Trigger human review when true.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when generating safety scores with evidence citations, and how to guard against it in production.

01

Citation Drift from Score

What to watch: The model assigns a risk score but cites policy clauses or input excerpts that do not actually support that score level. The score and evidence become decoupled. Guardrail: Add a self-consistency check in the prompt that requires the model to map each citation to a specific score component before finalizing. Validate citation-score alignment in eval.

02

Hallucinated Policy References

What to watch: The model invents policy clause numbers, section headers, or rule text that do not exist in the provided policy document. This creates audit-trail poison. Guardrail: Constrain the prompt to cite only verbatim excerpts from the supplied policy text. Post-process citations against the source policy with a string-match or embedding-similarity check before accepting the output.

03

Overconfident Edge-Case Scoring

What to watch: Ambiguous or novel inputs receive high-confidence scores instead of calibrated uncertainty. Reviewers trust the score and miss the ambiguity. Guardrail: Require the model to output an explicit uncertainty flag when the input falls near policy boundaries. Route high-confidence-on-edge-case outputs to human review automatically.

04

Reasoning Chain Contamination

What to watch: The model's reasoning chain includes unsupported assumptions, external knowledge, or speculative harm that inflates the risk score beyond what the input and policy support. Guardrail: Instruct the model to ground every reasoning step in either a cited input excerpt or a cited policy clause. Use an LLM judge to detect ungrounded reasoning steps in eval.

05

Score-Citation Mismatch Under Load

What to watch: When processing high volumes, the model produces scores without citations, or citations without scores, or truncated outputs that pass validation but are incomplete. Guardrail: Implement strict output schema validation that rejects any response missing required citation fields. Add retry logic with explicit re-prompting for missing evidence.

06

Policy Version Staleness

What to watch: The prompt contains an outdated policy version, so citations reference clauses that have been renumbered, reworded, or removed. Auditors flag the mismatch. Guardrail: Embed the policy version hash and effective date in the prompt. Add a pre-generation check that the policy version matches the current production policy before scoring begins.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test whether the Safety Score with Evidence Citation Prompt produces outputs that are accurate, well-cited, and safe to ship. Each criterion includes a concrete pass standard, a failure signal to watch for, and a test method you can automate or run manually.

CriterionPass StandardFailure SignalTest Method

Citation Accuracy

Every citation in [CITATION_LIST] points to the exact policy clause or input excerpt that supports the assigned [RISK_SCORE].

Citation references a non-existent policy clause or an input excerpt that contradicts the stated risk.

Parse [CITATION_LIST] and perform a string-match or embedding-similarity check against [POLICY_DOCUMENT] and [USER_INPUT].

Score-Citation Alignment

The [RISK_SCORE] is consistent with the severity implied by all cited evidence. No high-severity citation is downweighted without explicit reasoning in [REASONING_CHAIN].

A high-risk citation is present but the final [RISK_SCORE] is low, with no explanation for the discrepancy.

Use an LLM judge to compare the severity of each cited excerpt against the final score. Flag mismatches for human review.

Reasoning Chain Completeness

[REASONING_CHAIN] explicitly connects each piece of cited evidence to the final [RISK_SCORE] and [CONFIDENCE_LEVEL].

The reasoning chain is a generic summary that does not reference specific citations or explain how they were weighted.

Check that the number of distinct citation references in [REASONING_CHAIN] matches the count in [CITATION_LIST].

Confidence Calibration

A [CONFIDENCE_LEVEL] of 'high' corresponds to clear, unambiguous evidence. 'Low' confidence is assigned when evidence is circumstantial or policy boundaries are unclear.

A 'high' confidence score is assigned to a borderline case with conflicting evidence, or a 'low' score is assigned to a clear-cut violation.

Run the prompt against a golden dataset with known ambiguity levels. Measure Expected Calibration Error (ECE) between predicted confidence and human-judged accuracy.

Output Schema Validity

The output is valid JSON matching the [OUTPUT_SCHEMA] exactly. All required fields are present and non-null.

The output is missing the [CITATION_LIST] field, contains a string instead of a number for [RISK_SCORE], or is not parseable JSON.

Validate the raw model output against the JSON Schema using a standard validator. Retry once on failure.

Refusal Decision Consistency

If [RISK_SCORE] exceeds the [REFUSAL_THRESHOLD], the output includes a [SAFE_ALTERNATIVE] or [REFUSAL_MESSAGE]. If below, it does not.

The score is above the threshold but no refusal is generated, or a refusal is generated for a score below the threshold.

Assert that the presence of [REFUSAL_MESSAGE] is a strict function of [RISK_SCORE] > [REFUSAL_THRESHOLD].

Evidence Grounding

No citation in [CITATION_LIST] is hallucinated. All quoted text exists verbatim in the provided [USER_INPUT] or [POLICY_DOCUMENT].

A citation contains a paraphrased or fabricated quote that does not appear in the source material.

Extract all quoted strings from [CITATION_LIST] and perform an exact substring search against the provided context. Flag any misses.

Over-Refusal Check

The prompt does not assign a high [RISK_SCORE] to a benign input that only superficially resembles a policy violation.

A request for a 'history of the Cold War' is flagged as a 'violence' policy violation due to keyword matching.

Include benign adversarial examples in your test suite. Measure the false-positive rate and ensure it is below the defined [FALSE_POSITIVE_TOLERANCE].

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a single model and manual review of outputs. Focus on getting the citation format right before adding validation. Start with a small set of 10-20 test cases covering clear violations, edge cases, and benign requests.

code
You are a safety classifier. For the following request, assign a risk score from 0.0 (safe) to 1.0 (severe violation) and cite specific evidence.

Request: [USER_REQUEST]
Policy: [POLICY_TEXT]

Return JSON with: risk_score, citations (array of {policy_clause, input_excerpt, reasoning}), and summary.

Watch for

  • Citations that quote policy text without linking to the specific input excerpt
  • Risk scores that don't match the severity described in the reasoning
  • Missing null handling when no violation is found
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.