# 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.

## 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](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html))
- "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](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html))
- "Create dedicated service accounts for each application, and avoid using" ([source](https://cloud.google.com/iam/docs/best-practices-service-accounts))
- "you can control which managed identities are available to your container app during the init and main phases" ([source](https://learn.microsoft.com/en-us/azure/container-apps/managed-identity))

- [Previous: Keep the agent's code from reading node, instance or other workloads' credentials](/checklist/credential-isolation/)
- [Next: Restrict which principals can invoke each tool endpoint](/checklist/restrict-tool-invokers/)

## Related pages

- [Restrict which principals can invoke each tool endpoint: the check, and how in AWS, Google Cloud and Azure](/checklist/restrict-tool-invokers/)
- [Cap how much the agent can run and spend: the check, and how in AWS, Google Cloud and Azure](/checklist/cap-run-and-spend/)
- [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](/checklist/decide-user-or-agent-authority/)

## Sources

- docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html: https://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: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html (read 10 Nov 2026)
- cloud.google.com/iam/docs/best-practices-service-accounts: https://cloud.google.com/iam/docs/best-practices-service-accounts (read 10 Nov 2026)
- learn.microsoft.com/en-us/azure/container-apps/managed-identity: https://learn.microsoft.com/en-us/azure/container-apps/managed-identity (read 10 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://aiagentaccesscontrol.com/checklist/tool-own-role/
