Evaluation
AuraScore 81/100

E-Commerce Order Resolution Agent Benchmark Generator

Generate an automated LLM-as-a-judge Python evaluation script to benchmark retail order resolution agents against return policies and edge cases.

Use this template when deploying or auditing automated retail customer care agents handling returns, refunds, and exchanges. It produces a complete automated evaluation harness to detect policy deviations, hallucinated concessions, and latency bottlenecks.

Template

Role: Principal AI Evaluation Engineer specializing in retail customer care automation and LLM-as-a-judge benchmarking systems.

Context

  • Target Retailer: {{brand_name}}
  • Live Agent Endpoint: {{agent_endpoint}}
  • Authoritative Policy Source: {{return_policy_rules}}
  • Test Corpus Location: {{edge_case_dataset}}
  • Maximum Concession Margin: {{tolerance_threshold}}
  • Primary Evaluation Metrics: {{eval_metric_suite}}

Task

Generate a production-grade Python evaluation script that sends synthetic customer scenarios to {{agent_endpoint}}, evaluates the conversational agent responses against {{return_policy_rules}} using LLM-as-a-judge techniques, and asserts that financial concessions do not exceed {{tolerance_threshold}}.

Method

  1. Parse {{edge_case_dataset}} into structured synthetic customer sessions containing order histories, return reasons, and emotional escalation markers.
  2. Construct an asynchronous execution loop to replay sessions against {{agent_endpoint}} while recording request-response pairs and token latency.
  3. Build an evaluation engine incorporating {{eval_metric_suite}} to score policy adherence, factual grounding, and tone consistency.
  4. Embed deterministic boundary assertions that detect illegal refund approvals exceeding {{tolerance_threshold}} without human-in-the-loop triggers.
  5. Implement an LLM judge prompt that scores the agent transcripts against exact clauses inside {{return_policy_rules}}.
  6. Generate summary aggregate statistics including pass rates, false refund rates, hallucinated policy rates, and 95th percentile latency.
  7. Format execution logs into structured JSON artifacts and terminal console outputs with actionable failure traces.

Constraints

  • The generated script MUST be self-contained, executable Python (>=3.10) using standard async libraries (aiohttp, pydantic, pytest-compatible).
  • The output MUST NOT hardcode mock secrets or omit error handling for network timeouts.
  • Evaluation logic MUST isolate financial over-concession as a blocking catastrophic failure.
  • Include type hints and inline docstrings explaining scoring thresholds across {{eval_metric_suite}}.

Output format

  • Section 1: Environment prerequisites and installation instructions (Bash).
  • Section 2: Complete executable Python evaluation script containing test data parsers, async runner, judge logic, and assertion suite.
  • Section 3: Sample JSON report schema outputted by the runner (20-30 lines of JSON).
  • Total script length should not exceed 250 lines of code.

Self-review

  1. Verify all {{return_policy_rules}} and {{tolerance_threshold}} constraints are verified in assertions.
  2. Ensure async execution handles rate limits gracefully when querying {{agent_endpoint}}.
  3. Check that evaluation metric definitions align directly with {{eval_metric_suite}}.
AuraScore breakdown
81/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

ai-agents
agents-evaluation
retail-consumer-goods
retail
llm-evaluation
customer-service