Looker
Install the Looker integration and its MCP server so agents behind the P0 AI Gateway can request read or edit access to a LookML model in your Looker (Google Cloud core) instance.
The Looker integration lets agents behind the AI gateway, part of P0 Runtime Access for AI, request access to a LookML model in your Looker (Google Cloud core) instance. For each grant, P0 creates a new Looker service account with access to that one model. When the grant ends, P0 deletes the account.
An agent can request one of two levels on a model:
read: explore the model, run queries, and view Looks and dashboards.edit: everything inread, plus saving Looks and dashboards.
Neither level can change LookML, unless a group that every new Looker user joins gives that ability. See Group roles below.
Setup has four parts, in this order:
Create a Looker service account for P0's connector, with the Admin role and an API key.
Install the integration with Terraform, and store the API key in Google Secret Manager.
Add the Looker MCP server to your gateway.
Write the policies that decide which agents get which access.
Prerequisites
A registered Gateway component, with the gateway deployed in your environment.
A Looker (Google Cloud core) instance with a public endpoint at
https://<name>.looker.app. P0 reaches the instance over the internet, and doesn't support instances behind a custom domain. Use Enterprise edition if you can: Standard edition allows only 1,000 admin API calls a month.The Google Cloud integration installed for your Google Cloud organization.
Google Secret Manager and GCP Workload Identity Federation installed on the same Google Cloud project. P0's Looker connector runs in that project and keeps each grant's Looker API key in its Secret Manager. The gateway uses Workload Identity Federation to read each grant's key.
Permission to apply Terraform in the project.
A Looker admin, to create the connector's Looker service account.
Before you install
Licenses. Each active grant's Looker service account takes a Standard user license until the grant ends. Looker counts licenses by the roles an account holds, as described in Manage users within Looker (Google Cloud core).
API quota. Looker (Google Cloud core) limits the admin API calls an instance can make each month, to 10,000 on Enterprise edition. P0's connector uses that quota on every grant. Agents use it too, whenever their tools list models, Explores, fields, Looks or dashboards. Queries count against a separate query quota. See API limits.
The Shared folder. On a default instance, the All Users group can edit everything in the Shared folder, and each grant's account belongs to All Users. So an edit grant can change or delete any content in Shared, including content built on other models. To prevent that, set All Users to View on the Shared folder, and give people edit access through their own groups. See Designing and configuring a system of access levels.
Content agents save. When P0 deletes a grant's account, Looker moves the content in that account's personal folder to Trash, and deletes any schedules built on it. To keep what agents save, set an agent content folder when you install. An edit grant gets edit access to that folder, and content saved there stays after the grant ends.
Roles P0 creates. The first time a grant needs one, P0 creates a permission set, a model set or a role named
p0-looker-ai-..., and later grants reuse it. P0 never edits or deletes them. If someone changes one, every grant that needs it fails with an error that names it.Group roles. If a group adds every new Looker user automatically, its roles apply to each grant's account too, on top of the role P0 gives it. A role there that can develop LookML or save content gives every grant that ability, even a
readgrant. Before you install, check these groups in Looker and remove any role you don't want every agent to have.
Create the connector's Looker service account
P0's connector signs in to Looker with an API key of its own. It needs the Admin role to create the account, API key and role for each grant.
Create a Looker service account for the connector, and give it the Admin role. See Creating an API-only service account. An account with the Admin role takes a Developer user license.
Create an API key for that account. See API keys. Keep its client ID and client secret for the next section.
Install the integration with Terraform
The configuration below deploys P0's Looker connector to Cloud Run in your project, with a secret for the connector's API key. p0_looker_ai_staged registers the instance with P0, and p0_looker_ai completes the install.
When P0 completes the install, your connector signs in to Looker with the API key. So the key has to be in its secret before you create p0_looker_ai, and you apply the configuration in three steps.
Copy the configuration into your Terraform project, and set your values:
organization_idinp0_gcp: your Google Cloud organization. If you already manage the Google Cloud integration in Terraform, refer to your existingp0_gcpresource instead.project: the Google Cloud project for the connector and its secrets.instance: the name that agents, policies and the CLI use for this instance in P0, such asanalytics. Use letters, digits and hyphens.instance_url:https://<name>.looker.app, in lowercase, with no path or trailing slash.content_folder_id(optional): the ID of a Looker folder for agent content. It's the last part of the folder's URL, as inhttps://<name>.looker.app/folders/<id>. To set one, uncomment the line and enter the folder's ID.
Create the Admin key's secret:
Store the API key as a version of that secret. Set
LOOKER_CLIENT_IDandLOOKER_CLIENT_SECRETto the key's client ID and client secret. Then run this command, with yourinstancevalue and your project ID in place of the placeholders:Keep the key out of your Terraform configuration, so that it never lands in your Terraform state.
Apply the rest with
terraform apply. P0 checks the install through your connector, which signs in to Looker with the key. The apply fails with P0's message if:Looker doesn't accept the key
a level needs a permission your instance doesn't have
a level would need a permission that P0 never grants
the agent content folder doesn't exist
The failure message also lists the groups that add new Looker users automatically and give them roles. A successful install doesn't list them, so check those groups yourself, as Group roles above describes.
A Google Cloud project runs one Looker connector, for one Looker instance. To install another instance, apply this configuration in a different project, with that instance's own instance value and API key.
Add the Looker MCP server
You can add the Looker MCP server once you've installed at least one Looker instance.
Follow the shared steps in Add an MCP server to name the server and choose its gateway. On the configuration screen, set these fields, then click Finish:
Credential source: choose Vaulted credential.
Definition: choose P0, then select Looker as the predefined server identifier.
The server now shows the state Installed.
P0 pushes the server definition to the gateway on its next sync. Agents can then reach the Looker MCP server through the gateway URL.
How agents request access
An agent names the instance by its P0 identifier, the LookML model by its name, and a level. It can choose any of the instance's models that has at least one Explore and isn't hidden. The equivalent CLI request is:
See Requesting access for how agents submit and use requests.
Write policies for Looker
Match Looker requests in an agentic access policy (Agentic access policies) with service: looker-ai and accessType: model. Three filters narrow them, each keyed on name:
instance: the Looker instance, by the identifier you gave it in P0.model: the LookML model, by its name.level:readoredit.
For example, this policy auto-approves read access for one agent, but only to the sales model in the analytics instance:
Remove the integration
End or revoke every active grant, so that P0 deletes their Looker service accounts.
Remove the Looker resources from your Terraform configuration:
p0_looker_ai,p0_looker_ai_staged, the connector and its service account, the Admin key's secret, and the connector's IAM roles and bindings. Keepp0_gcpand the enabled APIs if anything else uses them. Then runterraform apply.Delete what P0 created in Looker. In Looker, open the Roles page in the Admin panel. Delete the roles named
p0-looker-ai-..., then the model sets and permission sets with that prefix. See Creating, editing, and deleting roles.Delete the connector's Looker service account in Looker.
Next steps
Define the Agentic access policies that decide which agents and users can request Looker access.
Last updated