A Google Workspace domain now runs agents that no one listed: Workspace Studio flows acting with their creator's access, Gemini Enterprise agents reaching into Drive and Gmail, shared Gems and years of Apps Script bots with their own Cloud projects. Each lives in a different part of the Admin console or Google Cloud, and none of them appears in the user directory. This runbook builds one reconciled inventory from the Agents pages, the API controls app lists, the OAuth token audit, the Workspace Studio and Drive audit logs and the organisation's Apps Script Cloud folder. It covers read-only discovery first, then ownership, access reduction and removal with a rollback. It is for Google Workspace super administrators, Google Cloud organisation administrators and the security engineers who own AI governance. For the operating model behind a registry, see the AI agent registry guide.
This is an independent guide from NHI Mgmt Group, based on Google's public documentation as of November 2026. It is not sponsored or reviewed by Google. Agent features in Workspace are changing quickly, so confirm menu names, privileges and editions against Google's current documentation.
Key takeaways
- Five sources, one inventory. Agent access management, the API controls app lists, the token audit, the Workspace Studio and Drive audit logs and the Apps Script Cloud folder each see a different slice of the agent estate.
- The agent list is not complete by default. Google documents that the Gemini Enterprise management list shows only agents an administrator added manually; everything else follows the edition's default policy.
- Agents inherit people. A Studio flow has the same data access as its creator by default, and an Apps Script bot runs with the scopes its user authorised, so the owner record matters as much as the agent record.
- Apps Script leaves a Cloud footprint. Every script has a default Cloud project in the organisation's Apps Script folder, which gives you a countable list and a reliable way to stop a script.
- Reduce access before you delete. Pause data access, Change access and the Blocked level are reversible; deleting a script's standard Cloud project or a flow is not.
When you need this
- Before or just after enabling Workspace Studio: Google launched Studio to all Rapid Release and Scheduled Release domains by March 2026 as a core service, so many tenants received it under their release preference rather than a project decision.
- After a leaver wave: flows and scripts owned by departed staff keep their configuration, and standard Apps Script Cloud projects persist even after the script is deleted.
- For an audit or AI register request: NIST SP 800-53 CM-8 and NIST CSF 2.0 ID.AM-02 expect a maintained inventory of software and services. The AI Register and AI Inventory Template gives the record this inventory feeds.
- After an OAuth or AI app incident: you need to find every agent and app holding a given scope fast. A forgotten AI tool with a live token is a standing machine identity, so the inventory should already show its owner, scopes and last activity. The Shadow AI Discovery Guide covers how such tools are found across the wider estate.
Where agents show up in Google Workspace
Google groups agent controls under a top-level Agents menu in the Admin console, but older automation still lives under API controls, Drive and Google Cloud. Use each view for the question it answers.
| Source | What it lists | Privilege to read | Limit to know |
|---|---|---|---|
| Admin console: Agents > Agent access management | Studio flows, Google Workspace work agents and Gemini Enterprise agents that request Google data, with an access level and actions | Security administrator (Gemini Enterprise agents) | Gemini Enterprise agents appear only if an administrator added them by Agent ID |
| Security > Access and data control > API controls | Configured apps (App name, Type, ID, Verified status, Access) and Accessed apps (users, requested services) | Service Settings administrator | Shows OAuth apps, including AI tools, but not what each app did |
Reports API token audit (applicationName=token) | authorize, revoke, request and activity events per app and user | Reports access | Records grants and API use, not the agent's purpose |
| Reporting > Audit and investigation > Workspace Studio log events | Flow and skill lifecycle and runs: Flow ID, Flow name, Agent ID, Step app, Actor | Audit and investigation tool administrator | Shows activity; an idle flow leaves few records |
| Drive log events filtered to Document type Google Script | Actions on Apps Script projects stored in Drive | Audit and investigation tool administrator | Container-bound scripts sit inside their Doc, Sheet or Form |
| Google Cloud: the organisation's Apps Script folder | Default and standard Cloud projects behind every script | resourcemanager.projects.list on the folder | Default projects are owned by a Google system service account and hidden from most users |
Agent types and what to record
| Agent type | Whose access it uses | Inventory question | Documented control |
|---|---|---|---|
| Workspace Studio flow | The creator's, by default | Which steps and third-party apps does it touch, and is the creator still here? | Pause data access, Change access, turn Studio off for an OU or group, stop a flow |
| Google Workspace work agent | Granted Workspace scopes | What tasks does it run, and who edits it? | Pause data access, suspend in the work agents list |
| Gemini Enterprise agent | Workspace data the agent requests | Is it known by Agent ID, and is it Trusted by default? | Add agent, Change access to Blocked |
| Shared Gem | The user running it | Who can use it, and is it shared outside the domain? | Gem sharing setting; Drive sharing rules |
| Apps Script bot or add-on | The scopes the authorising user granted | Which scopes, which triggers, which external URLs? | App access control, turn Apps Script off, delete the Cloud project |
| Third-party AI app (OAuth) | The user's granted scopes | How many users, which services, verified or not? | Trusted, Limited or Blocked in API controls |
Before you start
- Privileges: build a custom discovery role with the Audit and investigation tool, Reports and read access to Security settings. Keep Security administrator, Service Settings administrator and Gemini Settings administrator rights for the change steps in a separate, approved group. On the Google Cloud side, grant
resourcemanager.projects.liston the Apps Script folder only. - Editions: the security investigation tool, which raises the export limit, is available on Enterprise Standard and Plus, Frontline Standard and Plus, Education Standard and Plus, Enterprise Essentials Plus and Cloud Identity Premium. The Apps Script external connection allowlist needs Business Plus, Enterprise or the listed Education editions.
- Timing: Google states that agent access and Studio setting changes can take up to 24 hours, so plan holds and verification around that.
- Record format: agree fields first: agent name, type, IDs (Flow ID, Agent ID or SPIFFE ID, OAuth client ID, script ID, Cloud project number), owner, OU, scopes or access level, external apps or URLs, sharing, last run or last token activity and decision.
Step-by-step
Steps 1 to 6 are read-only. Steps 7 and 8 change access but are reversible. Step 9 is destructive.
- Export the agent access list. Open Menu > Agents > Agent access management. Filter by Type (for example Studio flow) and record every row with its access level. Then open Agents > Settings and record Default access for Workspace agents and Default access for Studio flows for each OU. The defaults matter most for Gemini Enterprise agents, because any agent not on the list follows the edition's policy, and the documented default for listed agents is Trusted.
- Add known Gemini Enterprise agents by ID. Ask the Google Cloud team for the SPIFFE ID of each agent in Gemini Enterprise Agent Platform. Use Add agent, enter the ID and keep the access option at its current state for now, so that the list becomes a register without changing behaviour. The Gemini Enterprise Security Guide covers how those agents are built and governed on the Cloud side.
- Download both app lists. In Security > Access and data control > API controls, open the app access list, then Download list for Configured apps and for Accessed apps. The configured CSV adds Number of users, Requested services and API scopes. Sort by users and by restricted services such as Gmail and Drive, and tag AI tools and assistants. Record the Unconfigured third-party apps setting and whether Trust internal apps is on, because that one setting trusts every organisation-owned app, including internal scripts, for restricted APIs. The third-party OAuth app inventory runbook goes deeper on this list.
- Pull the token audit. Query the Reports API for 90 days to see which apps were granted scopes, by whom, and which actually call APIs:
GroupGET https://admin.googleapis.com/admin/reports/v1/activity/users/all/applications/token?eventName=authorize GET https://admin.googleapis.com/admin/reports/v1/activity/users/all/applications/token?eventName=activityauthorizeevents byclient_idandapp_nameand keepscope; groupactivityevents byclient_id,api_nameandmethod_name, and sumnum_response_bytesto spot heavy readers.requestevents withapp_request_infoshow users asking for blocked apps, which is a good signal of shadow AI demand. For a single user, the Directory APIusers.tokens.listmethod returns their current grants. - Search Workspace Studio and Drive logs. In Reporting > Audit and investigation > Workspace Studio log events, widen the date range from the default 7 days and search Create flow, Edit flow, Turn on, Start run and Block step. Export Flow ID, Flow name, Actor, Step app and Agent product. A Step app value naming a third-party service (Studio connects to apps such as Jira, Asana and Salesforce) marks a flow that moves data out of Workspace. For full flow configurations, Google documents the Data Export tool, which includes flow setups and execution logs. Then open Drive log events, filter Document type to Google Script, and export to find standalone scripts, their owners and recent edits. Shared Gems are stored in Drive too, so check Drive sharing for them.
- List Apps Script Cloud projects. In the Google Cloud console Manage Resources page, copy the ID of the Apps Script folder, then list its projects:
Default projects carry the system service accountgcloud projects list --filter='parent.id=APPS_SCRIPT_FOLDER_ID'[email protected]as owner. Standard projects were created deliberately, are required for Marketplace add-ons and thescripts.runAPI, and persist after the script is deleted, so treat each one as a managed asset with an owner. Use Reports > Apps Reports > Apps Script for daily active users and projects over six months, which shows whether the estate is growing. For scripts that hold service account keys or use domain-wide delegation, cross-check the domain-wide delegation grants audit. - Reconcile and assign owners (reversible). Join the sources on OAuth client ID, Agent ID, Flow ID and script ID. Classify each agent as approved, needs owner, needs review or remove. A flow, script or app whose owner is suspended or deleted needs a named successor before anything else changes. Record a sponsor for each Gemini Enterprise agent, and see Agent Identity Recertification for the review cycle.
- Reduce access (reversible). For a Studio flow, work agent or Gemini Enterprise agent use Actions > Change access to Specific Google data or Blocked, or Pause data access. Know the effect per type: paused Studio flows keep running without Google data and users see errors in the Studio activity log; work agents stop in-progress tasks and their environment is deleted; Gemini Enterprise agents lose Google data but can still accept tasks. For OAuth apps, set Limited or Blocked in API controls; blocking overrides an allowlist entry for the same app. Hold this state for a full business cycle.
- Remove (destructive). To stop an Apps Script project completely, Google documents deleting its Cloud project, which stops all executions and needs delete permission on the project. Revoke individual user grants with the Directory API
users.tokens.deletemethod or the user's security page. Delete flows only after the hold period and owner sign-off, and export their configuration first so you can rebuild one if needed.
Verify it worked
- Counts reconcile: every client ID with token
activitymaps to a configured app, a script or a listed agent. Unmatched clients are your shadow agents. - Owners exist: no flow, script or standard Cloud project in the inventory is owned by a suspended or deleted account.
- Blocks are real: Workspace Studio log events show Block step or no new Start run for paused flows, and token
activitystops for blocked clients after the documented propagation window. - No breakage: owners and the help desk report no failed business process during the hold.
Rollback and common errors
| Situation | Fix |
|---|---|
| A paused or blocked agent is needed | Change access back to its previous level; allow up to 24 hours |
| A blocked OAuth app is needed | Set it to Limited or Trusted in Configured apps; users may need to authorise again |
| Expected Gemini Enterprise agent missing from the list | By design: add it by its SPIFFE ID from Gemini Enterprise Agent Platform |
| Script stopped after its Cloud project was deleted | Rebuild from a copy and authorise again; plan for this before deleting |
| Flows stop across an OU | Check whether Default access for Studio flows was set to Don't allow agent access; Google warns that this stops most flows |
| Gem still shared after sharing was turned off | Expected: earlier shared Gems stay shareable in Drive; remove sharing on the Drive file |
Common failure patterns
- Treating the agent list as the inventory: it only shows Gemini Enterprise agents you added. Use the token audit and the Cloud folder to find the rest.
- Leaving Trust internal apps on without a list: every internal script gains restricted API access with no individual review. Inventory internal apps first, then decide.
- Ignoring container-bound scripts: scripts inside Sheets and Forms are easy to miss in Drive searches; the Cloud folder and token audit still show them.
- Counting existence, not use: an agent with Trusted access and no runs is still a standing grant. Track last activity and reduce access for idle agents.
- Deleting first: a deleted flow or Cloud project removes the configuration you need if the agent turns out to be part of an incident. Export, pause, then delete.
Hardening afterwards
- Set safer defaults: use Specific Google data as the default for Workspace agents in OUs that handle sensitive data, and allow Studio only for groups that have an owner process.
- Restrict outbound reach: use the Apps Script external connection allowlist where your edition supports it, and the Studio step controls to allow or block service-specific and Gemini steps.
- Alert on change: configure Workspace Studio activity alerts and reporting rules on Create flow, token
authorizeevents for unreviewed clients, and new projects in the Apps Script folder. The Google Workspace Audit Log Detection Guide covers rule design. - Govern Gem sharing: keep Gem sharing on only where Drive external sharing rules are already tight. See the Gemini for Google Workspace Security Guide.
Small domain or large enterprise
A small domain can run steps 1, 3 and 5 from the Admin console each quarter and keep the inventory in a sheet, using the 100,000 row export limit. A large enterprise should script the Reports API token pull and the Cloud folder listing weekly into its CMDB or AI register, use the security investigation tool for large exports, and route new flows and scripts to OU owners automatically.
Metrics
| Metric | Direction |
|---|---|
| Agents, flows and scripts with no active owner | Zero, or each with a ticket |
| Client IDs with token activity but no inventory record | Zero |
| Agents at Trusted access with no review in 12 months | Falling |
| Flows using third-party step apps | Known and justified |
| Days from flow or script creation to inventory record | Under 7 |
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | CM-8 System Component Inventory; AC-2 Account Management; AC-6 Least Privilege | Agents and scripts as inventoried components with owners and minimal scopes |
| NIST CSF 2.0 | ID.AM-02; PR.AA-05; DE.CM-03 | Software and service inventory; permission review; monitoring technology usage |
| CIS Controls v8.1 | Control 2 Inventory and Control of Software Assets | Authorised and unauthorised software, applied to agents and scripts |
| MITRE ATT&CK | T1528 Steal Application Access Token; T1671 Cloud Application Integration | Stolen OAuth tokens and malicious app integrations as persistence in SaaS |
Practitioner checklist
- Create a read-only discovery role and keep change privileges in an approved group.
- Export Agent access management and record the default access settings per OU.
- Add every known Gemini Enterprise agent by SPIFFE ID.
- Download Configured apps and Accessed apps with scopes and user counts.
- Pull 90 days of token
authorizeandactivityevents and group by client ID. - Export Workspace Studio log events and Drive log events for Google Script.
- List the Apps Script Cloud folder and give each standard project an owner.
- Reconcile, assign owners, reduce access and hold before any deletion.
- Schedule the token and Cloud folder pulls and alert on new flows and grants.
Standards and references
- Google Workspace Admin Help: Manage work agent access to Google data
- Google Workspace Admin Help: Manage Gemini Enterprise agents for Workspace users
- Google Workspace Admin Help: Control which third-party and internal apps access Google Workspace data
- Google for Developers: Reports API OAuth token audit activity events
- Google Workspace Admin Help: Workspace Studio log events
- Google for Developers: Monitor and control Apps Script use in your organisation
- Google for Developers: Google Cloud projects for Apps Script
- Google Workspace Admin Help: Turn Gem sharing on or off
Related NHI Mgmt Group resources: AI agent registry · Shadow AI Discovery Guide · How to Inventory third party oauth apps in google workspace · Google Workspace Security Guide · Gemini for Google Workspace Security Guide