Skip to main content
Agent Instructions tell your AI Agent what to do, how to behave, and what a successful response should look like. Well-written instructions help your Agent stay focused, communicate consistently, and complete tasks more effectively. The key is not to write longer instructions, but to provide clearer direction. This guide covers practical techniques for writing Agent Instructions in TypingMind, based on modern AI prompting best practices.

What makes a good Agent Instruction?

Think of your AI Agent as a capable new team member. It can handle many tasks, but it needs to understand your goals, your expectations, and the context behind its work. A good instruction answers five questions: You don’t need to include every component in every instruction. Start with what’s essential for your use case.

Example: Vague vs. clear instructions

Less effective:
You are a helpful customer support assistant. Answer customer questions professionally.
More effective:
You are a customer support assistant for Acme, a project management platform. Help customers understand product features and resolve common issues using the available documentation. Provide direct, friendly answers. When troubleshooting, give clear steps customers can follow. If you cannot verify an answer, acknowledge the uncertainty instead of guessing.
The improved version explains the Agent’s purpose, available information, expected behavior, and limitations.

5 steps to writing effective Agent Instructions

1. Define the role and goal

Start by telling the Agent who it is, whom it serves, and what it should achieve. Be specific about the outcome, not just the job title. Example:
Focus on the outcome you want. A clear goal often works better than a long list of rules describing every possible situation.

2. Give context and explain why it matters

AI models often perform better when they understand the reason behind an instruction. Provide relevant background about your business, users, or workflow. Less effective:
Always keep your answers short.
More effective:
Most customers contact us while working on a task. They need quick, practical answers so they can continue without reading lengthy explanations.
The second instruction explains why concise responses matter, helping the Agent apply the preference appropriately. Useful context might include:
  • Who will interact with the Agent
  • What users typically need help with
  • Your business or product background
  • What matters most when responding
  • Any important constraints
Avoid including information that doesn’t help the Agent perform its responsibilities.

3. Describe the expected behavior

Explain how the Agent should approach common requests. Modern AI models can often make reasonable decisions without detailed instructions for every scenario. Example:
Avoid overly rigid workflows unless your task requires a specific sequence. For example, you don’t need to require every response to include an introduction, analysis, recommendation, and conclusion. Let the Agent adapt its response to the question.

4. Define communication style and output format

Tell the Agent how responses should sound and what format to use when necessary. Example:

Use examples for consistent outputs

If your Agent needs to follow a specific structure, show what a good response looks like. For example:
Examples are especially useful when you need consistent formatting, a particular writing style, or specialized responses.
TypingMind also supports Few-shot Prompting, allowing you to provide example conversations separately from your main Agent Instructions.

5. Set boundaries and decision-making rules

Clear boundaries help prevent unwanted actions, unsupported claims, and responses outside the Agent’s responsibilities. Example:
When setting boundaries, explain the preferred alternative whenever possible. Less effective:
Never provide incorrect information.
More effective:
When information is missing or uncertain, explain what you can confirm and suggest how the customer can obtain the remaining details.
For Agents with access to Plugins or external services, distinguish between answering a question and performing an action. For example:
This is particularly important for Agents that can modify data, send messages, or interact with external applications.

Ready-to-use Agent Instructions template

Use this template as a starting point. Copy it into the Agent Instructions field in TypingMind and replace the placeholders with your own details.
You don’t need to fill in every section. Remove sections that aren’t relevant to your Agent. A shorter, focused instruction is usually easier to maintain and improve.

Advanced techniques

Once your basic instruction works well, consider these techniques for more complex Agents.

Structure complex instructions with XML tags

For Agents with multiple responsibilities, XML tags can help separate instructions, context, and examples. Example:
XML tags are optional. Simple headings or Markdown sections are often sufficient. Use whichever structure makes your instructions easier to understand and maintain.

Give the Agent appropriate autonomy

For more capable AI models, avoid micromanaging every step. Instead, define the goal, constraints, and conditions that require user input. Example:
This approach helps Agents work independently while respecting user control.

Keep responses focused

More capable models may sometimes provide more detail than the task requires. A simple communication rule can help:

Verify actions and results

For Agents using tools, distinguish between what the Agent intends to do and what has actually happened. Example:
This is especially useful for Agents handling external services, business workflows, or multi-step tasks.

Give your Agent knowledge and tools

Instructions control behavior, but they don’t automatically provide access to company information or external systems. TypingMind offers additional features to extend your Agent’s capabilities. For example, a customer support Agent might use product documentation through a Knowledge Base, retrieve account information through Dynamic Context, and use Plugins for supported actions.
Features such as Dynamic Context, Plugins, and Memory must be configured separately. Writing an instruction alone does not grant an Agent access to these capabilities.
Learn more in AI Agents Overview.

Test and improve your instructions

Even well-written instructions should be tested with realistic conversations. Start by asking your Agent questions that reflect actual user needs. For a customer support Agent, try: Check whether your Agent:
  • Understands the user’s request and stays within its role.
  • Gives accurate, useful answers.
  • Follows your preferred communication style.
  • Asks clarifying questions only when necessary.
  • Acknowledges uncertainty instead of inventing information.
  • Respects boundaries and action permissions.
When something doesn’t work, update the relevant part of your instruction and test again. Avoid adding multiple new rules after a single unexpected response. First identify whether the problem comes from unclear instructions, missing knowledge, unavailable tools, or model behavior.
Agent Instructions improve consistency but cannot guarantee perfect accuracy. For sensitive or high-impact use cases, include appropriate verification and human review.

Common mistakes to avoid

Final tips

The most effective Agent Instructions combine a clear purpose with enough context and flexibility for the AI to make good decisions. Remember:
  1. Start with the goal. Explain what success looks like.
  2. Provide useful context. Include the information and reasoning that guide decisions.
  3. Be clear, not overly prescriptive. Focus on important behaviors rather than every possible situation.
  4. Use examples when needed. Show the expected output instead of relying on vague descriptions.
  5. Set meaningful boundaries. Define what the Agent can do and when to ask for confirmation.
  6. Test and refine. Improve instructions using real conversations and observed results.
A good Agent Instruction doesn’t need to be long. It needs to make the Agent’s job clear.