All Tools View Categories About Contact Privacy

IAM Policy Structure Validator

Paste a policy and check its structural shape — Version, Statement, and per-statement Effect/Action/Resource.

Runs entirely in your browser — your policy JSON never leaves this page.
0
statements

About IAM Policy Structure Validator

Before an IAM policy can be attached at all, it needs to have the minimal shape IAM requires: a recognized Version, a non-empty Statement array, and every statement carrying a valid Effect, an action field, and a target field. IAM Policy Structure Validator paste a policy JSON document and it checks exactly that — nothing more, nothing less — reporting a clear pass or fail with every specific structural problem listed.

The checks are the same structural rules IAM itself enforces on document shape before it even gets to evaluating what the policy grants. Version must be present and must be one of the two recognized values, 2012-10-17 (current) or 2008-10-17 (legacy) — anything else, including a missing field entirely, is an error. Statement must be present and must not be an empty array; a policy with no statements has nothing to evaluate and is not a usable document. Each individual statement is then checked on its own: it must have an Effect that is exactly Allow or Deny (not any other casing or value), it must have an Action or a NotAction field, and it must have one of Resource, NotResource, Principal, or NotPrincipal — the last two accounting for resource-based policy statements like S3 bucket policies or IAM role trust policies, which commonly identify a principal rather than a resource.

When the document is valid, the tool shows a clear pass result along with the statementCount — the total number of statements found — so the shape of what you just validated is visible at a glance without counting manually. When it is not valid, every specific problem is listed individually rather than stopping at the first one found: a missing Version, an empty Statement array, and a specific statement missing its Effect can all be reported together in one pass, so you can fix everything at once instead of re-running after each individual fix.

This tool is deliberately narrow and single-purpose. It does not attempt JSON syntax diagnosis beyond a plain "could not parse as JSON" message when the pasted text is not valid JSON at all — no line or column number, no attempt to guess where the syntax broke. That level of diagnosis is exactly what the separate IAM Policy JSON Syntax Validator tool in this category is built for, and this tool assumes you are pasting syntactically valid JSON and simply wants to know whether its structure is sound. It likewise does not check policy size against IAM's character-count quotas, does not look for duplicate statements, overly permissive Action/Resource combinations, or wildcard usage — each of those has its own dedicated, focused tool in this category. Keeping each tool to one job means the result here is exactly what it claims to be: a structural pass/fail with an itemized error list, nothing conflated with unrelated checks.

Structural validity here means the document has the shape IAM requires to be considered at all — it does not mean the policy is safe, well-scoped, free of duplicate statements, or within size limits; those are separate questions this tool intentionally does not answer. Everything runs locally in your browser the moment you paste a document or click the sample; nothing you paste is ever sent anywhere.

Features

  • Checks Version, Statement presence/non-emptiness, and per-statement shape.
  • Itemized error list — every structural problem shown at once, not just the first.
  • Statement count shown on a valid result.
  • Accepts Principal/NotPrincipal in place of Resource for resource-based policy statements.
  • Recognizes both Version values — 2012-10-17 and the legacy 2008-10-17.
  • Deliberately single-purpose — no JSON line/column diagnosis, no size check, no wildcard analysis (each has its own tool).
  • Simple, generic parse error for non-JSON input.
  • Sample valid and sample broken policy to see both outcomes immediately.
  • 100% client-side — nothing is uploaded.

How to Use

  1. Paste your policy JSON, or click a sample.
  2. Click Validate structure.
  3. If invalid, read every itemized structural error listed.
  4. Fix the document and re-run.
  5. Once valid, check the statement count shown.

Examples

Example 1 — missing Version. {"Statement":[{"Effect":"Allow","Action":"s3:GetObject","Resource":"*"}]} fails with "Missing required field \"Version\"".

Example 2 — empty Statement array. {"Version":"2012-10-17","Statement":[]} fails with "Statement array is empty".

Example 3 — statement missing Effect. {"Version":"2012-10-17","Statement":[{"Action":"s3:GetObject","Resource":"*"}]} fails with "Statement[0]: missing \"Effect\"".

Example 4 — resource-based statement with Principal, valid. {"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"arn:aws:iam::123456789012:root"},"Action":"sts:AssumeRole"}]} passes, since Principal satisfies the target-field requirement in place of Resource.

Example 5 — fully valid, multi-statement. A standard two-statement Allow/Deny policy with Version, Effect, Action, and Resource on both statements passes with statementCount: 2.

Benefits

  • Catches structural problems before an attach attempt fails.
  • Itemized, not one-at-a-time — every issue shown together.
  • Focused scope — a clear, predictable single-purpose check.
  • Handles resource-based policies correctly via Principal support.
  • Instant, local feedback — no waiting on an API call.
  • Private — policy content never leaves your browser.

Frequently Asked Questions

What structural checks does this tool run?
<code>Version</code> must be present and be a recognized value (<code>2012-10-17</code>, or the legacy <code>2008-10-17</code>). <code>Statement</code> must be present and must not be an empty array. Every individual statement must have a recognized <code>Effect</code> of exactly <code>Allow</code> or <code>Deny</code>, must have an <code>Action</code> or a <code>NotAction</code>, and must have a <code>Resource</code>, <code>NotResource</code>, <code>Principal</code>, or <code>NotPrincipal</code>.
Does this tool check JSON syntax, like line and column numbers for a malformed document?
No, deliberately not — this tool is a focused, single-purpose wrapper around structural validation only. If the pasted text is not valid JSON at all you get a simple, generic parse error and nothing more. The separate IAM Policy JSON Syntax Validator tool in this category is the one built for pinpointing the exact line and column of a JSON syntax error; use that one if you need that level of diagnosis.
What does "valid" mean here exactly?
It means the document has the minimal shape IAM requires before it will even be considered for attachment — the required top-level fields are present and every statement has the fields a statement must have. It does not mean the policy is safe, well-scoped, or free of duplicate/wildcard/oversized issues; those are each covered by a separate tool in this category.
What do I see when the document is valid?
A clear pass result along with the statement count from the document, so you can sanity-check the shape at a glance.
What do I see when the document is invalid?
A clear fail result with the itemized list of every structural problem found — for example "Missing required field \"Version\"" or "Statement[2]: missing \"Effect\"" — so you can see every issue at once rather than fixing one and re-running to discover the next.
Does a Principal count as satisfying the Resource requirement?
Yes — resource-based policy statements (like an S3 bucket policy or an IAM role trust policy) commonly use <code>Principal</code>/<code>NotPrincipal</code> instead of <code>Resource</code>/<code>NotResource</code>, so a statement with only a <code>Principal</code> field and no Resource still passes this check.
Does it accept the legacy Version "2008-10-17"?
Yes — both <code>2012-10-17</code> (current) and <code>2008-10-17</code> (legacy) are recognized as valid Version values.
Does it validate that Action values are real AWS actions, or that Resource values are well-formed ARNs?
No — this tool checks presence and shape only (does the field exist, is it one of the allowed field combinations), not the content validity of action names or ARN syntax.
Is my policy JSON uploaded anywhere?
No — parsing and structural validation both run entirely in your browser.