This prompt is designed for compliance officers and audit teams who need to review a single, high-stakes decision made by an AI assistant within a multi-turn conversation. The primary job-to-be-done is to transform a potentially complex and messy chat log into a structured, human-readable, step-by-step trace. This trace must explicitly link the user's request, the evidence retrieved, the internal policy rules that were triggered, and the assistant's final decision. The ideal user is not the AI engineer who built the system, but a compliance reviewer who needs to verify that a specific decision was made correctly, fairly, and in accordance with documented policies, without needing to understand the underlying model architecture.
Prompt
Conversation Decision Trace Prompt for Compliance Review

When to Use This Prompt
Define the job, the reader, and the operational constraints for the Conversation Decision Trace Prompt.
You should use this prompt when a decision's auditability is non-negotiable, such as in regulated finance, healthcare, or insurance workflows. It is appropriate for post-hoc review of decisions involving claim eligibility, transaction flags, clinical trial matching, or access control. The prompt requires a complete context package: the full conversation history, the specific assistant turn containing the decision, the exact text of the relevant policy documents, and the evidence snippets that were available to the model at the time. Do not use this prompt for real-time decision-making, for debugging model behavior during development, or for decisions where the policy is ambiguous and requires human interpretation. It is a documentation tool, not a judgment replacement.
This prompt is not a substitute for a human-in-the-loop approval workflow. It assumes the decision has already been made and focuses on creating a defensible audit artifact. Before relying on its output, you must implement a validation harness that checks for hallucinated policy citations and missing evidence links. The next step after generating a trace is to have a human reviewer compare the trace's 'Evidence-to-Conclusion' chain against the source documents. Avoid using this prompt for low-risk, conversational decisions where the overhead of a full trace is not justified by the compliance requirement.
Use Case Fit
Where the Conversation Decision Trace Prompt delivers reliable compliance evidence and where it introduces unacceptable risk.
Good Fit: High-Stakes, Low-Volume Decisions
Use when: Each decision carries regulatory, financial, or safety consequences and human reviewers need a complete trace. Guardrail: The prompt is designed for depth over speed; do not apply it to high-throughput, low-risk chat turns where latency and cost outweigh audit value.
Bad Fit: Real-Time Customer Chat
Avoid when: The assistant must respond in under one second to casual user queries. Guardrail: Generating a full decision trace is a heavyweight operation. Reserve it for post-hoc review or asynchronous compliance sampling, not synchronous chat loops.
Required Input: Structured State and Policy Artifacts
What to watch: The prompt cannot trace a decision if the conversation state, retrieved evidence, or policy rules are missing or implicit. Guardrail: The application harness must supply [PRIOR_TURNS], [ACTIVE_POLICIES], [RETRIEVED_EVIDENCE], and [STATE_SNAPSHOT] as explicit inputs. Do not rely on the model to infer them from raw chat logs.
Operational Risk: Hallucinated Policy Citations
What to watch: The model may invent plausible-sounding policy names or clause numbers that do not exist in your actual policy documents. Guardrail: Run a post-generation validation step that cross-references every cited policy identifier against a known policy registry. Flag any trace with unverifiable citations for human review before it enters the audit record.
Operational Risk: Missing Decision Steps
What to watch: The trace may skip intermediate reasoning steps, presenting a conclusion without showing how evidence was weighed against policy. Guardrail: Use an eval rubric that checks for the presence of required trace sections: triggering condition, evidence considered, policy rule applied, and final determination. Reject incomplete traces.
Operational Risk: Evidence-Conclusion Mismatch
What to watch: The trace may cite evidence that does not actually support the stated conclusion, creating a false sense of rigor. Guardrail: Implement a secondary LLM-as-judge check that verifies each evidence-to-conclusion link. Escalate mismatches for human review and log them as trace quality failures.
Copy-Ready Prompt Template
A reusable prompt template for generating a human-readable, step-by-step compliance decision trace from conversation logs.
This template is the core instruction set for the model. It is designed to be dropped into your application's prompt assembly pipeline. The prompt forces the model to act as a compliance analyst, reconstructing a decision's lineage from raw conversation turns, retrieved evidence, and stated policies. It strictly separates facts from interpretation and requires explicit citations for every inferential step. The output is a structured markdown report suitable for direct human review or ingestion into a compliance audit system.
markdownYou are a compliance review analyst. Your task is to produce a Decision Trace Report for a specific assistant action or conclusion within a conversation. You must reconstruct the logical path from user input to final decision, citing all evidence and policy rules used. ## Input Data - **Conversation Log:** A sequence of turns between a user and an AI assistant. ```json [CONVERSATION_LOG]
- Assistant Decision Under Review: The specific statement, action, or tool call made by the assistant that requires a trace.
json
[DECISION_UNDER_REVIEW] - Retrieved Evidence Corpus: The set of documents or data chunks available to the assistant at the time of the decision.
json
[EVIDENCE_CORPUS] - Active Policy Set: The rules, guidelines, or constraints the assistant was instructed to follow.
json
[POLICY_SET]
Output Schema
Generate a Decision Trace Report in markdown with the following sections. Be rigidly faithful to the input data. If a section cannot be completed due to missing information, explicitly state 'INSUFFICIENT DATA' and explain what is missing.
1. Decision Summary
- Decision: [Restate the decision under review]
- Turn: [Turn number where the decision occurred]
- Timestamp: [Timestamp of the decision turn]
2. Triggering Condition
- User Input: [The exact user message or event that immediately preceded the decision]
- Detected Intent/Need: [The inferred user goal that triggered the decision process]
- Confidence: [HIGH/MEDIUM/LOW] - [Brief justification]
3. Evidence Trail
For each piece of evidence used, provide:
- Source: [Document ID or chunk reference from the Evidence Corpus]
- Relevant Excerpt: [Quote the specific text used]
- Interpretation: [How this excerpt supports the decision. Clearly separate fact from inference.]
- Timeliness: [Timestamp of the evidence. Flag if it may be stale relative to the conversation.]
4. Policy Evaluation
For each policy rule that influenced the decision, provide:
- Policy Rule: [Exact text or ID of the rule from the Policy Set]
- Condition Check: [How the conversation state or evidence satisfied the rule's condition]
- Action Mandated: [The action the policy required or permitted]
- Compliance Status: [COMPLIANT / NON-COMPLIANT / NOT APPLICABLE] - [Justification]
5. Decision Logic Walkthrough
Provide a numbered, step-by-step narrative of the assistant's reasoning. Each step must reference the evidence (from Section 3) or policy (from Section 4) that justifies it. Do not add information not present in the inputs.
6. Missing Information & Ambiguities
List any gaps that prevented a complete trace:
- Missing Evidence: [What fact was needed but not found in the corpus]
- Ambiguous Policy: [Any policy rule that was open to interpretation]
- Unresolved Context: [Any prior user statement that was unclear or contradictory]
7. Overall Compliance Assessment
- Conclusion: [SUPPORTED / UNSUPPORTED / INCONCLUSIVE]
- Risk Level: [LOW/MEDIUM/HIGH/CRITICAL]
- Reviewer Notes: [Any flags for a human reviewer, such as potential hallucination, policy conflict, or evidence gap]
Constraints
- Do not invent facts, evidence, or policies not present in the input data.
- If the evidence is contradictory, note the contradiction in Section 6 and explain how it was resolved in Section 5.
- If the decision cannot be justified, state 'UNSUPPORTED' in the overall assessment.
- Maintain a neutral, factual tone. This is an audit document, not an argument for the defense.
To adapt this template, replace the four square-bracket placeholders with your application's data. The [CONVERSATION_LOG] should be a serialized JSON array of turn objects. The [DECISION_UNDER_REVIEW] can be a single string or a structured object identifying the specific assistant message or tool call. For high-risk domains, always pair this prompt's output with a programmatic validation harness that checks for the presence of all required sections and flags any 'INSUFFICIENT DATA' or 'UNSUPPORTED' conclusions for mandatory human review before the trace is archived.
Prompt Variables
Required inputs for the Conversation Decision Trace Prompt. Each placeholder must be populated before the prompt is assembled and sent. Missing or malformed inputs are the most common cause of incomplete traces.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[CONVERSATION_HISTORY] | Full transcript of the session up to the decision point, with speaker labels and timestamps | USER [2025-01-15 14:02:03]: I need to dispute charge #8842. ASSISTANT [2025-01-15 14:02:05]: I can help with that. Let me pull up your account. | Must contain at least one user turn and one assistant turn. Timestamps required for ordering validation. Reject if empty or only system messages. |
[DECISION_TURN_INDEX] | Zero-based index identifying which assistant turn to trace | 4 | Must be a non-negative integer. Must reference an existing assistant turn in [CONVERSATION_HISTORY]. Reject if index exceeds turn count or points to a user turn. |
[RETRIEVED_EVIDENCE] | Structured array of documents, policies, or data sources available to the assistant at the decision turn | [{"source_id": "POL-142", "title": "Dispute Handling Policy v3", "content": "...", "retrieved_at": "2025-01-15 14:02:04"}] | Must be a valid JSON array. Each entry requires source_id and content. Null allowed if no retrieval occurred, but must be explicitly null, not omitted. |
[APPLICABLE_POLICIES] | List of policy rules or business constraints active during the decision | [{"policy_id": "DISP-001", "rule": "Verify account ownership before processing dispute", "source": "Compliance Manual Section 4.2"}] | Must be a valid JSON array. Each entry requires policy_id and rule text. Empty array allowed if no policies apply, but must be explicit. Reject if policy_id is missing. |
[TOOL_CALL_LOG] | Record of function calls, API requests, or tool invocations made at or immediately before the decision turn | [{"tool": "lookup_account", "args": {"charge_id": "8842"}, "result": {"status": "active", "owner_verified": true}, "timestamp": "2025-01-15 14:02:04"}] | Must be a valid JSON array. Each entry requires tool name, args, result, and timestamp. Null allowed if no tools were called. Reject if result field is missing on non-null entries. |
[OUTPUT_SCHEMA] | JSON Schema defining the expected structure of the decision trace output | {"type": "object", "required": ["decision_id", "trace_steps", "final_decision"], "properties": {"trace_steps": {"type": "array"}}} | Must be a valid JSON Schema object. Required fields must include trace_steps and final_decision. Reject if schema is not parseable by a standard JSON Schema validator. |
[REVIEWER_CONTEXT] | Metadata about who will review this trace and under what regulatory or operational framework | {"reviewer_role": "compliance_officer", "regulation": "PCI-DSS", "review_deadline": "2025-01-22"} | Must be a valid JSON object. reviewer_role is required. regulation field optional but strongly recommended for regulated domains. Reject if reviewer_role is empty or generic placeholder. |
Implementation Harness Notes
How to wire the Conversation Decision Trace Prompt into a compliance review application with validation, retries, and human-in-the-loop controls.
The Conversation Decision Trace Prompt is designed to be called after a high-stakes assistant decision has been made, not during the real-time conversation flow. In a production compliance system, this prompt should be triggered by a decision-logging event—such as a tool call that modifies a customer record, a policy action that denies a claim, or an escalation that routes a case to a human reviewer. The application layer must capture the full conversation context, the retrieved evidence set, the applicable policy documents, and the final decision payload before invoking this prompt. Treat the trace generation as an asynchronous post-decision step that writes an immutable audit record to your compliance store.
Wire the prompt into a decision-audit pipeline with these components: Input assembly—collect the user's turn history, the evidence snippets returned by your RAG system (with source identifiers and retrieval timestamps), the policy rules that were active at decision time, and the structured decision output (action, confidence, reasoning). Model selection—use a model with strong instruction-following and long-context handling (GPT-4o, Claude 3.5 Sonnet, or equivalent). Avoid smaller models that may drop steps or hallucinate policy citations. Validation layer—after the trace is generated, run structured checks: (1) every cited policy rule must match a rule ID in the input policy set, (2) every evidence reference must resolve to a source ID in the input evidence set, (3) the trace must contain a step for each required phase (user intent, evidence retrieval, policy matching, decision, justification). Reject traces that fail validation and retry with a repair prompt that includes the specific validation errors.
For high-risk domains (finance, healthcare, legal), add a human review queue before the trace is finalized. The system should surface the generated trace alongside the original conversation and evidence for a compliance officer to approve, reject, or annotate. Log every review action with a timestamp and reviewer identity. Implement retry logic with a maximum of 2 repair attempts for validation failures; if the trace still fails after 2 retries, escalate to human review with the failure details attached. Store the final trace as an append-only record with a trace ID, decision ID, model version, prompt version, and generation timestamp. Never allow the trace to overwrite the original decision or conversation data—the trace is derivative evidence, not the source of truth. Avoid wiring this prompt into synchronous user-facing flows; the latency and review requirements make it unsuitable for real-time responses.
Expected Output Contract
Defines the structured fields, types, and validation rules for the Conversation Decision Trace output. Use this contract to parse, validate, and store the generated trace before presenting it to a compliance reviewer.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
trace_id | string (UUID v4) | Must be a valid UUID v4 string. Reject if missing or malformed. | |
session_id | string | Must match the [SESSION_ID] input exactly. Reject on mismatch. | |
decision_timestamp | string (ISO 8601) | Must parse as a valid ISO 8601 datetime in UTC. Reject if unparseable or in the future. | |
decision_summary | string (<= 280 chars) | Must be a non-empty string. Reject if length exceeds 280 characters. | |
input_evidence | array of objects | Each object must contain 'source' (string), 'content' (string), and 'retrieval_timestamp' (ISO 8601). Reject if array is empty or any required field is missing. | |
policy_rules_cited | array of strings | Each string must match a policy ID from the [POLICY_IDS] input list. Reject if any citation is not in the provided list. | |
decision_path | array of objects | Each step object must have 'step_number' (integer), 'reasoning' (string), and 'evidence_ref' (string or null). Reject if step numbers are not sequential or if 'reasoning' is empty. | |
final_decision | string (enum) | Must be one of [APPROVED, DENIED, ESCALATED, NEEDS_CLARIFICATION]. Reject on any other value. |
Common Failure Modes
What breaks first when generating compliance decision traces and how to guard against it.
Hallucinated Policy Citations
What to watch: The model invents policy names, clause numbers, or regulatory references that sound plausible but don't exist in the provided policy documents. This is the highest-risk failure mode for compliance review because auditors may trust fabricated citations. Guardrail: Require every policy citation to include a direct quote from the source document. Add a post-generation validation step that checks each cited policy string against the actual policy corpus using exact or fuzzy matching. Flag any citation without a matching source for human review.
Missing Decision Steps
What to watch: The trace skips intermediate reasoning steps, jumping from user input directly to final decision without showing which evidence was considered, which policies were checked, or why alternatives were rejected. This produces an audit record that looks complete but fails under scrutiny. Guardrail: Define a required step schema (Input → Evidence Retrieval → Policy Matching → Constraint Check → Decision → Justification) and validate that every step has non-empty content. Use a structured output format that enforces each step as a required field rather than free-text narrative.
Evidence-Decision Mismatch
What to watch: The trace cites evidence that doesn't actually support the stated decision, or the decision contradicts the evidence summary without explanation. This often happens when the model confuses multiple pieces of evidence or defaults to a common decision pattern. Guardrail: Add an eval step that extracts each claim in the decision and checks whether at least one cited evidence passage directly supports it. Use an LLM judge prompt specifically designed to detect unsupported claims. Flag decisions where support is missing or ambiguous.
Temporal Ordering Errors
What to watch: The trace presents events, evidence retrieval, and decisions in an order that doesn't match the actual conversation timeline. Evidence appears to have been considered before it was retrieved, or decisions reference future turns. Guardrail: Include explicit timestamps or turn numbers in every trace step. Validate that step timestamps are monotonically increasing. Add a harness check that rejects traces where any step references a turn number higher than the current turn.
Over-Confident Uncertainty Handling
What to watch: The trace presents ambiguous evidence or conflicting policies as definitive, removing uncertainty language that was present in the source material. Compliance reviewers need to see where the system was uncertain to assess risk properly. Guardrail: Require the trace to include an explicit confidence level or uncertainty flag for each decision step. When source evidence contains hedging language, the trace must preserve it. Add a validation check that detects when uncertainty markers from source text are absent in the trace output.
Context Window Truncation Artifacts
What to watch: Long conversations exceed context limits, causing earlier turns, policy documents, or evidence to be silently dropped. The trace appears complete but is built from incomplete context, producing decisions that ignore critical earlier information. Guardrail: Include a context-coverage assertion at the start of every trace listing which turns and documents were available during generation. Compare this against the full session record. Flag any trace where the available context doesn't cover all relevant turns or where safety-critical policy documents were truncated.
Evaluation Rubric
Criteria for testing the quality of a generated decision trace before it is accepted for compliance review. Each row defines a pass standard, a failure signal, and a concrete test method.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Evidence Grounding | Every factual claim in the trace is linked to a specific source passage or turn ID from [CONVERSATION_HISTORY] or [RETRIEVED_EVIDENCE] | Trace contains unsupported assertions or generic rationales without source references | Parse trace for claim markers; verify each marker resolves to a valid source ID in the input payload |
Policy Citation Accuracy | All cited policy rules match verbatim text from [POLICY_DOCUMENTS] and are applied to the correct condition | Trace cites a policy that does not exist in the input, misquotes rule text, or applies a rule to an inapplicable condition | Extract cited policy IDs; diff against [POLICY_DOCUMENTS] text; flag any string similarity below 0.95 or mismatched condition |
Decision Step Completeness | Trace includes all required steps: user intent, evidence retrieval, policy matching, conflict resolution, final decision, and justification | One or more required steps are missing or replaced with a placeholder like 'analysis complete' | Validate trace against a required-step schema; fail if any mandatory step key is absent or contains null justification |
Conflict Resolution Logging | When [USER_INPUT] contradicts [RETRIEVED_EVIDENCE] or [POLICY_DOCUMENTS], the trace explicitly records the conflict, the priority rule applied, and the overridden information | Contradiction exists in inputs but trace shows no conflict record or applies no explicit priority rule | Pre-process inputs to detect known contradictions; cross-check that each contradiction appears in the trace conflict log |
Turn Reference Ordering | All turn references in the trace are in ascending temporal order and match the sequence in [CONVERSATION_HISTORY] | Turn references are out of order, skip turns without explanation, or reference non-existent turn IDs | Sort extracted turn references; compare to [CONVERSATION_HISTORY] turn ID sequence; flag any gaps or reversals |
Justification Specificity | Justification text contains at least one specific fact, rule, or evidence quote per decision step; no generic phrases like 'based on policy' | Justification uses only vague language with no concrete reference to input data | Run regex for generic patterns; fail if any justification field is under 20 characters or matches a banned-phrase list |
Missing Step Detection | Trace includes an explicit 'unresolved_items' or 'missing_information' field when evidence is insufficient for a definitive decision | Trace presents a confident decision despite gaps in [RETRIEVED_EVIDENCE] or ambiguous [POLICY_DOCUMENTS] | Check if confidence score is above threshold while required evidence fields are null; flag as overconfident decision |
Human-Readable Format Compliance | Trace output is valid JSON matching [OUTPUT_SCHEMA] with all required fields present and no markdown or prose outside structured fields | Output is malformed JSON, missing required fields, or wraps structured data in explanatory prose | Validate JSON parse; check against [OUTPUT_SCHEMA] with a schema validator; fail on parse errors or missing required fields |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a single-turn trace and lighter validation. Remove the multi-turn dependency and feed a single [USER_INPUT], [RETRIEVED_EVIDENCE], and [POLICY_RULES] block. Accept free-text output instead of enforcing the strict JSON schema.
Watch for
- Missing evidence-to-decision links when the model skips intermediate reasoning steps
- Overly broad policy citations that don't reference specific rule IDs
- No distinction between 'no evidence found' and 'evidence contradicts decision'

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us