Inferensys

Prompt

Model Routing Decision Eval Failure Audit Prompt

A practical prompt playbook for AI platform engineers investigating whether eval failures correlate with suboptimal model routing decisions. Produces a structured routing audit comparing the model selected, task characteristics, and eval outcome to identify routing logic gaps.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Determine whether production eval failures are caused by the routing layer sending requests to the wrong model.

This prompt is for AI platform engineers and SREs who need to isolate whether a production evaluation failure originated at the routing layer. When a response fails an automated quality, safety, or accuracy check, the root cause can hide in many places: the prompt, the retrieved context, a tool call, or the model itself. This playbook focuses on one specific failure mode—the router selected a model that was poorly matched to the task characteristics, and that mismatch cascaded into the eval failure. Use it when you have trace data that captures the routing decision, the model that handled the request, the task profile, and the eval outcome. The prompt produces a structured audit comparing the actual model selected against the task requirements and identifies routing logic gaps that may have contributed to the failure.

To use this prompt effectively, you must supply trace-level routing metadata. At minimum, you need the router's input context (user query, task classification, estimated complexity), the routing decision (which model was chosen and why), the model's actual response, and the eval result with its rubric dimensions. Without this data, the prompt cannot distinguish a routing error from a prompt defect or a retrieval gap. The ideal input also includes the router's configuration at the time of the request—model availability, cost thresholds, latency targets, and any fallback logic that was active. If your observability pipeline does not capture routing decisions as structured trace events, instrument that first. A routing audit is only as good as the decision metadata it can inspect.

Do not use this prompt when the eval failure is already confirmed to be a prompt or retrieval issue, when the routing decision was made by a human rather than an automated system, or when you lack trace-level routing metadata. This prompt is also not a replacement for a full incident postmortem—it narrows the investigation to one specific hypothesis. If the audit clears the routing layer, your next step is to investigate the prompt, the retrieval pipeline, or the model behavior directly. Use the sibling playbooks for eval failure root-cause triage or retrieval gap diagnosis to continue the investigation.

PRACTICAL GUARDRAILS

Use Case Fit

Where this routing audit prompt adds value and where it creates noise. Use it to connect eval failures to routing logic, not as a general-purpose debugging tool.

01

Good Fit: Post-Deployment Routing Audits

Use when: you have production traces with eval scores, model routing decisions, and task metadata. Guardrail: Only run this audit after confirming the eval failure is not caused by a known prompt regression or infrastructure outage.

02

Bad Fit: Real-Time Request Steering

Avoid when: you need to make routing decisions during live inference. This prompt is a forensic audit tool, not a runtime router. Guardrail: Use a lightweight classification prompt or rule-based router for production traffic; reserve this audit for offline analysis.

03

Required Inputs: Trace + Eval + Routing Log

What you need: a trace containing the model selected, the task characteristics, the eval score, and the routing decision metadata. Guardrail: If your traces do not capture which router or rule selected the model, instrument that first. Without routing attribution, the audit cannot identify gaps.

04

Operational Risk: Correlation Without Causation

What to watch: the prompt may surface correlations between routing choices and eval failures without proving the routing decision caused the failure. Guardrail: Always pair the audit output with a human review step before changing routing logic. Flag cases where the model itself underperformed regardless of routing.

05

Scale Limit: Per-Session Analysis Only

What to watch: this prompt is designed for single-session or small-batch audit, not aggregate trend analysis across thousands of traces. Guardrail: For fleet-wide routing health, aggregate eval-failure rates by route first, then sample representative sessions for deep audit with this prompt.

06

Routing Logic Dependency: Know Your Router

What to watch: the audit is only as useful as your understanding of the routing logic being evaluated. If routing rules are undocumented or dynamic, the prompt cannot identify logic gaps. Guardrail: Document your routing decision tree, model selection criteria, and fallback chain before running this audit. Include that documentation in the prompt context.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

