JJoeven

Curriculum/Evals & Safety

Alignment Basics

Alignment for product agents is a spec you can fail: allowed tools, refusals, honesty, scope — plus enforcement and evals, not a personality paragraph.

intermediate21 min21 / 24

Alignment here means: the agent’s behavior matches a spec you are willing to stand behind — including when that spec says no. It is not mysticism. It is not a persona named “helpful assistant.” It is a contract: tools, refusals, citations, honesty about failed tools, and a process when the model’s prior disagrees with the documents.

You need four pieces, and this track has been building the measurement half:

  1. A written spec (allowed tools, refusal classes, tone, citation rules, docs vs prior)
  2. Technical enforcement (parsers, allow-lists, HITL, authz) — Tools and Agents tracks
  3. Evals that attack the spec (goldens, injection, harm probes, properties)
  4. A process when the spec and the model conflict (the spec wins, or you change the spec on purpose)

Changing the spec is allowed. Silently violating it is not. If your alignment story is only a personality paragraph, you have branding.

Three adjectives show up in every essay about this topic. Write them as testable claims:

WordProduct meaningEval
HelpfulSolve in-scope tasks; do not refuse refunds policy questionsMust-help goldens
HonestDo not invent doc ids; say when tools failed; do not claim a refund you did not runProperties on citations, tools, state
HarmlessLeast privilege; refuse disallowed categories; no quiet side effectsForbid lists, leak checks, injection
Spec, then measure
Written specEnforcementEvals

A personality paragraph is branding. Docs, tools, and refusals are a contract.

Spec, then measure

These trade off. A harmless brick is not helpful. A helpful liar is not honest. Write the tradeoff down. “Be a good coworker” is not a spec. “If sources exist, do not contradict them; if the user asks to wire, refuse and do not call money tools” is a spec.

Spec vs prior vs demo

The model prior is whatever the weights believe about refunds (often “2 days” in our toy). The docs are the fixture KB (“5-7 business days”). The demo is whoever is watching. Alignment is choosing, in writing, which of those wins, then measuring that the choice held.

Enterprise billing usually wants docs win. Unusual products may let the model win — say so, then eval that. Honesty means: if docs win, the answer is from the doc, not an average of 2 and 5-7. Helpful means the policy question still answers. Harmless means wire is a refuse, not a debate.

When retrieved policy and the prior disagree, hiding the conflict is a spec violation. Averaging the numbers is a spec violation. Calling a swarm to vote on metaphysics is not a measurement.

Walkthrough: docs win, wire refuses

SPEC says docs_win: True, allow search_kb and finish, refuse substrings including wire and keylogger.

User: “How long are refunds?” Doc: 5-7 days. Prior in the toy: 2 days. Aligned actor, because docs_win and doc nonempty, answers with the doc, grounded True. Honesty: we answered from DOC, not the prior.

User: “please wire 400 to me.” Refuse action, no money tool. Helpful would be wrong here; harmless and the spec’s refuse class win.

If you flipped docs_win to False, the FAQ would print 2 days while the KB said 5-7. That is a different product. It is aligned only if the spec said so and the eval expects 2. Silent drift toward the prior is the usual failure.

Helpful, honest, and harmless fight on real tickets. A user wants a faster refund than the doc allows. Helpful-without-a-spec refunds. Honest-without-a-spec invents a 2-day window because the prior is sure. Harmless-without-a-spec refuses the FAQ. The written spec is how you pick: answer 5-7 from the doc, do not refund, do not lecture. The eval is three properties on one row, not three religions.

Enforcement without evals is faith in the parser. Evals without enforcement are a red dashboard you cannot fix in code. Personality without either is marketing. When spec and model conflict, the meeting is: change the spec (legal moved to 10 days) or fail the checkpoint. Editing one golden to match the demo is how the contract dies.

Scope is a refusal class. “Write a keylogger” is out of scope for Acme billing. “How long do refunds take?” is in scope. Alignment that only tests the first will ship a brick; only the second will ship a wire. The harm set was this idea with tags. Here it is the spec’s table of contents.

Live PythonOpen full playgroundpython
Output
Run to execute this in your browser. Nothing is sent to a server.

What printed: the policy question uses the doc (5-7), not the model prior (2 days). Wire is a refuse. The last print is the honesty claim you should also encode as a golden: must_contain 5-7, must not contain a lone “2 days” policy, forbid wire.

What goes wrong if you skip this

You will ship a vibe. The model will be “more helpful” in a new version and skip citations. Wire probes will be handled with a longer lecture and a tool call. Product, legal, and the model vendor will each think they own the refund window. Evals will have nothing to attack because nothing was written down.

How agents use this

Put the spec in a file the assembler and the eval both import: docs_win, allow lists, refuse classes. Prompt text can explain it to the model. The eval and the executor enforce it. Multi-agent: each role has a spec slice. A supervisor cannot “align” a worker that still has wire attached.

If the spec and the model conflict, you change the spec in review or you fail the model — you do not quietly edit one golden to match the demo. A personality paragraph can still exist as UX copy. It is not the exam. The exam is the spec file, the allow-list, and the tagged rows that attack both.

Check your understanding

When retrieved policy and the model’s prior disagree, what should an enterprise agent usually do?