AI Agent Infrastructure
Agent runtime loop
Explain the agent runtime loop, where tool_use stop reasons lead to tool_result messages, and why a run needs an explicit end and a budget for steps, tokens and time.
What you will be able to do
- Explain how a tool_use stop reason leads to a tool_result in the next turn.
- Decide which budgets an agent loop needs for steps, tokens and time.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in AI Agent Infrastructure
- Regression evalsBeginner · 4 min
Test agents against reproducible scenarios, expected tool invocations, and outcome graders.
- Agent SLOsBeginner · 4 min
Track task success, p95 latency, retries, cost per successful task, and failure classifications.
- Tool interface schemasIntermediate · 4 min
Explain how a tool's JSON Schema constrains its arguments, what additionalProperties controls, and why the runtime should validate each call before the handler runs, so…
- MCP security boundariesIntermediate · 4 min
Explain the security boundaries of MCP servers, including startup commands, token audience and passthrough, and the listening address of a local server, and the consent…
- Sandboxed code executionIntermediate · 4 min
Explain how namespaces, control groups and capabilities combine into a sandbox for generated code, and which inputs a sandbox should never receive, and why each one…
- Tool retriesIntermediate · 4 min
Explain how retries with exponential backoff and jitter work, why nested retries multiply load, and why a retry is safe only for calls that can be repeated.