Connect using Service Account Authentication
In this guide, you will use the Guardrails Create Connection wizard to connect your GCP Organization using Service Account Impersonation.
Prerequisites
Turbot/OwnerorTurbot/Adminpermissions at the Turbot resource level.- Completed Set Up Service Account Authentication. Your service account should be created with the required IAM roles. If using impersonation, the Token Creator role should be granted.
- The required GCP APIs enabled in the Organization SA's project and in every project you plan to import. The wizard does not check or enable them.
- Your GCP Organization numeric ID.
- The Organization Service Account email address.
Step 1: Open the Create Connection Wizard
From the Accounts page, click the Actions dropdown and select Create Connection. Select GCP from the provider grid.

Choose GCP Organization (recommended). The alternative GCP Project option connects a single standalone project. See Connect a Project for that workflow.
Step 2: Configure the Service Account
The wizard opens with the service account configuration. Select Service Account Impersonation as the access mode and enter the Organization SA email.

The wizard displays:
- The gcloud command to grant the Token Creator role (copy and run it if you haven't already done so during Set Up Service Account).
- The External ID label key and value to set on the Organization SA's project.
About the External ID
Guardrails auto-generates a unique External ID for your workspace (e.g., turbot_123456789012345_99999999). We recommend using this value. It prevents the confused deputy problem by ensuring only your Guardrails workspace can use the service account. You can also set a custom External ID by clicking the lock icon to unlock the field.
For more information, see What is Guardrails External ID Protection?

[!IMPORTANT] For Service Account Impersonation, both the Token Creator role and the External ID label must be in place before clicking Continue. Guardrails verifies both.
Click Continue.
Step 3: Verify the Organization
Enter your GCP Organization numeric ID and click Discover Organization.

On success, you'll see Organization Discovered with a summary of your projects, folders, organization name, and ID.

[!TIP] If discovery fails, verify that the Organization SA has the required organization-level roles and that the required APIs are enabled. See Set Up Service Account: Troubleshooting.
Click Continue.
Step 4: Configure Discovery Settings
The wizard shows your discovered folder and project hierarchy. Each node has a Discovery Level dropdown.

Discovery Levels
| Discovery Level | What Guardrails Discovers | IAM Needed in Project? |
|---|---|---|
| None | Nothing, the project is excluded | No |
| Project Only | Project metadata and organization-level policies | No |
| All Resources | Everything in Project Only, plus individual resources (buckets, instances, etc.) | Yes, the SA needs permissions in the project |
Discovery levels set on a folder cascade to all its children (shown as "Inherited"). Individual projects can override.
[!TIP] Most organizations start with Project Only mode for all projects. This gives immediate visibility into your governance posture without requiring additional IAM permissions. You can upgrade individual projects to All Resources mode later.
Click Continue.
Step 5: Choose the Destination Folder
Choose where to place this connection in your Guardrails resource hierarchy. Select an existing folder or click Create Folder to create a new one.

Click Continue.
Step 6: Review and Connect
The final step shows a summary of your configuration:
- Service Account: access mode, client email
- Organization: organization ID, name, verification status
- Discovered Projects: number of projects, folders, and custom level overrides
- Destination Folder: where the connection will be placed

Review the details and click Create Connection.
Step 7: Monitor Discovery Progress
After connecting, you're redirected to the Organization Overview page. A Discovering Resources banner shows real-time progress.

Click Refresh now to update the display. As discovery progresses, the tree expands to show each folder and project with its control status.

[!NOTE] Discovery typically takes a few minutes depending on the size of your organization. You can navigate away and come back later.
Step 8: Verify the Connection
Navigate to Accounts > Organizations tab to see your newly connected GCP organization.

Switch to the Accounts tab and filter by GCP Project to see the individual projects.

Verify Controls
Check that CMDB and Discovery controls are in OK state for the organization and projects. Navigate to a project and select the Controls tab to verify. If controls are in Error state, check the Troubleshooting section below.
Next Steps
- Connect a Member Project: Upgrade projects to All Resources mode.
- Enable GCP Services: Control which GCP services Guardrails manages.
- Configure Real-Time Events: Set up event handlers for near-instant change detection.
- Configure Permissions: Manage GCP IAM permissions through Guardrails.
Troubleshooting
| Issue | Solution |
|---|---|
| Discovery fails: "Invalid form of account ID" | The impersonation grant may be incorrect. Verify the Master SA has Service Account Token Creator on your Organization SA. |
| Discovery fails: "Permission denied" | The Organization SA is missing one of the recommended org-level roles. Verify roles/browser, roles/viewer, roles/serviceusage.serviceUsageConsumer, and roles/logging.privateLogViewer are granted at the organization scope. See Set Up Service Account. |
| External ID verification fails | The guardrails_external_id label must be on the project where the Organization SA resides. Value must match exactly. |
| Zero projects discovered | The Organization SA is missing roles/browser at the organization level. |
| Controls in Error after import | If GCP > Project > CMDB is in Error on specific projects, check the two API rows below first. For Project Only mode, the recommended role set covers all default-on controls. For projects upgraded to All Resources mode, additional roles may be needed. See Connect a Member Project. |
Every control in Error with organizationcredentials and Cloud Resource Manager API has not been used in project | The API is disabled in the Organization SA's project. Enable cloudresourcemanager.googleapis.com there, wait a few minutes for propagation, and rerun GCP > Organization > CMDB. See Required GCP APIs. |
GCP > Project > CMDB in Error with Cloud Resource Manager API has not been used in project | The API is disabled in that project (the project number is in the message). Enable it there, or set GCP > Cloud Resource Manager > API Enabled to Enforce: Enabled, then rerun the control. See Required GCP APIs. |
| Quota exceeded (Read requests per minute) | The Organization SA is missing roles/serviceusage.serviceUsageConsumer at the org level. Re-grant the recommended role set. Controls self-heal on rerun. |
| Further assistance | Open a Support Ticket |