FDE Times dataFDE jobs open 932▼14 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 62Companies hiring 202Remote-friendly 24%Median US pay $201kTop hirer Databricks 92
中文VI

The newspaper of the Forward Deployed Engineer

Guides

To turn a client's SOP into a prompt, write the tests first

Model output shifts with every snapshot, so only past cases with known correct answers can prove a prompt will still work next month.

ShareLinkedInFacebookX

In brief

  • LLM output is non-deterministic and changes between model snapshots, so a prompt that works today still needs rechecking after every model change.
  • SOPs are already written as numbered steps. Keep that order and add the reason behind each rule so the model can handle cases the SOP never mentions.
  • The exceptions in an SOP are the best source of examples. Wrap them in example tags so the model does not confuse examples with instructions.
Diagram of a loop around a test case set: run all tests, compare with baseline, change one thing, then run again. An orange box reading "New model snapshot" enters the loop at the run-all-tests step.
The test suite comes before the prompt and becomes the regression check each time a client upgrades its model.

OpenAI’s API documentation contains a sentence every FDE should tape to their monitor: LLM output is non-deterministic, and model behavior changes between snapshots and model families. A prompt that gives a client a flawless demo today can drift next month without anyone changing a word.

When you work with a client, the best source of instructions is usually already in their hands: the standard operating procedure, or SOP. New staff read it to learn how to handle a refund request or classify a complaint. Your job is to turn that same document into a prompt the model follows consistently, and to prove that it does.

This guide walks through a hypothetical example from start to finish. The overall structure comes from the five steps in Google’s Prompting Essentials course (task, context, references, evaluate, iterate). The details come from Anthropic’s prompt-writing guidance.

What will you build, and what do you need?

Take a client that runs an e-commerce marketplace and has an SOP for handling refund requests. You need to produce two things. The first is a prompt that takes a buyer’s request and returns a decision (approve, reject or escalate to a human) with a reason. The second is a set of test cases to score that prompt.

You need the latest version of the SOP and a batch of past cases that staff have handled, with the correct decision recorded. You also need access to a model, and a colleague who has never read this SOP. Do not skip the colleague: you will need them in step 6.

Step 1: Write the tests before the prompt

The natural reflex is to open an editor and start writing the prompt. Do the opposite. OpenAI recommends starting with evals that measure model output to establish a baseline, and only then iterating: edit the prompt, measure again. With an SOP, you build the evals from the client’s historical cases; the baseline number arrives in step 2, when you run your first prompt through this suite.

The format below is just one simple way to organize the cases for illustration, not a required standard:

{"id": "c01", "input": "Order delivered 6 days late, buyer requests a refund", "expected": "approve"}
{"id": "c02", "input": "Buyer has used the product, requests a refund after changing their mind", "expected": "reject"}
{"id": "c03", "input": "High-value order, photo proving the defect is blurry", "expected": "escalate"}

Check: every case must have an answer confirmed by the client’s operations lead, not one you guessed yourself. The suite must also include hard cases, the ones where staff had to check with a manager. A suite full of easy cases produces a nice score that tells you nothing.

Step 2: One sentence for the role, one for the task

Anthropic says that setting a role in the system prompt helps the model focus on the right behavior and tone for your use case, and that even a single sentence makes a difference. This step costs very little. Next comes the task part of Google’s framework: one sentence that states clearly what the output is.

You are the marketplace's refund handler, and you follow the internal procedure exactly.
Task: read the request in the request tag and return one decision
(approve / reject / escalate) with a short reason that cites the relevant SOP step.

Check: run the step 1 suite right away against this rough version. The number you record now is your baseline, the mark against which every later edit is compared.

Step 3: Keep the SOP’s order, and add “because”

SOPs are usually written as step 1, step 2, step 3, and that works in your favor. Anthropic recommends numbered lists when order or completing every step matters, along with stating the output format and constraints explicitly. So do not merge the steps into a paragraph.

Copying the rules is not enough, though. According to Anthropic, explaining the reasoning behind an instruction helps the model understand your goal. Compare these two versions:

