D1: Custom Agent Loops, Harnesses & Hosting
Claude Certified Developer – Foundations exam practice questions · 10 flashcards
Question
What is an agent loop?
1 / 10
Tip: Space flips the card, ← / → navigate.
Show all 10 Custom Agent Loops, Harnesses & Hosting practice questions and answers
- What is an agent loop?Repeatedly: call Claude, execute any tool_use requests, return tool_results, and stop when Claude ends its turn.
- What stop_reason signals the loop should run a tool?tool_use.
- What signals the agent loop is finished?stop_reason end_turn (or a limit such as max turns or budget being reached).
- What is an agent harness?The code around the model that runs the loop, dispatches tools, manages context and permissions, and enforces limits.
- Why add a maximum iteration limit to a custom loop?To prevent runaway loops and unbounded token cost.
- Self-hosted vs Anthropic-hosted agents?Self-hosted: you run the harness in your own infrastructure with full control. Anthropic-hosted (managed): Anthropic runs the agent infrastructure for you.
- Why choose self-hosting?Control over network access, data location, custom tooling and compliance requirements.
- Why choose an Anthropic-hosted (managed) agent?Less infrastructure to build and operate; faster to ship.
- What are hooks used for in agents?Running deterministic code at fixed points (e.g. before a tool runs) to enforce rules regardless of what the model decides.
- Why use a hook instead of a prompt instruction for a hard rule?Prompts are probabilistic; hooks run every time, so the rule is guaranteed.