This post was first published on the Raison blog. Raison is Coyotiv’s platform for managing AI prompts as a team: versions, environments, evaluations and rollbacks, without an application deployment.
Somewhere in your codebase there is a prompt that says “if the customer has asked this question more than twice, escalate to a human.”
That is not a prompt. That is an if statement wearing a costume.
It got there for an understandable reason: the prompt is the fastest thing in the system to change. No deploy, no review, no test suite. When a rule needs adjusting on a Friday afternoon, the prompt is where it goes. Do that for six months and the prompt has quietly absorbed retry logic, routing rules, formatting requirements, and three business policies that nobody can find.
The dividing line
Prompts hold intent and voice. Code holds control flow and invariants.
That sounds abstract until you turn it into a question you can ask about any single line:
If this instruction were silently ignored, would I want a test failure, or would I want a slightly worse answer?
If the answer is test failure, it belongs in code. A model that ignores your instruction 4% of the time is fine for tone and unacceptable for “never quote a price.”
Things that belong in code, always
- Retries and timeouts. A model cannot retry itself.
- Output parsing and validation. Asking for JSON is a request. Validating JSON is a guarantee.
- Routing between prompts or models. If the choice is deterministic, make it deterministic.
- Rate limits and cost caps. Never delegate spend control to something you are paying per token.
- PII redaction. Redact before the call, not by asking nicely.
- Hard policy gates. “Never provide medical dosages” is a filter, not a sentence in a system prompt.
The pattern: anything you would be unwilling to see fail 1% of the time.
Things that belong in the prompt
- Role and framing. Who the model is, what the task is, what a good answer looks like.
- Tone and voice. The part that is genuinely a writing problem.
- Few-shot examples. These are prompt content, and they are also the most under-versioned part of most prompts.
- Soft preferences. “Prefer bullet points for lists of more than three items.”
- Domain context. Product names, terminology, what your company actually does.
The genuinely gray areas
Output format. Both. Describe the shape in the prompt so the model aims at it; enforce the shape in code so downstream parsing never sees a surprise. Describing without enforcing is the single most common source of 3am pages in LLM systems.
Refusal behavior. The style of a refusal is prompt work. The set of things that must be refused is a policy artifact that deserves version history and an approval trail, whether or not it is physically stored in the prompt.
Chain-of-thought and reasoning structure. Prompt, mostly — but if a step in the reasoning has to happen for correctness, that step is a separate call with its own validation.
Why the line is worth drawing
The practical payoff is not architectural purity. It is that a prompt containing only intent and voice is a prompt you can actually review.
A diff on a prompt that mixes business rules with tone is unreviewable — every change looks equally risky, so reviewers either rubber-stamp it or block everything. A diff on a prompt that holds only intent is a five-line read where you can see immediately whether a constraint was removed. That is the difference described in our playbook for shipping prompt changes safely: the review step only works if the diff is small enough to mean something.
It also fixes the thing that pushed logic into the prompt in the first place. The reason people edit prompts instead of code is that prompt edits are fast. The fix is not to make prompt edits slow — it is to make them fast and tracked, which is what it means to treat prompt work as a build step. Speed then stops being an argument for putting the wrong thing there.
// The prompt holds intent. The code holds the invariant.
const prompt = await client.getPrompt("support-reply", {
variables: { customer_name, plan_tier },
});
const reply = await llm.complete(prompt);
// This is not a suggestion to the model. It is a guarantee.
const parsed = ReplySchema.parse(reply);
if (parsed.containsPrice && !plan_tier) {
throw new PolicyError("price_without_tier");
}
So the question to ask of any line is what should happen when it is ignored. If the answer is a failing test, write code. If the answer is a slightly worse sentence, write a prompt — and then version it anyway, because “slightly worse sentence” is still your product’s voice, and that deserves history.
Try Raison at raison.ist, or read how Coyotiv started Raison.