Paste this prompt into your investigation workflow. Replace square-bracket placeholders with your trace data, routing policy, and eval results.

The following prompt template is designed to be copied directly into your investigation environment. It forces a structured comparison between the routing decision, the task characteristics, and the eval failure signal. Before using it, ensure you have collected the full trace for the failed request, including the router's input context, the selected model, any fallback attempts, and the specific eval rubric that was violated. The prompt assumes you are investigating a single trace at a time; for batch analysis, wrap this in an application loop that iterates over a set of failed trace IDs.

text
You are an AI platform reliability engineer auditing a model routing decision that resulted in an eval failure.

Your task is to determine whether the eval failure is attributable to a suboptimal routing choice, and if so, what change to the routing logic would have prevented it.

## INPUT DATA

### Trace Context
- Trace ID: [TRACE_ID]
- Timestamp: [TIMESTAMP]
- User Input Summary: [USER_INPUT_SUMMARY]
- Task Category: [TASK_CATEGORY]
- Task Complexity Indicators: [COMPLEXITY_INDICATORS]
- Expected Output Type: [EXPECTED_OUTPUT_TYPE]

### Routing Decision
- Routing Policy Version: [ROUTING_POLICY_VERSION]
- Router Input Features Used: [ROUTER_INPUT_FEATURES]
- Selected Model: [SELECTED_MODEL]
- Model Capability Profile: [MODEL_CAPABILITY_PROFILE]
- Alternative Models Considered: [ALTERNATIVE_MODELS]
- Routing Confidence Score: [ROUTING_CONFIDENCE_SCORE]
- Fallback Activated: [FALLBACK_ACTIVATED]
- Fallback Model (if any): [FALLBACK_MODEL]

### Eval Failure Details
- Failed Eval Dimension: [FAILED_EVAL_DIMENSION]
- Eval Rubric Excerpt: [EVAL_RUBRIC_EXCERPT]
- Eval Score: [EVAL_SCORE]
- Passing Threshold: [PASSING_THRESHOLD]
- Eval Judge Model: [EVAL_JUDGE_MODEL]
- Failure Severity: [FAILURE_SEVERITY]

### Model Output
- Actual Output (truncated to 500 words): [ACTUAL_OUTPUT]
- Expected Output Characteristics: [EXPECTED_OUTPUT_CHARACTERISTICS]

## ANALYSIS INSTRUCTIONS

1. **Task-Model Fit Assessment**: Compare the task category, complexity indicators, and expected output type against the selected model's capability profile. Identify any capability gaps that could explain the eval failure.

2. **Alternative Model Evaluation**: For each alternative model considered, assess whether it would have been a better fit for this specific task. Consider capability alignment, known limitations, and cost/latency trade-offs.

3. **Routing Logic Gap Identification**: Determine whether the routing policy's input features adequately captured the task characteristics that mattered for this eval dimension. Flag any missing features that would have changed the routing decision.

4. **Confidence vs. Outcome Analysis**: Compare the routing confidence score with the actual outcome. If confidence was high but the result failed, identify what signal the router missed.

5. **Fallback Effectiveness**: If a fallback was activated, assess whether the fallback model was appropriate and whether the fallback trigger conditions were correct.

6. **Root Cause Classification**: Classify the root cause into one of:
   - ROUTING_ERROR: A different model should have been selected
   - FEATURE_GAP: The router lacked features needed to make the right decision
   - POLICY_THRESHOLD: The routing policy thresholds need adjustment
   - MODEL_CAPABILITY_GAP: No available model could have passed this eval
   - EVAL_ISSUE: The eval failure is a false positive or rubric problem
   - UNRELATED: The eval failure is unrelated to model choice

## OUTPUT FORMAT

