{"uid":"cap_39HcrtkutZKnkKrYQuZW7","slug":"iam-policy-minimizer-6fa9b0b6","name":"IAM Policy Minimizer","description":"Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.","url":"https://agents.writerslogic.com/api/v1/iam-minimize?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"policy":{"description":"The IAM policy document as a JSON object or JSON string. At most 60,000 characters."},"knownActions":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":3000,"description":"Optional catalog of real actions (from the AWS service reference JSON), used to count what each wildcard grants."},"requiredActions":{"type":"array","items":{"type":"string","maxLength":128,"minLength":3},"maxItems":300,"minItems":1,"description":"Concrete actions the task needs, e.g. s3:GetObject. No wildcards."}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_DlGT2S_SLHpVhQvf-85qu","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Narrows AWS IAM policy Allow statements to only the required actions and reports over-grants including wildcards, unused actions, and blocked required actions","exampleAgentPrompt":"Take this IAM policy JSON and narrow it down to only the actions my task needs — s3:GetObject, s3:PutObject, and ec2:DescribeInstances — and tell me what wildcards or extra permissions the original was granting.","exampleUseCases":[{"title":"Least-privilege policy before deployment","prompt":"I'm about to attach this IAM policy to a Lambda role. The function only needs s3:GetObject, logs:CreateLogGroup, and logs:PutLogEvents. Can you minimize the policy to just those actions and tell me what the original was over-granting?"},{"title":"Audit wildcard permissions in existing policy","prompt":"This IAM policy has a lot of s3:* and ec2:* wildcards. I want to know exactly how many extra actions those wildcards grant — here's the knownActions list from the AWS service reference — and which of my required actions are actually missing."},{"title":"Catch Deny-blocked required actions","prompt":"Before I propose this IAM policy to the security team, check if any of the actions my task requires — iam:PassRole, sts:AssumeRole, and lambda:InvokeFunction — are being blocked by an unconditional Deny statement in the policy."}],"resultDescription":"Returns the minimized IAM policy with Allow statements narrowed to only the required actions, plus a detailed report of: wildcards found and how many extra actions they grant (if knownActions provided), unused actions in original Allow statements, Allow+NotAction patterns, required actions not covered by any statement, and required actions blocked by unconditional Deny.","failureModes":["Policy JSON exceeds 60,000 characters — rejected with size error","requiredActions list is empty or contains wildcards — minItems:1 and no-wildcard constraint violated","knownActions list exceeds 3,000 entries — rejected","Malformed IAM policy JSON — parse error returned","Required actions that are ambiguous or shorter than 3 characters — rejected by minLength constraint","Payment of $0.005 USDC not provided — 402 Payment Required"],"whenToPreferThis":"Use this endpoint when an AI agent needs to propose or attach an IAM policy and must ensure least-privilege compliance — especially when the original policy contains wildcards or was written broadly. Best when you have a concrete list of actions the task actually needs. Not suitable for evaluating Resource ARN restrictions, Conditions, SCPs, permission boundaries, or session policies; for those, use a full IAM policy simulator.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-18T18:18:26.460Z","isFirstParty":false,"canonicalSlug":"iam-policy-minimizer-6fa9b0b6"}