---
title: "How an AI Agent Gets Its Own File Workspace and Hands It to You"
description: "A real run: an agent with no account signs up for The Drive AI in one command, saves a report and its sources, and sends a claim link. The person sees the files before signing in and takes the workspace over with one button. Every output shown is what the tools returned."
url: https://thedrive.ai/blog/how-an-ai-agent-gets-its-own-file-workspace
published: 2026-10-23
updated: 2026-10-23
tags: ["ai agents", "mcp", "file storage for ai agents", "claude code", "cli", "claim link", "agent workspace"]
author: "Bigyan Karki"
publisher: The Drive AI
---

# How an AI Agent Gets Its Own File Workspace and Hands It to You

> **TL;DR:** An AI agent can open a The Drive AI account on its own, with no person present. `npx @thedriveai/cli signup` gives it a private workspace and a claim link. It saves its work there, then hands the link to the person, who sees the files before they sign in and claims them into their own workspace with one button. The agent keeps working as them. Below is a real run, start to finish, including what the person saw and what the agent could and could not do at each stage.

An agent that works for someone has a storage problem before it has any other. Its output lands in a working directory, a chat transcript or a temporary bucket, and the person it worked for has no account anywhere to receive it. Asking them to sign up first means asking them to trust work they have not seen.

The Drive AI treats the agent as a user of its own. It signs up, works, and shows the person what it made before anyone signs up for anything. This post is the whole sequence as it ran on 2026-10-23, with the CLI. The run was made against a development server: the only edits to the output below are the claim link's host, which is `thedrive.ai` in production, and long ids cut short.

## What does the agent need to start?

Node 20 or newer, and nothing installed. The CLI runs with `npx`. The agent in this run is called "Vendor Spend Agent", and its job was to turn three vendor exports into a quarterly spend report for someone who has never used The Drive AI.

## How does an agent sign up without a person?

One command. The name after `--agent` is what the person will see on the claim link, on the consent page and in their settings.

```bash
npx @thedriveai/cli signup --agent "Vendor Spend Agent"
```

```
Signed up as a provisional account: Vendor Spend Agent workspace.

Claim link (give it to the person; it shows them what you made and one button makes it theirs):
  https://thedrive.ai/claim/mk_vZ2s…

Until a person claims this account it cannot share, publish, invite, send file requests
or signatures, or run workflows; and it is erased when the claim link expires.
When the person claims it, the files are copied into a folder in their own workspace
(they need room for them there: a Free account has 1 GB in all) and this sign-in starts
acting as them, in every workspace they can reach: call get_current_user again and use
what it names. If the person already has a The Drive AI account, prefer the device
sign-in (/oauth/mcp/device) over making an account for them.
```

No email address, no card, no browser. Under the hood the CLI registered a public OAuth client under the agent's name, called the sign-up endpoint, and stored the tokens in `~/.config/thedrive`. The answer tells the agent the rules of the account in the same breath, so it does not have to discover them by being refused.

## What can the agent do in its workspace?

Everything that stays inside it. The agent made a folder for the report and one for the sources:

```bash
npx @thedriveai/cli mkdir "/Vendor spend Q3 2026/sources"
```

```
Changeset 3B0B3AA7… — "Make /Vendor spend Q3 2026/sources"
operations: 2 (create_folder 2)
risk: low — 2 non-destructive operation(s) within the auto-apply limit of 20
new folders: /Vendor spend Q3 2026, /Vendor spend Q3 2026/sources
Changeset 3B0B3AA7…: 2 applied, 0 failed.
```

Even a `mkdir` is a changeset: proposed with a count and a risk, applied, and reversible as a whole. Then it saved the report, the table and the three exports it was built from:

```bash
npx @thedriveai/cli put "Vendor spend Q3 2026.md" vendor-spend-q3-2026.csv --to "/Vendor spend Q3 2026"
npx @thedriveai/cli put sources/*.csv --to "/Vendor spend Q3 2026/sources"
```

```
Saved /Vendor spend Q3 2026/Vendor spend Q3 2026.md (1.0 KB).
Saved /Vendor spend Q3 2026/vendor-spend-q3-2026.csv (263 B).
Saved /Vendor spend Q3 2026/sources/acme-logistics-export.csv (238 B).
Saved /Vendor spend Q3 2026/sources/northwind-export.csv (203 B).
Saved /Vendor spend Q3 2026/sources/globex-export.csv (144 B).
```

Each save names the changeset that would take it back out. A look at the result:

```bash
npx @thedriveai/cli tree /
```

```
/ (workspace root)
  Vendor spend Q3 2026/  (2 files, 1 folders)
    sources/  (3 files, 0 folders)
```

The same tools work for reading and searching: `cat`, `grep`, `find`, and `ask` for a question across many files. Saving, listing, reading, moving and renaming cost nothing; `ask` runs The Drive AI agent and counts against the account's 20 tasks.

## What can't it do before someone claims it?

Reach anyone. The agent tried to publish the report with a public link:

```bash
npx @thedriveai/cli tool share_publish '{"ref":"/Vendor spend Q3 2026/Vendor spend Q3 2026.md","published":true}'
```

```
Error (permission): This account is waiting for a person to claim it, so it cannot
change who can reach its files yet. Open the claim link the agent was given to
finish setting it up.
```

Sharing, publishing, invites, file requests, signatures and workflows are all refused the same way, and the account gets no email. An account nobody has vouched for cannot be used to send things to people. The refusal says what to do instead, so an agent can relay it rather than guess.

