B.12.1 What the System Does After Pass 10
After Pass 10 a durable agent answers questions about the system itself. It retrieves from the system’s own documentation, calls tools through the engine’s tool-call API, cites what it used, runs as a durable workflow, and sits behind the gateway’s usage policy. It passes its evals and policy checks. As optional depth, post-training improves the TinyStories model on held-out preference tasks. Everything from earlier passes keeps working.
Concepts from other sections (2)
This section uses these ideas. Each has a short definition and a link to the section that explains it in full. Tap a dotted term in the text to preview it.
- usage policy: an ordered list of rules that allow or deny inference requests by model, tenant, token cap, or classifier score. Read more: 25.6 Usage policy enforcement
- Confidence interval: a procedure that, over repeated samples, produces intervals covering the fixed true parameter at the stated rate. Read more: 13.11 Probability problem set, part c: limit theorems and confidence intervals in Mathematics
The agent is built from the agent-SDK chapter of AI Engineering, from types and the provider, tools and schemas, the agent loop, and the tool gate to durable agent runs; from retrieval, with RAG ingest, retrieval, and context assembly and citations; and from evaluation, with the eval runner, scorers, the LLM judge, and paired A/B experiments. The policy is Usage policy at the gateway and its enforcement; the deployment is the agent image and chart; and the tests are agent evals as tests.
A durable agent answers with citations and passes evals and policy checks
Section titled “A durable agent answers with citations and passes evals and policy checks”The services involved are the engine, the gateway, the durable server and worker of Pass 8, and the agent. With the local SmolLM2-135M-Instruct model, the agent plans for itself. A deterministic fake tool provider, agent.faketool.json, runs the same prompts and tools reproducibly. The ctl verbs are in go/cmd/ctl.
Four behaviours define the pass. The first is an answer with citations:
{ctl} agent ask --query "Where are the serving runbooks?" --suite course-docsThe answer carries at least one citation, and every tool call succeeds. Retrieval-augmented answers are only trustworthy when their sources are named.
The second is an evaluation with an A/B experiment:
{ctl} eval experiment --base tinystories-10m --exp smol-135m-instruct --suite agent-smokeIt reports at least 5 samples per arm and a confidence interval on the difference, because comparing two models needs an interval, not two point estimates.
The third is the usage policy at the gateway. A POST /v1/chat/completions with a request the policy forbids is answered with HTTP 451 and the error code usage_policy. Policy is enforced once, at the edge, for every model and client.
The fourth is the prompt-injection suite, run with {ctl} eval run --suite <prompt-injection cases>. Over at least 10 cases there are zero unsafe tool calls: text retrieved from documents must never be able to direct the agent’s tools.
The agent runs as a durable workflow, so a long multi-step task survives a worker restart, and its chart deploys it next to the rest of the system.
Optional depth: post-training
Section titled “Optional depth: post-training”An optional local post-training capstone, Capstone 2: post-trained TinyStories model, improves the TinyStories model on held-out preference tasks. It uses supervised fine-tuning, DPO and IPO, GRPO with verifiable rewards, and distillation, with the derivations checked in the optimization problem set on constrained optimization, duality, and DPO. The v1.0.0 core course ends at the capstone of Pass 9; Pass 11 releases and operates it.