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

  1. Pretrained once. The developer trains the model on a very large number of prediction tasks, many of them synthetic.
  2. One forward pass. You send rows with known answers and rows with the answer missing. No weights change.
  3. 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

StepDone byWhy
Understand the request; choose target and populationLanguage modelLanguage and judgment
Build the context from governed data productsTool (query)Deterministic, auditable
Predict with probabilitiesTFM, called as a toolStatistics, reproducible with a seed
Apply thresholds and limitsRules enginePolicy
Explain and draft the next actionLanguage modelLanguage

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

  1. Define the target precisely. “Paid more than 15 days after due date” is a target. “Late” is not.
  2. Define the decision time. Every feature must be known at that moment. This prevents leakage.
  3. Select features wide, and remove fields filled only after the outcome.
  4. Pick the context rows: recent, relevant, labeled cases, usually 6 to 24 months of closed cases.
  5. Choose sampling: stratify for rare outcomes; sample by time for drifting processes.
  6. Backtest with a time split, never a random one.
  7. Set the threshold from economics, not accuracy.
  8. 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

AspectContextMemoryRetrieval
What it isThe input to one model callA store the harness writes and readsA lookup that adds passages to context
Main riskToo much, stale or untrusted contentSilent drift; personal data kept too longWrong or unauthorized passages
ControlContext assembly rulesRetention, write rules, reviewAccess 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

  1. Policy before precedent. Load current policy and limits first. Past cases enter only as evidence, with their date and policy version.
  2. Like for like. Retrieve precedent with the same entity class, the same policy version and a confirmed outcome.
  3. Cite every loaded fact and flag what is missing. An agent that cannot cite says what it lacks rather than guess.
  4. 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 questionUse
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 productLoad 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

ModeWhat runsWhen
OfflineGolden set, trajectory checks and adversarial testsEvery change of agent, model, tool or policy version
OnlineSamples, seeded cases, blind checks, judge scores and drift monitorsContinuously; 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

  1. Who acted: agent, version, identity?
  2. What was it authorized to do?
  3. What did it actually do, including blocked attempts?
  4. On whose behalf did it act?
  5. Why: which inputs, rules and evidence?
  6. Which version acted: agent, model, prompt, skills, tools?
  7. 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.

Open the controls library Open the decision trace viewer

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

  1. Separate reading from writing. An agent that reads untrusted text holds no write tool to sensitive objects.
  2. Type the hand-off. An instruction cannot travel in a field typed as a number.
  3. Gate irreversible actions. Bank detail changes need a call-back outside the agent.
  4. Limit egress. An agent holding confidential data has no open channel out. Review the allow-list monthly.
  5. Segment agent teams. Agents that can find each other sit in a team of equal privilege.
  6. 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

TierWhat the agent may doEntry evidence
T0 UnknownNothing; requests are logged and refusedNone
T1 SandboxCall test tools on synthetic dataVerified identity; contract annex
T2 ReadRead its own records through filtered toolsSandbox passed; owner and security chief sign
T3 Act within limitsCreate or update cases within caps90 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

WorkBudget (illustrative)
InteractiveUnder 2 seconds. A call slower than 5 seconds at p95 never sits inside an interactive flow.
Voice, to first audio750 to 1,200 milliseconds, with a scripted acknowledgment while tools run
Event-driven agent stepUp to a minute
BatchHours

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…ThenExample
Has a written rule a clerk applies without judgmentCode or a rules engineThree-way match tolerance
Changes a legal record or moves moneyDeterministic commit after routingPost a credit memo
Depends on free text, images or documentsLanguage or vision model, schema-bound outputRead a dispute email
Is a prediction from historical rowsTabular model, calibrated probabilityIs the dispute valid?
Is a forecast over timeTime-series model or a simple baseline13-week cash forecast
Chooses among feasible plansSolverSafety stock levels
Must be identical for identical inputs, for auditDeterministic, even if a model could do itRevenue 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

Threshold by credit amount for a pricing dispute, with a model score of 0.87
Credit amount (USD)Loss if wrong (USD)p*Decision at 0.87
1,0001800.64Post (L3)
3,4004200.81Post (L3) on a channel past 90 days
5,0005800.85Post (L3), at the hard limit
7,8008600.90Person (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

BandCalibrated confidenceRoute
Green0.95 or more, and all rails passAct at the step’s permitted level
Amber0.80 to 0.95, or one soft check failsConfirm with the person or send to a reviewer
RedUnder 0.80, or any hard check failsFall back; do not act

Thresholds illustrative. Book, Ch 07. Compute a threshold per step in the workflow designer.

Back to the model families Propose, validate, route, commit

Talk to the book