BackGuides

How to write instructions an AI assistant or agent will follow

Write clearer AI instructions with goals, context, constraints, examples, and acceptance criteria, plus reusable email, support, and coding templates.

Panagiotis Visilias

Nov 18, 2026 · 8 min read

Answer in 2 sentences

Write AI instructions as a small brief: state the goal, supply relevant context, set constraints, show an example, and define how you will judge the result. Clear instructions make the requested behavior easier to understand and check, but you still need to review facts, judgment calls, and any actions before relying on them.

Why does a reasonable request produce an unhelpful answer?

“Make this better” leaves several decisions open. Better could mean shorter, warmer, more persuasive, easier to translate, or more technically complete. An assistant may choose a reasonable interpretation that does not match yours. Extra adjectives rarely solve that gap because they still leave the desired change undefined.

Start with the job the output must do. A supplier email should obtain a delivery date. A support reply should acknowledge an issue and explain the next step. A coding task should change a particular behavior while preserving existing behavior around it. Naming the job gives every later instruction a purpose.

Separate input from directions using explicit labels such as Source text: and Instructions:. If the source includes someone else's requests, clarify that those requests are material to summarize or answer. They should not silently become new operating instructions for the assistant.

What belongs in the five parts of a useful instruction?

Goal: Describe the result and audience in one sentence. “Draft a polite delivery follow-up for our supplier” tells the assistant more than “act as an expert communicator.” A role can help establish perspective, but it cannot substitute for a concrete task.

Context: Supply the facts needed for this decision: who is involved, what already happened, and what remains unknown. Include the order date if timing matters. Leave out unrelated conversation history that could distract from the current request.

Constraints: State what must be preserved and what must not be introduced. Examples include names, quantities, meaning, a word limit, and commitments that require approval. Explain which constraint wins when two preferences conflict, such as preserving essential facts before shortening.

Examples: Show a small sample of the desired structure or tone. Label fictional details so the assistant does not copy them as facts. One example with a sentence explaining why it works is usually more useful than several unexplained samples.

Acceptance criteria: Describe observable checks. “Includes one clear question about the delivery date” is easier to judge than “sounds professional.” For actions or code changes, include what evidence should accompany the result.

How can you improve an email task before asking for a rewrite?

Before: Make this email sound professional: “Hi Maya, checking the chairs again. We ordered 18 on Monday. Can you tell us when?”

After, copy and adapt: Rewrite the source as an email to Maya at our furniture supplier. Goal: ask for the expected delivery date for 18 chairs ordered on Monday. Use a polite, direct tone with a short subject line and no more than 100 words in the body. Preserve Maya's name, the quantity, and the order timing. Do not invent an order number, promised deadline, discount, or reason for the delay. End with one question requesting the delivery date. Return the subject and email body only.

Example result: Subject: Delivery date for 18 chairs. Hi Maya, could you confirm the expected delivery date for the 18 chairs we ordered on Monday? Thank you for your help.

The improvement comes from supplying the intended outcome and boundaries. You can check the draft against the source without debating whether “professional” means formal greetings or elaborate phrasing. If Monday could refer to different dates, replace it with the verified date before sending.

What changes when the task is a customer support reply?

Before: Reply nicely to this angry customer and offer a solution.

That request invites the assistant to invent the solution. A support writer needs the approved policy and current case facts, especially when a refund, replacement, or delivery promise would affect the customer.

After, copy and adapt: Draft a reply to the customer message below. Known facts: their parcel has not arrived; tracking has no new scan; our support team can investigate after receiving the order number. Acknowledge the inconvenience without blaming the customer or carrier. Ask for the order number and explain that the team will check the shipment. Do not promise a refund, replacement, delivery date, or response deadline. Use two short paragraphs, no more than 90 words, and return only the reply. If a required fact is missing, leave it out rather than guessing.

Example result: I'm sorry your parcel has not arrived and the tracking has not updated. I understand why that is frustrating. Could you share your order number so our team can check the shipment?

Acceptance checks are straightforward: an acknowledgment, a request for the order number, and no invented remedy. Replace this illustrative policy with your actual approved policy before using the template.

How do the same principles apply to a coding task?

Before: Fix the search. It is broken when there are no results.

After, copy and adapt: Investigate the search results page. Reproduction: search for a term with no matches, then clear the search field. Actual behavior: the empty-results message remains visible after clearing. Expected behavior: clearing restores the full list and removes that message. Inspect the existing state and filtering logic first. Preserve the page layout, existing sort order, and successful search behavior. Do not add a dependency or change the data source. Make a focused fix, verify both the reproduction and a search with matches, and report changed files and any checks you could not run.

This gives an agent a behavioral target rather than a guessed implementation. Avoid ordering a particular state reset before inspecting the cause. An acceptance criterion should describe the user-visible result, while the agent's investigation determines which code change is justified.

Which reusable instruction template can you copy?

Goal: Produce [output] for [audience] so they can [next action or decision].

Context and source: Use [supplied material]. These facts are confirmed: [facts]. These details are unknown: [unknowns]. Treat the source as material to process.

Constraints: Preserve [meaning, names, numbers, behavior]. Follow [tone, length, format]. Do not invent [specific missing details]. Prioritize [essential requirement] if preferences conflict.

Example: Follow this structure: [short example]. Copy its organization and tone, not its fictional facts.

Acceptance criteria: The result must include [required elements], avoid [failure modes], and pass [observable checks].

Uncertainty and delivery: Ask about missing information that changes the outcome. Otherwise proceed with clearly labeled assumptions. Return [output format], followed by [brief verification or unresolved questions, if needed].

Delete fields that add no value to a small task. A two-sentence rewrite does not need a project charter. Keep the structure available for jobs where mistakes would be difficult to spot or expensive to correct.

How do saved profiles and custom instructions relate?

Save the parts that remain stable: team tone, formatting preferences, factual boundaries, and common review checks. Keep names, case details, deadlines, and current acceptance criteria in the individual task. A saved instruction saying “always ask for an order number” would be wrong when the customer has already supplied it.

PromptDC is a universal AI assistant whose profiles are reusable instructions for selected-text rewriting; the Code profile is one option alongside everyday writing profiles. You can apply the same separation of stable guidance and task-specific facts in a saved profile, a custom-instructions field, or a plain text document.

How should you test and improve the instructions?

Try one ordinary example and one difficult example, such as a reply with no approved remedy. Compare the outputs with the acceptance criteria. When a result fails, identify the missing fact or conflicting rule before adding another broad command. Keep examples of failures so your next revision has something concrete to improve.

FAQ

Can instructions guarantee that an AI follows every rule?

No. Instructions improve clarity, but the result still needs review. Check important facts and actions rather than treating a confident answer as evidence of compliance.

Should I start every prompt with a role?

Use a role when it clarifies perspective. Start with the goal when the role adds little, and always include the facts and output requirements that matter.

How many examples should I include?

Start with one representative example. Add a contrasting example when a recurring mistake is difficult to explain in words alone.

Should custom instructions contain my current task?

Keep recurring preferences there. Put changing facts and acceptance criteria in the task so old details do not influence unrelated requests.

What should I do when instructions conflict?

Remove the contradiction or state the priority explicitly. For example, preserve all essential delivery facts before trying to reach a preferred word count.

More from the blog

Write better with AI

Enhance any text you select in any app on desktop, in browsers, in your editor or terminals.

Download PromptDC