Inferensys

Prompt

Refusal vs. Allow Decision Boundary Trace Prompt

A practical prompt playbook for using the Refusal vs. Allow Decision Boundary Trace Prompt in production AI safety and policy enforcement workflows.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Understand the forensic use case for the Refusal vs. Allow Decision Boundary Trace Prompt and when it is the wrong tool for the job.

This prompt is a forensic analysis tool for policy engineers and trust and safety analysts who need to understand why an AI system made inconsistent safety decisions on two similar requests. The core job-to-be-done is isolating the critical feature—a single phrase, a subtle context shift, or a policy gap—that pushed one request across the policy boundary while allowing the other. You should use this prompt when you have two complete production traces, one resulting in a refusal and the other in an allowed response, and you need a structured differential analysis to refine policy definitions or reduce inconsistent enforcement. The ideal user has access to raw trace data, understands the applicable safety policies, and is responsible for generating evidence to support a policy update or model configuration change.

The prompt requires two full production traces as input, including the user request, system prompt, any retrieval context, tool calls, and the final model output for each. It produces a structured differential analysis that identifies the critical distinguishing feature, explains the decision boundary mechanics, and flags any policy ambiguity that contributed to the inconsistency. This analysis is designed to be reviewed by a human before any policy change is made; it is not a source of truth on its own. The output should be treated as an investigative lead that requires human verification against the actual policy documents and trace evidence.

Do not use this prompt for real-time decision-making or as a replacement for a safety classifier. It is a post-hoc review tool, not an online enforcement mechanism. It is also not suitable for cases where the two traces differ across many dimensions simultaneously—if the requests, user context, model version, or retrieval results are fundamentally different, the differential analysis will produce noisy, low-confidence results. For those scenarios, first isolate the variable you want to test by finding or constructing a more controlled pair of traces. After running this analysis, the next step is typically to draft a policy clarification, update a system prompt instruction, or adjust a safety filter threshold, then validate the change against a broader set of trace pairs.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Refusal vs. Allow Decision Boundary Trace Prompt works and where it does not. This prompt is designed for differential analysis of two similar requests, not for bulk classification or single-event review.

01

Good Fit: Policy Boundary Tuning

Use when: you have two requests that are semantically similar but received different refusal outcomes. Guardrail: The prompt requires both traces to be provided as input; do not use it to speculate about missing data.

02

Good Fit: Inconsistent Enforcement Diagnosis

Use when: users or reviewers report that the model is 'inconsistent' on a specific topic. Guardrail: Run the prompt on multiple pairs before concluding a pattern exists. A single pair may be an outlier.

03

Bad Fit: Single Trace Review

Avoid when: you only have one trace to analyze. This prompt is explicitly designed for differential comparison. Guardrail: Use the Production Refusal Event Trace Review Prompt for single-trace analysis instead.

04

Bad Fit: Bulk Refusal Categorization

Avoid when: you need to categorize thousands of refusal events for a dashboard. This prompt is too verbose and pairwise for scale. Guardrail: Use the Refusal Event Categorization Prompt for batch processing before drilling into boundary cases.

05

Required Inputs: Two Complete Traces

Risk: Incomplete traces will produce speculative or incorrect differential analysis. Guardrail: Both traces must include the full user input, system prompt, any retrieval context, and the final model output. Missing fields should be flagged, not guessed.

06

Operational Risk: Policy Drift Masking

Risk: If the two traces were generated by different model versions or system prompts, the prompt may attribute the difference to content rather than configuration. Guardrail: Always verify that both traces share the same deployment context before running the analysis.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready prompt for differential analysis of two production traces to identify the critical decision boundary feature.

This prompt template is designed for policy engineers who need to understand why one request was refused while a structurally similar request was allowed. It forces the model to perform a structured differential analysis, comparing two traces side-by-side to isolate the specific phrase, context, or policy signal that pushed one request across the boundary. The output is a decision-ready report that can be used to refine policy definitions, update safety instructions, or calibrate refusal thresholds. Before using this prompt, ensure you have extracted the full trace for both the refused and allowed request, including the user input, any retrieved context, the system prompt, and the final model output or refusal message.

text
You are a policy trace analyst. Your task is to compare two production traces—one where the model refused a request and one where the model allowed a similar request—and identify the critical feature that caused the different outcomes.

## INPUTS
- Refused Trace: [REFUSED_TRACE]
- Allowed Trace: [ALLOWED_TRACE]
- Active Policy Definitions: [POLICY_DEFINITIONS]
- System Prompt Version: [SYSTEM_PROMPT]

