> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Let AI Agents Draft Word Docs in OneDrive

> Let agents read, create, and edit Word documents in OneDrive and SharePoint through Microsoft Graph. The gateway injects OAuth tokens, not the agent.

> [!NOTE]
>
> On self-hosted Buckle, Microsoft Word needs your own Microsoft app first. See [Self-hosted](#self-hosted).

## Overview

Buckle connects AI agents to Microsoft Word through Microsoft's OAuth flow. Agents can read, create, and edit Word documents stored in OneDrive and SharePoint. The gateway injects OAuth credentials into requests to the Microsoft Graph API automatically.

This is useful for agents working in Microsoft 365 environments that need to generate reports, draft documents, or process existing Word files.

## What you will set up

* A Microsoft Word connection through Microsoft OAuth
* Automatic token injection on Microsoft Graph requests
* Per-agent, per-tool access to documents

## Setup

**1. Open the app**

Open the Buckle dashboard and navigate to **Settings** > **Apps** > **Microsoft Word**.

**2. Authorize**

Click **Connect Microsoft Word**. You'll be redirected to Microsoft to sign in and authorize Buckle. Review the permissions and click **Accept**.

![Buckle connect window for Microsoft Word on Cloud, showing the Connect to Microsoft Word button.](https://mintcdn.com/onecli-17d3f772/h1DTAVlDkLshz4JZ/images/integrations/microsoft-word/buckle-connect-microsoft-word.png?fit=max\&auto=format\&n=h1DTAVlDkLshz4JZ\&q=85\&s=2055511e0d1ef36aa7bb6f9f37992f68)

The Microsoft Word connect window on Buckle Cloud.

## Permissions

| Permission | Access | Description |
| - | - | - |
| Files.ReadWrite | Read & write | View, create, update, and delete files in OneDrive and SharePoint |
| User.Read | Read | Your name and email address |

## Self-hosted: use your own Microsoft app

> [!NOTE]
>
> **Skip this section on Buckle Cloud.** It's only for self-hosted Buckle without `MICROSOFT_CLIENT_ID` and `MICROSOFT_CLIENT_SECRET` set. One Microsoft app serves all four Microsoft apps in Buckle, so you set it up once.

> [accordion] Set up your Microsoft app
>
> Follow [Self-hosted: use your own Microsoft app](/docs/integrations/outlook-mail.md#self-hosted) on the Outlook Mail page. If you already have one for another Microsoft app, it already works here. Then open **Settings** > **Apps** > **Microsoft Word** and select **Connect Microsoft Word**.
>
> ![Buckle Custom credentials card for Microsoft Word with the setup guide link, the Redirect URI and its copy button, and the Client ID and Client Secret fields.](https://mintcdn.com/onecli-17d3f772/h1DTAVlDkLshz4JZ/images/integrations/microsoft-word/buckle-custom-credentials-microsoft-word.png?fit=max\&auto=format\&n=h1DTAVlDkLshz4JZ\&q=85\&s=14caf77beb6eceb6e5277d1183d255db)
>
> Custom credentials for Microsoft Word in Buckle. The Microsoft app is shared, so the same client works here.

## What agents can do

* Read the content of Word documents from OneDrive or SharePoint
* Create new Word documents
* Edit and update existing documents
* Search for documents across drives and SharePoint sites
* Access shared files and followed sites

## Controlling access

Access is per agent: [grant](/docs/guides/agent-access.md) the connection to each agent that needs it, choosing per tool what runs freely, what needs human approval, and what stays blocked — a read-only agent is a single grant. Organization [rules](/docs/guides/rules.md) add guardrails on top, like rate limits and blanket blocks. Everything is checked before credential injection, so a blocked request never reaches Microsoft Graph.

## FAQ

> [accordion] Which files can the agent reach?
>
> Word documents in the connected account's OneDrive and SharePoint, through the `Files.ReadWrite` permission.

> [accordion] Does the agent see my Microsoft token?
>
> No. The token stays in Buckle, and the gateway adds it at the proxy. See [How it works](/docs/how-it-works.md).

> [accordion] Can I stop an agent from deleting files?
>
> Yes. Block or require approval for write tools when you [grant](/docs/guides/agent-access.md) the connection.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.