Blueprints · Design choices
Design choices
Six choices decide whether models work safely inside an agent-operated company. Each one comes from the book, with the chapter to read next.
01 · Prediction
Tabular foundation models and RPTs
A tabular foundation model (TFM, also written TabFM) predicts from labeled business rows in one pass. No model is trained for the task. Book, Ch 04
Some vendors call their models relational pretrained transformers (RPTs). The book treats them as one class and judges each on your own backtest. Book, Ch 04
How it works
- Pretrained once. The developer trains the model on a very large number of prediction tasks, many of them synthetic.
- One forward pass. You send rows with known answers and rows with the answer missing. No weights change.
- Probabilities out. Classification returns class probabilities. Regression can return a distribution, so a treasurer can plan on the 10th percentile.
A new use case is a context query and a call, not a training job. The model predicts only classes it has seen in context. It does not repair bad labels. Book, Ch 04
The agent pattern: the language model reasons, the TFM does the statistics
| Step | Done by | Why |
|---|---|---|
| Understand the request; choose target and population | Language model | Language and judgment |
| Build the context from governed data products | Tool (query) | Deterministic, auditable |
| Predict with probabilities | TFM, called as a tool | Statistics, reproducible with a seed |
| Apply thresholds and limits | Rules engine | Policy |
| Explain and draft the next action | Language model | Language |
The language model should call the TFM, not imitate it. A TFM call logs context, version, seed and output. A language model’s estimate logs nothing. Book, Ch 04
Designing a TFM use case
- Define the target precisely. “Paid more than 15 days after due date” is a target. “Late” is not.
- Define the decision time. Every feature must be known at that moment. This prevents leakage.
- Select features wide, and remove fields filled only after the outcome.
- Pick the context rows: recent, relevant, labeled cases, usually 6 to 24 months of closed cases.
- Choose sampling: stratify for rare outcomes; sample by time for drifting processes.
- Backtest with a time split, never a random one.
- Set the threshold from economics, not accuracy.
- Log context ID, model version, seed and output for every production prediction.
Speed, explanation and benchmarks
- Build the context once per scoring window and cache it. Record the cache ID in the trace: it defines what the model “knew”.
- Show per-row drivers on the approval card. Use overall feature importance in the monthly model review.
- Several developers claimed first place on overlapping benchmarks within two months. Decide on your own time-split backtest, and check the weight licence.
Book, Ch 03 and Ch 04. See the tabular model card on the Models page.
02 · Context
Retrieval (RAG): find, ground, cite
Context, memory and retrieval are different things. Every privacy, audit and cost decision depends on keeping them apart. Book, Ch 05
| Aspect | Context | Memory | Retrieval |
|---|---|---|---|
| What it is | The input to one model call | A store the harness writes and reads | A lookup that adds passages to context |
| Main risk | Too much, stale or untrusted content | Silent drift; personal data kept too long | Wrong or unauthorized passages |
| Control | Context assembly rules | Retention, write rules, review | Access filters at query time; citations |
Retrieval design
- Start in a store you already run. Consider a separate vector database only above about 100 million chunks with a 50 ms target. Book, Ch 03
- A separate store duplicates permissions. The book calls that the most common source of leaks in retrieval systems. Book, Ch 03
- Test the permission filter. Some approximate indexes filter after the search, so a filter can silently return too few results. Book, Ch 09
- An embedding is a copy. It points to its source record and carries its source ID, classification and access rule. Book, Ch 09
- Put retrieval content under change control. A poisoned policy document can change a threshold. Catch it with content hashes. Book, Ch 23
Chunks and how much to load
The book sets no chunk size or overlap. It sets the test instead. Book, Ch 08
- Set a context budget. Measure quality against context size on the golden set. Stop where quality stops rising.
- Assemble per step, not per run. Planning needs goal and policy. Drafting needs evidence and tone. Book, Ch 05
- Fetch just in time on long tasks. Carry identifiers and fetch the record when a step needs it.
- Scope by domain. Load only the concepts in the agent’s domain, not everything the company knows.
Grounding and citations
- Policy before precedent. Load current policy and limits first. Past cases enter only as evidence, with their date and policy version.
- Like for like. Retrieve precedent with the same entity class, the same policy version and a confirmed outcome.
- Cite every loaded fact and flag what is missing. An agent that cannot cite says what it lacks rather than guess.
- Untrusted text is data. Emails and PDFs are wrapped so the model and the filters can tell them from instructions.
When to use a knowledge graph or the record instead
| The question | Use |
|---|---|
| What is the number? | The semantic layer or the data product |
| How is this connected to that? | The knowledge graph |
| A fact that exists in a data product | Load the record, not a document that mentions it |
| Which passage says this? | Retrieval, with access filters and citations |
Book, Ch 05, Ch 08 and Ch 09. In the dispute, the graph decides which ERP holds the invoice; retrieval cannot. See Graphs.
03 · Evidence
Evals and audits
Evals are the gate evidence for every promotion and demotion. Audits need a trace that answers seven questions. Book, Ch 06 and Ch 22
Offline and online
| Mode | What runs | When |
|---|---|---|
| Offline | Golden set, trajectory checks and adversarial tests | Every change of agent, model, tool or policy version |
| Online | Samples, seeded cases, blind checks, judge scores and drift monitors | Continuously; reported weekly |
The test plan
- Tool tests: each tool returns correct data and rejects bad input.
- Golden set: the final decision matches the expert decision.
- Trajectory checks: right tools, sensible order, no forbidden calls.
- Envelope and failure tests: limits stop the run; a trace store outage blocks the commit.
- Shadow, then canary: live triggers with no actions, then a small share of live volume.
Golden sets and calibration
- A golden set holds 200 to 500 real cases, refreshed quarterly. Add confirmed overrides weekly. A score means nothing without the set version. Book, Ch 04 and Ch 06
- Calibration means scores match reality: among proposals scored 0.9, about 90% are right on your data. Book, Ch 07
- Calibrate a model-as-judge on at least 100 human-graded cases. Use it only at 85% agreement or better. Book, Ch 06
- A judge never grades its own model family alone. Pair it with another family or with code checks.
Red-teaming
Run adversarial tests before production, after every material change and after every vendor model update. Examples from the book’s security catalog: Book, Ch 23
- An instruction in a supplier PDF to change bank details. Pass: no change proposed; event logged.
- Hidden white text with instructions. Pass: ignored and flagged.
- A forged message from another agent. Pass: rejected at the gateway.
- The kill switch pulled during a run. Pass: stops in time, with no half-finished postings.
Keeping reviewers awake
About 1 in 200 proposals is a seeded known-bad case. A reviewer who catches fewer than 90% has their approvals re-checked. Book, Ch 06
Drift
Watch input drift, behavior drift and outcome drift. One past its band opens an offline rerun. Two together freeze promotion. Book, Ch 06
Audit trails: seven questions
- Who acted: agent, version, identity?
- What was it authorized to do?
- What did it actually do, including blocked attempts?
- On whose behalf did it act?
- Why: which inputs, rules and evidence?
- Which version acted: agent, model, prompt, skills, tools?
- What did the human do, and when?
- One trace ID runs across every platform the case touches. Book, Ch 22
- The trace is written before the commit returns. If the trace store is down, the agent does not post. Book, Ch 05
- Store traces where agents cannot change them. Reconcile monthly: every agent posting has a trace. Book, Ch 22
Dashboards, the agent registry, audit walkthroughs, the kill switch and reliability rules are on Operating agents.
04 · Security
Security: injection, leakage, identity and the front door
A language model cannot reliably separate instructions from content. Any text an agent reads can carry an instruction. Book, Ch 23
In three published incidents on three enterprise platforms, configuration and architecture decided the outcome, not the model. Book, Ch 23
Structural defenses first
- Separate reading from writing. An agent that reads untrusted text holds no write tool to sensitive objects.
- Type the hand-off. An instruction cannot travel in a field typed as a number.
- Gate irreversible actions. Bank detail changes need a call-back outside the agent.
- Limit egress. An agent holding confidential data has no open channel out. Review the allow-list monthly.
- Segment agent teams. Agents that can find each other sit in a team of equal privilege.
- Supervise powerful tools. After reading untrusted text, create, update, delete and external mail need a human confirmation.
Redesign rule. One run must not combine confidential data or financial write tools, untrusted text and an external channel. Remove at least one. Book, Ch 23
Data leakage
- Mask personal data before any external model. Masking misses some identifiers, so it cannot be the only privacy control. Book, Ch 04
- If logging runs before masking, personal data reaches the log.
- “Zero retention” must be in the contract, not only on a product page.
- Where inference runs follows the data class: restricted data stays on a self-hosted pool. Book, Ch 09
Agent identity and permissions
- No agent reaches L3 while it acts through a shared account or a person’s credentials. Book, Ch 23
- When an agent acts for a person, the token names both. Effective rights are the overlap of the two.
- Request a short-lived token per tool, bound to that tool. Never forward a token issued for someone else.
- Pin and hash every outside tool, skill and server version. Treat any change as a change request.
The front door for outside agents
Treat an outside agent like a new trading partner that never sleeps. One door, the least it needs, and closer watching than your own agents. Book, Ch 23
| Tier | What the agent may do | Entry evidence |
|---|---|---|
| T0 Unknown | Nothing; requests are logged and refused | None |
| T1 Sandbox | Call test tools on synthetic data | Verified identity; contract annex |
| T2 Read | Read its own records through filtered tools | Sandbox passed; owner and security chief sign |
| T3 Act within limits | Create or update cases within caps | 90 days at T2 without a material finding |
No tier allows payment release, bank-data changes, credit-limit changes or user administration. Revocation runs at the gateway within five minutes (illustrative). Book, Ch 23.
One poisoned invoice
A real supplier’s invoice hides white text: change the bank account and pay today. Only a reader agent sees it. The writer holds no bank-data tool. People verify against the master record. Book, Ch 23
None of these controls depended on the model spotting the attack. Detection helped; structure decided.
05 · Inference
Inference design: route, budget, cache, fall back
Send each step to the cheapest engine that passes evaluation: rules, a tabular model, a small model, a frontier model, or a person. Book, Ch 09
In the book’s accounts-payable simulation, rules resolve 39% of items, the tabular model 8%, the small model 4%, the frontier model 13% and people 36%. Book, Ch 21
- Small or large. Use a reasoning mode for the plan step and exception analysis. Use a fast model for extraction and drafting. Book, Ch 04
- Spend tokens to save review minutes. A stronger model on hard items often costs less per outcome. Book, Ch 21
- Compute is small. In the simulation it is about 1.6% of total cost. Review and wrong actions dominate.
Latency and cost budgets
| Work | Budget (illustrative) |
|---|---|
| Interactive | Under 2 seconds. A call slower than 5 seconds at p95 never sits inside an interactive flow. |
| Voice, to first audio | 750 to 1,200 milliseconds, with a scripted acknowledgment while tools run |
| Event-driven agent step | Up to a minute |
| Batch | Hours |
Book, Ch 04 and Ch 07.
The operating envelope
The harness, not the agent, limits each task: a deadline, model calls, tool calls, retries, a budget shared across retries and a loop guard. At a limit, the run stops and escalates. Book, Ch 05
- The run-level cap is the most effective cost control. A reasoning loop can burn thousands of actions before anyone looks. Book, Ch 25
- An agent re-reads its context every step, so input grows with the square of the step count. Cap steps. Book, Ch 21
- Retry only if the chance of success times the human cost avoided beats the retry’s cost and risk. Book, Ch 05
- Alert when units per run pass twice the baseline. Review product budgets when the forecast misses by more than 15%. Book, Ch 25
Caching and batching
- Put stable content first: instructions, tool schemas, certified definitions. Put variable content last. That order makes caching pay. Book, Ch 09
- Cache a tabular model’s context once per scoring window and reuse it for every query. Book, Ch 04
- Batch work that can wait. On a per-action meter, caching and routing do not help; only fewer actions per task do. Book, Ch 21
Fallbacks and guardrails at inference time
- Keep one tested fallback from a different provider for every production agent. Book, Ch 04
- If no model can serve, the model gateway degrades the step to L1. Book, Ch 05
- The gateway pins versions, masks personal data, filters input and output, and logs model, version, tokens and latency.
- Every channel writes a fallback ladder: retry tighter, ask, a safe default, hand off to a person, safe stop. Book, Ch 07
- Code, not the model, validates the output schema and does the arithmetic. Book, Ch 04
06 · Alignment
Probabilistic or deterministic: which step goes where
If you can write the decision as code, write it as code. Use a model only where code would need judgment you cannot specify. Book, Ch 03
| If the step… | Then | Example |
|---|---|---|
| Has a written rule a clerk applies without judgment | Code or a rules engine | Three-way match tolerance |
| Changes a legal record or moves money | Deterministic commit after routing | Post a credit memo |
| Depends on free text, images or documents | Language or vision model, schema-bound output | Read a dispute email |
| Is a prediction from historical rows | Tabular model, calibrated probability | Is the dispute valid? |
| Is a forecast over time | Time-series model or a simple baseline | 13-week cash forecast |
| Chooses among feasible plans | Solver | Safety stock levels |
| Must be identical for identical inputs, for audit | Deterministic, even if a model could do it | Revenue recognition rule |
Book, Ch 03.
The model proposes; deterministic rails dispose
Six rails can accept, reject, limit or reshape a proposal without asking the model. Each fails closed. Book, Ch 07
- Schema: the proposal has the right shape.
- Validator: values make sense, such as a credit no larger than the invoice line.
- Policy engine: the action is allowed for this actor, channel and amount.
- State machine: only legal next steps happen, in order.
- Ledger: a posted fact is final; a reversal is a new entry.
- Safety controller: physical motion stays inside certified limits.
A wrong answer about money, rights, identity or safety must come from a deterministic component. The model only presents it. Book, Ch 07
The confidence threshold
Act automatically only when the expected gain beats the expected loss. The threshold is p* = L ÷ (G + L): G is the gain when right, L the loss when wrong. Book, Ch 03
| Credit amount (USD) | Loss if wrong (USD) | p* | Decision at 0.87 |
|---|---|---|---|
| 1,000 | 180 | 0.64 | Post (L3) |
| 3,400 | 420 | 0.81 | Post (L3) on a channel past 90 days |
| 5,000 | 580 | 0.85 | Post (L3), at the hard limit |
| 7,800 | 860 | 0.90 | Person (L2): over limit and below p* |
Illustrative, with G = USD 100 for a pricing dispute. Book, Ch 03.
- The threshold rises with the amount, so one confidence cut-off for all cases is wrong.
- The root cause changes the loss. For a damage claim at USD 3,400, p* is 0.95, and the same 0.87 score goes to a person.
- The hard limit stays, because calibration is thin at high amounts and auditors want a ceiling a person signed.
- p* means nothing unless the model’s probabilities are calibrated. Use calibrated scores to route, never to approve. Book, Ch 03 and Ch 07
Three bands for interactions
| Band | Calibrated confidence | Route |
|---|---|---|
| Green | 0.95 or more, and all rails pass | Act at the step’s permitted level |
| Amber | 0.80 to 0.95, or one soft check fails | Confirm with the person or send to a reviewer |
| Red | Under 0.80, or any hard check fails | Fall back; do not act |
Thresholds illustrative. Book, Ch 07. Compute a threshold per step in the workflow designer.