← Back to learning path
Case · Published

Case study: an auditable support-ticket triage agent

Classify support tickets with read-only lookups and structured output, then hand uncertain cases to a person.

Source: knowledge/p24-b/collection_8023a8d754046b6c2ae7220f/cases/agent-support-ticket-triage.mdAI agent engineering
Chapter progress 0%Learning path progress 0% · 0/10 chapters completedContinue learning path →

Problem and boundaries

The support team needs to classify new tickets as product, billing, or security issues and assign a priority. The system must not change customer data automatically; insufficient evidence must result in a human handoff.

Design

The agent can call only two read-only tools: lookup_ticket and search_policy. The server validates the ticket id, role, and tool-call budget. The final result is written to a review queue and never sends an external message directly.

Minimal implementation

from dataclasses import dataclass

@dataclass(frozen=True)
class Triage:
    category: str
    priority: str
    needs_human: bool

def accept(result: dict) -> Triage:
    allowed = {'product', 'billing', 'security'}
    if result.get('category') not in allowed:
        raise ValueError('unknown category')
    return Triage(result['category'], result.get('priority', 'normal'), bool(result.get('needs_human', True)))

Reproduction steps

  1. Prepare redacted ticket samples and policy excerpts, with the expected category and cases that must go to a person.
  2. Implement read-only tools and assign an idempotent run_id to each run.
  3. Validate the structured result before writing it to the review queue.
  4. Assert from the trace that no write tool was called, and sample the referenced policy ids.

Verification checklist

Check empty tickets, unknown categories, tool timeouts, duplicate run_id values, and human handoff for security tickets. Record events without retaining the complete customer body.

Common questions

Can the agent close a ticket automatically? No. Closing is a side effect and needs separate authorization and human confirmation.

How can a failed run be replayed? Read the event summary by run_id and replay it in an isolated environment.

Official references

OpenAI Agents guide; OpenAI Structured Outputs.

Last checked: 2026-11-16. Follow the linked sources for current interfaces and security boundaries; this case makes no performance or cost claim.

Prerequisite tutorials

KnowledgeAgent observability and cost controlsKnowledgeAgent production release: canary, rollback, and human handoff

Further reading

KnowledgeDesigning Reliable AI Automation WorkflowsKnowledgeAI Agents: From Core Concepts to ProductionKnowledgeStructured Outputs and Tool Contracts for Safe Agents
Product Hub Demo · V0.3