Create and use an agent in OneDrive

Applies To
Microsoft 365 Business Premium Microsoft 365 Business Standard

With agents in OneDrive, you can ask questions and get helpful answers from your documents—without opening each file. Whether you're managing a project or trying to catch up on work, agents save you time and effort by using AI to summarize and search your content.

Note

AI agents are available with Microsoft 365 Copilot license for work or school accounts only.

Screenshot showing the defining identity access page when creating an agent in OneDrive.

Follow these steps to create and use an agent:

Step 1: Build your own AI assistant in OneDrive

  1. Sign in to the OneDrive website with your work or school credentials. 

  2. Select files that you want to create the agent from. Then select Create agent (you may see this in the toolbar or right-click menu).
    Screenshot showing how to access and create an agent in OneDrive.
    Alternatively, you can also select + Create or upload and then select Create an agent.
    screenshot of creating new agent

  3. From here, you can specify up to 20 sources, give the agent a name, and modify the behavior of the agent.
    Screenshot of OneDrive agent builder

  4. Select Save or Save as.

Your agent will be saved as a .agent file in your OneDrive. By default, your agent is saved in the folder where it was created.

Note

If you create an agent from a Shared or Favorites folder, it will be saved under My Files > Documents > Agents.

First run experience: Discover how to create an agent

When you open the new menu or select the Copilot button on files for the first time, you’ll see a guided experience that introduces you to creating agents in OneDrive. This helps you quickly learn how to build your own AI assistant using your files and folders.

You’ll see a prompt like “Build your own AI assistant,” with options to try it or dismiss. 

FRE - Create or Upload agent

Step 2: Use your agent

1⁠. In OneDrive, find and open your .agent file.

2⁠. The file opens in a full-screen viewer.

3⁠. Type a question like:

  • What are the key updates in this folder?
  • What did we decide in the last meeting notes?
  • When is the next deadline in these project files?

4⁠. Press Enter or Send.

You can ask follow-up questions to dive deeper or clarify anything.

Step 3: Edit your agent (if needed)

To change the files your agent uses:

  • Option 1: Select the ⁠...⁠ (More actions) menu next to the .agent file and select Edit.
  • Option 2: Open the agent file, then select Edit from the top of the viewer.
  • Option 3 (if using SharePoint): Use the Edit option in the side panel.

You can rename your agent, update the file list, or remove files as needed.

OneDriveAgent-EditAnAgent

Step 4: Share your agent

You can share your agent just like a regular OneDrive file:

  1. Select the .agent file.
  2. Choose Share.
  3. Set the sharing permissions and send the link.

AgentsInOneDrive-Share3

AgentsInOneDrive-Share4

Note

  • The person you share with must also have access to the files inside the agent. If not, they won’t see the agent’s responses.
  • Agent creation in OneDrive is only available for these file types: DOC, DOCX, PPT, PPTX, PDF, TXT, RTF, MD. You can add up to 20 files when creating an agent. If you select a folder, it must contain no more than 20 files.

Need more help?

Account support. For help with your Microsoft account and subscriptions, visit Account & Billing Help.

Technical support. For technical support, select Contact Microsoft Support below, enter your problem and select Get Help.

Mobile users can contact Support by opening the OneDrive app and gently shaking your device.

Community support. Communities help you ask questions, give feedback, and hear from experts with rich knowledge. Ask the Microsoft Community. Do not disclose personal or sensitive information in public forums.