Tracing How AWS Evaluates Policies
This lesson explains the fixed logic AWS uses to combine the policies that apply to a request, since exam questions often turn on why a request was allowed or denied.
Learning outcomes
After completing this lesson, you will be able to:
- Trace a request through implicit denies, explicit denies and allows.
- Explain how SCPs, permissions boundaries and session policies limit permissions.
- Explain how permissions boundaries make delegated role creation safe.
- Troubleshoot an unexpected denial systematically.
How a request is evaluated
IAM evaluates every request against all the policies that apply to it, following a fixed logic. Every request starts implicitly denied: if nothing allows it, it fails. If any applicable policy contains an explicit deny for the action, evaluation ends immediately with a deny, whatever any other policy allows.
Otherwise, the request needs an explicit allow in an identity-based or resource-based policy. In addition, every limiting policy in play must also allow the action: service control policies and resource control policies from AWS Organizations, permissions boundaries and session policies. These limiting policies never grant access themselves; they only set the maximum that other policies can grant.
The following diagram shows the evaluation as a sequence of checks.

Evaluating a request
Limiting policy types
Some policy types grant no permissions at all. They set the maximum permissions available, and a request succeeds only if it is also allowed by an identity or resource policy. Service control policies (SCPs) cap what users and roles in an organisation's member accounts can do. Resource control policies (RCPs) cap what can be done to resources in those accounts, whoever the caller is, for example preventing access from outside the organisation.
A permissions boundary caps a single user or role. It lets administrators delegate role creation to developers safely, because any role they create can never exceed the boundary. A session policy, passed when a role is assumed, caps that one session, for example to give a script less than the role's full permissions. The following table summarises what each type limits.
| Policy | Caps |
|---|---|
| Service control policies (SCPs) | Principals in accounts of an organisation |
| Resource control policies (RCPs) | Resources in accounts of an organisation |
| Permissions boundaries | A single user or role |
| Session policies | A single assumed-role session |
They never grant, only cap. Example: a role allows s3:*, its boundary allows only s3:GetObject, and an SCP denies S3 outside eu-west-1. The developer can only read objects, only in eu-west-1: the effective permission is the intersection.
Limiting policies
Permissions boundaries for delegation
A permissions boundary lets administrators delegate role creation safely. Developers may create roles only if they attach a given boundary, so no role they create can exceed it, even if they attach AdministratorAccess.
The following diagram shows how a boundary caps a role that a developer creates.

Resource-based policies
A resource-based policy is attached to a resource, such as an S3 bucket, an SQS queue or a KMS key, and names the principals allowed to use it. Whether it is enough on its own depends on whether the request crosses an account boundary.
Within the same account, either policy is sufficient: if the bucket policy allows a role to read, the role needs no identity policy for it, and the reverse is also true. For a cross-account request, both accounts must agree. The resource policy in the owning account must allow the caller's account or role, and the caller's identity policy in its own account must allow the action on that resource. This protects each account: neither can grant access to the other's resources, or for the other's principals, alone. The following table summarises the rule.
| Scenario | What must allow |
|---|---|
| Same account | Either the identity policy or the resource policy |
| Cross-account | Both the resource policy and the caller's identity policy |
KMS keys are an exception: the key policy must allow access, even in the same account, before IAM policies take effect.
Same account or cross-account?
Troubleshooting a denial
When a request is unexpectedly denied, a systematic review usually finds the cause. The first step is to look for an explicit deny, in a service control policy, resource control policy, resource policy, permissions boundary or session policy, because a deny anywhere overrides every allow. If there is none, the cause is a missing allow. Access denied error messages often name the type of policy responsible, which narrows the search.
Encrypted resources add another layer: reading an object encrypted with an AWS KMS key also requires permission to use the key, so a request can be denied even when the S3 permissions are correct. The IAM policy simulator tests how an identity's policies evaluate a given action and resource, without making the request.
An allow that still does not work
A developer's role has AdministratorAccess, yet cannot launch instances in ap-southeast-2. The account is in an organisation, so the architect checks every layer of policy:
| Layer | Result |
|---|---|
| Identity policy | Allows everything |
| Permissions boundary | None |
| SCP on the OU | Denies all actions outside eu-west-1 and eu-central-1 |
| Outcome | Explicit deny from the SCP wins |
The SCP is working as intended: the company operates only in two EU Regions for data residency. No change to the developer's IAM policy could override it. This is the core rule of evaluation: an explicit deny in any applicable policy ends the decision.
What does a permissions boundary do?
Show answer
It sets the maximum permissions that identity-based policies can grant to a user or role. It grants nothing by itself.
Exam Tips
Remember for the exam
- An explicit deny always wins over any allow.
- Effective permissions are the intersection of the identity policy and every limiting policy.
- Permissions boundaries let you delegate the creation of roles without privilege escalation.
- Cross-account access needs both the resource policy and the caller's identity policy to allow it.
- If access to an encrypted object is denied despite S3 permissions, KMS key permissions are missing.