## OUTPUT SCHEMA
Return a JSON object with the following fields:
{
  "differential_analysis": {
    "shared_features": ["list of features present in both requests"],
    "divergent_features": ["list of features present in only one request"],
    "critical_boundary_feature": "the single feature most likely responsible for the different outcomes",
    "critical_feature_location": "which trace contains the critical feature (refused or allowed)",
    "policy_clause_triggered": "the specific policy clause or rule that the critical feature activated"
  },
  "confidence": "high | medium | low",
  "alternative_explanations": ["list of other plausible explanations for the divergence"],
  "recommendation": "actionable suggestion for policy refinement or prompt update",
  "requires_human_review": true or false
}

## CONSTRAINTS
- Do not assume the refusal was correct. Evaluate whether the refusal or the allow decision was the error.
- If the critical feature is ambiguous, set confidence to "low" and list alternative explanations.
- If the divergence appears to be a model inconsistency rather than a policy-driven decision, flag it explicitly in the recommendation.
- Do not hallucinate policy clauses. Only reference clauses present in the provided [POLICY_DEFINITIONS].
- If either trace contains evidence of prompt injection or adversarial input, note it in the alternative_explanations field.

## EVALUATION CRITERIA
A valid output must:
1. Identify at least one divergent feature between the two traces.
2. Map the critical feature to a specific policy clause or explain why no clause applies.
3. Provide a confidence level that is consistent with the ambiguity of the evidence.

To adapt this prompt for your environment, replace the square-bracket placeholders with actual trace data. The [REFUSED_TRACE] and [ALLOWED_TRACE] fields should contain the full request payload, including user input, retrieved context, tool calls, and the model's final output or refusal message. The [POLICY_DEFINITIONS] field should include the exact policy text your system uses—do not summarize or paraphrase, as the model needs the precise wording to map features to clauses. The [SYSTEM_PROMPT] field should contain the system prompt active at the time of both requests. If your traces include safety filter metadata or content moderation scores, include those as well. For high-stakes policy decisions, always route outputs with "requires_human_review": true or "confidence": "low" to a human reviewer before taking action. Validate the output against the schema before ingesting it into your policy refinement workflow.

IMPLEMENTATION TABLE

Prompt Variables

Each placeholder must be populated with production trace data before running the prompt. Missing or null variables will cause the analysis to fail or produce unreliable differential results.

PlaceholderPurposeExampleValidation Notes

[REQUEST_A_TRACE]

Full trace object for the request that was allowed

{"trace_id": "abc123", "turns": [...], "safety_checks": [...]}

Must be a valid JSON object. Schema check required. Must contain at least one user turn and one model response. Null not allowed.

[REQUEST_B_TRACE]

Full trace object for the request that was refused

{"trace_id": "def456", "turns": [...], "safety_checks": [...]}

Must be a valid JSON object. Schema check required. Must contain a refusal signal or safety filter activation event. Null not allowed.

[POLICY_DOCUMENT]

The applicable safety or content policy text that governs the decision boundary

"Do not generate content that promotes violence or illegal activity. Allow educational discussions with appropriate context."

Must be a non-empty string. Policy text should match the version active at the time of the traces. Human review required if policy has changed since trace capture.

[POLICY_VERSION]

Identifier for the policy version in effect when the traces were generated

"v2.4.1"

Must match a known policy version in the policy registry. Parse check against version format. Null allowed if version tracking is unavailable, but flagged for human review.

[MODEL_IDENTIFIER]

The model name and version that processed both requests

"claude-sonnet-4-20250514"

Must be a non-empty string matching a known model identifier in the deployment registry. Both traces must originate from the same model. Mismatch triggers a retry condition.

[ANALYSIS_TIMESTAMP]

ISO 8601 timestamp of when the differential analysis is performed

"2025-06-15T14:30:00Z"

Must be a valid ISO 8601 datetime string. Parse check required. Used for audit trail generation. Null not allowed.

[OUTPUT_SCHEMA]

Expected JSON schema for the differential analysis output

{"critical_difference": "string", "boundary_feature": "string", "confidence": 0.0-1.0}

Must be a valid JSON Schema object. Schema check required. Must include fields for critical_difference, boundary_feature, and confidence. Null not allowed.

[REVIEWER_IDENTIFIER]

Identifier for the human reviewer or automated system requesting the analysis

"trust-safety-engineer-7"

Must be a non-empty string. Used for audit trail attribution. Null allowed for automated batch processing but flagged for traceability.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Refusal vs. Allow Decision Boundary Trace Prompt into a production trace analysis pipeline.

This prompt is designed to be a differential analysis tool within a larger trace review system. It should not be called on every production request. Instead, wire it into a workflow triggered by a human analyst or an automated anomaly detection system that has identified a pair of semantically similar requests with divergent refusal outcomes. The prompt expects two complete trace objects as input, so your harness must first query your trace store to retrieve the full session data for both the refused and allowed requests, ensuring you capture the system prompt, user messages, tool calls, and any safety filter metadata.

