On a Friday afternoon, a well-meaning engineer edited Relay's live drafting prompt to sound warmer. It took four minutes. By Monday, nurses reported drafts promising things Relay cannot verify, like guaranteed callback times. Nobody knew exactly what had changed: there was no version, no diff, no test run to point at. Restoring the old wording took two days of guesswork, while Tom's pool edited around the problem by hand.

The edit took four minutes. The missing contract cost two days of trust.

A prompt is a contract

Think of a rental agreement: it names who provides what, what the other side can rely on, and who to call when something breaks. A production prompt deserves the same clarity, because other systems and people build on its behaviour.

Relay's drafting prompt contract states five things. Inputs: the message thread, the patient summary, and the appointment facts from the lookup. Nothing else is promised to be present. Output shape: a draft in the agreed schema, because downstream code parses it, so the shape is a guarantee, not a hope. Guarantees: what the surrounding system enforces. Owner and version: a named owner, a version number and a changelog entry for every change, however small. Non-guarantees: what the prompt asks for but cannot promise, stated honestly so nobody designs on it.

A paper contract binds both sides. A prompt binds only your side. The model can still drift, which is why the contract pairs every promise with either code or an eval.

Requests in the prompt, guarantees in code

The drafting prompt asks for things: be warm, be brief, cite only facts present in the inputs, never invent a callback time. The prompt asks; the model usually complies. But Relay never sends without a nurse approving, and that rule is code, not a prompt line. The output schema is validated in code. Tool permissions decide what the agent may call at all.

The contract's guarantee list may only contain the enforced kind. The moment a requested rule is written up as a guarantee, someone downstream designs on it, and the first model slip becomes their incident. Honest contracts list requests under non-guarantees, with the eval that watches them. "The prompt says never, so it is guaranteed" is the mix-up that ships incidents.

Changes are releases, gated by evals

A change travels a fixed path. A change request states the problem, the exact wording change and the expected effect. The edit gets the next version number, a diff and a changelog entry before anyone tests it. The 400-case golden set runs: acceptance, unsafe rate and the contract's watched metrics. One failing gate is a fail. Acceptance cannot outvote an unsafe or unverifiable-promise rise. Passing changes roll out in stages with the previous version ready to restore. Failing ones return with their numbers attached.

The warmer edit, judged by that gate, tells the story in numbers. Proposal: add the line "be warmer and reassure the patient" to the drafting prompt. Acceptance: version 7 scores 71 percent, that is 284 of 400 drafts accepted. Version 8, the warmer draft, scores 76 percent, that is 304 of 400. A gain of 20 more accepted drafts. Unverifiable promises: version 7 has 3 cases with a promise Relay cannot verify, like a guaranteed callback time. Version 8 has 7 cases. More than double, 3 to 7 on the same set. Unsafe rate: unchanged, and still under the 0.5 percent ceiling.

Gate verdict: reject. Acceptance rose 5 points, but a watched contract metric more than doubled. Vibes said warmer is better; the guarantee list said drafts must cite only verifiable facts, and the gate caught what vibes missed. The fix that later passed aimed warmth at wording nurses control, plus an explicit line that times and outcomes are stated only when present in the inputs. Same gate, both metrics green.

Rollback is part of the release

Rollback is not an improvisation. The previous version stays deployable, the switch back is one operation, and the team has rehearsed it. If restoring the old prompt takes two days, you do not have rollback, you have archaeology.

The change policy around the contract is short. Anyone may propose: nurses, engineers and clinicians all see failure modes the others miss. Proposals are cheap; releases are not. The owner decides, accepting or rejecting after the gate, and owns the changelog. Some changes are not prompt changes: a new rule that must always hold belongs in code, and a new tool instruction changes the tool contract too. Timing is policy: no live edits on a Friday, no unversioned hotfixes. Urgent safety fixes use the same path, faster, with the gate run first and the steering group told the same day. And the rejected version stays in the history. A changelog that only records successes teaches the next engineer to repeat the failure.

So the decision rule is this: if a prompt change has no version, no gate result and no rollback, it is not a change, it is an incident waiting for a date. Wording is behaviour. The warmer tweak doubled unverifiable promises, and the only reason the team could prove it was the golden set from the previous chapter, run before the edit shipped.

The full interactive chapter is free at https://deployedlab.dev/lessons/ccap-20-prompts-as-contracts, with the hands-on lab where you write Relay's prompt contract and change policy. There are 79 chapters free with no signup across the bundle, and the full bundle is $5 a month or $39 a year at https://deployedlab.dev.