一句话:提出确定性静态分析工具 IPA,从多语言应用代码的 AWS SDK 调用自动生成带来源追溯的最小权限 IAM 策略。
部署在 AWS 的应用需要 IAM 策略声明可调用的 API。托管策略权限常过宽,AI 助手生成的策略可能含幻觉、滞后且非确定性,难被安全关键场景信任。本文提出 IAM Policy Autopilot(IPA),一个确定性静态分析工具:对 Python、Java、Go、TypeScript/JavaScript 代码做 AST 模式匹配识别 AWS SDK 调用,查权威服务元数据将操作映射为所需权限,并合成带来源追溯的策略文档。在 10 个跨四语言基准与一个 Python 生产聊天机器人上评估:IPA 策略足以运行 9/10 个基准应用和 12 个处理函数中的 11 个;平均授权数比最优托管策略组合少约一个数量级,比专家手写策略少约 60%,可作为编写应用策略的良好起点。
Every application deployed on Amazon Web Services (AWS) requires Identity and Access Management (IAM) policies that specify which API actions the application is authorized to perform. AWS offers managed policies as a convenience to simplify policy authoring. However, these policies are designed to cover common scenarios which can lead to unnecessarily broad permissions beyond what a specific use case requires. AI coding assistants offer an alternative, but can be unreliable: they hallucinate invalid policy content, and lag behind newly launched services and APIs. Moreover, some organizations distrust nondeterministic processes for security-critical artifacts such as access policies. We present IAM Policy Autopilot (IPA), a deterministic static-analysis tool that generates IAM policies by examining API usage in Python, Java, Go, and TypeScript/JavaScript code. The tool occupies a middle ground between hand-crafted least-privilege policies, which require deep IAM expertise, and potentially overpermissive managed policy selection. It implements a three-phase pipeline that parses source files to identify AWS SDK calls via AST pattern matching; maps SDK operations to the required permissions by consulting authoritative, up-to-date service metadata; and synthesizes policy documents with provenance, tracing each permission to its origin in the source code. We evaluate IPA in two settings: (1) on 10 synthetic benchmark applications across four languages, comparing generated policies against minimal baseline policies, AI-generated policies, and an optimal selection of managed policies. IPA-generated policies prove sufficient to run 9 of the 10 applications; and (2) on a production-style multi-service chatbot application in Python, where IPA-generated policies prove sufficient for executing 11 of 12 handlers. Our findings show that policies generated by our tool are sufficient to run applications on a level similar to, or outperforming, AI-generated policies, while being generated deterministically. On average, the policies permit about an order of magnitude fewer permissions than the optimal selection of managed policies and about 60% fewer permissions than an expert developer-authored set of policies, indicating that IAM Policy Autopilot provides a good starting point when writing application policies.
@inproceedings{paperbot12374,
title = {IAM Policy Autopilot: Static Analysis for Policy Generation from Application Code},
author = {Antonio Filieri and Luke Kennedy and Kevin Luo and Matt Luttrell and Adrián Palacios and Akash Panda and Neha Rungta and Matthias Schlaipfer and Karan Jit Singh and Anvesh Tanuku and Nick Winans and Diana Yin and Weiben Zhang},
booktitle = {ASE},
year = {2026},
doi = {10.1145/3832783.3834512}
}