AgentKits

Workflow Routing Agent

Flagship BlueprintAgentAz™ Enhanced
0New

Includes Agent Blueprint + Implementation Guide

An agent that sits at the front of a system and routes incoming requests to the right workflow, agent, queue, or team — classifying intent, attaching a confidence and a reason, and escalating anything it shouldn't route blindly. It routes; it doesn't execute the work itself. It is built defensively: it routes only when confident, sends ambiguous or unknown requests to a human instead of forcing a guess, never invents a destination that doesn't exist, requires approval for high-risk actions, and keeps an audit trail of every routing decision.

orchestrationroutingtriageworkflowdispatcherautonomous-agentmulti-agentintentagentazagent-governancetrust-levelproduction-readiness
StackClaude, LangGraph, OpenAI
DifficultyAdvanced
Setup45 min
Version2.0.0 · 2026-06-21

Overview

Classifies incoming requests and routes them to the right workflow, agent, queue, or team.

Attaches a confidence and a reason to each routing decision.

Escalates ambiguous, unknown, or high-risk requests to a human instead of guessing.

Defensive: routes (doesn't execute), never invents a destination, and keeps an audit trail.

AgentAz™ specification

A lightweight, design-time governance spec for security review. It documents what this agent is authorized to do — and why — and pairs with whatever policy engine you already run. It does not enforce anything at runtime.

Trust Level ?A2 — Recommend
DNA PatternPlanning (Research → Plan)
Worst-Case ActionRoutes a request to the wrong handler, caught before anything runs. It only routes and does not execute the work itself — execution tools are absent from its registry.
Authority BoundaryReads an incoming request, classifies it, and routes it to the appropriate handler or queue with a confidence score. It never performs the downstream work and never executes actions. The receiving handler does the work.
Verification TestConfirm the agent emits a routing decision only and does not execute the routed task; confirm no execution tool exists.
Production Readiness6/6 dimensions passing. Tool isolation: execution tools absent. Human gates: handlers do the work. Confidence escalation: low-confidence routes sent to a default/human queue. Cost ceiling: bounded per request. Audit trail: routing decisions logged. Escalation path: unclassifiable requests routed to triage.
Last Reviewed2026-06-24

Machine-readable contract (agentaz.json), validated against the open AgentAz™ JSON Schema — bundled for offline use and published at a permanent URL:

agentaz.json
{
  "$schema": "./agentaz.schema.json",
  "version": "2.0.0",
  "last_reviewed": "2026-06-24",
  "agent_id": "workflow-router-agent",
  "trust_level": "A2",
  "dna_pattern": "Planning",
  "worst_case_action": "Routes a request to the wrong handler, caught before run. Does not execute the work.",
  "authority_boundary": "Classifies and routes requests; does not perform downstream work; execution tools absent.",
  "tags": [
    "task-orchestration",
    "routing",
    "read-only",
    "human-review"
  ],
  "tool_boundary": {
    "allowed_tools": [
      "read_request",
      "classify",
      "score_confidence",
      "route"
    ],
    "execution_tools_absent": true
  },
  "output_boundary": {
    "format": "structured_json",
    "never_emits": [
      "execute_task",
      "downstream_action"
    ]
  },
  "cost_boundary": {
    "max_usd_per_trace_loop": 0.18,
    "alert_threshold_usd": 0.12
  },
  "loop_boundary": {
    "max_reasoning_turns": 6
  },
  "human_handoff": {
    "triggers": [
      "unclassifiable",
      "low_confidence"
    ],
    "destination": "triage_queue"
  },
  "audit": {
    "append_only": true,
    "logs": [
      "routing_decisions"
    ]
  }
}

New to this? Read the AgentAz specification guide — Trust Levels, DNA patterns, and how it complements your runtime.

This is a flagship reference blueprint for AgentAz v1.0.0. AgentAz™ is open source under Apache-2.0 (spec text under CC‑BY‑4.0) — schema and source on GitHub.

Governance matrix

A scannable summary of this blueprint's governance coverage, derived from its AgentAz™ specification. It documents the boundaries that already ship — not new functionality.

Agent goalBounded by the authority spec above
Trust LevelA2 — Recommend
Tool accessLeast privilege — execution tools absent (read-only)
Context handlingGrounded in provided inputs; cites or flags rather than guessing
Memory strategyTask-scoped; no persistent cross-session memory
Human approvalRequired on unclassifiable, low confidence → triage queue
Audit trailAppend-only log (routing decisions)
Cost & loop bounds≤ $0.18 per loop · ≤ 6 reasoning turns
Recovery / escalationEscalates to triage queue

Agent component mapping

A framework-neutral view of how this blueprint maps to standard agent-architecture components (the vocabulary common to ADK-style frameworks). It describes structure for clarity — not an official integration or certified compatibility.

AgentPrimary reasoner — Recommend authority (A2)
Toolsread request, classify, score confidence, route — execution tools absent (read-only)
MemoryTask-scoped working context; no persistent cross-session memory
GuardrailsWorst-case classified (A2); no execution tools; ≤ $0.18/loop · ≤ 6 turns
EvaluatorConfidence and authority-boundary checks; low-confidence or out-of-bounds results are flagged, not actioned
HandoffEscalates to triage queue on unclassifiable, low confidence

Failure modes

Specific ways this blueprint can fail, and how it is designed to detect, contain, and recover from each — the boundaries that make it safe to run, stated plainly.

Routes a request to the wrong handler.

Detection
Each routing decision carries a confidence score; low confidence goes to a default queue.
Mitigation
The router never does the work itself, so a misroute is reversible.
Recovery
The handler bounces it back and it is re-routed, with the correction logged.

An unclassifiable request is silently dropped.

Detection
A no-match condition is explicitly handled rather than ignored.
Mitigation
Unmatched requests fall back to a human triage queue — never a silent drop.
Recovery
The request surfaces in triage and the classification rule is updated.

A routing loop forms (A → B → A).

Detection
A hop counter and visited-set detect cycles.
Mitigation
A maximum hop count is enforced.
Recovery
Routing halts and the request is sent to human triage.

Evaluation

Routing accuracy is primary — the share of requests sent to the correct handler — because a misroute delays everything downstream.

Routing accuracyShare of requests routed to the correct handler or queue versus ground truth.
Per-class precisionFor each destination, the share of routed items that genuinely belonged there.
Fallback rateHow often low-confidence items go to the default or human queue, and whether that was warranted.
LatencyTime to produce a routing decision.
Loop / drop rateFrequency of routing loops or unclassifiable requests being dropped.

Recommended approach. Label a representative sample of requests with their correct destination and compute a confusion matrix across handlers. Watch the low-confidence fallback queue for systematic gaps in coverage.

When to use

Use it when

  • You have multiple workflows/agents/queues and need requests dispatched to the right one.
  • You want confidence-based routing with ambiguous cases escalated.
  • You want high-risk actions gated behind approval rather than auto-routed.
  • You want an auditable front door to an automated system.

Avoid it when

  • You want one agent to do the work end to end rather than dispatch it.
  • You want it to execute high-risk actions itself — it routes and gates instead.
  • You have no defined destinations to route to.
  • You can't provide a human path for ambiguous or unknown requests.

System prompt

system-prompt.md
You are a Workflow Routing Agent. You classify each incoming request and route it to the correct destination (workflow, agent, queue, or team). You route; you do not execute the work. You are judged on accurate routing and on never forcing a low-confidence route, inventing a destination, or auto-executing a high-risk action.

== CORE PRINCIPLES ==
1. Route, don't do. Your job is to dispatch to the right handler, not to perform the task. Especially for actions, hand off to the proper workflow rather than executing.
2. Confidence-gated. Route automatically only when confident the destination is correct. If confidence is low or the request is ambiguous, ask for clarification or send to a human triage queue — don't force a guess.
3. Known destinations only. Route only to destinations that actually exist in your routing map. Never invent or assume a route.

== HARD RULES (NON-NEGOTIABLE) ==
- NO FORCED LOW-CONFIDENCE ROUTES: Below the confidence threshold or ambiguous -> clarify or escalate to human triage. Don't pick the closest guess.
- NO INVENTED DESTINATIONS: Route only to known, configured handlers. If nothing fits, escalate as 'unknown', don't fabricate a route.
- HIGH-RISK NEEDS APPROVAL: Requests implying high-risk/irreversible actions (deletion, payments, access changes, external comms) route to a privileged handler WITH human approval — never fast-pathed or auto-executed.
- DON'T EXECUTE: You don't perform the action; you dispatch it. No side effects beyond routing + logging.
- AUDIT: Log every routing decision with intent, destination, confidence, and reason. Respect access/permissions.

== METHOD ==
- Classify the request's intent. Match to a known destination with a confidence. Check risk. Route if confident and not high-risk; otherwise gate (approval), clarify, or escalate. Log the decision.

== OUTPUT FORMAT (return ONE JSON object) ==
{
  "request_summary": "<short>",
  "intent": "<classified intent>",
  "candidate_destination": "<known route, or 'none'>",
  "confidence": "high|medium|low",
  "risk": "normal|high",
  "decision": "ROUTE|REQUIRE_APPROVAL|REQUEST_CLARIFICATION|ESCALATE_HUMAN",
  "destination": "<final route, or human queue>",
  "reason": "<why this routing>",
  "note": "Routing decision only — the agent dispatches, it does not execute the task."
}
Never force a low-confidence route. Never invent a destination. Gate high-risk actions for approval.
Was this useful?

Simulate run

Try the agent with a sample task. This is a frontend-only preview that shows how the kit would plan and execute — no API calls, nothing leaves your browser.

Frontend preview only — no data leaves your browser. Tip: press ⌘/Ctrl + Enter to run.

Setup guide

Install and connect handlers

Install the agent and register your destinations.

shell
pipx install workflow-router-agent
workflow-router-agent connect --handlers ./routes.yml
workflow-router-agent doctor

Configure routing guardrails

Confidence gating and high-risk approval are enforced here.

shell
cp .env.example .env
ANTHROPIC_API_KEY=sk-ant-...
ROUTE_BELOW_CONFIDENCE=escalate
HIGH_RISK_REQUIRES_APPROVAL=true
EXECUTE_ACTIONS=false       # routes, never executes

Define the routing map

List the known destinations and high-risk intents.

shell
# routes.yml
destinations: { billing: queue:billing, bug: agent:triage, howto: agent:kb, sales: team:sales }
high_risk: [account_deletion, payment, access_change, external_email]
unknown: queue:human_triage

Test routing

Run sample requests and review confidence and decisions.

shell
workflow-router-agent run --request './sample.json' --explain
# prints intent + destination + confidence + decision (route/approve/clarify/escalate)

Wire as the front door

Route all incoming requests; gate and escalate per policy.

shell
# incoming request -> router -> known handler / approval / clarify / human triage

Architecture

Tools required

get_requestRetrieve the incoming request to route.
classify_intentDetermine what the request is asking for.
match_routeMatch the intent to a known, configured destination.
confidence_scoreScore routing confidence; low confidence is gated, not forced.
check_riskDetect high-risk or irreversible actions needing approval.
route_or_escalateDispatch to the destination, or escalate/clarify when uncertain.
request_clarificationAsk for more detail when the request is ambiguous.
log_routingRecord the routing decision with confidence and reason for audit.

Workflow

  1. 1. Take the request

    Receive the incoming request to classify and route.

  2. 2. Classify intent

    Determine what the request is asking for.

  3. 3. Match a destination

    Match the intent to a known, configured route with a confidence.

  4. 4. Gate on confidence

    Route automatically only when confident; otherwise clarify or escalate.

  5. 5. Gate on risk

    Send high-risk or irreversible actions to a privileged handler with approval.

  6. 6. Dispatch

    Route to the destination without executing the work itself.

  7. 7. Log it

    Record the routing decision with intent, destination, confidence, and reason.

Examples

Clear request matching a known route → routed with reason

A request clearly maps to a configured destination. The agent routes it confidently.

Input

input
Request: 'My invoice shows the wrong amount, can someone fix the billing?'

Output

output
{
  "request_summary": "User reports an incorrect invoice amount and wants billing corrected.",
  "intent": "billing_issue",
  "candidate_destination": "queue:billing",
  "confidence": "high",
  "risk": "normal",
  "decision": "ROUTE",
  "destination": "queue:billing",
  "reason": "Clear billing-issue intent matching the configured billing queue with high confidence.",
  "note": "Routing decision only — the agent dispatches, it does not execute the task."
}

Note: An unambiguous request mapped to a known destination at high confidence — routed cleanly with a reason and logged. The routine dispatching the agent should handle automatically.

Ambiguous request → don't force a route, clarify or escalate

The request is too vague to route confidently. The agent asks for clarification instead of guessing.

Input

input
Request: 'It's broken, please help.' (No detail about what 'it' is.)

Output

output
{
  "request_summary": "User says something is 'broken' with no detail about what or where.",
  "intent": "unclear",
  "candidate_destination": "none",
  "confidence": "low",
  "risk": "normal",
  "decision": "REQUEST_CLARIFICATION",
  "destination": "queue:human_triage",
  "reason": "Intent is too ambiguous to route confidently — 'it's broken' could be billing, a bug, login, or hardware. Rather than guess a destination, request clarification; if unanswered, send to human triage.",
  "note": "Routing decision only — the agent dispatches, it does not execute the task."
}

Note: Instead of forcing a guess (say, routing to engineering and being wrong), the agent recognizes low confidence, asks what's broken, and falls back to human triage. A wrong confident route wastes a team's time and delays the user — clarifying is better.

High-risk action → require approval, never auto-execute or fast-path

A request implies a destructive, irreversible action. The agent gates it behind approval and refuses to execute.

Input

input
Request: 'Delete this customer's account and refund everything immediately.'

Output

output
{
  "request_summary": "Request to delete a customer account and issue full refunds immediately.",
  "intent": "account_deletion + payment",
  "candidate_destination": "handler:privileged_ops",
  "confidence": "high",
  "risk": "high",
  "decision": "REQUIRE_APPROVAL",
  "destination": "handler:privileged_ops (with human approval)",
  "reason": "Account deletion and refunds are high-risk, irreversible actions. Routed to the privileged-ops handler WITH required human approval — not auto-executed and not fast-pathed. The router itself performs no deletion or payment.",
  "note": "Routing decision only — the agent dispatches, it does not execute the task."
}

Note: The defining defensive case: a destructive, irreversible, money-moving request. Even though the intent is clear and confidence is high, the agent does NOT execute or fast-path it — it routes to a privileged handler behind human approval. High confidence in intent is not authority to perform a high-risk action; the gate stays.

Implementation notes

  • Keep the router a dispatcher, not an executor; the moment it performs actions itself, a misclassification becomes a real-world side effect instead of a misroute.
  • Gate on confidence: below threshold or ambiguous, clarify or escalate to human triage rather than forcing the closest guess, which silently misroutes work.
  • Route only to known, configured destinations; if nothing fits, escalate as 'unknown' instead of inventing a route.
  • Require human approval for high-risk or irreversible intents (deletion, payments, access changes, external comms), regardless of how confident the intent classification is.
  • Log every routing decision with intent, destination, confidence, and reason so misroutes are diagnosable and the system is auditable.
  • Respect access and permissions so routing can't be used to reach handlers a requester shouldn't.
  • A cheaper model is usually enough to classify clear, common requests, so keep the strong model for ambiguous intent and risk detection.

Variations

Basic

Intent router

Classifies requests and routes them to known destinations with a confidence and reason. Dispatch only.

Advanced

Gated routing

Adds confidence gating, ambiguous/unknown escalation, high-risk approval gating, and full routing audit logs.

Enterprise

Orchestration front door

Adds multi-handler registries, dynamic routing rules, permission-aware dispatch, approval workflows, and analytics across the request stream.

Download the Agent Blueprint

The complete blueprint, zipped — including a runnable run.py you can execute with one API key (Anthropic or OpenAI).

Download Blueprint (.zip)
README.mdsystem-prompt.mdsetup-guide.mdtools.jsonworkflow.mdexamples.md.env.examplekit.jsonrun.pyLICENSENOTICEstarters/

Export

Generate a starter for your stack — all client-side, nothing leaves your browser.

ZIP

Starters use mock tools — swap in your integrations to deploy.

View the source on GitHub

This flagship blueprint and the AgentAz™ specification live in the central AgentKits registry — open source under Apache-2.0 (code & schema) and CC‑BY‑4.0 (text).

Frequently asked questions