Share via

SharePoint Agent - Opens in new page with Error

Hishmat Salehi 0 Reputation points
2026-05-29T16:17:25.0733333+00:00

Hello,

Recently, the SharePoint Agent on our site has been opening in a new tab and throws the following error:
User's image

Any ideas how to fix this?

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments

2 answers

Sort by: Most helpful
  1. Ruby-N 11,730 Reputation points Microsoft External Staff Moderator
    2026-05-29T21:55:53.1533333+00:00

    Good day @Hishmat Salehi

    Thank you for sharing your concern.  

    Just to gently clarify before we go any further, this is a user‑to‑user support forum. I don’t have the ability to access or investigate individual accounts because this is a user-to-user support forum. Moderators and contributors, including external Microsoft employees, do not have access to internal systems or the ability to directly take action on Microsoft product features. However, I truly hope I can help review your situation, offer some guidance, and support you in finding the right next steps as best as possible.  

    From the screenshot, SharePoint seems to be opening the .agent file in preview mode instead of launching it in the side pane as expected, which usually happens when the Agent link web part is pointing to an outdated or invalid file, often because the .agent file was renamed, moved, or relocated during publishing. 

    Please see the following workarounds that will help you verify the issue:  

    Step 1: Reconfigure the agent link web part 

    Open the SharePoint page in Edit mode > Select the Agent link web part. 

    Open the web part properties panel > Re-select the correct agent from the available list. 

    If the issue persists, remove the web part completely: 

    Add a new Agent link web part > Select the correct agent again > Republish the page. 

    This helps ensure the web part is linked to the correct and current agent reference. 

    Step 2: Verify the .agent file location and status 

    Go to the SharePoint document library where the agent is stored. 

    Locate the .agent file. 

    Check if the file has been renamed recently. 

    Confirm whether the file has been moved to a different folder or an approved location. 

    If any changes were made, update the web part to point to the new file location. 

    Changes to the file location or name are a common cause of this issue. 

    Step 3: Verify permissions, licensing and service availability 

    This step needs to be performed by a SharePoint admin or IT admin to ensure proper access and configuration, so please ask your IT Admin to follow these steps: 

    Note: In case you do not know who is your IT admin, kindly refer to this article: How do I find my Microsoft 365 admin? - Microsoft Support  

    1/ Check that affected users have access to the .agent file in SharePoint. Verify that users also have permission to the content sources used by the agent. 

    2/ Confirm that users have a valid Microsoft 365 Copilot license and enable Microsoft 365 Copilot for SharePoint in Microsoft 365 admin center

    3/ Alternatively, check whether Pay-As-You-Go is enabled for SharePoint agents in the tenant. 

    4/ Ensure the feature is correctly enabled and configured in the environment. 

    Note: The agent will not work properly if required permissions, licensing, or configurations are missing. 

    Additional information is available in the following resources: 

    Get started with agents in SharePoint - Microsoft Support 

    Manage access to agents in SharePoint - SharePoint in Microsoft 365 | Microsoft Learn 

    Step 4: Contact Microsoft Support 

    If the issue still persists after trying the steps above, I recommend reaching out to your IT administrator to create a support ticket via Microsoft 365 Admin Center > Support > Help & Support for further backend investigation.  

     A technical support engineer can perform a remote session to investigate the situation, verify the backend configurations, and run any necessary synchronization tools to resolve the problem. If the issue requires further attention, they can escalate it to a specialized team for deeper analysis.    

    I hope this information is helpful. If you have any questions or need further support, please don’t hesitate to reach out at any time. 

    Thank you for your patience and understanding. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have any extra questions about this answer, please click "Comment".            

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-05-29T16:17:42.3166667+00:00

    The screenshot shows the browser trying to download or preview an .agent file instead of running the SharePoint Agent experience inline. In Microsoft 365, this typically happens when the SharePoint tool or agent integration cannot authenticate correctly or cannot reach the target SharePoint service, so the agent endpoint is treated as a file download.

    Use the troubleshooting guidance for the SharePoint tool with the Agent API and verify the following in order:

    1. Ensure user-based identity is used
      • The SharePoint tool requires user identity (identity passthrough).
      • Do not configure or call the agent with application-only (AppOnly) authentication.
      • If seeing errors like AuthenticationError: AppOnly OBO tokens not supported by target service, switch to user identity.
    2. Confirm licensing for the user
      • If the user does not have a valid Microsoft 365 Copilot license or pay-as-you-go model, SharePoint-based agent calls can fail.
      • Assign a Microsoft 365 Copilot license to the affected user or enable the pay-as-you-go model as required.
    3. Verify tenant alignment
      • 401 or other authentication failures can occur if the Foundry/agent user and the Microsoft 365 user are in different tenants.
      • Confirm the same user identity exists and is used in the same tenant for both the agent platform and Microsoft 365.
    4. Check SharePoint permissions
      • If the tool returns no results or fails when opening, verify the user has at least read access to the SharePoint sites and libraries the agent is configured to use.
    5. Validate SharePoint URLs and paths
      • If the agent is configured with specific site or library paths, ensure those URLs are valid and accessible.
      • Resource not found conditions will cause the tool to fail and may surface as a broken or download-only experience.
    6. Reduce scope and wait for indexing if content is missing
      • For slow or inconsistent behavior, narrow the search scope (specific sites or libraries) and confirm the content is indexed by Microsoft Search.
      • If content was recently added, allow time for indexing and semantic index synchronization.

    After correcting identity, licensing, tenant, and URL issues, re-open the SharePoint Agent from the site. It should run within the page instead of forcing an .agent file download.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.