Reference
Glossary
The vocabulary of building AI agents, from agent and harness to idempotency key and tool poisoning, each in a sentence or two, with the chapter of the book that covers it.
Short definitions of the terms this guide uses. Each entry names the chapter of Building AI Agents in Go where the term comes up, and links to a guide where one covers it.
A
Ablation
Running the agent with a single component removed, next to the complete agent, so the difference in results shows what that component is worth. Chapter 13
Adapter
A thin layer that lets code written against one interface use something with a different one. In the book, an adapter makes each tool an MCP server offers look like an ordinary agent tool, so the loop needs no changes. Chapter 10
Agent
A program where the model picks the next tool to call, one turn at a time, using what earlier tool calls returned, and keeps going until the job is finished or the harness hits a limit. Chapter 1 · The agent loop in Go
Agent event
A notice the harness emits while a run is in progress, at the moment each thing happens: the model produced some text, a tool call is complete, a tool returned, a turn ended, or the run ended. Chapter 6
Agentic loop
What the harness does each turn, in four steps: assemble the request, send it to the model, execute any tools the model asked for, then decide whether another turn is needed. Chapter 1 · The agent loop in Go
Approval
A yes from a person, which the harness records, allowing a single specific action to proceed. Chapter 14
At least once
A delivery guarantee under which an action is never lost but may run more than once. You get it by retrying until a reply comes back. Chapter 15
At most once
A delivery guarantee under which an action never runs twice but may not run at all. You get it by never retrying. Chapter 15
Attempt marker
A note the harness writes right before a call that could change the outside world, saying the call is starting. A marker with no saved result beside it means the call may or may not have happened. Chapter 15
Attention
The part of a model that lets each position in the text look back over itself and all earlier positions, score them by relevance, and mix in information in proportion to those scores. Chapter 3
Audit log
A record that is only ever appended to, saying who made each decision and when, so anyone can verify the decision afterward. Chapter 14
B
Backoff
Increasing the wait before each retry, commonly doubling it, so a client that keeps failing puts less load on the server over time instead of more. Chapter 12
Barrier
A point that work can’t pass in either direction: all the work before it must finish first, and none of the work after it starts until then. Chapter 9
C
Chat template
The rules a specific model uses to flatten a list of messages, plus any tool definitions, into the single stream of text it saw during training. Different model families use different templates. Chapter 3
Checkpoint
A saved snapshot of a run’s state, written in a way that survives a crash at any instant: what’s on disk afterward is always a whole snapshot, either the old one or the new one. Chapter 15
Circuit breaker
A guard placed in front of a dependency. After a string of consecutive failures it trips and fails calls immediately without sending them; after a pause it allows a single probe call through to find out whether the dependency is back. Chapter 12
Compaction
Shrinking the request by swapping the oldest part of the conversation for a model-written summary of it. Chapter 8
Context policy
The code that decides which parts of the full conversation go into each request. The book’s policies send everything, drop old turns, clear old tool results, or summarize. Chapter 8
Context window
The text a model can take into account on one call, and its maximum size in tokens. The prompt and the reply share it, so a long prompt leaves less room for the answer. Chapter 2
Cost budget
A cap, in dollars, on what a run may spend. The harness checks it before every call to the model. Chapter 5
Crash catalog
The 32 triage tasks the book seeds for its examples and evals. Each task bundles crash reports made by sending requests to the practice service, remind; the answer the agent ought to reach; hidden tests for its fix; and the issues already on file.
Chapter 7
Crash group
A set of crash reports with a single underlying cause. Grouping is a judgment call: the same bug can crash in several different stacks, and two different bugs can produce the same stack. Chapter 7
Crash report
Everything captured about one crash: the panic message and stack trace, which version of the program crashed, the request it was handling, and the last log lines before it. Chapter 7
D
Data marker
A random boundary string, new each time the program runs, wrapped around any text that came from outside the harness. The prompt says that anything between the markers is data, which the model must not obey. Chapter 14
Deduplication
Using an ID that the sender attached to a message to spot a repeat of something already handled, so a message delivered twice acts as if it arrived once. Chapter 17
Delta
A fragment of a reply that arrives over a stream. Each delta carries one of four things: some text, a piece of a tool call, the usage, or the finish reason. Chapter 6
E
Egress
Anything that flows out of a system. For the book’s triage agent, that includes the text of each issue and comment it files. Chapter 14
Embedding
A vector, a list of numbers, that represents a token. Training adjusts the vectors so tokens that appear in similar contexts end up with similar vectors. Production models use a few thousand numbers per vector. Chapter 3
Eval
An eval measures how well a model, a prompt, or an agent performs a task by running it many times against a real model, scoring each run, and reporting the result as a rate. Chapters 5 and 13
Eval set
A fixed list of tasks, each with its starting inputs and the checks a result has to pass. Because it runs identically every time, it lets you compare one version of an agent with another. Chapter 13
Exfiltration
Moving data to an outsider who shouldn’t have it, usually through a channel the system has for some other job. Chapter 14
F
Fan-out
Splitting one job into parts and having the harness run an agent on each part at the same time, then gathering their results. Chapter 9
Fingerprint
A short identifier derived from a crash report. The goal is that crashes from one cause share a fingerprint and crashes from different causes don’t. Chapter 7
Finish reason
The field in each reply that says why the model stopped generating: it was done (stop), it ran out of room (length), it wants tools run (tool_calls), a content filter cut it off (content_filter), or the provider hit an error (error).
Chapter 2 · Tool calling in Go, on the wire
G
Graceful shutdown
Ending a process without dropping work or leaving it half finished: refuse new work, complete or save whatever is in progress, then exit. Chapter 15
Grader
Code that tests one run’s result against each of its checks and decides whether the run passed. Chapter 13
H
Hallucination
A model presenting something false with the same confidence as something true. Nothing has malfunctioned: the model produces likely text, and a false statement can be likely. Chapter 3
Harness
Everything in an agent program except the model. The harness carries out the tool calls the model requests, chooses what goes into each request, and decides when the run is over. Chapter 1 · The agent loop in Go
Hidden test
A test kept out of the agent’s view that tries its fix on inputs other than the one in the crash report. A patch that merely prevents the reported panic doesn’t pass. Chapter 13
HMAC
A keyed hash: producing or verifying one requires a secret key, so nobody without the key can forge it. Chapter 14 uses it so an edited audit log can be detected. Chapter 14
Host
A company that actually runs a model behind OpenRouter. OpenRouter routes each request to one of them, and each serves the model with its own account. Chapter 11
I
Idempotency key
A unique name the sender attaches to a request and the receiver stores. When a request arrives with a key the receiver has seen before, it returns the earlier result and doesn’t act again. Chapter 15
Idempotent
Safe to repeat: a second call leaves things exactly as one call did. In the triage agent, run_tests is idempotent; issue_file is not, since a second call files a second issue.
Chapter 7
Idle timeout
How long a client will wait on a stream that has gone quiet before abandoning it. Chapter 6
Interrupt
A pause requested by a tool partway through a run, so the run can wait on something external, like a person’s decision, and later pick up from the same point. Chapter 16
Issue tracker
Where a team keeps its list of known problems, for example GitHub Issues or Jira. The companion code ships a small stand-in, tracker, which stores issues in a JSON file.
Chapter 7
J
Jitter
A random amount added to each retry’s wait, so clients that failed at the same moment spread their retries out instead of all retrying at once. Chapter 12
JSON Schema
A standard vocabulary for describing JSON values: the fields an object has, each field’s type, and which fields are required. A tool definition uses one to describe its arguments. Chapter 4 · Tool calling in Go, on the wire
JSON-RPC
A small protocol for remote method calls carried in JSON. A request has an ID, the response repeats that ID so the caller can match the two, and a notification gets no response at all. MCP uses it as its message format. Chapter 10
L
Language model
A program that takes text and returns a probability for every possible next piece. To generate, you choose a piece, add it to the end, and ask again, as many times as you want text. Chapter 3
Least privilege
Granting a program the capabilities its task requires and nothing else, so a bug or an attacker has nothing extra to misuse. Chapter 14
Logprobs
For each token the model wrote, the logarithm of the probability it assigned to that token, and optionally the top alternatives it considered at the same spot. Exponentiate to get the probability back: a logprob of -1.11 is about 0.33. Chapter 3
M
MCP
The Model Context Protocol: an open standard that lets one program expose tools and data, and lets an agent in another process or on another machine find and call them. Chapter 10 · One sentence in a tool description decided 79 of 80 first moves
Message
A single entry in a conversation with a model, tagged with a role for its sender: system for instructions, user for whoever is asking, assistant for the model, and tool for a tool’s output. The conversation is the ordered list of messages so far.
Chapter 1
Middleware
A wrapper around each model or tool call that runs extra code before and after it, such as retrying or enforcing a timeout. Neither the wrapped call nor the loop has to know it is there. Chapter 12
Model
Short for large language model (LLM): a system trained to continue text. Your program sends it text through an API and gets back its prediction of what follows. Chapter 1
Model-as-judge
Asking a model to score another model’s output against a written rubric, for outputs that code can’t check. Chapter 13
N
Native API
The API a provider built for its own models. A compatible API, by contrast, imitates another provider’s request and reply format. Chapter 11
O
OpenRouter
A service that puts many model providers behind a single API, so one key and one bill cover all of them. You pick a model by ID, and OpenRouter sends the request to a provider that runs it. Chapter 2
Orchestration graph
A program written as nodes, such as a model call, a tool call, or a branch, joined by edges. A framework executes the graph and takes care of checkpointing and resuming it. Chapter 16
P
Parallel tool calls
More than one tool call in a single reply. The harness can run them concurrently; the model only asks for them and never executes anything itself. Chapter 9
Pass rate
Of an eval’s scored runs, the share that passed every check, averaged per task so each task has equal weight. The book reports it with its range, how many tasks and runs it covers, and how many runs couldn’t be scored. Chapter 13
Prompt caching
A provider saving the computation it did on the opening tokens of a request, then charging less to reuse that work when a later request begins with the identical tokens. Chapter 8
Prompt injection
Instructions planted in an agent’s input by someone other than its user, which the model then carries out as though its user had given them. Chapter 14
Protected path
A file or directory the agent can’t modify unless a person approves. Chapter 14
Protocol version
A date that identifies a revision of MCP, for example 2026-07-28. Starting with that revision, every request includes it in its _meta field.
Chapter 10
R
Range
The interval of plausible values for a measured number, allowing for how far chance could have moved it. The book uses the central 95 percent of results the measurement would give if repeated on a new sample of the same kind. Chapter 13
Rate limit
A cap a provider sets on the requests or tokens one caller can send per period. Anything beyond the cap is rejected with HTTP 429. Chapter 9
Read-only tool
A tool that only reads, such as code_read or crash_list: calling it has no effect outside the run.
Chapter 7
Reasoning model
A model trained to produce reasoning tokens before it answers. The reply usually hides those tokens or shows a summary, but you pay for them as output. Chapter 3
Retry budget
A pool of retries shared by everyone calling a service. Failures draw it down and successes refill it, so when most calls are failing, retrying stops. Chapter 12
Run state
All a run needs to carry on once its process has exited: the conversation, the money spent so far, anything it is waiting on, and the step it was in the middle of. Chapter 15
S
Sandbox
Limits on what code may read, write, or connect to, enforced from outside that code so it can’t lift them itself. Chapter 14
SDK
A library a provider publishes for using its API from a particular language. It typically includes request and response types and a client, and often helpers for retries and streaming. Chapter 11
Server-sent events
A simple format for streaming messages from a server over an HTTP response that stays open. A message travels on lines beginning data: and ends at a blank line; a line beginning with a colon is a comment.
Chapter 6
Settled
Describes a call whose saved answer shows either that it completed or that it never started. The harness never runs a settled call again. Chapter 15
Side effect
A lasting change a tool makes beyond the run, for example an edited file or a filed issue; it is still there when the run is over. Chapter 7
Span
One timed step in a trace. It records its parent span, when it started and ended, its attributes, and an error if there was one. Turns, model calls, attempts, and tool calls each get a span. Chapter 12
Stack trace
The chain of function calls active at the moment a program panicked, listed from the innermost call outward, each with its file and line number. Chapter 7
Stop reason
The harness’s account of why a whole run ended: it got an answer, hit a limit, was cancelled, or failed with an error. Compare the finish reason, which explains only why a single reply ended. Chapter 5 · The agent loop in Go
Structured outputs
An API option that forces the model’s reply to fit a JSON Schema, so your code can decode it directly instead of parsing free text. Chapters 4 and 7
Sub-agent
A separate agent loop that a tool of another agent starts, with its own empty context, to handle one self-contained task and return a report. Chapter 9
Supply-chain attack
An attack that comes in through something a project depends on (a library, a tool, a build step) rather than through the project’s own code. Chapter 14
System prompt
The first message in a conversation, with the role system, holding instructions that apply throughout: what the model’s job is and how it should respond.
Chapter 2
T
Threat model
A brief inventory of what in a system is worth protecting, where untrusted input gets in, and what the system is able to do with that input, used to tie each defense to a specific risk. Chapter 14
Token
The unit of text a model reads and writes. A token can be a whole common word, a fragment of a longer word, or a punctuation mark; in English a token is about four characters on average. Chapter 2
Tokenizer
The program that converts text into tokens and tokens back into text. It has a fixed vocabulary, usually between 100,000 and 250,000 tokens, each assigned a number, and the model works entirely in those numbers. Chapter 3
Tool and tool call
A tool is an action your program offers to perform for the model, like reading a file or running tests, which the model knows by a name and a description of its inputs. A tool call is the model’s request to run one of those tools with specific inputs, for example read_file on duration.go.
Chapter 1 · Tool calling in Go, on the wire
Tool definition
The description of a tool sent to the model: a name, a plain-language explanation of what it does, and a JSON Schema for its arguments. Chapter 4 · Tool calling in Go, on the wire
Tool poisoning
Hostile instructions planted in a tool’s description or schema to steer the model that reads the definition. Since definitions reach the model before any tool runs, it is prompt injection that acts before the first call. Chapter 10 · One sentence in a tool description decided 79 of 80 first moves
Tool result
What a tool returned, delivered to the model as a tool message tagged with the ID of the tool call it responds to.
Chapter 1 · Tool calling in Go, on the wire
Trace
A record of one unit of work, such as a single agent run, organized as a tree of steps, each with its timing. Chapter 12
Tuning set and confirmation set
Two separate groups of tasks. You may try a change against the tuning set while you develop it; the confirmation set judges the finished change and is never used during development. Chapter 13
Turn
One trip around the loop: the harness sends the model the whole conversation so far, gets a reply, and acts on it. Chapter 1 · The agent loop in Go
Turn limit
A cap on how many turns a run can take before the harness ends it. A loop without one can keep running, and charging you, indefinitely. Chapter 1 · The agent loop in Go
U
Unscored run
A run cut short by a failure in the harness or at the provider, so its result tells you nothing about the agent. Such runs are counted and reported, excluded from the pass rate, and rerun. Chapter 13
Usage
The token counts the API returns with each reply: input tokens, output tokens, and on OpenRouter the dollar cost of the call. Chapter 2 · Tool calling in Go, on the wire
W
Workflow
A program that calls a model at points its code decides ahead of time. In an agent, by contrast, the model picks the next step. Chapter 1
Workspace
A separate copy of a codebase made for one run, which the agent reads and edits so the original is never touched. Chapter 7