# IAM Policy Minimizer

> IAM Policy Minimizer is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-18).

Narrows AWS IAM policy Allow statements to only the required actions and reports over-grants including wildcards, unused actions, and blocked required actions

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/iam-minimize?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/iam-policy-minimizer-6fa9b0b6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_39HcrtkutZKnkKrYQuZW7

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability iam-policy-minimizer-6fa9b0b6 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/iam-policy-minimizer-6fa9b0b6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
