> This page is for Agent Filesystem.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.dropboxapi.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.dropboxapi.com/_mcp/server.

# Sample Apps

The [Agent Filesystem samples](https://github.com/dropbox/agent-filesystem-samples)
repository on GitHub has reference apps for Agent Filesystem workflows such as
managed users, agents with folder-scoped workspaces, automatic token minting,
and an agent's change history and undo. Use them to learn the API and as a
starting point for integrating Agent Filesystem into your own apps and
services. The samples change along with the Agent Filesystem API.

> **Warning**
>
> Agent Filesystem is in Private Preview and is subject to change. Contact
> your Dropbox representative to request access.

## Before you begin

You need an app enabled for the Agent Filesystem Private Preview. Follow
[Application Setup](/agentfs/docs/get-started/application-setup) to create
an Agent Filesystem application in the Developer Console. Each sample has a
README with its setup steps.

## FolderSync

[FolderSync](https://github.com/dropbox/agent-filesystem-samples/tree/main/foldersync)
is a desktop app that keeps a project folder in sync with a managed user's
Dropbox. You sign in as a managed user, sync a project folder with
**Sync now**, and then undo the changes FolderSync made in Dropbox. Changes
made outside FolderSync are kept. It shows how to:

* Sign in as your app and mint tokens on a backend. A small token server stands
  in for your backend: it holds the app key and secret, keeps the secret out of
  the app, and mints the managed user's token. FolderSync uses that token to
  mint each agent's token, and mints new ones automatically before they expire.

  ```text
  App key: <your_app_key>
  App secret (hidden):
  Starting the token server…
  … checking the app key and secret with Dropbox...
  … token server listening on http://127.0.0.1:8787
  ```

* Sign users in as managed users. A user types a name, and the token server
  creates a managed user for a new name or signs back in to the existing one.
  Any name works here, for the demo. In your product, your backend checks who
  your user is before it mints their managed user's token.

  ![The FolderSync sign-in screen with the name managed-user-1](/_fern-files/_img/1154938c4e1032da6e65cc53841230fd49ffa89b2d761aa2bb1c425533645e5d.webp)

* Give each project an agent whose workspace is limited to that project's
  folder. FolderSync writes changes with the agent's token, so Dropbox records
  them as the agent's. FolderSync syncs when you click **Sync now**, not in the
  background. **Undo** is next to it.

  ![A synced project in FolderSync: up to date after two uploads, with Undo and Sync now](/_fern-files/_img/fa1db86f5f7f0933b956e5f26ae8243d8d6b5bd4152735b68448ac207b633767.webp)

* See the agent's change history and undo back to a chosen change. Dropbox
  undoes that change and every change after it, and keeps changes made outside
  FolderSync.

To run it, follow
[Run FolderSync](https://github.com/dropbox/agent-filesystem-samples/tree/main/foldersync#run-foldersync)
in its README.