Return a JSON object with this exact schema:
{
  "trace_id": "string",
  "routing_decision_quality": "adequate|suboptimal|incorrect",
  "root_cause_classification": "ROUTING_ERROR|FEATURE_GAP|POLICY_THRESHOLD|MODEL_CAPABILITY_GAP|EVAL_ISSUE|UNRELATED",
  "task_model_fit": {
    "selected_model_suitability": "suitable|marginal|unsuitable",
    "capability_gaps": ["string"],
    "best_alternative_model": "string or null",
    "best_alternative_rationale": "string"
  },
  "routing_logic_issues": [
    {
      "issue_type": "missing_feature|incorrect_weight|threshold_error|fallback_error",
      "description": "string",
      "recommended_change": "string"
    }
  ],
  "confidence_assessment": {
    "router_confidence": number,
    "was_confidence_warranted": "yes|no|partially",
    "missed_signal": "string or null"
  },
  "recommendation": {
    "action": "adjust_routing_policy|add_router_feature|recalibrate_thresholds|update_model_capability_profile|investigate_eval|no_change",
    "priority": "critical|high|medium|low",
    "summary": "string",
    "expected_impact": "string"
  },
  "evidence_chain": [
    {
      "observation": "string",
      "source": "trace_event|routing_log|eval_output|model_output",
      "relevance": "string"
    }
  ]
}

## CONSTRAINTS
- Do not speculate beyond the provided trace data. Mark any inference as such.
- If the trace data is insufficient to reach a conclusion, set root_cause_classification to UNRELATED and explain what data is missing.
- Do not recommend model changes that violate cost or latency constraints unless those constraints are explicitly provided.
- Preserve all trace IDs and timestamps exactly as provided.

To adapt this template for your environment, replace each square-bracket placeholder with data extracted from your observability platform. The [ROUTER_INPUT_FEATURES] field should include the actual feature vector or metadata the router used, not just a description. For the [MODEL_CAPABILITY_PROFILE], include the documented strengths, weaknesses, and intended use cases for each model in your routing pool. If your routing system does not produce confidence scores, set [ROUTING_CONFIDENCE_SCORE] to null and the analysis will skip that section. The output schema is designed to be machine-readable so you can aggregate results across multiple investigations into a routing quality dashboard. Before acting on any recommendation classified as critical, validate the finding against at least two additional failed traces with similar characteristics to avoid overfitting to a single incident.

IMPLEMENTATION TABLE

Prompt Variables

Inputs the prompt needs to work reliably. Validate each before running the audit.

PlaceholderPurposeExampleValidation Notes

[ROUTING_LOG]

Complete model routing decision log for the audited request

{"request_id":"req-9a2b","selected_model":"claude-3-haiku","fallback_activated":false,"routing_rule":"cost_min_latency","candidate_models":["claude-3-haiku","gpt-4o-mini"],"decision_timestamp":"2025-06-15T14:32:01Z"}

Must be valid JSON with required fields: request_id, selected_model, routing_rule. Parse check before audit. Reject if decision_timestamp is missing or malformed.

[TASK_CHARACTERISTICS]

Task complexity, domain, and requirement signals available at routing time

{"task_type":"code_explanation","estimated_complexity":"high","domain":"distributed_systems","requires_reasoning":true,"input_token_estimate":4200,"expected_output_tokens":800}

Must include task_type and estimated_complexity. Domain field required for domain-specific routing audits. Null allowed for input_token_estimate if unavailable.

[EVAL_RESULT]

Full evaluation outcome for the response produced by the routed model

{"eval_id":"eval-7c1d","overall_score":0.62,"pass_threshold":0.80,"verdict":"fail","dimension_scores":{"accuracy":0.55,"completeness":0.70,"citation_quality":0.60},"failed_dimensions":["accuracy","citation_quality"]}

Must be valid JSON with overall_score and pass_threshold as numbers. Failed_dimensions array required for correlation analysis. Reject if verdict is pass when overall_score is below pass_threshold.

[TRACE_SEGMENTS]

