Legare Kerrison of IBM Technology breaks a production AI agent into four workloads. Each comes with its own costs, permissions, and way of failing.

Give each workload a place to run

  • Inference runs wherever the model weights are loaded: a provider’s servers, a local device, or your own GPU nodes. Watch the memory used by the model’s prompt cache when you host it yourself.
  • The agent loop assembles context, calls the model, and dispatches tools. It spends much of its time waiting on network responses, so Kerrison suggests stateless CPU workers that scale with concurrent work.
  • Tool execution reads or changes outside systems. Give tools short-lived, narrowly scoped credentials, restricted network access, and isolated execution. Use queued jobs when the work needs it.
  • State holds messages, task progress and checkpoints. Store it outside the worker when a replacement needs to resume a task. Scale and monitor that storage separately.

Make restarts safe for side effects

  • Save a checkpoint before a tool call as well as after it. A restart between the external action and the second checkpoint can leave the worker unsure whether the action went through.
  • Make retries safe: a repeated request should have the same effect as one request. Where the tool can’t guarantee that, check whether the first action succeeded before repeating it.
  • Keep model and loop credentials out of the tool process. Audit what each tool can reach and whose permissions it uses.

“It’s what can this code reach, and with whose credentials?”