Policy Sentry is an AWS IAM Least Privilege Policy Generator, auditor, and analysis database, currently at version 0.15.1. It compiles database tables based on the AWS IAM Documentation on Actions, Resources, and Condition Keys and leverages that data to create least-privilege IAM policies. It helps organizations limit the blast radius in the event of a breach and scale the creation of secure IAM policies. The project maintains an active release cadence with frequent updates.
pip install policy-sentryVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to programmatically define policy requirements using a dictionary structure similar to the CLI's YAML templates, and then generate a least-privilege AWS IAM policy in JSON format. It creates a policy allowing read and list access to a specific S3 bucket and its objects.
Ensure your environment uses Python >=3.10 when upgrading to policy-sentry 0.15.x.
Review the Policy Sentry GitHub releases and documentation for v0.13.0 to understand the specific changes and update any code that interacts with internal path structures or previously deprecated functions.
If you require the most up-to-date IAM definitions or custom overrides, run `policy_sentry initialize --fetch` as a CLI command before using the library's querying or writing functions that depend on the database.
No dependency data recorded yet.