Exploring Ways to Access SharePoint Agent
Introduction
SharePoint Agent is the easiest way to get started with building your own grounded Agents from your SharePoint data. The possibilities are vast, from HR agents to legal agents. If more configuration and features are required, the Copilot Studio or Azure AI Foundry could help.
Each SharePoint site comes with its own default Agent scoped to data within the site. As of today (i.e. March 2025), the default SharePoint agent can’t be modified.
Custom SharePoint agents can easily be created with a few clicks, providing source data and defining the behavior using a declarative approach via meta/system prompts. An agent, compared to Copilot, can operate autonomously on behalf of a process or company and can outnumber people. However, SharePoint Agent is quite basic for now with no autonomous capability until the integration with Copilot Studio is made available to extend it.
Copilot, on the other hand, is a personal assistant augmenting personal productivity and efficiency.
I was exploring ways to make it easier and more intuitive for end users to access the SharePoint Agent. Currently, the way to access the SharePoint Agent is to click the not-so-obvious Copilot icon from the top right.
From having used virtual customer support from websites where the agent/Copilot is accessible from the page itself, I looked into the following options:
1. Find ways to open the Copilot side panel from a click of a button
I checked the network tab from developer tools to capture any API calls. I saw the REST API call to the URL _layouts/15/chat.aspx
:
However I could not call the URL from a button on the SharePoint page to open the side panel.
2. Use the button on the SharePoint page to call the Copilot agent directly
The approved SharePoint agent is saved in the /Site Assets/Copilots/Approved
folder. Copy the link from the approved agent to call from a button.
The format of the link is https://contoso.sharepoint.com/:u:/r/sites/mentalfirstaider/SiteAssets/Copilots/Approved/MentalFirstAider.agent?csf=1&web=1&e=8oJVcv
However, the Agent/Copilot opens in a dialog and on close navigates to the Approved Copilots folder instead of the page where the Copilot was called.
3. Add the agent to a Teams chat and try to embed the chat within an embed webpart
The link of the agent copied from option 2 can be added to a Teams chat to interact with it.
Using Graph Explorer, I figured out the chat ID using the Graph endpoint chats. However, I could not figure out how to force it to start a new chat with an agent automatically added from Deep link to Teams chat. This is something I may need to work on more.
I was planning to test embedding the Teams chat with an agent, but this is something I may revisit in the future.
4. Use the embed webpart
The embed webpart is a great way to make an agent available on the page even though the agent does not belong to the SharePoint site.
Add an iFrame tag to the Embed webpart’s code section using the HTML tag:
<iframe src="https://reshmee.sharepoint.com/:u:/s/mentalfirstaider/ESORkL-qEmhFoMOW9UkhzIkBYrvKK1Mxrxr6-heWzczc2w?e=7hMOnC" width="360" height="720" frameborder="0"></iframe>`
Feel free to adjust the height and width. Save and republish the page, and the agent is readily available within the page.
However, there are some improvements like removing the agent header so that users only see the agent to interact with no option to edit it. I did not manage to find any parameters I could pass to control the display of the agent. The frameborder=“0” parameter does not have any effect on the display of the agent.
Thoughts
It would be nice to have the agent subtly more visible whenever the user requires help without being ubiquitious.
Please share your own experience exploring options to embed SharePoint agents within a page and what worked and did not work without using custom code.
Thanks to the Project: Copilot Learning Center SharePoint hackathon 2025 submission, it shows how it can be done with SPFx: custom code neatly using a dialog.
References
Create a Custom Copilot Agent for SharePoint Online
Deep Dive into Copilot agents for SharePoint