Key trace segments from the request lifecycle for correlation

{"segments":[{"step":"routing","duration_ms":45},{"step":"inference","model":"claude-3-haiku","duration_ms":1200,"output_tokens":750},{"step":"eval","duration_ms":340}]}

Must include routing, inference, and eval segments at minimum. Each segment requires step name and duration_ms. Model field required on inference segment. Reject if inference segment missing model field.

[ROUTING_POLICY_CONFIG]

Active routing policy configuration at the time of the request

{"policy_name":"cost_optimized_v2","rules":[{"condition":"estimated_complexity == 'low'","target_model":"claude-3-haiku"},{"condition":"estimated_complexity == 'high'","target_model":"gpt-4o"}],"fallback_model":"gpt-4o","cost_cap_per_request":0.05}

Must include policy_name and rules array. Each rule requires condition and target_model. Validate that fallback_model is present. Reject if rules array is empty.

[ALTERNATIVE_MODEL_CAPABILITIES]

Capability profiles for models that were available but not selected

{"models":[{"name":"gpt-4o","strengths":["complex_reasoning","code_generation"],"cost_per_1k_tokens":0.015},{"name":"claude-3-haiku","strengths":["low_latency","cost_efficiency"],"cost_per_1k_tokens":0.001}]}

Must include all candidate models from ROUTING_LOG. Each model requires name, strengths array, and cost_per_1k_tokens. Reject if a candidate model is missing from this list.

[PREVIOUS_ROUTING_DECISIONS]

Recent routing decisions for similar task types for baseline comparison

[{"request_id":"req-8a1c","task_type":"code_explanation","selected_model":"gpt-4o","eval_score":0.88,"timestamp":"2025-06-14T10:15:00Z"},{"request_id":"req-7b3e","task_type":"code_explanation","selected_model":"gpt-4o","eval_score":0.91,"timestamp":"2025-06-14T16:42:00Z"}]

Must be a JSON array. Each entry requires task_type matching the current request, selected_model, and eval_score. Minimum 2 entries recommended for meaningful comparison. Null allowed if no historical data exists for this task type.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the routing audit prompt into an investigation workflow or automated audit pipeline.

The Model Routing Decision Eval Failure Audit Prompt is designed to be invoked as part of a structured investigation workflow, not as a standalone chat. When an eval failure is detected in production, the platform should automatically enrich the trace with the routing decision metadata, the task characteristics snapshot, and the eval outcome before calling this prompt. The prompt expects a complete trace segment that includes the original user input, the routing classifier's output (model selected, confidence, reasoning), the actual model that handled the request, the task profile (complexity, domain, expected capabilities), and the eval result with dimension-level scores. Without all four inputs, the audit will produce incomplete or misleading conclusions.

Wire this prompt into your investigation pipeline as a post-eval enrichment step. After the eval system flags a failure, the harness should: (1) retrieve the trace segment from your observability store using the trace ID and span ID; (2) extract the routing decision payload from the classifier service logs; (3) capture the task characteristics that were available at routing time (input length, detected domain, complexity score, required tool set); (4) assemble the eval outcome with per-dimension scores and the failing rubric criteria; and (5) invoke the prompt with all four inputs in a single structured payload. Validate the prompt's output against a schema that requires a routing_gap_hypothesis (one of: wrong_model_capability, task_misclassification, confidence_threshold_error, fallback_incorrect, no_gap_found), a severity score (1-5), and an evidence_chain array linking each finding to a specific trace event. If the output fails schema validation, retry once with a stricter constraint instruction appended. Log every audit result to a dedicated routing_audit index in your observability platform, keyed by trace ID, so that routing logic engineers can query patterns over time.

