# Google Drive plugin

The Google Drive plugin lets a Vaubaan Gateway mission use Google Drive without handing the agent a credential. Google Drive through Google's Drive API: list folders, search and read files (Docs, Sheets and Slides as text), upload new files and create folders. No sharing, no deletion.

Version `0.1.0` · 4 permissions · 2 macro-actions · 5 tools · 0 gateways run this plugin (over the last 90 days).

## How Google Drive is modelled

1 plane, 4 things. The things that exist at the service and how they nest. Every permission is written over these; a resource of an account is one of them, named by its ref.

- **Account** — One account is one Google account, signed in at Google with nothing to create or paste.
  - Plane `drive` — The files and folders one Google account can open.
    - `drive` (1 *; the resource) — The resource an account exposes: what the account can open in Drive. Its identifier is the ref (alice\~acme.com); an address the slice grammar cannot carry is written \[\*\].
      - `folder` (1 *) — A folder, by its Drive id (\`root\` for the top of My Drive); without an identifier, a new one.
      - `file` (1 *) — A file, by its Drive id; a search is \[\*\]; without an identifier, a new one.
        - `content` (1) — Verb leaf: reading what a file holds, not only its name and type.

Marks: 1 exactly one, named; n a finite, known set; * an unknown number, possibly all.

- **Account**: One account is one Google account, signed in at Google with nothing to create or paste.
- **Resource**: One resource is its drive: everything the account can open. A mission reads what files are called and what they hold as two permissions, and creating folders and uploading files as two more; nothing is shared or deleted. Until Google reviews Vaubaan's access to Drive, Google's consent screen warns that the app is unverified.
- **Environment**: No permission of this service depends on an environment: each is held once, whatever the resource. Known: none. Carried by: nothing in the model.

## What an agent does at Google Drive: 2 macro-actions

A mission is made of them: the person ticks the ones the task needs and sets each to a trust level.

1. **Read files** — List folders, search files and read them. Browsing the account's Drive: listing folders, searching by name and content, and reading documents, sheets, presentations and text files. Nothing changes, but files hold what a company keeps, and their text was written by others. Reading what a file holds is a permission apart from listing what files are called. (2 permissions)
2. **Add files** — Create folders and upload new files. Putting new files and folders in the account's Drive. Nothing existing is changed, shared or deleted. A new file is seen at once by everyone who can open its folder, and the agent cannot take it back, so uploading asks first unless the mission is trusted with it. (2 permissions)

## The map

4 permissions of 2 macro-actions, in the four rows of the tree. For the chosen trust level, each cell gives yes, ask me or no, and the quota a day.

Careful ×1: Mild actions run freely; sensitive or costly ones ask first; irreversible ones are left out. Trusting ×3: Up to sensitive actions run freely; costly and irreversible ones ask first. Limits ×3. Autonomous ×10: Everything but irreversible actions runs freely; those ask first. Limits ×10.

yes: runs freely; ask me: ask me first; no: not included. A permission sits in the first row its facts answer: irreversible; costly to undo or unbounded cost; secret or personal data, whole account or bulk, moderate cost, public; otherwise harmless.

### Cannot be repaired

Careful: no. Trusting, Autonomous: ask me.

None.

### Repairable, at a price

Careful, Trusting: ask me. Autonomous: runs freely.

- Add files: Upload a file `google-drive.file-upload`, costly to undo — A new file written by the agent, at once visible to everyone who can open its folder, which may be shared outside the company. Its text is the agent's: whatever it read can leave this way. The agent cannot delete it afterwards, and a person who read it cannot unread it. Careful: ask me · 50 a day · Trusting: ask me · 150 a day · Autonomous: yes · 500 a day.

### Worth a look

Careful: ask me. Trusting, Autonomous: runs freely.

None.

### Harmless

Runs freely at every level.

- Read files: List folders and search files (names, types, dates, links) `google-drive.file-list` — What the account's files are called, where they sit, when they changed and who can follow their link: a listing says what a person works on, not what the files hold. Names are written by others, a path for prompt injection. Careful: yes · 1,000 a day · Trusting: yes · 3,000 a day · Autonomous: yes · 10,000 a day.
- Read files: Read what a file holds `google-drive.file-read` — The text of a document, a sheet, a presentation or a text file lands in the agent's context: whatever the account can open, its own files and the ones others shared with it. Nothing is modified. Careful: yes · 300 a day · Trusting: yes · 900 a day · Autonomous: yes · 3,000 a day.
- Add files: Create a folder `google-drive.folder-create` — An empty folder, seen by whoever can open its parent. The agent cannot delete it; a person removes it in a click. Careful: yes · 30 a day · Trusting: yes · 90 a day · Autonomous: yes · 300 a day.

Careful: runs freely 3, ask me first 1.
Trusting: runs freely 3, ask me first 1.
Autonomous: runs freely 4, ask me first 0.

Limits are counted over a mission's period: a day unless its creator picks another, or the mission's whole life for a one-off. The figures here are per day.

## A few calls, classified by the plugin

6 declared calls, run through the plugin's own classifier when this page was built; here one per macro-action. [The 6 calls, as code](https://github.com/vaubaan/gateway/blob/main/plugins/google-drive/src/examples.ts).

- `google_drive__list_folder {}`
  - the plugin sees: `google-drive.drive[alice~acme.example].folder[root].R`
  - the catalog answers: List folders and search files (names, types, dates, links) `google-drive.file-list`
  - a Careful mission: yes
- `google_drive__upload_file {"name":"notes.md","content":"# Notes\n","mimeType":"text/markdown","folderId":"1FoLdEr_x-2"}`
  - the plugin sees: `google-drive.drive[alice~acme.example].file.W`
  - the catalog answers: Upload a file `google-drive.file-upload`
  - a Careful mission: ask me

## Anything else

A call no permission covers touches `google-drive.uncategorized-write` instead of slipping through. No macro-action holds it; a person ticks it knowingly.

| Permission | Risk | Careful ×1 | Trusting ×3 | Autonomous ×10 |
| --- | --- | --- | --- | --- |
| Uncategorized write `google-drive.uncategorized-write`: Catch-all for writes without a dedicated entry. A mission creator who includes it allows the writes this catalog has not reviewed. | Repairable, at a price (costly to undo) | ask me · 50 a day | ask me · 150 a day | yes · 500 a day |

Left out on purpose — tools of the service this plugin does not expose:

- `google_drive__share_file`: Sharing gives people outside the mission a file at once and for as long as nobody revokes it; a person shares by hand.
- `google_drive__delete_file`: No deletion is offered, not even a move to the trash: what an agent writes stays until a person removes it.
- `google_drive__update_permissions`: Changing who may open a file is the person's decision, never an agent's.

## Tools

5 tools. A tool's permissions depend on its arguments, so a mission is made of the macro-actions above, not of tools.

| Tool | What it does | Usually touches |
| --- | --- | --- |
| `google_drive__list_folder` | List a folder | `google-drive.file-list` |
| `google_drive__search_files` | Search files | `google-drive.file-list` |
| `google_drive__read_file` | Read a file | `google-drive.file-read` |
| `google_drive__upload_file` | Upload a file | `google-drive.file-upload` |
| `google_drive__create_folder` | Create a folder | `google-drive.folder-create` |

## Connecting an account

**3 of 3 · you sign in through an OAuth broker** — `oauth2 · broker · google`

**Before anyone connects** (an administrator, once):

- The instance must be enrolled with an OAuth broker serving the service `google`; an administrator sets it up once, for everyone on the instance. Until then Google Drive reads "not configured" on the connect screen.
- Two ways to get one: enrol with a broker someone else operates, or run the published broker image with your own client at the service.
- The gateway's pages tell whether the broker is attested.
- OAuth provider `google`; scopes asked: `https://www.googleapis.com/auth/drive`. [Your own OAuth broker](/docs/operations/oauth-broker)

Google Drive signs in through the client of an OAuth broker: nothing is created or pasted, the person signs in at Google Drive and allows the gateway.

Disconnecting: In your Google account, open Security, then 'Third-party apps with account access', and remove the app this gateway signed you in with.

## Health

0 gateways run this plugin (over the last 90 days).

No version of this plugin has reported a call or a gateway yet.

A version is marked validated by the community with at least 200 reports and a success rate of at least 90 %, over the last 90 days; a gateway shows that mark on the accounts of this service. The figures are refreshed at most hourly ([what they mean](/plugins/health)). It is a community signal, not a security guarantee.

Calls are counted over the last 90 days from the instances that share plugin health. Gateways are counted over the same window among the instances that also share usage statistics, so they are a lower bound. The success rate leaves out calls refused for a rejected credential: a revoked token is the user's configuration, not the plugin.

## Links

- [Connect a Google Drive account](/plugins/google-drive#connect)
- [How Google Drive is modelled](https://github.com/vaubaan/gateway/blob/main/docs/handbook/services/google-drive.md)
- [The catalog, as code](https://github.com/vaubaan/gateway/blob/main/plugins/google-drive/src/risk-catalog.yaml)
- [The plugin source](https://github.com/vaubaan/gateway/tree/main/plugins/google-drive)
- The page: [/plugins/google-drive](/plugins/google-drive)
