iam
AWS Identity and Access Management for users, roles, policies, and permissions
Install / Use
npx skills add itsmostafa/aws-agent-skills --skill iamInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
SecuritySupported Platforms
Our assessment of iam
iam scores 89/100 on our quality scale, 511th of 1,108 Security skills we index (top 47%).
Its SKILL.md is 6.9 KB long, well organised into 30 sections with 4 code examples: a thorough specification that gives an agent plenty to work with.
With 1,159 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 14 days ago, so iam is actively maintained.
- Our last check on 2026-10-31 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-06. Automated pattern scan on 2026-10-05. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
iam compared with similar skills
All 4 of these similar skills score higher than iam; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| iam (this skill)by itsmostafa | 89 | 1.2k | 14d ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 112.3k | 8d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.8k | today | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 103.6k | 2d ago | MCP Server |
| crawl4aiby unclecode | 100 | 87.4k | 3d ago | MCP Server |
Frequently asked questions
- How do I install iam?
- Run
npx skills add itsmostafa/aws-agent-skills --skill iam. The install tabs above show the steps for each supported agent. - Which AI agents does iam work with?
- It is written for Zed, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is iam safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is iam still maintained?
- The repository was last updated 14 days ago, so iam is actively maintained.
Skill content
View source on GitHubname: iam description: AWS Identity and Access Management for users, roles, policies, and permissions. Use when creating IAM policies, configuring cross-account access, setting up service roles, troubleshooting permission errors, or managing access control. last_updated: "2026-01-07" doc_source: https://docs.aws.amazon.com/IAM/latest/UserGuide/
AWS IAM
AWS Identity and Access Management (IAM) enables secure access control to AWS services and resources. IAM is foundational to AWS security—every AWS API call is authenticated and authorized through IAM.
Table of Contents
Core Concepts
Principals
Entities that can make requests to AWS: IAM users, roles, federated users, and applications.
Policies
JSON documents defining permissions. Types:
- Identity-based: Attached to users, groups, or roles
- Resource-based: Attached to resources (S3 buckets, SQS queues)
- Permission boundaries: Maximum permissions an identity can have
- Service control policies (SCPs): Organization-wide limits
Roles
Identities with permissions that can be assumed by trusted entities. No permanent credentials—uses temporary security tokens.
Trust Relationships
Define which principals can assume a role. Configured via the role's trust policy.
Common Patterns
Create a Service Role for Lambda
AWS CLI:
# Create the trust policy
cat > trust-policy.json << 'EOF'
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": { "Service": "lambda.amazonaws.com" },
"Action": "sts:AssumeRole"
}
]
}
EOF
# Create the role
aws iam create-role \
--role-name MyLambdaRole \
--assume-role-policy-document file://trust-policy.json
# Attach a managed policy
aws iam attach-role-policy \
--role-name MyLambdaRole \
--policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
boto3:
import boto3
import json
iam = boto3.client('iam')
trust_policy = {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {"Service": "lambda.amazonaws.com"},
"Action": "sts:AssumeRole"
}
]
}
# Create role
iam.create_role(
RoleName='MyLambdaRole',
AssumeRolePolicyDocument=json.dumps(trust_policy)
)
# Attach managed policy
iam.attach_role_policy(
RoleName='MyLambdaRole',
PolicyArn='arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole'
)
Create Custom Policy with Least Privilege
cat > policy.json << 'EOF'
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:Query"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/MyTable"
}
]
}
EOF
aws iam create-policy \
--policy-name MyDynamoDBPolicy \
--policy-document file://policy.json
Cross-Account Role Assumption
# In Account B (trusted account), create role with trust for Account A
cat > cross-account-trust.json << 'EOF'
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::111111111111:root" },
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": { "sts:ExternalId": "unique-external-id" }
}
}
]
}
EOF
# From Account A, assume the role
aws sts assume-role \
--role-arn arn:aws:iam::222222222222:role/CrossAccountRole \
--role-session-name MySession \
--external-id unique-external-id
CLI Reference
Essential Commands
| Command | Description |
|---------|-------------|
| aws iam create-role | Create a new IAM role |
| aws iam create-policy | Create a customer managed policy |
| aws iam attach-role-policy | Attach a managed policy to a role |
| aws iam put-role-policy | Add an inline policy to a role |
| aws iam get-role | Get role details |
| aws iam list-roles | List all roles |
| aws iam simulate-principal-policy | Test policy permissions |
| aws sts assume-role | Assume a role and get temporary credentials |
| aws sts get-caller-identity | Get current identity |
Useful Flags
--query: Filter output with JMESPath--output table: Human-readable output--no-cli-pager: Disable pager for scripting
Best Practices
Security
- Never use root account for daily tasks
- Enable MFA for all human users
- Use roles instead of long-term access keys
- Apply least privilege — grant only required permissions
- Use conditions to restrict access by IP, time, or MFA
- Rotate credentials regularly
- Use permission boundaries for delegated administration
Policy Design
- Start with AWS managed policies, customize as needed
- Use policy variables (
${aws:username}) for dynamic policies - Prefer explicit denies for sensitive actions
- Group related permissions logically
Monitoring
- Enable CloudTrail for API auditing
- Use IAM Access Analyzer to identify overly permissive policies
- Review credential reports regularly
- Set up alerts for root account usage
Troubleshooting
Access Denied Errors
Symptom: AccessDeniedException or UnauthorizedAccess
Debug steps:
- Verify identity:
aws sts get-caller-identity - Check attached policies:
aws iam list-attached-role-policies --role-name MyRole - Simulate the action:
aws iam simulate-principal-policy \ --policy-source-arn arn:aws:iam::123456789012:role/MyRole \ --action-names dynamodb:GetItem \ --resource-arns arn:aws:dynamodb:us-east-1:123456789012:table/MyTable - Check for explicit denies in SCPs or permission boundaries
- Verify resource-based policies allow the principal
Role Cannot Be Assumed
Symptom: AccessDenied when calling AssumeRole
Causes:
- Trust policy doesn't include the calling principal
- Missing
sts:AssumeRolepermission on the caller - ExternalId mismatch (for cross-account roles)
- Session duration exceeds maximum
Fix: Review and update the role's trust relationship.
Policy Size Limits
- Managed policy: 6,144 characters
- Inline policy: 2,048 characters (user), 10,240 characters (role/group)
- Trust policy: 2,048 characters
Solution: Use multiple policies, reference resources by prefix/wildcard, or use tags-based access control.
References
Related Skills
Agent-Reach
112.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
79.8kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Scrapling
103.6k🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
crawl4ai
87.4kOfficial Crawl4AI Cloud: a hosted web scraping, extraction, and search API for AI agents. Free API key, 1,000 credits a month, no card. Fully open source: this repo is the Apache-2.0 crawler that powers it, and you can self-host it.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
