LearnQuestion bank

List the main ways tool-using agents fail in production and the mitigation for each.

Applied LLMTechnicalMedium

Answer it yourself first, out loud or on paper, then compare.

Answer

Model answer, written in a candidate's voice

In short

  • Loops/stalls: step/time/token limits, repetition detection, progress checks
  • Wrong tool/bad arguments: typed schemas, validation, examples, tool retrieval
  • Claimed success without effect: verify state; ground final answers in tool outputs
  • Cost/latency blow-ups: budgets, cheaper sub-models, caching, early stop
  • Long-horizon drift: plan-then-execute, checkpoints, intermediate verification
  • Injection/irreversible actions: untrusted outputs, confirmations, idempotency/dry-run/rollback

In full

The main failure modes are control failures, not just model failures: agents can loop or stall, call the wrong tool with malformed arguments, report success without changing anything, blow budgets, drift over long horizons, and act on untrusted or irreversible inputs. I mitigate loops with step/time/token limits, repetition detection, and explicit progress checks; wrong tools and bad arguments with typed schemas, argument validation, few-shot examples, and retrieval of only relevant tools. I prevent false success by verifying state after actions and grounding the final answer in actual tool outputs rather than the model’s narrative. For cost and latency I set budgets, route easy subtasks to cheaper models, cache repeated calls, and stop early when marginal value is low. Over long horizons I plan before executing, checkpoint progress, and verify intermediate results before continuing. Finally, I treat tool outputs as untrusted data, separate instructions from observations, and require confirmations, idempotency keys, dry-runs, or rollback for irreversible actions.

Checked against sources by an independent AI reviewer.

What a strong answer covers

  • Loops → step limits, repetition detection, progress checks
  • Wrong tool / bad arguments → schemas, validation, examples, tool retrieval
  • Claimed success without effect → verify state; ground final answers in tool outputs
  • Cost/latency blow-ups → budgets, cheaper sub-models, caching
  • Compounding errors over long horizons → plan-then-execute, checkpoints, verification
  • Injection via tool outputs and irreversible actions → treat outputs as untrusted; confirmations and idempotency

Common mistakes

  • Only describing the happy path
  • relying on the system prompt alone to stop dangerous actions