For high-risk domains where routing errors could cause safety or compliance failures, add a human review gate before the audit finding is accepted. The harness should flag any audit result with severity >= 4 or routing_gap_hypothesis == 'wrong_model_capability' for manual review in a queue. The reviewer should see the original trace, the prompt's audit output, and a diff between the model that was selected and the model that should have been selected according to the task profile. Do not automatically retrain or adjust routing weights based on a single audit result; aggregate findings across at least 50 correlated failures before proposing routing logic changes. Avoid running this prompt on every eval failure indiscriminately—filter first for failures where the eval dimension is plausibly routing-sensitive (e.g., accuracy, grounding, tool-use correctness) rather than format or latency issues.

IMPLEMENTATION TABLE

Expected Output Contract

Fields, format, and validation rules for the routing audit output. Use this contract to parse, validate, and store the audit result before surfacing it in a dashboard or routing logic review.

Field or ElementType or FormatRequiredValidation Rule

audit_id

string (UUID)

Must match the trace or eval run ID provided in [TRACE_ID]. Reject if missing or malformed.

routing_decision

object

Must contain 'selected_model' (string), 'routing_rule_applied' (string), and 'confidence' (float 0-1). Reject if any subfield is missing.

task_characteristics

object

Must contain 'task_category' (string from [TASK_TAXONOMY]), 'estimated_complexity' (enum: low|medium|high), and 'input_modalities' (array of strings). Reject if category is not in taxonomy.

eval_outcome

object

Must contain 'eval_name' (string), 'score' (float), 'threshold' (float), and 'pass' (boolean). Reject if pass does not match score >= threshold.

routing_gap_analysis

object

Must contain 'gap_detected' (boolean), 'gap_category' (string or null), and 'evidence' (array of strings). If gap_detected is true, gap_category must not be null and evidence must have at least one entry.

alternative_model_suggestion

object

If present, must contain 'suggested_model' (string) and 'rationale' (string). Reject if suggested_model equals selected_model in routing_decision.

trace_citations

array of objects

Each object must have 'step_id' (string) and 'event_type' (string). Array must not be empty. Reject if any step_id is not found in the provided [TRACE_DATA].

human_review_required

boolean

Must be true if gap_detected is true and confidence is below [CONFIDENCE_THRESHOLD]. Reject if this rule is violated.

PRACTICAL GUARDRAILS

Common Failure Modes

Model routing audits can fail silently when the trace lacks sufficient signal or when the evaluator confuses correlation with causation. These are the most common failure modes and how to guard against them.

01

Routing Decision Without Task Complexity Signal

What to watch: The audit prompt flags a routing decision as 'suboptimal' but the trace contains no task complexity metadata (input length, expected reasoning depth, domain specificity). The model then hallucinates a complexity justification. Guardrail: Require explicit task characteristic fields in the trace input. If missing, the prompt must return INSUFFICIENT_DATA rather than inferring complexity from the prompt text alone.

02

Confusing Eval Failure Cause with Routing Cause

What to watch: The audit attributes an eval failure to model routing when the root cause is actually a retrieval gap, a malformed tool call, or a truncated context window. The routing decision was correct, but the surrounding pipeline failed. Guardrail: Add a mandatory differential diagnosis step that rules out retrieval, tool, and context-window failures before attributing the eval failure to routing. Require evidence links for each ruled-out cause.

03

Ignoring Cost-Latency Constraints in Routing Assessment

What to watch: The audit recommends a more capable model for every eval failure, ignoring the cost and latency budget that drove the original routing decision. This produces impractical recommendations that the platform team will reject. Guardrail: Include cost and latency constraints as required inputs. The prompt must evaluate routing decisions against the stated budget, not against an unbounded quality target. Flag recommendations that exceed budget with a BUDGET_VIOLATION severity.

04

Overfitting to a Single Eval Dimension

What to watch: The audit focuses exclusively on one eval dimension (e.g., factual accuracy) and recommends routing changes that degrade other dimensions (e.g., latency, safety, format compliance). The recommendation creates a regression elsewhere. Guardrail: Require multi-dimensional eval results as input. The prompt must produce a trade-off matrix showing how the recommended routing change affects all eval dimensions, not just the one that failed.

