
Aws Iam
Pair IAM role, policy, STS, and Organizations work with verified edge cases so your agent stops hallucinating limits, CloudTrail quirks, and cross-account region rules.
Overview
AWS IAM is an agent skill for the Build phase that supplies verified IAM, STS, and Organizations corrections so solo builders avoid policy and session pitfalls while wiring AWS authorization.
Install
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill aws-iamWhat is this skill?
- Documents verified IAM pitfalls AI agents repeatedly get wrong (policy evaluation, trust policies, Organizations handsha
- STS specifics: GetSessionToken API restrictions and cross-account AssumeRole opt-in region behavior
- CloudTrail nuance: AcceptHandshake/DeclineHandshake account scope and ConsoleLogin region variability
- Explicit scope: IAM/STS/Organizations only—not Cognito user-pool policies or in-app RBAC
- Instructs agents to verify limits and API names against official AWS docs instead of memory
Adoption & trust: 1.7k installs on skills.sh; 819 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent drafts IAM policies and role trust but confidently states wrong STS limits, CloudTrail account scope, or cross-region AssumeRole rules.
Who is it for?
Indie builders or small teams implementing AWS roles, policies, and STS in repos where the agent is the primary author.
Skip if: Cognito user-pool authorization only, pure application RBAC, or teams that want a full IAM course instead of pitfall guardrails.
When should I use this skill?
Working with IAM roles, policies, STS, or Organizations; verify claims against official AWS documentation.
What do I get? / Deliverables
IAM-related code and configs align with documented edge cases, with unclear claims flagged for official AWS doc verification before merge.
- IAM-corrected policy or role drafts
- Documented edge-case notes tied to AWS APIs
Recommended Skills
Journey fit
IAM wiring lands in the build phase when you connect apps, agents, and CI to AWS identities and permissions. Integrations is the canonical shelf for AWS auth plumbing (roles, policies, STS) distinct from app-level RBAC or Cognito pools.
How it compares
Use as a procedural pitfall layer on top of AWS docs—not a generic cloud MCP or a complete IAM reference manual.
Common Questions / FAQ
Who is aws-iam for?
Solo builders and indie teams using Claude Code, Cursor, or similar agents to implement AWS IAM roles, policies, STS, and Organizations—not for Cognito-only auth design.
When should I use aws-iam?
During build integrations when drafting trust policies, session assumptions, or org-wide roles; during ship security reviews when validating least-privilege; whenever the agent touches IAM APIs and you need edge-case checks before committing infra code.
Is aws-iam safe to install?
It is read-only procedural knowledge with no shell or network hooks in the skill itself; review the Security Audits panel on this Prism page before trusting any third-party skill in your agent workflow.
SKILL.md
READMESKILL.md - Aws Iam
# AWS IAM — Common Pitfalls ## About This Skill This skill contains verified corrections for things that AI agents frequently get wrong about IAM. It is not a comprehensive IAM guide — for full IAM guidance, search AWS documentation. When answering IAM questions, verify specific claims (limits, quotas, exact API names, edge-case behaviors) against official AWS documentation rather than relying on pre-training. Prefer fetching known documentation URLs over broad searches. Trust official documentation over memory when they conflict. ## Verified Edge Cases **CloudTrail:** - AcceptHandshake/DeclineHandshake logged in ACTING account ONLY, not management account. Organization trail required for centralization. - ConsoleLogin region varies by endpoint/cookies, NOT always us-east-1. `?region=` forces specific region. **STS:** - GetSessionToken restrictions: (1) No IAM APIs unless MFA included (2) No STS except AssumeRole and GetCallerIdentity. - Cross-account AssumeRole to opt-in region: TARGET account must enable region, not calling account. - Role chaining: max 1-hour session. **Organizations:** - Suspended/closed accounts CANNOT be removed until permanently closed (~90 days). Remove FIRST, then close. - Policy management delegation: use PutResourcePolicy, NOT register-delegated-administrator. - AI opt-out policies: management account required by default. - Organizations policy types for ListPolicies filter: SERVICE_CONTROL_POLICY, TAG_POLICY, BACKUP_POLICY, AISERVICES_OPT_OUT_POLICY, CHATBOT_POLICY, DECLARATIVE_POLICY_EC2, RESOURCE_CONTROL_POLICY. **SDK Specifics:** - Organizations: `DuplicatePolicyAttachmentException` (not PolicyAlreadyAttachedException). - Boto3 IAM AccessKey: methods are `activate()`, `deactivate()`, `delete()` — NO `update()`. - Instance profiles: waiter + `time.sleep(10)` pattern. - Managed policy max versions: 5. **SAML:** - Encrypted assertions URL: `https://region-code.signin.aws.amazon.com/saml/acs/IdP-ID`. - Private key from IdP uploaded to IAM in .pem format. **Policy Evaluation:** - ForAllValues with empty/missing key: evaluates to true (vacuous truth). To avoid that, use a `Null` condition in addition to the `ForAllValues` on **the same context key** to require that key to be present and non-null. For example, when evaluating the `aws:TagKeys` context key: ``` { "Version": "2012-10-17", "Statement": { "Effect": "Allow", "Action": "ec2:RunInstances", "Resource": "*", "Condition": { "ForAllValues:StringEquals": { "aws:TagKeys": ["Alpha", "Beta"] }, "Null": { "aws:TagKeys": "false" } } } } ``` - Resource-based policies granting to IAM user ARN bypass permissions boundaries in same account. - 8 privilege escalation actions via direct IAM policy manipulation: PutGroupPolicy, PutRolePolicy, PutUserPolicy, CreatePolicy, CreatePolicyVersion, AttachGroupPolicy, AttachRolePolicy, AttachUserPolicy. - `iam:PassRole` with `Resource: "*"` + create/update on a compute service (EC2 `RunInstances`, Lambda `CreateFunction`/`UpdateFunctionConfiguration`, ECS `RegisterTaskDefinition`, Glue, SageMaker, CloudFormation, etc.) = privilege escalation to any passable role in the account, including Administrator. Scope `Resource` to specific role ARNs or an IAM path; optionally constrain with `iam:PassedToService` / `iam:AssociatedResourceArn`. See [IAM User Guide — Grant a user permissions to pass a role](https://docs.aws.amazon.com/IAM/lates