← Practical labsPlatform-neutral systems lab

Build a supervised tool-using agent

Let an agent prepare a bounded action while a person controls execution.

Request
Agent decision
Read-only tools
Prepared action
Human approval
Execute and record

Scenario

An incoming request is classified. The agent may retrieve customer and order data, prepare an action, request approval, execute only after approval, and record the result.

Concepts used

  1. structured output
  2. tool calling
  3. agent loop
  4. permissions
  5. approval
  6. audit trail

Step-by-step build

  1. Define categories and a structured classification schema.
  2. Expose narrow read-only customer and order tools.
  3. Set a maximum number of agent steps and repeated-call protection.
  4. Prepare an action object without executing it.
  5. Show evidence, arguments, and risk to a reviewer.
  6. Enable one narrow action tool only after approval.
  7. Record model, tools, approval, result, and fallback.

Expected result

The agent can research and prepare, but no consequential change happens without explicit approval and a complete audit record.

Failure cases

  1. Wrong customer selected
  2. Tool returns stale data
  3. Agent repeats a call
  4. Approval expires
  5. Action fails after approval

Improvements

  1. Add confidence thresholds
  2. Use policy-based tool permissions
  3. Evaluate tool choice and argument accuracy

Platform variants

  1. n8n
  2. Microsoft
  3. UiPath
  4. OpenAI Agents SDK
  5. LangGraph