Writing clear instructions is key to helping your Copilot chat agents respond accurately. Here are some tips for drafting and improving your agent instructions.

Instruction writing guide

You can find a guide for agent instructions on Microsoft Learn here. When putting together instructions for your Copilot chat agents, keep these points in mind:

  • Be clear and direct: Avoid vague language. Instead of saying “Provide information,” explain exactly what kind of information you want and how it should be presented.
  • Include examples: Examples help set expectations. If you want responses in a table, include a sample table in your instructions.
  • Set boundaries: Be clear about any limits your agent should follow—such as topics to avoid, formats to use, or sources to refer to.
  • Test and adjust: Regularly check how your agent responds. Update your instructions if needed to improve accuracy and relevance.

Use Copilot to write your instructions

You don’t need to remember all these best practices yourself. You can use Copilot to help refine your instructions. Think about what you want your agent to do. Enter a prompt into a new Copilot chat that describes your agent, any initial instructions you want to provide, and point it to the guide on Microsoft Learn. For example:

I am creating an agent in M365 Copilot agent builder that helps in [agent purpose, e.g. organising and improving training programs by generating content, analysing feedback, creating quizzes, and suggesting engaging activities]. In YAML, can you write instructions I can put into the agent according to the framework here https://learn.microsoft.com/en-us/microsoft-365-copilot/extensibility/declarative-agent-instructions

Replace the text in the square brackets

You can copy and paste the provided instructions, and enter it into your agent’s configuration.

Refine your instructions with Copilot

Test out your agent to see if the instructions are working. Is there anything the agent is not handling well? Do you need to add more instructions? Go back to your Copilot chat with the instructions, and ask it to update the instructions with these new considerations.

If you find that the agent cannot handle all tasks effectively, try breaking down the agent into multiple agents. For example, have a separate agent that handles changing the tone and style of the outputs for you, such as a Language Cleaner Agent.

Leave a comment