Before calling the LLM, your harness must validate and normalize the inputs. Construct a JSON payload with the two trace objects, ensuring each contains at minimum the user_input, system_prompt, and final_output fields. If your trace store captures safety filter scores or intermediate reasoning steps, include them under an annotations key. Implement a pre-flight check that rejects the pair if the requests are identical or if either trace is incomplete, logging a TRACE_PAIR_INVALID event. After receiving the model's differential analysis, validate the output against a strict JSON schema that requires the critical_differentiator field to be a non-empty string and the boundary_features array to contain at least one entry. If validation fails, retry once with a more explicit instruction appended to the prompt, then escalate to a human review queue if the second attempt also fails.

For high-stakes policy decisions, never automatically apply the model's analysis to change a safety filter or policy definition. The output of this prompt is a diagnostic artifact for a human policy engineer. Log every analysis to an immutable audit table, linking it to the source trace IDs, the analyst who initiated the review, and the model version used. This creates a feedback loop where policy refinements are evidence-backed and traceable. Avoid wiring this prompt into any real-time blocking path; its latency and cost profile are suited for asynchronous, investigative workflows.

IMPLEMENTATION TABLE

Expected Output Contract

The model must return a JSON object with the following fields. Validate each field before accepting the output.

Field or ElementType or FormatRequiredValidation Rule

decision_boundary_analysis

object

Schema check: object must contain critical_feature, request_a_summary, request_b_summary, and boundary_classification fields

critical_feature

string

Non-empty string; must be a direct quote or close paraphrase from one of the two input requests; null not allowed

request_a_summary

object

Schema check: must contain intent, policy_relevant_phrases (array of strings), and refusal_decision fields

request_b_summary

object

Schema check: must contain intent, policy_relevant_phrases (array of strings), and refusal_decision fields

boundary_classification

string

Enum check: must be one of 'phrase_boundary', 'context_boundary', 'intent_boundary', 'ambiguity_boundary', or 'no_clear_boundary'

boundary_confidence

number

Range check: must be between 0.0 and 1.0 inclusive; values below 0.7 should trigger human review flag

policy_clause_reference

string

Null allowed; if present, must be a non-empty string referencing a specific policy clause or rule ID from the system prompt or policy document

differential_evidence

array

Schema check: must be an array of objects, each containing phrase (string), location (enum: 'request_a' or 'request_b'), and impact (enum: 'pushed_to_refusal' or 'pushed_to_allow')

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when analyzing refusal vs. allow decision boundaries and how to guard against it.

01

False Equivalence Between Surface Similarity and Policy Relevance

What to watch: The prompt treats two requests as a minimal pair differing only by a single policy-relevant feature, but the actual difference is a confounding variable (e.g., tone, length, or an unrelated entity). The analysis attributes the decision boundary to the wrong feature. Guardrail: Require the prompt to enumerate all differences between the two requests before isolating the policy-critical one. Add a validation step that asks: 'What else changed besides the suspected policy trigger?'

02

Overfitting to a Single Keyword or Phrase

What to watch: The differential analysis pins the refusal/allow decision on one keyword (e.g., 'bomb') while ignoring that the same keyword appears in allowed contexts elsewhere in production logs. This produces brittle policy definitions that break on common vocabulary. Guardrail: Include a counterfactual check in the prompt: 'Would the decision flip if this keyword were replaced with a synonym? If yes, the policy boundary is likely too narrow.' Cross-reference the keyword against a sample of allowed traces.

03

Ignoring Context Window Truncation Effects

What to watch: The refused request and the allowed request appear to differ only in the final user message, but the refused request had earlier context truncated due to token limits. The model's decision was influenced by missing context, not by the surface-level difference the prompt analyzes. Guardrail: Require the prompt to inspect the full trace for context-window truncation markers before attributing the decision boundary. Flag any trace where the model's context window was exceeded or where earlier turns were dropped.

04

Confirmation Bias Toward Expected Policy Violations

What to watch: The analyst selects two requests expecting to find a specific policy boundary (e.g., 'violence') and the prompt confirms that expectation by overemphasizing violent language in the refused request while downplaying similar language in the allowed request. Guardrail: Blind the prompt to the expected policy category. Ask it to identify the most likely policy boundary from a full taxonomy rather than confirming a pre-selected one. Include a 'no clear boundary' output option.

05

Misattributing Model Uncertainty to Policy Enforcement

What to watch: The model refused not because of a policy violation but because of low confidence, ambiguity, or a malformed request. The differential analysis incorrectly classifies this as a policy boundary decision, leading to unnecessary policy tightening. Guardrail: Add a pre-classification step: 'Did the model refuse due to a safety policy, or due to uncertainty, capability limitations, or input quality?' Only proceed with boundary analysis if the refusal reason is policy-related.

