Give each tool function its own least-privilege role instead of the agent's role
Facts read 10 Nov 2026. Page reviewed 16 Nov 2026.
Check 19 of 30: Give each tool function its own least-privilege role instead of the agent's role. A tool that runs with the agent's full role can do everything the agent can, even if the tool needs one action. A narrow role per tool limits damage when one tool is abused or buggy.
The whole checklist ยท The map
Why it matters
A tool that runs with the agent's full role can do everything the agent can, even if the tool needs one action. A narrow role per tool limits damage when one tool is abused or buggy.
How, in each cloud
- AWS
- Action group Lambda functions run under their own execution role, and Bedrock reaches them through a resource-based policy.
- Google Cloud
- Create dedicated service accounts for each application, so each tool service can have its own account.
- Azure
- Use user-assigned managed identities per workload and control which identities are available to the container app.
What the documentation says
- "Lambda automatically assumes your execution role when you invoke your function." (source)
- "For your agent to use a Lambda function, you must attach a resource-based policy to the function to provide permissions for the agent." (source)
- "Create dedicated service accounts for each application, and avoid using" (source)
- "you can control which managed identities are available to your container app during the init and main phases" (source)
- Previous: Keep the agent's code from reading node, instance or other workloads' credentials
- Next: Restrict which principals can invoke each tool endpoint
Related pages
- Restrict which principals can invoke each tool endpoint: the check, and how in AWS, Google Cloud and Azure
- Cap how much the agent can run and spend: the check, and how in AWS, Google Cloud and Azure
- Decide for each tool whether the action runs with the agent's authority or the signed-in user's: the check, and how in AWS, Google Cloud and Azure
Sources
- docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html, read 10 Nov 2026
- docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html, read 10 Nov 2026
- cloud.google.com/iam/docs/best-practices-service-accounts, read 10 Nov 2026
- learn.microsoft.com/en-us/azure/container-apps/managed-identity, read 10 Nov 2026
Last reviewed 16 Nov 2026.