Test and edit your agents
In today's fast-paced digital world, the ability to test, edit, and customize agents within SharePoint and Microsoft 365 Copilot Chat is crucial. These skills enable you to create tailored solutions that can automate tasks, improve user engagement, and enhance overall productivity without the need for extensive coding knowledge.
Testing an agent is crucial for ensuring its effectiveness and reliability. By conducting thorough tests, you can identify and address any issues or bugs in the agent's behavior, which helps prevent potential problems that could arise during real-world interactions. This process allows you to refine the agent's instructions and responses, ensuring that it meets the specific needs and expectations of its users. Additionally, testing provides valuable insights into the agent's performance, enabling you to optimize its efficiency and accuracy.
Testing an agent also helps enhance the overall user experience. By experiencing the agent from the end user's perspective, you can make necessary adjustments to improve its usability and interaction quality. This iterative process of testing and refining ensures the agent is well-designed and capable of delivering a seamless and satisfying experience for its users. Ultimately, testing is a vital step in the development process that contributes to creating a robust, reliable, and user-friendly agent.
Once you finish configuring an agent, Microsoft recommends that you test the agent before you create it for the following reasons:
- Identify issues early. Testing allows you to identify and address any issues or bugs in the agent's behavior before it goes live. Doing so helps ensure the agent functions as expected and provides accurate responses.
- Refine instructions. By testing the agent, you can refine and improve the instructions and responses. Doing so ensures the agent's behavior aligns with your expectations and meets the needs of your users.
- User experience. Testing provides an opportunity to experience the agent from the end user's perspective. Doing so helps you understand how users interact with the agent so that you can make any necessary adjustments to enhance the user experience.
- Performance optimization. Testing allows you to evaluate the agent's performance, including response times and accuracy. You can make optimizations to improve the agent's efficiency and effectiveness.
- Feedback and iteration. Testing provides valuable feedback that can be used to iterate and improve the agent. This iterative process helps create a more robust and reliable agent.
- Ensure compliance. Testing helps ensure that the agent complies with any relevant policies, regulations, or guidelines. Compliance testing is important for agents that handle sensitive information or perform critical tasks.
While predeployment testing is essential, post-deployment testing is equally important to ensure the agent's ongoing performance, reliability, and user satisfaction. Continuous monitoring and feedback help maintain and improve the agent over time. Once an agent is created in either SharePoint or Copilot Chat, you should still periodically test it. Doing so helps you analyze the agent's continual effectiveness and whether it still reflects your goals.
Test your agent
You should test each of the following areas of your agent.
Instructions
- Tones and styles. Modify the agent's instructions to experiment with different tones and styles. For example, you might instruct your agent to respond like a kind, patient teacher or in the style of a friendly customer service representative. You can also try giving it a professional, corporate voice, or a friendly, casual tone to see which resonates best with your audience.
- Clarity and accuracy. Ensure that the instructions provided to the agent are clear and accurate. Test the agent's responses to see if it follows the instructions correctly. For example, if the instruction is to provide step-by-step guidance, ask, "How do I create a new ticketing system in Microsoft 365 Copilot Chat?" and verify that the response is detailed and accurate.
- Consistency. Test the agent's responses to ensure consistency in following the instructions. Ask similar questions in different ways to see if the agent provides consistent answers. For example, "How do I set permissions for a document library in a SharePoint site?" and "Can you tell me how to manage permissions for a library in SharePoint?"
- New instructions. Test the new instructions with another question to observe the changes in response. For instance, ask "Can you explain the steps to manage permissions in SharePoint?" and compare the differences in the agent's replies based on the tone you set. Examples of follow-up questions include:
- Scenario 1. A user is having trouble uploading a document. Ask, "How do I upload a document to SharePoint?"
- Scenario 2. A user needs to share a file with a colleague. Ask, "How can I share a file with a colleague in SharePoint?"
- Scenario 3. A user wants to set up alerts for changes in a document library. Ask, "How do I set up alerts for changes in a SharePoint document library?"
- Adaptability. Modify the instructions and test how quickly and effectively the agent adapts to the changes. For instance, change the instructions to provide brief summaries instead of detailed steps and ask, "How do I create a new ticketing system in Copilot Chat?" to see if the response aligns with the new instruction.
- Edge cases. Test the agent's ability to handle edge cases or unusual instructions. Provide instructions that are less common or more complex and evaluate the responses. For example, instruct the agent to provide troubleshooting steps for a specific error message in Copilot Chat and ask, "What should I do if I see error code 0x80070005?"
- User feedback. Gather feedback from users on the clarity and helpfulness of the instructions. Ask users if the instructions provided by the agent are easy to understand and follow. Use this feedback to refine and improve the instructions.
Knowledge sources
- Verify knowledge base integration. Ensure that the agent is correctly integrated with the knowledge base. Ask questions that should be answered using the knowledge base to verify accuracy. For example, "What is the company policy on remote work?"
- Update and test. Regularly update the knowledge base with new information and test the agent's responses to ensure it reflects the latest updates. For instance, after adding a new policy, ask, "What is the new policy on vacation days?"
- Cross-reference testing. Test the agent's ability to cross-reference information from different sources. For example, "Can you explain the process for submitting an expense report and the related approval workflow?" When a SharePoint hub site is included as the source for the agent, it automatically includes its associated sites. Your agent uses information from both the hub site and its associated sites to respond. If a hub site is included as a knowledge source for your agent, verify the agent includes information from both the hub site and its associated sites.
Capabilities
- Code interpreter. Test the agent's ability to interpret natural language instructions and generate the appropriate behind-the-scenes code.
- Simple queries. Provide various natural language instructions and evaluate the results. For example, ask, "Can you generate a bar chart using this data set?" and provide a data set to see if the agent correctly interprets the request and generates the necessary Python code.
- Complex queries. Test the agent's capabilities with more complex natural language queries that require code interpretation. For example, ask, "Can you analyze this data set and provide a summary of the key findings?" and provide a data set to see if the agent can generate the appropriate code to perform the analysis.
- Edge cases. Test the agent's ability to handle edge cases or unusual natural language instructions. Provide instructions that are less common or more complex and evaluate the responses. For example, ask, "Can you create a scatter plot with a trend line using this data set?" and provide a data set to see if the agent can generate the necessary code.
- User feedback. Gather feedback from users on the clarity and effectiveness of the Code interpreter. Ask users if the results from the generated code reflect their natural language instruction. Use this feedback to refine and improve the Code interpreter's capabilities.
- Image generator. Test the agent's ability to generate images based on descriptions. Provide detailed prompts and evaluate the generated images.
- Simple queries. Provide various natural language instructions and evaluate the results. For example, "Generate an image of a sunset over a mountain range."
- Complex queries. Test the agent's capabilities with more complex queries that require both code interpretation and image generation. For example, "Create a scatter plot of the following data points: (1, 2), (2, 3), (3, 5), (4, 7), (5, 11). Include a trend line and provide the R code used to generate the plot."
Starter prompts
- Evaluate default prompts. Test the agent's responses to default starter prompts to ensure they're engaging and informative. For example, "What can you do?" or "How can you help me today?"
- Customize and test. Customize the starter prompts to better suit your audience and test the agent's responses. For instance, "How can I get started with using SharePoint for project management?"
- User interaction. Observe how users interact with the starter prompts and gather feedback to further refine them. Ask users if the prompts are helpful and if they have suggestions for improvement.
Edit your agent
When you edit an agent in SharePoint or Copilot Chat, you use the same tool to edit the agent as you did to create it. For a Copilot Chat agent, you use Copilot Studio. For a SharePoint agent, you use the Copilot agent tool embedded within SharePoint.
When you edit an agent, shared users of that agent can't see the latest changes until the agent is reshared with them. Once you update an agent, your changes can sometimes take several minutes to become available for end users.
Tip
When an agent has SharePoint files or folders as knowledge sources and the agent is shared with specific users in the organization, Microsoft recommends that you reshare the agent with the same group of users. Doing so automatically shares the files and folders again with the users to ensure consistent agent experience.
Edit a Copilot Chat agent
Perform the following steps to edit an agent that you created in Copilot Chat:
Sign in to Microsoft 365 Copilot with your work or school account. The Microsoft Copilot Chat page appears by default.
If the agent that you want to edit appears in the list of pinned and unpinned agents, then hover over the agent and select the ellipsis (More) icon that appears. In the drop-down menu that appears, select Edit.
If the agent that you want to edit doesn't appear in the list of pinned and unpinned agent, then select All agents in the navigation pane. This option opens the Agent Store, which displays your agents and the prebuilt agents that you used, along with the prebuilt agents that were created by Microsoft. In the list of Your Agents, select the ellipsis icon that appears for that agent, and in the drop-down menu that appears, select Edit.
When you select the Edit option for an agent, Copilot Studio opens and the agent's information is displayed in the corresponding fields on the Configure tab.
Make your necessary changes to the agent and test them out if necessary.
When you're finished editing (and testing) the agent, select the Update button.
Edit a SharePoint agent
Every time you create an agent in SharePoint, it's stored as a .agent file.
- If you create it from the homepage of a site, the agent file is automatically stored under Site contents > Site Assets > Copilots.
- If you create an agent from other places, it's automatically saved to the current document library folder, in the place where you originally created it.
Once you locate the agent, select it and then choose Edit. Doing so opens the Copilot tool in SharePoint that you used to create the agent. Make your necessary changes and then save the agent.
Note
You can't edit a SharePoint site's ready-made agent that's automatically created by Copilot when the user creates the site.