## What does the person see when they open the link?

The files. Not a login page.

![The claim page: a workspace shared by Vendor Spend Agent, the folder tree on the left, the report open on the right, and one button, Sign in to claim](https://thedrive.ai/images/for-agents/claim-page.png)

The top bar says who shared it. The title is the workspace, with its size. The report opens on the right as soon as the page loads; notes, text files and CSV tables are readable in place, and anything else opens once the workspace is theirs. Below the files, three lines of fine print say what claiming does: the files are copied into a folder named after the agent, the agent keeps working as them within the scopes shown, and the link expires. On a phone the button sits at the bottom of the screen.

The person in this run did not have an account. The button took them through sign-up and straight back to the same page.

## What happens when they claim it?

The claim copies the agent's files, folders and all, into the person's own workspace, and moves the agent's sign-in onto their account. Nothing already in their workspace is touched: it is a copy into a new folder, not a merge. The provisional account is then deleted.

The agent did not have to do anything. Its next call answered as the person:

```bash
npx @thedriveai/cli whoami
```

```
Signed in as Priya Raman <priya@…> (user id 5001489A…).

Workspaces (1):
- Personal (personal) · id 7E30EC7F… · owner · agent_ask available · used when you pass no workspace
```

```bash
npx @thedriveai/cli tree /
```

```
/ (workspace root)
  Vendor Spend Agent/  (0 files, 1 folders)
    Vendor spend Q3 2026/  (2 files, 1 folders)
```

The report, the table and the sources are in the person's workspace, under a folder named after the agent. In the activity log, each copied file is recorded as "Vendor Spend Agent (claimed)", so the origin survives any later rename.

## What happens to the agent's changes after the claim?

They become the person's to approve. The agent tried the same publish again, now as the person:

```
Waiting for the person's approval. Nothing has changed yet.

Make /Vendor Spend Agent/Vendor spend Q3 2026/Vendor spend Q3 2026.md public
Note: Anyone with the link can view it, without signing in.
```

Before the claim, there was nobody to ask, and nothing could leave the sealed workspace, so the agent confirmed its own changes there. After the claim there is a person, so a change that needs agreement is parked. They get a notification and decide in The Drive AI, under Settings → MCP → Waiting for you. The agent is told to wait and can follow the decision with `approval_status`. Every change it makes from now on is logged as "Vendor Spend Agent via MCP", and the person can narrow its scopes or disconnect it in the same settings page.

## What if nobody claims it?

The account is erased after seven days, files included, and the link stops working. An agent that still has work to hand over signs up again. Sign-ups are limited per client and per address, so a runaway loop cannot fill the service with abandoned workspaces.

## Can an agent do this without the CLI?

Yes. The CLI is a convenience over four public endpoints. Any OAuth 2.1 client can do the same:

1. Read the authorization server's metadata at `https://service.thedrive.ai/.well-known/oauth-authorization-server`. It names every endpoint, the scopes and the auth methods.
2. Register a public client (RFC 7591) with a name. No secret; PKCE proves every exchange.
3. Sign up at `https://service.thedrive.ai/api/v1/oauth/mcp/signup` with the client id and the scopes wanted. The answer carries tokens, the workspace and the claim link.
4. Call the MCP server at `https://mcp.thedrive.ai/mcp` with the access token as a bearer, the same endpoint Claude and ChatGPT use.

An agent harness that installs skills can take the whole recipe with `npx skills add thedriveAI/skills`. The briefing written for agents is at [thedrive.ai/agents.md](https://thedrive.ai/agents.md), and the page for people is [thedrive.ai/for-agents](https://thedrive.ai/for-agents).

## What if the person already has an account?

Then the agent should not make them another. It runs `npx @thedriveai/cli login` instead, which prints an eight-letter code. The person approves it at thedrive.ai in their own browser, sees the agent's name and the scopes it asks for, and the agent gets its tokens. From then on it works in their workspace and their connected Google Drive, OneDrive, SharePoint or Dropbox folders, with the same previews, confirmations and undo. The sign-up answer says this too, which is why an agent reading it will usually ask the person first.

## Frequently Asked Questions

### Does the agent's account cost anything?

No. Until it is claimed it is free, with 1 GB of storage and 20 agent tasks in all. Direct file tools do not count as tasks. After the claim, the person's own plan applies.

### Can the agent read or change my existing files before I claim?

No. Before the claim it has no connection to you at all; it is a separate, sealed account. Claiming copies its files into a new folder in your workspace and never changes what was already there.

### Is a claim link safe to send over chat?

Treat it like a password-reset link. Whoever opens it can claim the workspace and the agent with it, so the agent should give it to one person, and that person should not forward it. It expires with the account.

### Which agents can use this?

Any agent that can make HTTPS calls: Claude Code, Codex and Cursor through the MCP server, an autonomous agent with its own HTTP client, or a script using the CLI. There is nothing to install and no SDK.

### How is this different from giving an agent a Google Drive API key?

A key is the whole drive, for ever, with no preview and no undo. An account the agent makes for itself is sealed until you have seen the work. Afterwards it has only the scopes you allowed, every change is a previewed changeset you can reverse as a whole, and the activity log names the agent on each one.

---

Give your agent somewhere to put its work: the recipe, the limits and what the person sees are on [the page for agents](https://thedrive.ai/for-agents), and the server it connects to is described on [the MCP page](https://thedrive.ai/mcp).
