setup-security-agent
Skill2.8k starsChanged 6 months agoApache-2.0View on GitHub
Configure AWS Security Agent for the current workspace — provision or reuse an agent space, IAM service role, and S3 bucket. Use when the user asks to "set up security agent", "configure security scanner", "is security agent configured", or on first-time use before any scan or pentest.
Trending
Less talk lately.about the whole repository
Who's talking about aws/agent-toolkit-for-aws
- A Hacker News story“Agent Toolkit for AWS”Hacker News · Jun 8, 2026 · 5 points
- @yug1224.com“AIエージェントがAWS環境の構築や運用を効率よく行うための公式ツールキットらしい ClaudeやCursorなどのエージェントに導入して開発を自動化するのが楽しみ yug1224 starred …”Bluesky · Jun 27, 2026 · 2 likes
- @librecanada.bsky.social“GitHub - Webpage "GitHub - aws/agent-toolkit-for-aws: Official, AWS-supported MCP servers, skills, and …”Bluesky · May 10, 2026 · 2 likes
- @yug1224.com“AIエージェントにAWSの操作や開発をサポートさせるためのツールキットらしい 実務でAIを活用してインフラ構築を効率化するのに使えそう yug1224 starred aws/agent-toolkit-for-aws…”Bluesky · Jun 27, 2026 · 1 likes
- sudosubin/agents.nix“agent-skills.github.aws.agent-toolkit-for-aws: 0-unstable-2026-10-03 → 0-unstable-2026-10-05”GitHub · Oct 5, 2026
The biggest 5 of 44 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 44
Talked about on GitHub, Bluesky and Hacker News (44 times).
On GitHub · 39
- Oct 5, 2026agent-skills.github.aws.agent-toolkit-for-aws: 0-unstable-2026-10-03 → 0-unstable-2026-10-05 — sudosubin/agents.nix0 reactions
- Oct 4, 2026codex-plugins.github.aws.agent-toolkit-for-aws: init at 0-unstable-2026-10-03 — sudosubin/agents.nix0 reactions
- Oct 4, 2026codex-marketplaces.github.aws.agent-toolkit-for-aws: init at 0-unstable-2026-10-03 — sudosubin/agents.nix0 reactions
- Oct 4, 2026claude-code-plugins.github.aws.agent-toolkit-for-aws: init at 0-unstable-2026-10-03 — sudosubin/agents.nix0 reactions
- Oct 4, 2026agent-plugins.github.aws.agent-toolkit-for-aws: init at 0-unstable-2026-10-03 — sudosubin/agents.nix0 reactions
34 more on GitHub
- Oct 3, 2026agent-skills.github.aws.agent-toolkit-for-aws: init at 0-unstable-2026-10-03 — sudosubin/agents.nix0 reactions
- Oct 3, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Oct 1, 2026docs(aws): update EFS performance guidance — mouadja02/skills0 reactions
- Sep 30, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 28, 2026aws-skills: upstream update — robomotionio/robomotion-skills0 reactions
- Sep 24, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 23, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 23, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 19, 2026Agent toolkit for AWS — freeflow-community/skill-explorer0 reactions · 1 comment
- Sep 19, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 19, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions · 1 comment
- Sep 8, 2026aws-core: marketplace pins agent-toolkit-for-aws to a pre-fix commit — asm-exec resolves no secrets (fixed upstream, PR #296) — anthropics/claude-plugins-official0 reactions
- Sep 8, 2026feat(telemetry): hook-driven migration telemetry emitter with on-disk attribution — awslabs/startups0 reactions · 1 comment
- Sep 3, 2026(aws-api-mcp-server): MIGRATION.md lists aws___call_aws as a live tool, AWS removed it on 2026-08-31 — awslabs/mcp0 reactions
- Aug 25, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 21, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 18, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 14, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 11, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 7, 2026[bot] Generate Manifests — sator-imaging/suggest-skills0 reactions
- Aug 7, 2026Skills 需补充 references 参考文档(对标 AWS agent-toolkit) — huaweicloud-mate/huaweicloud-devkit0 reactions
- Aug 4, 2026fix: discover skills nested under two categories — vercel-labs/skills0 reactions
- Aug 4, 2026Expand development environment sections — aws/aws-durable-execution-docs0 reactions · 1 comment
- Aug 4, 2026Schedule Batch: Media Host port (JPG convert, S3 upload/delete) with fake + live adapter — SandroBlunt/OrganicGrowthLegacy0 reactions
- Aug 3, 2026add agent skill for using this package — correspondMerchant/LAGO-R-Package0 reactions
- Jul 31, 2026[docs]: Remove Duplicated Kiro Power Content — aws/aws-durable-execution-docs0 reactions
- Jul 25, 2026Install and configure APM tool — scalasm/strands-agents0 reactions
- Jul 7, 2026feat: add Claude Platform on AWS migration skill (.claude/skills/) — aws-samples/anthropic-on-aws0 reactions · 5 comments
- Jul 6, 2026Add weekly AWS resources - 2026-07-06 — sebastianmarines/awesome-aws0 reactions
- Jun 26, 2026agent-toolkit-for-aws: AWS 환경을 위한 MCP 서버 및 도구 모음 — roomedia/ax-trend0 reactions
- Jun 26, 2026Add aws/agent-toolkit-for-aws to Awesome Open Source AI — alvinreal/awesome-opensource-ai0 reactions
- Jun 23, 2026Sandbox backend: AWS Lambda microVMs (Firecracker) — sseshachala/conductai0 reactions
- Jun 17, 2026Agent skills — ryandam9/Explorer0 reactions
- May 14, 2026[Bug]: Cannot install skill using the `npx skills add` command — vercel-labs/skills0 reactions
On Bluesky · 4
- Jun 27, 2026AIエージェントがAWS環境の構築や運用を効率よく行うための公式ツールキットらしい ClaudeやCursorなどのエージェントに導入して開発を自動化するのが楽しみ yug1224 starred aws/agent-toolkit-for-aws… — @yug1224.com2 likes and reposts · 1 reply
- May 10, 2026GitHub - Webpage "GitHub - aws/agent-toolkit-for-aws: Official, AWS-supported MCP servers, skills, and plugins to help AI agents build on… — @librecanada.bsky.social2 likes and reposts
- Jun 27, 2026AIエージェントにAWSの操作や開発をサポートさせるためのツールキットらしい 実務でAIを活用してインフラ構築を効率化するのに使えそう yug1224 starred aws/agent-toolkit-for-aws… — @yug1224.com1 likes and repost
- May 8, 2026aws/agent-toolkit-for-aws: Official, AWS-supported MCP servers, skills, and plugins to help AI agents build on AWS #devopsish — @chrisshort.net0 likes and reposts · 1 reply
On Hacker News · 1
- Jun 8, 2026Agent Toolkit for AWS5 points
In this repository185 other files it gives its agents.
- analyzing-release-readinessSkill
- chatting-with-aws-devops-agentSkill
- coordinating-multi-space-devops-agentSkill
- diff-scanning-with-aws-security-agentSkill
- investigating-incidents-with-aws-devops-agentSkill
- pentesting-with-aws-security-agentSkill
- remediating-with-aws-security-agentSkill
- running-release-testsSkill
- scanning-with-aws-security-agentSkill
- setup-devops-agentSkill
- setupSkill
- threat-modeling-with-aws-security-agentSkill
- agents-buildSkill
- agents-connectSkill
- agents-debugSkill
- agents-deploySkill
- agents-get-startedSkill
- agents-hardenSkill
- agents-optimizeSkill
- agents-paySkill
- agents-paySkill
- amazon-bedrockSkill
- aws-ai-mlSkill
- aws-authSkill
- aws-billing-and-cost-managementSkill
- aws-blocksSkill
- aws-cdkSkill
- aws-cloudformationSkill
- aws-computeSkill
- aws-containersSkill
- aws-databaseSkill
- aws-deploymentSkill
- aws-iamSkill
- aws-messaging-and-streamingSkill
- aws-networkingSkill
- aws-observabilitySkill
- aws-sdk-js-v3-usageSkill
- aws-sdk-python-usageSkill
- aws-sdk-swift-usageSkill
- aws-secrets-managerSkill
- aws-securitySkill
- aws-serverlessSkill
- aws-storageSkill
- aws-well-architected-reviewSkill
- launch-with-awsSkill
- signing-in-to-awsSkill
- amazon-opensearch-serviceSkill
- authoring-mwaa-workflowSkill
- connecting-to-data-sourceSkill
- creating-data-lake-tableSkill
- debugging-mwaa-workflowSkill
- exploring-data-catalogSkill
- finding-data-lake-assetsSkill
- ingesting-into-data-lakeSkill
- querying-data-lakeSkill
- redshift-guideSkill
- storing-and-querying-vectorsSkill
- testing-mwaa-workflowSkill
- upgrading-mwaa-environmentsSkill
- agent-advisorSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 9 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
All Security Agent skills share workspace-local state at .security-agent/:
- Very specific: line 41
Check existing state: read .security-agent/config.json if it exists.
- Very specific: line 50
If config.agent_space_id is set, verify with:
- Distinctive: line 56
If the response shows it doesn't exist, treat as missing.
- Distinctive: line 57
If missing, list existing:
- Distinctive: line 63
If any exist → show them to the user with name + id and ask: "Would you like to reuse one of these, or should I create a new one?" Wait for …
- Very specific: line 64
If user picks one, use that agentSpaceId.
- Distinctive: line 65
If user wants new, or none exist:
- Very specific: line 79
If NoSuchEntity is returned, create the role.
- Very specific: line 128
If not found, create it. A BucketAlreadyExists error means another account already holds the global name — treat it as fatal and distinct …
- Distinctive: line 154
Always (re)apply public access block + 30-day lifecycle:
- Very specific: line 173
Look at agentSpaces[0].awsResources.iamRoles and awsResources.s3Buckets.
- Distinctive: line 174
If the role ARN or the bucket name is missing from those lists, merge and update:
- Distinctive: line 190
Create gitignore: if missing:
- Distinctive: line 203
Never auto-select an agent space when multiple exist — always ask the user
- Distinctive: line 204
Never disable safety protections (the public-access-block stays on)
- Very specific: line 205
Every S3 call against the derived bucket MUST pass --expected-bucket-owner "$ACCOUNT".
- Very specific: line 207
If the user provides their own role name or bucket name (different from the conventional defaults), tell them: this plugin uses …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AWS Security Agent — Setup
This skill handles ONE thing: making sure the workspace has a working agent space, IAM service role, and S3 bucket linked together. Scans and pentests live in separate skills and assume this is done.
Local state convention
All Security Agent skills share workspace-local state at .security-agent/:
config.json—{ "agent_space_id": "as-...", "region": "us-east-1", "code_reviews": { "<abs_path>": "cr-..." } }. Account ID, role ARN, and bucket name are derived by convention. Thecode_reviewsmap lets scans reuse the same CodeReview for a workspace.scans.json— array of{ scan_id, code_review_id, job_id, agent_space_id, scan_type, title, started_at, status, path }(keep last 50)pentests.json— same shape, for pentest jobs.gitignore— contents*so this directory stays untrackedfindings-{scan_id}.md— written by the scan skill after each scan completes
This skill's job is to populate config.json and create .gitignore.
Derived values (convention over config)
Other skills compute these on each invocation rather than reading them from config.json:
| Value | Convention |
ACCOUNT | aws sts get-caller-identity --query Account --output text |
REGION | config.region (default us-east-1) |
service_role_arn | arn:aws:iam::${ACCOUNT}:role/SecurityAgentScanRole |
s3_bucket | security-agent-scans-${ACCOUNT}-${REGION} |
Why minimal config: the role name and bucket name are deterministic, so storing them adds drift risk (a user re-creating a role manually would silently use a stale path). Only agent_space_id is stored because users may have multiple agent spaces and we don't want to ask which one every session.
Workflow
- Check existing state: read
.security-agent/config.jsonif it exists. Caller identity + region:
export ACCOUNT=$(aws sts get-caller-identity --query Account --output text) export REGION="${AWS_REGION:-us-east-1}"- Agent space:
If
config.agent_space_idis set, verify with:aws securityagent batch-get-agent-spaces --agent-space-ids <id>If the response shows it doesn't exist, treat as missing.
If missing, list existing:
aws securityagent list-agent-spaces- If any exist → show them to the user with name + id and ask: "Would you like to reuse one of these, or should I create a new one?" Wait for the answer. Do not auto-select.
- If user picks one, use that
agentSpaceId. If user wants new, or none exist:
aws securityagent create-agent-space --name security-scansCapture returned
agentSpaceId.
- Service role (
SecurityAgentScanRole, ARNarn:aws:iam::$ACCOUNT:role/SecurityAgentScanRole):Probe:
aws iam get-role --role-name SecurityAgentScanRoleIf
NoSuchEntityis returned, create the role. Idempotency note:create-rolewill fail withEntityAlreadyExistsif the role already exists. If that happens, fall through toupdate-assume-role-policyto ensure the trust policy is correct.# Trust policy — includes aws:SourceAccount confused-deputy guard cat > /tmp/sa-trust.json <<EOF {"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":"securityagent.amazonaws.com"},"Action":"sts:AssumeRole","Condition":{"StringEquals":{"aws:SourceAccount":"${ACCOUNT}"}}}]} EOF # Permissions policy (S3 + CloudWatch Logs) cat > /tmp/sa-perms.json <<EOF {"Version":"2012-10-17","Statement":[ {"Effect":"Allow","Action":["s3:GetObject","s3:GetObjectVersion","s3:ListBucket"],"Resource":["arn:aws:s3:::security-agent-scans-${ACCOUNT}-${REGION}","arn:aws:s3:::security-agent-scans-${ACCOUNT}-${REGION}/*"]}, {"Effect":"Allow","Action":["logs:CreateLogGroup","logs:CreateLogStream","logs:PutLogEvents"],"Resource":"arn:aws:logs:*:${ACCOUNT}:log-group:/aws/securityagent/*"} ]} EOF aws iam create-role --role-name SecurityAgentScanRole --assume-role-policy-document file:///tmp/sa-trust.json # if EntityAlreadyExists: aws iam update-assume-role-policy --role-name SecurityAgentScanRole --policy-document file:///tmp/sa-trust.json # always (re)apply permissions: aws iam put-role-policy --role-name SecurityAgentScanRole --policy-name SecurityAgentCodeReviewAccess --policy-document file:///tmp/sa-perms.json
S3 bucket (
security-agent-scans-$ACCOUNT-$REGION):Bucket-ownership enforcement (required). The bucket name is derived from the caller's AWS account ID and region — both non-secret and publicly derivable from ARNs / ECR URIs — so any third party can pre-register ("squat") the predictable name in their own account. Every S3 call MUST pass
--expected-bucket-owner "$ACCOUNT"so the operation fails closed if the bucket is owned by someone else. A403 Forbiddenon a bucket that exists but is foreign-owned is fatal — abort setup and never upload.Probe (asserts ownership):
BUCKET="security-agent-scans-${ACCOUNT}-${REGION}" NEED_CREATE=0 if aws s3api head-bucket --bucket "$BUCKET" --expected-bucket-owner "$ACCOUNT" 2>/tmp/sa-head.err; then : # bucket exists and is owned by this account — safe to reuse elif grep -q '404' /tmp/sa-head.err; then NEED_CREATE=1 elif grep -Eq '403|Forbidden' /tmp/sa-head.err; then echo "FATAL: bucket $BUCKET exists but is owned by another account (403). Possible bucket-squatting — aborting. Nothing was uploaded." >&2 exit 1 else cat /tmp/sa-head.err >&2; exit 1 fiIf not found, create it. A
BucketAlreadyExistserror means another account already holds the global name — treat it as fatal and distinct fromBucketAlreadyOwnedByYou(which is a safe no-op). Re-assert ownership after creation before any further use:if [ "$NEED_CREATE" = "1" ]; then if [ "$REGION" = "us-east-1" ]; then # us-east-1: no LocationConstraint aws s3api create-bucket --bucket "$BUCKET" 2>/tmp/sa-create.err || true else # other regions: aws s3api create-bucket --bucket "$BUCKET" \ --create-bucket-configuration LocationConstraint="$REGION" 2>/tmp/sa-create.err || true fi if grep -q 'BucketAlreadyExists' /tmp/sa-create.err; then echo "FATAL: bucket name $BUCKET is already owned by another account (BucketAlreadyExists). Possible bucket-squatting — aborting." >&2 exit 1 elif [ -s /tmp/sa-create.err ] && ! grep -q 'BucketAlreadyOwnedByYou' /tmp/sa-create.err; then cat /tmp/sa-create.err >&2; exit 1 fi # Confirm ownership of the freshly created bucket before using it. aws s3api head-bucket --bucket "$BUCKET" --expected-bucket-owner "$ACCOUNT" fiAlways (re)apply public access block + 30-day lifecycle:
aws s3api put-public-access-block --bucket "$BUCKET" \ --public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true cat > /tmp/sa-lifecycle.json <<'EOF' {"Rules":[{"ID":"AutoDeleteUploads","Status":"Enabled","Filter":{"Prefix":""},"Expiration":{"Days":30}}]} EOF aws s3api put-bucket-lifecycle-configuration --bucket "$BUCKET" --lifecycle-configuration file:///tmp/sa-lifecycle.json
- Register role + bucket on the agent space (idempotent):
Read existing resources:
aws securityagent batch-get-agent-spaces --agent-space-ids <id>Look at
agentSpaces[0].awsResources.iamRolesandawsResources.s3Buckets.If the role ARN or the bucket name is missing from those lists, merge and update:
aws securityagent update-agent-space --agent-space-id <id> --name <existing-name> \ --aws-resources iamRoles=[<arn1>,<arn2>...],s3Buckets=[<bucket1>,<bucket2>...]
Persist to
.security-agent/config.json(minimal — account/role/bucket are derived):{ "agent_space_id": "as-xxxxx", "region": "us-east-1" }Create gitignore if missing:
mkdir -p .security-agent echo '*' > .security-agent/.gitignore- Confirm to user: "Setup complete. You can run security scans or pentests now."
Rules
- Never auto-select an agent space when multiple exist — always ask the user
- Never disable safety protections (the public-access-block stays on)
- Every S3 call against the derived bucket MUST pass
--expected-bucket-owner "$ACCOUNT". The bucket name is derived from a non-secret account ID, so a third party can pre-register it; a403/BucketAlreadyExistson a foreign-owned bucket is fatal — abort and never upload. - Trust policy must allow
securityagent.amazonaws.com(production service principal) and include theaws:SourceAccountconfused-deputy guard - If the user provides their own role name or bucket name (different from the conventional defaults), tell them: this plugin uses convention-based defaults (
SecurityAgentScanRole/security-agent-scans-${ACCOUNT}-${REGION}). Either accept those defaults or extend the skill — the other skills derive these names rather than reading them from config. - The scan and pentest skills can call this skill inline if
config.jsonis missing — first-time users don't need to run setup separately.
Troubleshooting
AccessDeniedcallingiam:CreateRole→ user lacks IAM permissions. Ask them to run setup with their own role ARN, or to grantiam:CreateRole+iam:PutRolePolicy.AccessDeniedons3api create-bucket→ either the bucket name is taken globally, or the user lackss3:CreateBucket. Suggest using an existing bucket they own and pass it explicitly.403 Forbidden/BucketAlreadyExistson the derived bucket → the predictable name is owned by a different account (bucket-squatting). This is fatal by design — do not upload. Have the user pick a bucket name they own (or run from the expected account/region) and re-run setup.- Role exists but trust policy is wrong →
update-assume-role-policy(step 4 fallback). If they don't want that role updated, ask them for a different role ARN. - Agent space exists but in a different region → tell the user; suggest using the right region or creating a new space in the current region.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

