awslabs/iam-policy-autopilot
IAM Policy Autopilot is an open source static code analysis tool that helps you quickly create baseline AWS IAM policies that you can refine as your application evolves. This tool is available as a command-line utility and MCP server for use within AI coding assistants for quickly building IAM policies.
What it solves
IAM Policy Autopilot helps developers avoid the tedious and error-prone process of manually writing AWS Identity and Access Management (IAM) policies. It reduces the time spent troubleshooting "AccessDenied" errors and accelerates application deployment by automatically generating baseline permissions based on the actual AWS SDK calls found in the application's code.
How it works
The tool uses deterministic static analysis of source code to identify AWS SDK calls and map them to the required IAM permissions. It can be used as a standalone command-line interface (CLI) or as a Model Context Protocol (MCP) server, allowing AI coding assistants to trigger policy generation directly within the IDE.
It supports several workflows:
- Code Analysis: Analyzes Python, Go, Java, TypeScript, and JavaScript code to generate policies.
- Terraform Integration: Generates policies from JSON-formatted Terraform plan files.
- Error Fixing: Parses specific AWS "AccessDenied" error messages to suggest or apply policy fixes.
Who it’s for
AWS builders, including developers, product managers, and technical experimenters who use AI coding assistants to build and deploy applications on AWS.
Highlights
- AI Assistant Integration: Functions as an MCP server, enabling AI agents to generate IAM policies based on the user's code context.
- Multi-language Support: Works with the AWS SDKs for Python (Boto3/Botocore), Go, Java, and JavaScript/TypeScript.
- Deterministic Analysis: Uses static code analysis rather than guessing, ensuring policies are valid and reliable.
- Service Hints: Allows users to specify which AWS services are actually used to reduce unnecessary permissions.
- AccessDenied Debugging: Can take an error message as input to automatically fix permission issues.
Related
- Project
- Project
- Project
- Project
- Project