You want to change your agent's system prompt. How do you ship it without finding out from customers that you broke something?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Treat the prompt, the tool definitions, and the model version as a single versioned artifact, because changing any one of them regresses behaviour identically. That is the core insight: teams version their code and leave the prompt in a string literal anyone can edit, then wonder why quality moves without a deploy.
Full worked answer with diagram
Treat the prompt, the tool definitions, and the model version as a single versioned artifact, because changing any one of them regresses behaviour identically. That is the core insight: teams version their code and leave the prompt in a string literal anyone can edit, then wonder why quality moves without a deploy.
The artifact. One bundle: system prompt, tool schemas and descriptions, model ID, sampling params, budget limits. Immutable, content-hashed, tagged on every trace span. If you cannot answer "which agent version produced this trace", you cannot correlate a regression with a change, and that is the whole game.
The pipeline:
- Offline eval gate. Run the candidate against your task set. Gate on pass^k, not pass@1, because a change that raises capability while lowering consistency is a regression users will feel. Also gate on cost per successful task and steps per task, since prompts that improve quality by rambling into more tool calls are a real and common outcome.
- Shadow. Run the candidate against a sample of live traffic with tools mocked or restricted to reads, and diff trajectories against production. Do not diff strings, diff decisions: which tools were called, in what order, was the final state equivalent. This catches distribution shift your eval set does not cover, which is most of it.
- Canary by cohort. 1%, then 10%, low-blast-radius tenants first. Route by tenant, not per request, because flipping versions mid-conversation gives you an agent that contradicts itself and traces nobody can interpret. Long-running agents finish on the version they started with: pin at run creation, resume on the pinned version.
- Rollback on the right metric. Not error rate. Agents fail silently, every span returns 200 and the task is wrong. Watch task success rate, human intervention rate, escalation rate, and the share of runs hitting max iterations. Those move before complaints do.
Going further: follow-up territory
The honest caveat. Eval sets rot, and the confidence interval on a 200-task eval is wide enough that small deltas are noise. So evals gate against large regressions and canaries are the real detector. And when a provider silently updates a model under you, none of this helps unless you pin model versions and treat upgrades as deliberate, tested changes.
Worth sketching. Drawing it as a release pipeline shows the prompt is a versioned artifact moving through gates, not a string someone edited.
flowchart LR
A["Bundle: prompt + tool defs<br/>+ model id, content hashed"] --> B["Offline eval gate:<br/>pass^k, cost per success"]
B --> C["Shadow on live traffic,<br/>diff decisions not strings"]
C --> D["Canary by tenant,<br/>1% then 10%"]
D --> E{"Success rate, intervention rate,<br/>share hitting max iterations"}
E -->|"degraded"| F["Roll back; in-flight runs<br/>finish on their pinned version"]
E -->|"stable"| G["Full rollout"]
What a good answer covers
- Treat the prompt, the tool definitions, and the model version as a single versioned artifact, because…
- That is the core insight: teams version their code and leave the prompt in a string literal anyone can…
- One bundle: system prompt, tool schemas and descriptions, model ID, sampling params, budget limits
- Immutable, content-hashed, tagged on every trace span
- If you cannot answer "which agent version produced this trace", you cannot correlate a regression with a…
Key terms: The artifact · The pipeline · Offline eval gate · pass^k, not pass@1 · Shadow · Canary by cohort · Rollback on the right metric
Interviewer follow-ups to expect
Your eval set says the new prompt is 3% better. Is that real?
How do you build an eval set that does not rot?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep