How to Configure Copilot Studio DynamoDB Read Only Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up copilot studio dynamodb read only permissions by creating a scoped cloud role. Then you link that role to your bot action so it only reads table items. Many teams start by giving their AI agents broad database roles during early tests. Those wide permissions let a bot update or delete production records by mistake. Scoping the role down to read actions stops the bot from changing stored data. How to set up copilot studio dynamodb read only permissions First, you build a custom role

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You set up copilot studio dynamodb read only permissions by creating a scoped cloud role. Then you link that role to your bot action so it only reads table items. Many teams start by giving their AI agents broad database roles during early tests. Those wide permissions let a bot update or delete production records by mistake. Scoping the role down to read actions stops the bot from changing stored data.

How to set up copilot studio dynamodb read only permissions

First, you build a custom role in your cloud console for the DynamoDB tables. This role should only allow item lookups, table scans, and index queries. You must leave out all write, update, and table drop actions from the policy. Next, you limit the policy to the exact tables the AI bot needs. Avoid using wildcards that grant read rights across every table in the account.

After the cloud role is ready, you set up the action in Copilot Studio. The bot uses an API action or custom plugin to call the cloud endpoint. You store the role keys or token settings inside the bot platform secret store. When a user asks the bot a question, the bot runs the read action. The cloud service checks the role permissions and returns the matching DynamoDB items.

Teams should also separate test tables from live data during the build phase. You can assign one read role for test bots and another for live bots. This keeps test prompts from reading real customer rows while builders tune the bot.

Why static database roles are not enough for AI bots

A read-only role stops a bot from deleting rows or changing table settings. Still, cloud roles only check who logs in and which API call runs. They do not inspect the actual data rows returned inside the query response. If a DynamoDB table holds customer records, a read role returns every field.

This creates a major risk when an AI bot reads a shared table. A single query can pull emails, phone numbers, card numbers, or national IDs. The bot then processes those raw values and may show them in chat. Static role permissions cannot rewrite sensitive fields inside a table response on the fly.

Role policies also fail to block expensive table scans that slow down the database. A bot with read permissions can still run a full scan across millions of items. Cloud permissions see a valid read call and allow the heavy query to run. Also, basic cloud logs only show that the bot role called a table. They do not tie the database query back to the specific user prompt. Security teams need a way to filter fields in flight and log every query.

Read-Only Root Filesystem + DynamoDB Fine-Grained Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Best practices for scoping bot table roles

Start by listing the exact attributes your bot needs to answer user questions. If the bot only checks order status, it does not need customer billing fields. You can add field conditions to your cloud policy to restrict visible attributes. This limits the columns the role can pull during a query or scan.

Next, rotate the credentials that the bot uses on a strict schedule. Short-lived tokens work much better than static keys stored in a bot setting. If a static key leaks, an attacker can read your entire DynamoDB table. Rotating keys reduces the window of exposure if a secret gets copied.

Finally, review your role logs every week to spot unusual query spikes. Look for bots that scan whole tables instead of querying a single key. Tight role rules paired with active monitoring keep your data safe during bot runs.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Can a read-only role stop a bot from seeing sensitive fields?

A basic read role returns all fields in a matched DynamoDB item. You must add specific attribute rules or use data masking to rewrite emails and card numbers in results.

Should multiple bots share the same DynamoDB role?

No, each bot should have its own distinct role and policy. Separate roles make it easy to revoke permissions for one bot without breaking others.

How do I stop a bot from running slow table scans?

Remove the scan action from the role policy and only allow query and item lookup actions. This forces the bot to look up items using a specific key.

The query runs. The emails stay hidden.