> For the complete documentation index, see [llms.txt](https://docs.p0.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.p0.dev/agentic-access/agentic-gateway.md).

# AI gateway

Configure the P0 AI Gateway and the upstream MCP servers and agents it fronts, so P0-managed AI agents can reach them under runtime authorization policy.

The AI gateway integration puts runtime authorization in front of what your agents call: the MCP servers in your environment, and, through an [A2A bridge](/agentic-access/agentic-gateway/a2a-bridge.md), other agents. Agents don't operate on loose delegation or standing privilege, and every action stays attributable. The gateway sits in the data path, verifies the identity of the originator and the agent on every call, and evaluates each action against the authorization policy defined in [P0 Runtime Access for AI](/readme/agentic-control-plane.md) before it reaches its target.

This integration has four components:

| Component                                                       | Use                                                                                                                                             |
| --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| [Gateway](/agentic-access/agentic-gateway/gateway.md)           | Registers your self-hosted P0 AI Gateway deployment with P0 so it can enforce policy and report activity.                                       |
| [MCP server](/agentic-access/agentic-gateway/mcp-server.md)     | Configures an upstream MCP server behind the gateway. Once configured, it becomes available to P0-managed agents across your organization.      |
| [A2A bridge](/agentic-access/agentic-gateway/a2a-bridge.md)     | Places an upstream agent host behind the gateway so agent-to-agent (A2A) calls pass through the gateway under policy.                           |
| [Log provider](/agentic-access/agentic-gateway/log-provider.md) | Points P0 at the logs holding the gateway's tool-call activity, so the [Event log](/agentic-access/using-the-gateway/event-log.md) can show it. |

## Prerequisites

* An existing P0 account at [p0.app](https://p0.app/).
* A Kubernetes cluster to run the gateway in, and permission to create the cloud resources it federates with.

## Set up agentic access

Work through these five steps in order. Each one depends on the one before it, and at the end a developer's agent can reach a server behind the gateway under policy.

1. [Deploying the gateway](/agentic-access/agentic-gateway/gateway/deploy.md)**.** Install the gateway into your own environment and register it with P0, so P0 Runtime Access for AI can supply policy and collect audit activity. The console installer does both in one pass, as in [Install from the P0 console](/agentic-access/agentic-gateway/gateway/deploy/install-from-the-p0-console.md). If you deploy with Helm instead, as in [Install the batteries-included Helm chart](/agentic-access/agentic-gateway/gateway/deploy/install-the-batteries-included-chart.md), register the gateway separately as described on the [Gateway](/agentic-access/agentic-gateway/gateway.md) page.
2. **Federate cloud credentials.** Give the gateway an identity your cloud trusts, so it can obtain short-lived credentials for the agents it serves. For AWS, install [AWS OIDC](/agentic-access/credential-sources/aws-oidc.md). For Google Cloud, install [GCP Workload Identity Federation](/agentic-access/credential-sources/gcp-wif.md). Install the one that matches the servers you are about to configure, or both.
3. [MCP server](/agentic-access/agentic-gateway/mcp-server.md)**.** Declare each MCP server you want to expose behind the gateway. Choose a server P0 defines for you, such as [AWS](/agentic-access/agentic-gateway/mcp-server/aws.md) or [GCP](/agentic-access/agentic-gateway/mcp-server/gcp.md), or [Custom](/agentic-access/agentic-gateway/mcp-server/custom.md). Nothing is reachable through the gateway until you configure at least one.
4. [Agentic access policies](/policy-studio/policy-studio/agentic-access-policies.md)**.** Decide which agents may act, whom they may act for, and what they may reach. Until a policy matches, the gateway authenticates agents but authorizes nothing.
5. **Connect your agents.** Each developer connects their own client to the servers behind the gateway, per user and per machine. For Claude Code, the P0 CLI lists the available servers and adds each one you want. See [Use MCP servers with Claude Code](/agentic-access/using-the-gateway/using-mcp-servers.md). For an agent you write yourself, connect an MCP client with the Python example in [Connect an MCP client](/agentic-access/using-the-gateway/connect-an-mcp-client.md). For an unattended workload with no one to sign in, see [JWT-SVID](/agentic-access/using-the-gateway/spiffe-svid.md).

## Optional, depending on your install

These branch off the five steps above. Add the ones your environment calls for.

* [Identity provider](/agentic-access/identity-provider.md)**.** For agents that authenticate with a JWT from your own IdP, tell the gateway which token issuer to trust. Agents that sign in interactively don't need this.
* [A2A bridge](/agentic-access/agentic-gateway/a2a-bridge.md)**.** Place an upstream agent host behind the gateway so agent-to-agent calls pass through under the same policy.
* [Log provider](/agentic-access/agentic-gateway/log-provider.md)**.** Link one to the gateway so P0 can read back the activity it logs on the [Event log](/agentic-access/using-the-gateway/event-log.md) tab. Without one, the tab is empty.

## Runtime reference

Once agents are connected, these describe what happens on each call rather than anything you set up:

* [Requesting access](/agentic-access/using-the-gateway/requesting-access.md): how an agent requests, checks, uses, and relinquishes just-in-time access to the servers and agents behind the gateway.
* [Agentic client registration API](/agentic-access/using-the-gateway/connect-an-mcp-client/client-registration-api.md): the API behind client registration, for scripting it yourself.
* [Event log](/agentic-access/using-the-gateway/event-log.md): review the tool calls your agents made, filter and export them, and open the access request behind each one.