06

Temporal Drift Between Compared Traces

What to watch: The two requests were processed under different model versions, system prompts, or safety filter configurations. The differential analysis attributes the decision difference to the request content when the real cause is a deployment change between the two traces. Guardrail: Require the prompt to extract and compare version metadata (model ID, prompt version, filter config hash) from both traces before analyzing content differences. Flag any version mismatch as a confounding factor.

IMPLEMENTATION TABLE

Evaluation Rubric

Criteria for testing the quality of a differential analysis before relying on it for policy refinement. Apply these checks to the output of the Refusal vs. Allow Decision Boundary Trace Prompt.

CriterionPass StandardFailure SignalTest Method

Critical Feature Isolation

The output identifies exactly one primary feature, phrase, or context delta that explains the decision flip.

The analysis lists multiple unrelated differences without ranking them or identifies a feature present in both traces.

Parse the [CRITICAL_FEATURE] field. Verify the feature is present in the allowed trace and absent in the refused trace via substring or structural check.

Decision Boundary Mapping

The output maps the critical feature to a specific clause in [POLICY_DOCUMENT] and explains why it crosses the boundary.

The explanation references a policy clause that does not exist, misinterprets the clause, or provides a generic rationale not grounded in the policy text.

Extract the cited policy clause ID. Validate it exists in [POLICY_DOCUMENT]. Perform a semantic similarity check between the clause text and the provided rationale.

Confidence Calibration

The [CONFIDENCE_SCORE] is a float between 0.0 and 1.0 and correlates with the specificity of the evidence. Scores above 0.8 require unambiguous feature isolation.

The confidence score is 1.0 despite ambiguous evidence, or the score is below 0.5 but the analysis claims a definitive root cause.

Assert 0.0 <= [CONFIDENCE_SCORE] <= 1.0. If score > 0.8, run a secondary validator to confirm no contradictory evidence exists in the provided traces.

Trace Grounding

Every claim in the [DIFFERENTIAL_ANALYSIS] is supported by a direct quote or event timestamp from the provided [ALLOWED_TRACE] or [REFUSED_TRACE].

The analysis hallucinates a user query, tool call, or safety filter activation that is not present in the input traces.

Extract all factual claims from the analysis. For each claim, run a text-matching script against the raw trace logs. Flag any claim with no matching substring as ungrounded.

Output Schema Adherence

The output is valid JSON that strictly conforms to the [OUTPUT_SCHEMA] with all required fields present.

The output is missing the [CRITICAL_FEATURE] or [CONFIDENCE_SCORE] field, contains an extra undefined field, or is not parseable as JSON.

Run a JSON schema validator using the exact [OUTPUT_SCHEMA] definition. Fail the test on any schema violation.

Null Output Handling

If no meaningful difference is found, the [CRITICAL_FEATURE] field is null and the [DIFFERENTIAL_ANALYSIS] explicitly states that the decision appears inconsistent or driven by an unobserved variable.

The analysis fabricates a minor stylistic difference as the root cause when the traces are functionally identical, or it returns a non-null [CRITICAL_FEATURE] with a confidence score below 0.3.

Inject two identical traces with opposite outcomes. Assert that [CRITICAL_FEATURE] is null and that the analysis text contains a phrase indicating uncertainty or inconsistency.

Refusal Style Consistency

The analysis correctly distinguishes between a policy-driven refusal and a capability-driven refusal (e.g., 'I don't know' vs. 'I can't do that').

The analysis conflates a model's lack of knowledge with a safety policy activation, misattributing the refusal reason.

Provide one trace with a safety refusal and one with a capability refusal. Assert the [DIFFERENTIAL_ANALYSIS] correctly labels the refusal type in each case before comparing them.

Human Approval Gate

If the [CONFIDENCE_SCORE] is below 0.7 or the analysis is for a high-stakes policy change, the output includes a flag requiring human review before the analysis is used to modify any policy definition.

The output is used to automatically update a policy definition or blocklist without a human-in-the-loop check when the confidence score is below the threshold.

Check the [REQUIRES_HUMAN_APPROVAL] boolean field. Assert it is true when [CONFIDENCE_SCORE] < 0.7 or when [POLICY_DOCUMENT] has a 'high_stakes' tag.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a frontier model (GPT-4o, Claude 3.5 Sonnet) and minimal validation. Focus on getting the differential analysis structure right before adding operational guardrails. Keep the two input traces short and clearly different.

code
[TRACE_A]: { "request": "...", "decision": "refused", "reason": "..." }
[TRACE_B]: { "request": "...", "decision": "allowed", "reason": "..." }

Watch for

  • The model inventing differences that don't exist in the traces
  • Over-explaining obvious boundary features while missing subtle ones
  • Treating correlated features as causal without evidence from the trace
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.