Share via


Write agent instructions

Instructions are the central directions and parameters an agent follows. Agents depend on instructions to:

  • Decide what tool or knowledge might need to be called to address a user query or autonomous trigger.

  • Fill inputs for any tool based on the available context.

  • Generate a response to the end user.

Agents can't act on instructions to use tools, knowledge sources, or topics the agent doesn't have. You must first configure your agent with the appropriate toolss and knowledge sources. For example, if you give an instruction for your agent to search a website's FAQ, the agent can't follow that instruction unless you add the website FAQ as a knowledge source. Ensure that any instructions you give your agent are grounded in actions and knowledge you configured for your agent.

Add or change agent instructions

When you first create an agent, one of the first configurations is instructions.

If you create an agent using the conversational experience, Copilot Studio uses your descriptions to create relevant instructions for you. If you use the configuration method, you can write instructions for your new agent directly.

You can also add and change instructions after creating an agent:

  1. In the Agents tab, select the agent.

  2. On the Overview page, find the Instructions section.

  3. Add or change instructions. You can type instructions in plain text. At any point within the instructions, you can type / to add a reference to a specific object, such as a tool, topic, variable, or Power Fx expression.

    Screenshot of the menu that appears when you type '/' in the agent instructions.

  4. Test the changes using the test pane or test payloads for triggers for agents with triggers.

  5. If you've published your agent, select Publish to update published versions.

Writing great instructions

Agents use the names and descriptions of tools, topics, and knowledge sources to determine which to call when. Before you add instructions to call the right actions and knowledge source for your agent, make sure each action and knowledge source is following the best practices for authoring descriptions.

In cases where you need your agent to call a specific agent object, you can also name specific tools, topics, variables, and Power Fx expressions in your agent's instructions. Write /, then select the object from the menu that appears. You can also start typing the name of the object to see matching suggestions.

How best to write your instructions also depends on the type of agent and your goals for the agent. For more information on writing good instructions for your conversational and trigger agents, see Guidance for using instructions in generative mode.