Datadog
Install the Datadog agentic integration and its MCP server so agents behind the P0 AI Gateway can request scoped access to your Datadog organization.
The Datadog agentic integration lets agents behind the AI gateway, part of P0 Runtime Access for AI, request permissions in your Datadog organization, such as logs_read_data. For each grant, P0's connector creates a service access token on a Datadog service account you choose. The token holds only the approved permissions, and the connector stores it in your Google Secret Manager. The gateway calls Datadog's hosted MCP server with that token. When access ends, P0 revokes the token in Datadog.
This is a different integration from the Datadog setup, which sends P0's audit logs to Datadog. Both appear as Datadog on the Integrations page.
Setup has four parts, in this order:
Install the Datadog organization in P0, which deploys P0's connector in a Google Cloud project.
Create a Datadog service account and give P0 an admin key pair.
Add the Datadog MCP server to your gateway.
Write the policies that decide which agents get which permissions.
Prerequisites
A registered Gateway component, with the gateway deployed in your environment. The gateway must be able to reach
https://mcp.<site>, such ashttps://mcp.datadoghq.com, and Google Secret Manager.The Google Cloud integration installed for your Google Cloud organization.
The Google Secret Manager integration installed on the Google Cloud project where the connector will run, and permission to apply Terraform in that project.
GCP Workload Identity Federation installed for that same project. The gateway uses it to read each grant's token.
A Datadog user who can create service accounts and assign roles.
Install the organization in P0
Navigate to Integrations on p0.app, select Datadog, and choose the Credential provisioning component.
Click Add Organization, and enter an identifier for it, such as
acme-prod. Agents and policies use this name for the organization. Use letters, digits, and hyphens.Fill in the organization details, then click Next:
Datadog site: the site whose domain is in your organization's Datadog URL, such as US5 (us5.datadoghq.com).
Secret manager provider: choose Google Secret Manager, then the Installation for the project where the connector will run.
P0 generates a Terraform configuration. Copy it into your Terraform project,
applyit, then click Next.The configuration creates:
A Cloud Run service,
p0-connector-datadog-ai, that runs P0's connector under its own service account,p0-datadog.A secret for your Datadog admin keys,
p0_install_datadog_<identifier>_admin-keys, which only the connector can read.Permission for the connector to create and manage the secrets that hold grant tokens. Their names start with
p0_access-token_datadog_<identifier>_, and the connector can touch no other secret.Bindings that let P0's Google Cloud service account call the connector and read its URL. The connector accepts calls from that service account only.
The Cloud Run, Secret Manager, IAM, and Resource Manager APIs, turned on in the project.
When you click Next, P0 checks that the connector is deployed. A new Cloud Run service can take a minute to start. If the check fails, wait a minute and click Next again.
Set up Datadog
Create a service account for P0 in Datadog under Organization Settings > Service Accounts. Every token P0 creates belongs to this account.
Give the service account a role that holds only the permissions agents may request, including MCP Read, which every Datadog MCP tool needs. A token can hold no permission that this role lacks.
Store an admin key pair. Create a Datadog API key and an application key. The application key's user needs the Service Account Write permission. Set
DD_API_KEYandDD_APP_KEYto them, and run the command P0 shows:P0 never sees the keys: only your connector reads them.
Enter the Service account ID of the service account in P0.
Review the summary and click Finish. The organization now appears with the state Installed.
Add the Datadog MCP server
You can add the Datadog MCP server once at least one organization is installed. P0 offers one server per site, such as Datadog (US5), and lists each one only when an organization on that site is installed.
Follow the shared steps in Add an MCP server to name the server and choose its gateway. On the configuration screen, set the following fields, then click Finish:
Credential source: choose Vaulted credential.
Definition: choose P0, then select the server for your organization's site.
The server now appears with the state Installed.
One Datadog MCP server serves every organization you install on its site. Each grant names the organization it is for.
How agents request access
An agent requests access with the server's access tool. It names the organization by its P0 identifier, and one or more Datadog permissions by name. Every Datadog MCP tool needs mcp_read, so agents include it in every request, and your policies must allow it. The agent's list tool shows the installed organizations and the permissions it can request, which are the permissions your service account's role holds.
Once a request is approved, access usually works within 5 to 15 seconds, and can take up to a minute. Agents see every Datadog tool whether or not their permissions cover it. Datadog refuses a call that the token's permissions don't cover.
Each agent has one token per organization. A new grant in the same organization adds its permissions to that token, and when a grant ends, P0 removes its permissions. Each token appears on your service account in Datadog, named P0 followed by the full name of the Google Cloud secret that holds it.
See Requesting access for how agents submit and use requests.
Write policies for Datadog
Match Datadog requests in an agentic access policy (Agentic access policies) with service: datadog-ai and accessType: permission. Two filters narrow them:
organization: the organization, keyed onname, the identifier you gave the organization in P0.policy: the permission, keyed onname. A rule covers a request only if it matches every permission in it.
Patterns are regular expressions, so a rule can match one permission (^logs_read_data$), every permission for one product (^logs_.*$), or every read permission (^.*_read$).
For example, auto-approve log and monitor reads for one agent, but only in the acme-prod organization:
Next steps
Define the Agentic access policies that determine which agents and users may request Datadog access.
Last updated