05

Treating Correlation as Routing Logic Defect

What to watch: The audit finds that eval failures are more common on a specific model and concludes the routing logic is defective. But the model was correctly chosen for low-complexity tasks, and the failures are concentrated in edge cases that no model handles well. Guardrail: Add a counterfactual check: 'If the alternative model had been selected, would the eval outcome have changed with high confidence?' Require the audit to state its confidence in the counterfactual and flag low-confidence attributions.

06

Missing Fallback and Escalation Path Analysis

What to watch: The audit evaluates only the primary routing decision and ignores whether the fallback or escalation path would have caught the failure. A correct primary route with a broken fallback is a different problem than an incorrect primary route. Guardrail: Require the full routing decision tree in the trace input, including fallback activations and escalation triggers. The prompt must distinguish 'primary route error' from 'fallback gap' and produce separate recommendations for each.

IMPLEMENTATION TABLE

Evaluation Rubric

Criteria for testing the quality of a routing audit before acting on its recommendations. Use this rubric to validate that the audit output correctly identifies routing gaps, provides actionable evidence, and avoids false confidence.

CriterionPass StandardFailure SignalTest Method

Routing Decision Attribution

Audit correctly identifies the model selected for the trace and the routing rule or logic path that triggered the selection.

Audit misidentifies the selected model, attributes the selection to a non-existent rule, or fails to locate the routing decision in the trace.

Compare audit's identified model and rule against trace metadata. Require exact match on model ID and rule name.

Task-Characteristics Extraction

Audit extracts at least 3 relevant task characteristics from the input and trace context that should influence routing.

Audit extracts fewer than 3 characteristics, extracts irrelevant features, or hallucinates task properties not present in the trace.

Manual review of extracted characteristics against the raw input and trace. Require source grounding for each characteristic.

Routing-Failure Correlation

Audit correctly links the eval failure to a specific routing gap with trace evidence for the causal chain.

Audit claims correlation without evidence, blames routing when the failure is unrelated, or fails to identify a genuine routing gap.

Trace the audit's causal chain back to trace events. Require at least one trace event per link in the chain.

Alternative Model Recommendation

Audit recommends a specific alternative model or routing rule change with a clear rationale tied to task characteristics.

Audit recommends a model that is unavailable, makes a vague recommendation without rationale, or suggests a change that would not address the gap.

Check recommended model against available model registry. Verify rationale references at least one extracted task characteristic.

Confidence Calibration

Audit includes a confidence level for its routing-gap finding that is consistent with the strength of the trace evidence.

Audit expresses high confidence on weak evidence, low confidence on clear evidence, or omits confidence entirely.

Cross-reference confidence level with number and quality of trace evidence citations. Flag mismatches where evidence count < 2 but confidence is high.

False-Positive Avoidance

Audit correctly identifies when routing was NOT the cause of the eval failure and does not fabricate a routing gap.

Audit invents a routing gap when the eval failure was caused by retrieval, tool error, or model behavior unrelated to routing.

Inject a trace where the eval failure is known to be non-routing. Audit must return null or empty for routing-gap findings.

Evidence Completeness

Audit cites at least one trace event for each routing-gap claim and does not rely on inference without trace support.

Audit makes claims without trace citations, cites events that do not exist in the trace, or relies solely on output inspection.

Parse all citation references in the audit output. Validate each against the trace event log. Require 100% citation validity.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a single trace file. Replace the full routing configuration with a simplified [ROUTING_RULES_SUMMARY] that lists only the model-to-task mapping. Use manual review instead of automated correlation. Focus on one eval dimension at a time.

Watch for

  • Over-attributing failure to routing when the model itself underperformed
  • Missing task characteristic fields that the production version requires
  • Confirmation bias when you already suspect a specific routing rule is broken
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.