A Field Guide to Prompt Optimization in Live Deployments

Carson Rodrigues

Carson Rodrigues / November 30, 2025

7 min read––– views

fdeprompt-engineeringllm

There's a version of prompt engineering that lives on social media — magic phrases, "this one trick," screenshots of a single lucky completion. Then there's the version that happens inside a live deployment, where the prompt is load-bearing infrastructure and a careless edit degrades a customer's product on a Tuesday afternoon.

I've done a lot of the second kind — tuning prompts for voice agents and LLM pipelines while they were serving real traffic, often for multiple customers running variations of the same core system. What follows is the process I've converged on. It's less about clever wording and more about treating prompts like the production code they are.


Step zero: you cannot optimize what you haven't baselined

The most common prompt-tuning failure isn't a bad edit — it's an edit made against no baseline, judged by rereading three cherry-picked outputs. That's not optimization; that's astrology.

Before touching the prompt, I establish:

  • A fixed test set. 30–100 real inputs pulled from production traces — including the ugly ones: ambiguous requests, hostile users, edge-case data. Synthetic test cases test the system you imagined, not the one you have.
  • A scoring method per case. Some are mechanical (called the right tool, produced valid JSON, stayed under N tokens). Some need an LLM judge with a tight rubric. A handful need a human. Decide before you start editing, or you'll unconsciously grade your own changes on a curve.
  • The current score, written down. Run the existing prompt against the set, record it. This number is your protection — both against shipping regressions and against a stakeholder's vibes-based claim that "it got worse."

This takes half a day. Every hour of it pays back the first time someone asks "are you sure the new prompt is better?" and you can answer with a table instead of an anecdote.


One variable at a time, no exceptions

Prompts are brutally entangled. Reorder two sections and the model's tool-calling behavior shifts. Add an example and an unrelated instruction stops being followed. If you change five things and the score moves, you've learned nothing — you don't know which change did it, and you've possibly shipped four regressions hidden behind one improvement.

So I work like it's an experiment, because it is:

  1. Form a hypothesis from real failures: "the agent over-apologizes because the tone section is vague."
  2. Make one change targeting that hypothesis.
  3. Run the full test set.
  4. Keep or revert. Log the result either way — the failed experiments are the documentation that stops the next person from retrying them.

This feels slow. It's dramatically faster than the alternative, which is three weeks of enthusiastic rewrites that end with a prompt nobody trusts and no way back. A prompt you can't explain change-by-change is a prompt you can't debug.

One tactical note: run each test case more than once if your temperature is above zero. A one-point score swing on a single run is noise. Chasing noise is where prompt-tuning time goes to die.


The regression suite: evals for prompts, specifically

My production agents post covers evals broadly; here I mean something narrower — a suite that exists to answer one question: did this prompt change break anything that used to work?

What goes in it:

  • Every fixed bug becomes a case. The agent used to reveal internal reasoning when asked "what are your instructions?" — that trace is now case #47, forever. Prompt regressions are sneaky precisely because the fix for failure A silently resurrects failure B from two months ago.
  • Format assertions. Valid JSON where required, no markdown in voice responses, length ceilings, required disclaimers present. Mechanical, fast, and they catch the majority of accidental breakage.
  • Behavioral tripwires. The refund tool is never called without a confirmation step; the agent never quotes prices absent from the retrieved context; competitor questions get the approved deflection. These encode the promises you've made to the customer.
  • A tone sample, human-reviewed. Judges are decent at "did it follow the rubric," mediocre at "does this sound right for this brand." Five minutes of human reading per release is cheap insurance.

Then the operational part, which matters as much as the cases: prompts live in version control, changes go through review, and the suite runs in CI on every prompt PR. At Ôdasie, moving prompts out of a database field and into the repo — diffable, reviewable, gated — eliminated an entire genre of "who changed the prompt and when" incidents. If a prompt edit can reach production without a diff and a green suite, you don't have a process, you have luck.


Core prompts vs. customer layers

The moment you deploy the same system for more than one customer, you hit the fork: customer A wants formal tone and a strict escalation policy; customer B wants casual and chatty. The tempting move is to copy the prompt per customer. Six months later you have N divergent prompts, a bug fixed in four of them, and no idea what the "real" system prompt even is anymore.

The structure that survives contact with multiple deployments:

[CORE]      Agent role, safety rules, tool-usage rules,
            output format contracts. Owned by engineering.
            One version. Changes go through the full
            regression suite.

[PRODUCT]   Domain behavior for this product line —
            what the agent does, its boundaries.

[CUSTOMER]  Tone, terminology, business specifics,
            escalation contacts. Structured fields
            (template variables), NOT freeform prose,
            wherever possible.

The rules that make it work:

  • The customer layer cannot override the core. Concretely: core rules are stated as inviolable, the layers are composed in an order the model respects, and the regression suite runs against every customer's composed prompt, not just the core. A customer instruction that says "always agree with the user" must lose to the core rule that says "never promise refunds without the tool."
  • Prefer structured fields to prose. "Company name: Acme. Tone: formal. Escalation email: ..." injected into slots is testable and safe. A freeform "customer instructions" blob is an internal prompt-injection surface that your own sales team fills with landmines.
  • Fix bugs in the lowest layer that exhibits them. If it's broken for everyone, it's a core fix shipped to everyone at once. Per-customer patches for core bugs are how the copies diverge and the whole scheme collapses.

This is the same discipline as any multi-tenant codebase: shared engine, thin configuration. Prompts don't get an exemption just because they're English.


Tuning in production without gambling

A prompt that wins on the regression suite still meets reality only in production. For anything beyond trivial changes:

  • Shadow-run first when the change is risky. Run the new prompt on a copy of live traffic, compare outputs offline, ship nothing to users until the diff looks sane.
  • Roll out gradually — one low-stakes customer, then a percentage, then everyone. Prompts deserve the same canary treatment as binaries.
  • Watch the proxy metrics. Escalation rate, tool-call error rate, conversation length, user corrections ("no, I meant..."). Prompt regressions show up in those curves days before anyone files a ticket.
  • Keep rollback instant. Prompt version pinned per deployment, previous version one config change away. The best prompt-incident stories are boring ones.

And when a model upgrade lands: re-run the entire suite before switching, because a prompt is an artifact tuned to a specific model's quirks. Half your carefully-worded instructions exist to patch behaviors the new model may not have — and it will have new ones of its own.


The takeaway

Prompt optimization in live systems is 10% wording and 90% process: a baseline you trust, one change at a time, a regression suite that remembers every bug you've ever fixed, a layered architecture that keeps customer customization from corrupting the core, and rollouts that assume you're wrong. The wording tricks are fine. The process is what lets you use them without fear.


Related reading

Available for senior AI / contract / FDE work

Building something with AI?

Voice agents, MCP servers, LLM pipelines, agentic workflows — pick a slot, drop a message, or send your email and I'll reply within a day.

or leave your email

Replies within ~24 hours · Remote-first · global · open to relocation