Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Goal-Driven Tool-Using Agent

Design a safe, durable service that turns a user goal into observable multi-step tool execution.

Problem statement

For this exercise, assume an authenticated user submits a natural-language goal to an AI agent. The agent may plan up to 20 steps and call a fixed registry of read and write tools to complete the goal.

It must stream useful progress, preserve enough state to resume after a worker restart, and return a terminal result with the tool outcomes that support it.

Assume every tool declares its input schema, timeout, side-effect class, and whether explicit user confirmation is required. Read-only calls may be retried with bounded backoff.

Write calls receive stable idempotency keys, and designated high-impact writes require confirmation of the exact proposed action before execution. A user may cancel an active run, but a tool call already accepted by an external system may finish and must be reconciled.

Keep an immutable audit trail of plans, approvals, tool attempts, observations, and the final outcome.

The first version serves one deployment region with zone-level failure tolerance. Custom user-supplied code, multi-agent collaboration, model training, and unrestricted web browsing are outside scope.

What to build

  1. A user can submit a goal, inspect the proposed high-impact actions, approve or reject them, and cancel an active run.
  2. The agent can select registered tools, validate arguments, execute bounded multi-step plans, and incorporate tool observations into later steps.
  3. A user can observe ordered progress and reconnect to a run without losing committed execution history.
  4. A user can retrieve a durable success, failure, or cancelled outcome with an auditable record of consequential actions.

At scale

  • Assume up to 100 new goals per second and 20,000 concurrently active runs, with most runs completing within five minutes and a hard limit of fifteen minutes.
  • Assume each run performs at most 20 tool calls and stores at most 1,000 ordered progress or audit events retained for 30 days.
  • Assume committed progress should normally become visible to a connected user within two seconds, while reconnect replay may be at least once when events have stable identifiers and sequence numbers.
  • Assume that after a run is acknowledged, loss of any single application process or worker must not lose its committed plan, approval state, tool outcomes, or terminal result.