You’ve picked a small job for an AI agent, opened the builder, and found an empty box labeled “instructions.” What you type there decides what the agent does when you aren’t watching. The short answer is to write a brief with five parts: a goal (the outcome you want), instructions, boundaries, a definition of done, and stop conditions (rules for when the agent stops or hands back to you). Then enforce the boundaries that matter with real platform limits.
Some quick definitions. An AI assistant responds inside a conversation you lead. An automation runs a fixed sequence whenever its trigger fires. An AI agent receives a goal and may choose or adapt its steps and tools within limits. That suits some jobs, not all, so an agent isn’t automatically better. The beginner's guide to building an AI agent covers the whole project, and the previous guide, your no-code first build, sets up a meeting follow-up drafter. This guide tightens the words that drafter runs on.
Enforcement matters because security guidance is clear: an agent’s written instructions are not a security control [1, 2].
TL;DR
- Write the goal as a checkable outcome and define any word the agent could read two ways.
- Give every step an action and a transition, and tell the agent to ask rather than guess.
- Sort actions into allowed, ask first and never; enforce the last two with platform settings and approvals.
- Write a checkable definition of done and plan human review before anything is used.
The five parts of a clear agent brief
Vendors describe the same ingredients differently. OpenAI says an agent is made of a model, tools and instructions, which it defines as explicit guidelines and guardrails for how the agent behaves [3]. Google’s Agent Development Kit (ADK) documentation says an instruction should state the agent’s core task or goal, constraints on its behavior, how and when to use its tools, and the output format [4]. Microsoft’s guidance for Microsoft 365 Copilot agents, last updated in August 2026, starts from the goal the agent must accomplish, then adds restrictions, error handling and limitations [5].
A tool is an action or information source you’ve approved for the agent, such as searching one folder. An action is a step that changes something, like saving a draft.
| Part | Question it answers |
|---|---|
| Goal | What outcome, for whom, and what counts as good? |
| Instructions | Which steps, in what order, and what if something is missing? |
| Boundaries | What may it do alone, ask about first, or never do? |
| Definition of done | What does the finished output contain, and how is it checked? |
| Stop conditions | When does it stop or hand back to me? |
OpenAI says clear instructions reduce ambiguity and lead to fewer errors [3]. That’s a vendor’s view, not an independent measurement, but the logic holds: a gap you leave is often filled with a guess.
Step 1: Write a goal the agent can’t misread
A goal is the outcome you want, not an activity. “Go through my meeting notes” is an activity the agent can finish without producing anything useful. “The draft recap lists every action item with its owner” is an outcome you can check. A strong goal also says who it’s for, why it matters and how a good result differs from a bad one.
Literal goals can be met in ways nobody wanted. In a 2020 post, researchers at Google DeepMind called this specification gaming: behavior that satisfies the literal specification of an objective without achieving the intended outcome [6]. Their examples mostly come from older reinforcement-learning systems, not today’s language-model agents, though the authors expected the problem to grow harder as systems become more capable [6]. A goal like “reduce the number of open tickets” invites closing tickets instead of solving them. “Resolve or correctly route each open ticket” leaves less room for that.
Define words that seem obvious. Microsoft advises defining any nonstandard or organization-specific term in the instructions [5]. If “urgent” means “a client deadline within two days,” say so.
A good goal still won’t produce identical behavior every time; Google’s ADK documentation notes that agent behavior is non-deterministic and must be evaluated with that in mind [4]. Writing the purpose down also helps later reviewers; NIST’s AI Risk Management Framework calls for documenting a system’s intended purposes and targeted application scope [7].
Step 2: Turn the job into steps with clear transitions
Instructions are the step-by-step directions the agent follows to reach the goal. Write them for a capable newcomer.
OpenAI recommends starting from procedures you already have, breaking dense material into smaller steps, and tying every step to a specific action or output [3]. Microsoft suggests that each step state a goal, an action (including which tool to use), and a transition: clear criteria for moving to the next step or ending the workflow [5]. The transition keeps an agent from wandering: “When every item is listed, move on to drafting. If the file is unreadable, mark it skipped.”
Plan for missing information. OpenAI advises capturing edge cases, such as how to proceed when a user provides incomplete information [3]. Microsoft names “overeager tool use,” calling a tool without the inputs it needs, as a common failure, and suggests telling the agent to call a tool only when the inputs are available and otherwise ask [5].
In Ambig-SWE, a study accepted at ICLR 2026, researchers gave coding agents tasks with key details left out [8]. Most of the models struggled to spot incomplete tasks and rarely asked questions unless told to; when they did ask, performance improved by up to 74% over non-interactive runs [8]. The study used software tasks, GPT-4o playing the user, and six models from 2024 and 2025: Claude Sonnet 3.5 and 4, Claude Haiku 3.5, Llama 3.1 70B, DeepSeek-V2 and Qwen 3 Coder [8]. The number won’t transfer to your agent; the lesson does: tell the agent when to ask instead of guess, then check that it does, because prompting alone didn’t make the models reliably spot missing details [8].
Wording, examples and formatting are prompt-writing craft, covered in How to Prompt AI in the Prompting + Working With AI series.
Step 3: Set boundaries: allowed, ask first, never
A constraint limits how the agent does the job. A boundary marks what it may do at all. Write boundaries in three tiers:
- Allowed on its own: low-risk, reversible actions, such as reading one named folder or saving a draft.
- Ask first: actions that are hard to undo, affect other people or spend money. The agent pauses for approval, meaning a person explicitly says yes before it acts. See how to make an AI agent ask before it takes action.
- Never: anything outside the job, such as sending messages, deleting files or opening folders you didn’t name.
To sort actions, OpenAI suggests rating each tool’s risk as low, medium or high by write access, reversibility, permissions and financial impact, then pausing or escalating before high-risk actions [3].
Make boundaries specific. As of November 2026, Microsoft’s Copilot Studio guidance recommends limiting the values a tool may use, such as only emailing a specified list of people [9]. “Be careful with email” isn’t a boundary. “Address drafts only to people on the meeting’s attendee list” is.
Add a data rule. If the job touches personal details, client records, money, health, employment or other confidential matters, run it only in a system approved for that data. Never put passwords, API keys or other credentials in the instructions. OWASP says credentials don’t belong in a system prompt, the behind-the-scenes instructions an agent runs on [1]. What the agent receives (its context) and what its memory or state carries forward are covered in how to give an AI agent the context and memory it needs.
Why written boundaries aren’t enough on their own
“Never delete anything” states your intent. It won’t stop a deletion if the agent has a delete tool and misreads the situation, or if a document it reads carries its own instructions. That document is untrusted content, meaning material from sources you don’t control, such as web pages, emails or shared files. Content that steers the agent this way is called prompt injection.
Security guidance says the same. In its 2025 Top 10 for LLM Applications, OWASP says a system prompt shouldn’t be treated as a secret or used as a security control, and that controls should be enforced independently of the model [1]. Its “excessive agency” entry says authorization belongs in downstream systems, not in the model’s judgment, and high-impact actions should need human approval [10]. The UK NCSC explains that language models make no inherent distinction between data and instructions, and recommends deterministic, non-AI safeguards that constrain what the system can do [2]. See how to protect an AI agent from unsafe instructions and untrusted content.
Benchmark research points the same way, though it measures rule-following rather than security. In τ-bench (ICLR 2025), customer-service agents got tools and a written policy for simulated retail and airline tasks [11]. The best agent, built on gpt-4o (mid-2024), succeeded on about 61% of retail tasks and 35% of airline ones; its chance of passing all eight repeat attempts at a retail task was under 25% [11]. Removing the policy in a separate ablation cut its retail success from 61.2% to 56.8%, a 4.4-point drop the authors read as the agent not fully using the policy [11]. In the same ablation’s airline runs, where rules are more complex, success fell from 33.2% to 10.8%, a 22.4-point drop the authors read as the agent following rules at times [11]. The rules helped but weren’t reliably followed. Newer models may score higher; a written rule is still a request, not a guarantee.
Microsoft’s documentation, as of November 2026, agrees: in Copilot Studio, an agent can’t use a tool it hasn’t been given, and a topic it must avoid is better handled by a scripted response than by instructions alone [9]. Its Microsoft 365 Copilot guidance warns against keeping instructions in editable files such as SharePoint documents, since anyone who can edit them could change the agent’s behavior [5].
So pair each important boundary with a permission, the access the platform actually grants:
- “Never send email”: connect a create-draft action, not a send action.
- “Only this folder”: connect only that folder.
- “Ask before paying”: require approval in the platform, or don’t connect payments.
Next in this series, giving an agent tool access without too much control covers that setup.
Step 4: Define what “done” looks like
A definition of done describes the finished output precisely enough for the agent, and you, to check it. Without one, an agent may stop early, pad the result or keep going.
Microsoft suggests an “output contract” stating the goal, format, level of detail, and what to include and exclude, plus a final self-check in which the agent confirms the output is complete [5].
OpenAI describes an agent as recognizing when a workflow is complete and, on failure, handing control back to the user [3]. So define both: what complete looks like, and what to report when it can’t finish. A self-check is the agent grading itself; it doesn’t replace human review, where a person checks the output before anyone relies on it.
Step 5: Add stop conditions
An agent works in a loop: act, check the result, decide what’s next. In OpenAI’s description, a run loops until it hits an exit condition, which might be a final output, an error or a turn limit [3]. Anthropic’s December 2024 engineering guidance adds that builders commonly cap iterations even though agents often stop on completion, and that agents can pause for human input at checkpoints or blockers [12].
A stop condition is a rule that ends a run or hands it back to you. Write one for each way a run can end:
- Finished: the definition of done is met.
- Stuck: the same step has failed a set number of times. A retry is another attempt at a failed step. OpenAI suggests limiting retries and escalating to a person when the limit is exceeded [3].
- Missing information: a required input isn’t available, and asking hasn’t resolved it.
- Out of scope: the request falls outside the goal or boundaries.
- Hard cap: a maximum number of steps or turns, no matter what.
Defaults vary. As of November 2026, OpenAI’s Agents SDK ends a run with an error at its turn limit [13], while Google ADK’s loop agent sets no iteration maximum by default in Python, so builders must add a way to end it [14]. See how to set spending, time, and usage limits and how to fix an agent that gets stuck.
Example: tightening the meeting follow-up drafter’s brief
Your no-code first build covers the drafter’s folder, tools and tests. This hypothetical, tool-agnostic example keeps its tools and draft-recap output, stretching the brief from one meeting per run to every new file in the notes folder, which is why it needs firmer stop conditions.
| Part | Vague | Clear |
|---|---|---|
| Goal | “Handle my meeting follow-ups.” | “For each new notes file, draft a recap document listing every decision, action item, owner and due date, ready for me to check and send. Never invent owners or dates.” |
| Instructions | “Pull out the important stuff.” | “List each action item; write Unassigned or No date if either is missing. Then fill in the recap template, save it as a draft document and open the next file.” |
| Boundaries | “Be careful with my files.” | “Allowed: read the notes folder, create draft documents. Ask first: replacing an existing draft. Never: send, share or post anything, edit or delete notes, or open other folders. Skip and flag notes marked HR, health or confidential.” |
| Definition of done | “Finish when it looks right.” | “Every new file has a saved draft or a skip note, and a final check confirms each action item appears in a draft.” |
| Stop conditions | None written | “Stop when all files are done, after two failed attempts on one file, if an input is still missing after one question, or after 20 steps. Report what was drafted and skipped.” |
Human review point and sensitive data
A person reads, edits and sends every recap. As in the first build, nothing connects to email or calendar, so “never send” is enforced by the setup, not just the wording. Notes often hold client, personnel or health details, so run the agent only in a system your workplace approves for that material.
Test the brief, then revise one change at a time
First, run it on sample material you don’t mind it getting wrong. This starts evaluation: a structured check of output against what you expected. Microsoft suggests checking that the agent follows its instructions and handles unexpected requests appropriately [5]. Include awkward cases, like a blank notes file, and read the log, the platform’s record of each step.
Change one thing at a time. Copilot Studio’s guidance, as of November 2026, says the system treats instructions much like code; if complex instructions break responses, it suggests removing them and adding them back one at a time, testing after each [9]. Microsoft’s separate Microsoft 365 Copilot documentation, updated August 2026, adds that Copilot periodically moves to newer models automatically, so behavior can shift [5]. Platform details like these change, so check current documentation. A few clean runs aren’t proof of reliability; see how to test an AI agent before you trust its work and how to monitor an AI agent after you launch it.
What We Know, What We Don’t, and Where Experts Disagree
What We Know
Major platform makers describe similar parts of agent instructions [3, 5, 4]. OWASP and the UK NCSC say instructions guide an agent but don’t enforce limits [1, 10, 2]. One benchmark study with mid-2024 models found that agents given written rules often didn’t follow them consistently [11].
What We Don’t Know
We found no independent, controlled study showing which instruction practices make beginner-built or no-code agents more reliable; most advice comes from vendors [3, 5]. Both studies cited here used 2023–2025 models in coding or simulated customer-service settings; newer models may behave differently [8, 11, 15].
What Experts Disagree About
On how much weight written limits can bear, the gap is mostly emphasis. OpenAI calls guardrails a layered defense that should be paired with authentication, authorization and access controls [3], and Microsoft advises not relying only on instructions to keep an agent off a topic [9]. Builder documentation still foregrounds written instructions as the main way to shape behavior [3, 5, 4], while OWASP says a system prompt shouldn’t be used as a security control [1].
How much an agent should improvise is a design trade-off rather than a dispute. Anthropic’s December 2024 guidance describes agents planning and operating independently once the task is clear, returning to a person when needed [12]. Microsoft’s August 2026 guidance offers a literal-execution header as an interim fix for agents that drift, telling them not to fill in missing steps [5]. The more an action matters, the less improvising you want.
Practical Takeaways
- Write the goal as a checkable outcome and define any word the agent could read two ways.
- Give every step an action and a transition, and tell the agent to ask rather than guess.
- Sort actions into allowed, ask first and never; enforce the last two with platform settings and approvals.
- Write a checkable definition of done and plan human review before anything is used.
- Add stop conditions for finished, stuck, missing information and out of scope, plus a hard cap.
- Keep credentials out of instructions, test awkward cases, and change one instruction at a time.
Sources
- LLM07:2025 System Prompt Leakage. OWASP Gen AI Security Project, accessed 2026-11-13.
- Prompt injection is not SQL injection (it may be worse). UK National Cyber Security Centre (NCSC), 2025-12-08, accessed 2026-11-13.
- A practical guide to building agents. OpenAI, accessed 2026-11-13.
- Simple agents – Agent Development Kit (ADK). Google (Agent Development Kit documentation), accessed 2026-11-13.
- Write effective instructions for declarative agents. Microsoft Learn, 2026-08-11, accessed 2026-11-13.
- Specification gaming: the flip side of AI ingenuity. Google DeepMind, 2020-04-21, accessed 2026-11-13.
- Artificial Intelligence Risk Management Framework (AI RMF 1.0), NIST AI 100-1. National Institute of Standards and Technology (NIST), 2023-01, accessed 2026-11-13.
- Ambig-SWE: Interactive Agents to Overcome Underspecificity in Software Engineering. arXiv (accepted at ICLR 2026), 2025-02-18, accessed 2026-11-13.
- Configure high-quality instructions for generative orchestration. Microsoft Learn (Copilot Studio), 2026-11-04, accessed 2026-11-13.
- LLM06:2025 Excessive Agency. OWASP Gen AI Security Project, accessed 2026-11-13.
- τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains. arXiv (published at ICLR 2025), 2024-06-17, accessed 2026-11-13.
- Building effective agents. Anthropic, 2024-12-19, accessed 2026-11-13.
- Running agents – OpenAI Agents SDK. OpenAI, accessed 2026-11-13.
- Loop agents – Agent Development Kit (ADK). Google (Agent Development Kit documentation), accessed 2026-11-13.
- Function calling and other API updates. OpenAI (Internet Archive capture of 2023-07-02), 2023-06-13, accessed 2026-11-13.
