Skip to main content
These habits apply to any prompt you write, anywhere. Read Best practices before you write. Use What to avoid as a checklist. Use Fixing a prompt that failed when something has already gone wrong. To learn which prompt each instruction belongs in, see Cloud Employee and data capture.

Best practices

A good prompt tells your AI agent three things: who it is, what a good result looks like, and how to decide what to do next. Most problems come from leaving one of those out, saying it two different ways, or hiding a mistake under a new rule.

Know the job before you write

First, write down the role, the situations it needs to handle, and what a good result looks like. You do not have to paste all of that into the prompt. But you do need it written down somewhere, or your later edits have nothing to aim at. Don’t
Sound professional and handle whatever comes up.
Do
You review internal design documents. A good result is a short list of risks and open questions, not a rewrite of the whole document.

Show the behavior you want

One short example works better than a pile of extra rules. Give a realistic request, then show the answer you want. Don’t
Always be helpful when someone is vague.
Do
If someone says “summarize this,” reply with five bullet points: the goal, the decision needed, the risks, who owns it, and the deadline.

Leave room for the way people really talk

People rarely use the exact words you expect. A script that only accepts one phrasing will fail on normal writing. Save strict rules for the places you truly need them. Don’t
Only accept a date if it is written as 2026-09-22.
Do
If someone writes “next Tuesday” or “the 15th,” work out the date. Ask only when you cannot tell which date they mean.

Break the prompt into labeled parts

Give each part a label, such as identity, goals, rules, and examples. You do not need any special formatting. A reader should be able to tell at a glance what each part is for. Don’t
One long paragraph that mixes tone, rules, formatting, and rare exceptions.
Do
You can also label sections with XML tags. XML is just a way of marking where something starts and stops, using angle brackets. You write an opening tag before a section, then the same tag again after it with a slash in front:
You pick the tag names yourself. The only rule is that the closing tag has to match the opening one. The benefit is that your AI agent can see exactly where each section ends, which helps most on long prompts.This is optional, and it will not rescue a prompt that contradicts itself. If you use tags, wrap whole sections and stay consistent. Do not scatter them around single sentences.

What to avoid

These problems come up again and again. If you only skim one list, skim this one.

Asking for something it cannot do

Do not ask for actions your AI agent is unable to take, such as pausing for a set number of seconds or remembering someone after the conversation ends. Don’t
Wait 10 seconds, then keep going. Remember this person forever.
Do
If you need information you do not have, ask for it, or say you cannot finish that step.

Conflicting instructions

Do not explain the same decision two different ways. Your AI agent will follow one or the other, and you cannot predict which. The result looks unreliable even though nothing is broken. Don’t
In one place: “It is urgent if they mention a deadline.” In another place: “It is urgent only if they say the word urgent.”
Do
Choose one meaning. Write it in one place. Delete the other version.

Overusing absolutes

A few firm rules are good, and some things really should be absolute. The trouble starts when most of your prompt is written that way. Every “always” and “never” takes away a little of your AI agent’s judgment. Stack up enough of them and there is no answer left that satisfies them all, so you get behavior you did not ask for. It may refuse, quietly ignore part of your prompt, or abandon the task. Save absolutes for the things that genuinely must never happen. Write the rest as guidance. Don’t
Never answer without a source. Always answer in one sentence. Always list every exception.
Do
Answer in a few sentences and include a source when you have one. Never invent a source.

Band-Aid fixes

A Band-Aid is a small rule you add to stop a behavior you just saw, without finding out why it happened. It covers the symptom and leaves the cause in place. It usually starts innocently. Your AI agent describes something in the past tense, which reads strangely, so you add “never write in the past tense” to the bottom of the prompt. A week later it answers as though it were the customer, so you add “never change point of view.” Each line seems harmless on its own. Two problems build up. First, the real cause is still in your prompt, so it keeps producing new symptoms for you to patch. Odd behavior almost always traces back to an earlier instruction your AI agent read too literally, or to two lines that disagree. Fix that line and the symptom disappears, along with the ones you have not run into yet. Second, the patches pile up. Months later nobody remembers which problem each line was for, or whether it is still needed, so nobody is willing to delete any of them. The prompt keeps growing, and every new problem gets harder to trace because there is more writing to search through. Don’t
Never write in the past tense. Never change point of view. Never say “unfortunately.” Never mention pricing first.
Four leftover patches, and no one can say what any of them were for. Do
Find the earlier instruction your AI agent read too literally. Change that line, and delete the patch you added last time.
If you truly need a Band-Aid right now, add it and write yourself a note about what it was for. That way the next person can tell whether it is still doing anything.

Fixing a prompt that failed

Your goal is to find the line that caused the problem. Adding a new rule on top is the wrong move.

1. Write down what should have happened

Write the request and the answer you expected. If you cannot describe it, the prompt was too vague before it ever failed.

2. Collect the prompt and the conversation

You need two things, not one. Every instruction that was in play. The main prompt, plus any other writing your AI agent was reading at the time, such as tool descriptions, field descriptions, and wording you added for phone calls or chat. The problem is often not in the prompt you just edited. The conversation and anything else it was working from. Copy the conversation from the beginning through the moment it went wrong, not only the last reply. Include whatever information your AI agent had been given, such as customer details or an answer that came back from a tool. The prompt alone is not enough. It tells you what your AI agent was told, but not what it was responding to. With the conversation in hand, you or a reviewing tool can point at the exact moment things went sideways and work backward from there.

3. Note exactly what went wrong

The request was X. Your AI agent did Y. You wanted Z.

4. Ask why it happened, not what to add

Paste everything you gathered in step 2 into another AI tool and ask which line caused the behavior. Ask it for an adversarial analysis or a red team analysis. Those two phrases tell the tool to hunt for gaps and contradictions instead of complimenting your work. You can copy this:

5. Change the original line, then test again

Edit or delete the line you found. Only add a new rule if the original line was already correct. Then run the same request again, plus one close variation, such as “next Tuesday” and “September 22.”

Checklist

Read your prompt once more and check these off. If you can check every box, you have a solid prompt. If you cannot check one, that is the first thing to fix. What the prompt says
  • Your AI agent’s purpose is clearly stated
  • You have described what a good result looks like
  • There is at least one example of the behavior you want
  • Your wording still works when someone phrases a request differently than you expected
How the prompt is put together
  • A long prompt is broken into labeled sections
  • You can explain why every line is there
  • Each instruction sits with the thing it controls, rather than in a prompt that covers everything
What the prompt avoids
  • There are no instructions your AI agent is unable to carry out
  • No two lines decide the same thing in different ways
  • Absolutes are saved for what truly matters, and the ones you kept can all be followed at the same time
  • There are no leftover Band-Aid fixes for problems you no longer have