API lesson 04 · Run a bounded tool loop
Shared system · deterministic provider fixtures
Harbor Support Drafting API. One bounded request moves through typed items, tools, state, budgets, and evidence without live provider calls.
01 · Smallest useful mechanism
Tool loops require exact call/result correlation, schema and semantic validation, current authorization, approval for risky operations, bounded execution, sanitized results, and explicit stop conditions.
The model chooses from descriptions; the application decides what may happen.
02 · Experiment
Deterministic protocol fixture
This workbench uses inspectable provider-event fixtures and injected failures. It does not make live calls or execute external effects.
Protocol workbench · harbor-tools-v3
Question to consider
Complication
The first response is lost after execution; an untrusted result contains instructions.
What would you do?
Choose the approach you would be prepared to defend in a design review.
Consider the trade-offs first.
Choose an answer, then run the scenario. You’ll see what the system checks, what happens under the complication, and where the control boundary holds or breaks.
03 · Implementation brief
Your learning artifact
Stored only in this browser. No account required; course reset does not delete it.
04 · Check your understanding
Primary sources · verified 2026-08-02
Function calling changes an LLM from a text component into a participant in workflows that can read private data or cause side effects.
Common mistake: The tool schema is also an authorization policy. A schema describes shape. Authorization depends on the current principal, resource, action, environment, and policy.
Transfer exercise: Send two parallel policy lookups, return their results out of order, and prove the final response still cites the correct call.
Next: A tool loop needs context across turns, so the next lesson makes conversation and canonical state ownership explicit.