Google Workspace Integration
Google Workspace is Google's suite of cloud-based productivity and collaboration tools. LangGuard integrates with Google Workspace to enrich trace data with user information and support identity governance.
Overview
The Google Workspace integration enables LangGuard to:
- Enrich traces with user identity — Map activity to real users via Google profiles
- Track user-level AI usage — See which users are using which AI tools
- Organizational unit analysis — Understand AI usage by team and department
- Support identity governance — User access reviews and permission tracking
SSO vs Identity Integration
This integration is for user enrichment and governance. If you want to configure Google Workspace for Single Sign-On (login), see SSO Settings.
Prerequisites
- Google Workspace admin access
- A Google Cloud project with the Admin SDK API enabled
- Service account with domain-wide delegation
- LangGuard admin role
Setup
Step 1: Create a Google Cloud Service Account
- Go to the Google Cloud Console
- Create or select a project
- Navigate to IAM & Admin > Service Accounts
- Click Create Service Account
- Name it "langguard-integration"
- Click Create and Continue
- Skip the optional steps and click Done
Step 2: Create and Download a Key
- Click on the newly created service account
- Go to the Keys tab
- Click Add Key > Create new key
- Select JSON format
- Download and securely store the credentials file
Step 3: Enable Domain-Wide Delegation
- In the service account details, click Show domain-wide delegation
- Check Enable Google Workspace Domain-wide Delegation
- Note the Client ID displayed
Step 4: Authorize in Google Workspace Admin Console
- Go to the Google Admin Console
- Navigate to Security > Access and data control > API controls
- Click Manage Domain Wide Delegation
- Click Add new
- Enter the Client ID from Step 3
- Add the following OAuth scopes:
https://www.googleapis.com/auth/admin.directory.user.readonlyhttps://www.googleapis.com/auth/admin.directory.group.readonly
- Click Authorize
Step 5: Add Integration in LangGuard
- Navigate to Integrations in the sidebar
- Click Add Integration
- Select Identity Platforms > Google Workspace
- Upload your service account credentials JSON file
- Enter the admin email — A Workspace admin email for domain-wide delegation impersonation
- Click Test Connection
- Click Save
What Gets Captured
User Information
| Field | Description |
|---|---|
| Full Name | User's full name from Google profile |
| Primary email address | |
| Job Title | Title from directory profile |
| Department | Organizational department |
| Manager | Reporting manager (if set) |
| Org Unit | Google Workspace organizational unit |
| Account Status | Active, suspended, or archived |
Group Memberships
- Google Groups the user belongs to
- Group roles (owner, manager, member)
- Group email addresses
How Enrichment Works
LangGuard matches users from Google Workspace to AI activity by:
- Mapping email addresses from trace metadata to Google Workspace user profiles
- Resolving user identifiers to their directory entries
- Enriching the Discovery view with user and department context
Troubleshooting
Authentication Failed
- Verify the service account credentials JSON file is valid and complete
- Check that domain-wide delegation is enabled on the service account
- Ensure the admin email is a valid Workspace admin account
- Confirm the OAuth scopes are authorized in the Admin Console
Users Not Appearing
- Verify the Directory API scopes are authorized
- Ensure the admin email has admin privileges
- Check that the service account has domain-wide delegation enabled
Permission Denied
- Confirm you authorized the correct Client ID in the Admin Console
- Verify the OAuth scopes match exactly (including
readonly) - Allow a few minutes for delegation changes to propagate
Next Steps
- Integrations Overview — See all available integrations
- Discovery — View user access summaries
- SSO Settings — Configure Google Workspace for login