What Is an Output Contract?
An output contract is a prompt section that specifies exactly what the finished response must look like before the model writes a single word: format, length, structure and what to leave out. Instead of describing the topic and hoping for the best, you spell out the shape of the answer, the same way a work order spells out deliverables before a contractor starts.
This single habit is why some people get sharp, usable drafts from ChatGPT, Claude or Gemini every time, while others get something different each session even when the topic prompt looks almost identical.
Why Your Prompts Work Sometimes and Fail Other Times
When a prompt only describes a topic, the model has to guess at the format, length and tone you want. It picks the statistically likely "average" answer for that kind of request, and that average shifts slightly every time depending on how the request is worded.
That is why the same short prompt, typed twice, can come back as a bullet list once and a full paragraph the next time. The model is not being unreliable. It is filling in gaps you left open, and it fills them differently each time.
This shows up constantly in real workflows: ask for "a summary of this article" three separate times and you might get a five-bullet list, a two-paragraph overview, and a single dense paragraph, in that order, with no change to the request itself. Each version is individually reasonable. None of them is predictable, and predictability is exactly what you need when a deliverable is going straight to a client or a manager. An output contract closes those gaps before generation starts. According to Anthropic's own prompt engineering documentation, structuring a prompt with clearly separated role, context, task and output sections produces noticeably more consistent, parseable responses than a single unstructured paragraph.
The 4-Part Output Contract Framework
Every reliable prompt needs four parts, in this order: a role that sets the model's perspective, context that gives it your specific situation, a task that states the single deliverable, and an output format section that locks the shape of the answer. A constraints line at the end removes the generic filler language models default to.
Here is a complete, copy-paste-ready template you can adapt for almost any writing task:
Try This Prompt:
<role>You are a senior content editor for a Hong Kong marketing agency.</role>
<context>I am drafting a 300-word LinkedIn post announcing a new AI feature. My audience is Hong Kong SME marketing managers who already use AI tools daily.</context>
<task>Write the LinkedIn post.</task>
<output_format>
- Exactly 3 short paragraphs, no more than 4 sentences each
- End with one question to invite comments
- No hashtags, no emojis
</output_format>
<constraints>Do not use the words "revolutionize," "game-changer," or "unlock." Keep the tone conversational, not corporate.</constraints>
Run that exact prompt five times and the structure barely moves. Remove the output_format and constraints sections and run it five more times, and you will see paragraph counts, tone and length drift noticeably between attempts.
Applying This to a Real Marketing Brief
Say you need a client-ready content brief from a rough internal note. A vague prompt like "turn this into a content brief" produces a different structure every time: sometimes a list, sometimes prose, sometimes missing the deadline or target keyword entirely.
Add an output contract instead: role as a content strategist, context including the client industry and the internal note, task as "produce a one-page content brief," and an output_format specifying the exact six fields you need (objective, audience, key message, format, deadline, success metric) with a one-sentence limit per field.
The result is a brief your team can act on immediately, in the same layout every single time, whether you run it on Monday morning or Friday night.
The same fix applies to weekly client reports. Marketing teams that ask for "a summary of this month's campaign performance" get wildly different structures each time, sometimes prose, sometimes a data dump, rarely both a headline and the supporting numbers together. Adding an output_format section that fixes the order (one-line headline, three supporting metrics, one recommendation) turns a report that used to take three rounds of edits into something a client can read in ninety seconds, every single month.
Freelancers juggling several clients get an extra benefit here: once an output contract is dialed in for a recurring deliverable, such as a weekly social content calendar or a monthly SEO update, it can be saved and reused as a template, cutting the setup time for that task to almost zero.
Applying This Across Claude, ChatGPT and Gemini
Claude was trained to recognize XML-style tags like <role> and <output_format> specifically, so wrapping sections in tags produces a measurable jump in consistency compared to plain paragraphs.
ChatGPT responds just as well to the same four-part structure written as labeled headings ("Role:", "Context:", "Task:", "Output format:") rather than XML tags, and system-level instructions persist across a longer chat thread if you set them once at the top.
Gemini benefits most from an explicit output_format section when you need structured data such as a table or numbered list, since without it Gemini tends to default to longer, softer prose than either of the other two models. All three models also respond well to a short example of the desired output pasted directly into the context section: showing one finished sentence in the exact tone and length you want typically locks in the pattern faster than describing it in words.
Common Mistakes That Break Output Contracts
Stacking too many constraints in one line is the most common failure. Five or six rules at once causes models to satisfy the easy ones and quietly drop the harder ones. Keep constraints to two or three per prompt and add more only if the output still misses the mark.
A constraint with no reference point is the second failure. "Keep it concise" means something different to every model. "No more than 120 words" or "exactly 3 bullet points" removes the ambiguity entirely.
Skipping the output_format section for one-off, low-stakes questions is fine. The technique matters most for anything you will run more than once, share with a client, or paste directly into a deliverable.
The last mistake worth flagging is treating the contract as permanent. A format that works for a LinkedIn post will not automatically work for an internal Slack update or a client email. Rewrite the output_format section for each distinct deliverable type rather than reusing one template everywhere and hoping the model adapts on its own.
Try It Now
Take a prompt you use every week and rewrite it with all four sections: role, context, task and output_format. Run it three times back to back and compare the outputs side by side. If they look nearly identical, the contract is doing its job.
The Takeaway
Inconsistent AI output is rarely a model problem. It is almost always a missing-instructions problem, and an output contract is the fastest way to close that gap without rewriting your whole workflow.
Before you build this into a bigger automated workflow, it is worth checking whether your current AI setup is actually ready to support it. UD's AI Ready Check is a free, quick way to see where your team's AI habits already work and where they quietly fall apart, the same gap this technique is built to close. It pairs well with the persona-based approach covered in our persona and anti-goal prompting guide, if you want to layer both techniques together.
We understand AI. We understand you better. With UD by your side, AI doesn't feel cold.
Ready to Build a Reliable AI Workflow?
Now that you have the technique, the next step is building it into a workflow that runs reliably every time. We'll walk you through every step, from prompt structure to full AI readiness across your team.
Reviewed by the UD AI team.