Before: Orders above the high-value threshold are escalated to a human.

After:  Orders above the high-value threshold are escalated to a human,
        because a wrong decision on these orders causes large losses
        and requires sign-off from someone with authority.

The second version tells the model why the rule exists. So when it meets a case the SOP did not anticipate, such as a low-value order with signs of fraud, the model has grounds to escalate instead of guessing.

The reason behind each rule usually lives in the operators’ heads, not in the document, so you have to ask them.

Step 4: Use tags to separate rules, documents and input

A real SOP prompt usually holds several things at once: the main procedure, policy appendices, examples and the request to be handled. Anthropic recommends nesting XML tags when content has a natural hierarchy, for instance putting the documents inside a documents tag, with each one inside a document tag that has an index attribute.

The sample blocks from here on use square brackets in place of the XML tags’ angle brackets so they display cleanly; in a real prompt, use angle brackets.

[documents]
  [document index="1"] Refund SOP, numbered steps with reasons [/document]
  [document index="2"] Appendix: list of non-refundable items [/document]
[/documents]
[examples]
  ... see step 5 ...
[/examples]
[request]
  ... the buyer's request ...
[/request]

Check: reread the prompt and ask whether any sentence sits outside a tag where the model could mistake it for input data. If so, move it to the right place.

Step 5: Turn the SOP’s exceptions into examples

Anthropic calls examples one of the most reliable ways to steer the format, tone and structure of output. Good examples must be close to the use case and diverse enough: they should cover edge cases and differ enough that the model does not pick up patterns you never meant to teach.

The “notes” and “special cases” sections of an SOP are a ready-made source of examples. Take them from real historical cases, and wrap each one in an example tag so the model can tell examples from instructions:

[example]
  [request] Low-value order, buyer has sent 3 refund requests in one week [/request]
  [decision] escalate [/decision]
  [reason] Step 5: an unusual frequency of requests needs a human to review. [/reason]
[/example]

Common mistake: all three examples end in “approve”. The model may conclude that approving is the safe answer. Spread the examples evenly across the decision branches. And do not reuse cases from the test suite as examples, because that inflates the score.

Step 6: Give it to a colleague before you give it to the model

Anthropic has a “golden rule”: show the prompt to a colleague who knows almost nothing about the task and ask them to follow it. If they are confused, the model will be too. The test suits SOPs well, because SOPs often quietly assume the reader has absorbed the company’s internal culture.

Say the colleague asks: “What is the high-value threshold?” That is a number the client never wrote into the SOP. Ask the client, put the number in the prompt, then add a test case sitting right at the threshold.

Step 7: Measure, fix, and measure again when the model changes

Google’s course treats evaluating output and refining the prompt as the key to getting the results you want. In other words, an SOP prompt is never written once and finished. After every edit, rerun the full suite and compare against the step 2 baseline.

Change one thing at a time, so you know exactly which change moved the score up or down.

Handover does not end the work. Because model behavior changes between snapshots, every time the client upgrades the model, your test suite becomes a regression suite. Agree with the client from the outset that nobody switches the production model until the suite passes.

Why does the hardest part sit with the client?

Looking back over the seven steps, most of the raw material sits with the client: the reason behind each rule, past cases with known answers, thresholds nobody wrote down. So when you plan a real project, budget more time sitting with the operators than writing sentences.

The prompt is only a record of what you have understood about the client’s process.

A tip for reading FDE job descriptions: any line that mentions evals, working with operations teams, or turning business processes into working systems is where this skill gets used. On your CV, do not write “proficient in prompt engineering”.

Be specific instead: how many historical cases you built the eval suite from, how far accuracy rose above the baseline, and how you caught a regression when the model changed.

The client will not remember how well your prompt was written. They will remember the day the vendor shipped a new model and your test suite caught the error before it reached a buyer.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
3 sources
Read next on the roadmap · Stage 3: Applied AIIn tool calling, the model proposes and your code executesAnthropic, OpenAI and Google describe the same contract, which shows FDEs exactly where to put the checks a client's security team will ask about.