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

# Google Drive

> Connect Drive audit attribution, file metadata, and published label taxonomy.

Google Drive is a data and attribution integration, not an AI activity source.
Forge correlates Drive audit records with agent activity and imports published
Drive labels for use as data context in policies.

## Access

The hosted OAuth flow requests:

```text theme={"system"}
https://www.googleapis.com/auth/admin.reports.audit.readonly
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.labels.readonly
https://www.googleapis.com/auth/drive.admin.labels.readonly
```

Forge supports the hosted OAuth refresh-token flow and service-account
domain-wide delegation. Service-account setup requires the delegated admin
subject email and the same approved scopes.

## Collection

| Source                   | Data                                                                                             |
| ------------------------ | ------------------------------------------------------------------------------------------------ |
| Admin Reports Drive feed | Native event ID, actor, action, timestamp, resource references, and sharing context              |
| Drive metadata           | File name/type, owner, shared-drive context, and identifiers needed to resolve a referenced file |
| Drive Labels API         | Published label definitions, fields, selection choices, and descriptions                         |

Label sync calls the Drive Labels API with `publishedOnly=true`,
`useAdminAccess=true`, and full label view. Forge imports the taxonomy; it does
not create, edit, or publish customer labels.

## Attribution

Forge evaluates a Drive event using direct resource IDs, resource-name
matches, OAuth application context, and bounded temporal behavior. The result
is one of:

```text theme={"system"}
agent_attributed
likely_agent
human_or_unobserved
unknown_automation
conflict
```

The record also preserves the attribution method and competing candidates.
Forge does not force a match when evidence conflicts.

## Setup

1. Open **Settings → Integrations → Google Drive** and complete the Google
   OAuth flow, or save the approved domain-wide-delegation credential.
2. Configure poll interval, import delay, and lookback window.
3. Run **Sync labels** and confirm the expected published taxonomy count.
4. Enable or resume the connector, then run an audit sync.
5. Compare one known Drive action with its actor, file, native event ID, and
   attribution result in Forge.

## Verification

| Symptom                        | Check                                                                                                            |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
| Zero labels                    | Labels exist but are not published, admin label scope is missing, or the wrong customer was authorized           |
| Audit works, metadata does not | `drive.metadata.readonly` scope or file visibility                                                               |
| Unresolved owner               | Workspace identity email/alias correlation                                                                       |
| `conflict` attribution         | Multiple candidates are within the scoring threshold; review source evidence instead of overriding automatically |

Pausing the connector stops polling without deleting prior attribution
records. Revoking the Google grant removes provider access.
