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
Injected failure
The first response is lost after execution; an untrusted result contains instructions.
The trace has not run.
Commit to an implementation, then inject the failure and inspect the actual state transitions.
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.