Amazon DynamoDB
Install the DynamoDB (AI) integration and the Amazon DynamoDB MCP server so agents behind the P0 AI Gateway can request temporary read or write access to one DynamoDB table.
The DynamoDB (AI) integration lets agents behind the P0 Runtime Access for AI request temporary access to one DynamoDB table and its indexes, in one AWS account and Region. For each approved request, P0 adds an IAM policy statement for that table to a role from your AWS OIDC role pool. The statement works only for the agent's session, and only until the grant ends. The gateway assumes the role and runs P0's Amazon DynamoDB MCP server with its credentials, so IAM decides what each call can do.
Only agents can use this integration. People request DynamoDB access through the AWS integration.
Prerequisites
A registered Gateway component, with the gateway deployed in your environment.
P0's AWS IAM management installed for the AWS account. See Setting up AWS IAM management.
The AWS OIDC component installed for the same account.
To let agents list tables, AWS Resource Explorer turned on in the account, with an index in each Region that has tables. Without an index, agents can still request a table by name.
The install adds nothing in AWS. P0 uses the IAM management role to find tables, and the AWS OIDC role pool to grant access.
Install an AWS account
Navigate to Integrations on p0.app, select DynamoDB (AI), and choose the IAM management component.
Add an account. P0 lists only AWS accounts where its AWS IAM management is installed. Click Next.
P0 checks that AWS OIDC federation is installed for the account, and that it can search the account with Resource Explorer. Review the summary and click Finish. The account now appears with the state Installed.
Install with Terraform
Instead of the installer, you can install each account with the P0 Terraform provider (see Manage integrations as code with the P0 Terraform provider). Create p0_dynamodb_ai with id set to the AWS account ID, after the account's p0_aws_iam_write and p0_aws_oidc_identity resources:
Add the Amazon DynamoDB MCP server
You can add the server once at least one account 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 AWS IAM federation, then select the Federation provider: the AWS OIDC identity for the account that holds your tables.
Definition: choose P0, then select Amazon DynamoDB.
The server now appears with the state Installed.
A federation provider maps to one AWS account. To reach tables in another account, add a second server with that account's AWS OIDC identity.
How agents request access
An agent requests access with the server's access tool. It names an installed AWS account by its ID, the table's Region, the table's name, and a level. The equivalent CLI request is:
The grant covers the table and all of its indexes. The level is read or write:
read
describe_table, get_item, batch_get_item, query, scan
dynamodb:GetItem, BatchGetItem, Query, Scan, PartiQLSelect, DescribeTable, DescribeTimeToLive
write
The read tools, and put_item, update_item, delete_item, batch_write_item
The read actions, and dynamodb:PutItem, UpdateItem, DeleteItem, BatchWriteItem, ConditionCheckItem, PartiQLInsert, PartiQLUpdate, PartiQLDelete
scan reads every item in the table, so read lets an agent read the whole table. write lets it change or delete any item in the table.
Items go in and out of the tools as plain JSON, such as {"pk": "user#1", "count": 3}. Each call returns at most 1 MB.
Once a request is approved, access usually works within about 10 seconds, and can take up to 30 seconds. When the grant ends, calls stop working within the same time.
P0 refuses a request in these cases, with a message that says why:
It didn't come from an agentic session.
The account isn't installed in DynamoDB (AI).
The Region or table name isn't one AWS allows.
If every role in the account's AWS OIDC role pool is full, an approved request fails. Revoke unused access, or add roles to the pool, then request again.
P0 doesn't check that the table exists. A grant on a table that doesn't exist gives no access.
See Requesting access for how agents submit and use requests.
Write policies for DynamoDB
Match DynamoDB requests in an agentic access policy (see Agentic access policies) with service: dynamodb-ai and accessType: table. These filters narrow them:
account
id
The AWS account ID
123456789012
region
name
The table's Region
us-west-2
table
name
The table's name
orders-prod
level
name
read or write
read
Policies are the only limit on what agents can request. Every table in an installed account can be requested, so write a policy for each kind of access you allow. Agents see only the tables their policies let them request.
Patterns are case-sensitive regular expressions, and they match anywhere in a value. Start each pattern with ^ and end it with $. A pattern without anchors matches more than it looks like it does: orders also matches old-orders-archive.
This policy auto-approves read access to every table whose name starts with orders-, in one account, for one agent:
Remove the integration
Remove the Amazon DynamoDB MCP server from your gateway.
End or revoke every active grant, so that P0 removes each grant's statement from the role pool.
Delete each account from the DynamoDB (AI) integration in P0.
Next steps
Define the Agentic access policies that decide which agents and users can request DynamoDB access.
Last updated