
remediating-with-aws-security-agent
Pull AWS Security Agent findings (penetration tests and code reviews) and drive remediation. Use this whenever the user mentions Security Agent, security findings, pentest or penetration test results, code review findings, vulnerabilities found in their AWS account, "what did the security scan find", remediating or triaging security risks, or wants to start fixing reported vulnerabilities — even if they don't name the service explicitly. Trigger it for phrases like "get my security findings", "what vulnerabilities do we have", "let's fix the pentest results", or "triage the security report". The skill discovers scans, exports findings to a gitignored local directory (so sensitive exploit detail is never committed), produces a prioritized triage summary, and offers to start fixing the highest-risk issues.
- Installs
- 1.5K
- Last 24h
- +9
- Trending rank
- #9230
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill remediating-with-aws-security-agent- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads remediating-with-aws-security-agent automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Security Agent Remediation
AWS Security Agent is a frontier agent that runs on-demand penetration tests and code reviews against a customer's applications and reports verified security risks. This skill takes you from "I have findings somewhere in AWS" to "I'm actively fixing the most important ones," while keeping the sensitive exploit detail out of source control.
The flow has four stages, and they matter in order:
- Discover which scans exist and how the account is configured (live, read-only).
- Export the findings to a local gitignored directory.
- Triage the findings into a prioritized, human-readable plan.
- Remediate by offering to fix the highest-risk issues.
Why the ordering and the guardrails matter
Findings contain working attack scripts, reproduction steps, file paths, and sometimes
leaked secrets or environment details. If that lands in a Git repo, a customer can
accidentally commit and publish a step-by-step exploit for their own production system.
So the non-negotiable rule is: findings are written only to .security-agent/, and that
path is gitignored before anything is written.
Stage 1: Discover scans (live, read-only)
Find out what the account has. All commands are read-only list-* operations.
AWS Security Agent organizes data as a hierarchy — work down it:
Application (account + Region)
└── Agent Space (workspace for design review, code review, and pentests)
├── Penetration test → Pentest job → Findings
└── Code review → Code review job → Findings
Run these to orient yourself and show the user what exists:
aws securityagent list-agent-spaces
aws securityagent list-pentests --agent-space-id <as-...>
aws securityagent list-code-reviews --agent-space-id <as-...>
aws securityagent list-pentest-jobs-for-pentest --agent-space-id <as-...> --pentest-id <pt-...>
aws securityagent list-code-review-jobs-for-code-review --agent-space-id <as-...> --code-review-id <cr-...>
Job status is one of IN_PROGRESS, STOPPING, STOPPED, FAILED, COMPLETED. Only
COMPLETED jobs have a stable, full set of findings.
Match the codebase to a scan, then confirm
Agent spaces, pentests, and code reviews are named after the application they target. Before asking the user to pick from a raw list, make an informed guess about which scan corresponds to this repository — the user is working in a codebase for a reason, and the relevant findings are almost always for the app in front of them.
Infer the app identity from the workspace using cheap, high-signal sources:
- The repository / root directory name and the Git remote URL (
git remote -v). - Project manifests and their
name/description(package.json,pyproject.toml,*.csproj,go.mod,Cargo.toml). - README titles, product/steering docs, and any obvious product or company name.
- Distinctive frameworks or domains that match a scan title.
Compare those signals against the agent space / scan names (case-insensitive, allow partial and fuzzy matches). Then always confirm before exporting — present your best guess and your reasoning, and let the user correct it:
"This repo looks like
<product>(from<signal>), which matches the <name> agent space. Use that, or pick another? [Other Agent Space names, ...]"
If nothing matches with reasonable confidence, say so plainly and show the full list rather than forcing a wrong guess. Never export from a guessed scan without the user's confirmation.
Stage 2: Export findings to .security-agent/ (gitignored)
Pull findings using AWS CLI commands. Write everything into .security-agent/ in the repo —
never to chat or stdout — because findings include working attack scripts, reproduction
steps, and sometimes leaked secrets.
1. Lock down the output directory before pulling anything
mkdir -p .security-agent
echo '*' > .security-agent/.gitignore
2. Resolve the latest COMPLETED job
You should already have the agentSpaceId and the pentest/code-review id from Stage 1.
List jobs for the chosen scan:
# Pentest jobs:
aws securityagent list-pentest-jobs-for-pentest \
--agent-space-id <as-...> --pentest-id <pt-...>
# Code review jobs:
aws securityagent list-code-review-jobs-for-code-review \
--agent-space-id <as-...> --code-review-id <cr-...>
Paginate by passing --next-token from the previous response until absent. Filter the
job summaries to status == "COMPLETED". If none are COMPLETED, stop and tell the user
"No completed jobs found. Please wait for a job to complete or check job statuses."
Otherwise, pick the COMPLETED job with the greatest createdAt timestamp.
3. List finding summaries and filter by confidence
# Pentest findings:
aws securityagent list-findings \
--agent-space-id <as-...> --pentest-job-id <pj-...>
# Code review findings:
aws securityagent list-findings \
--agent-space-id <as-...> --code-review-job-id <cj-...>
Paginate on --next-token until exhausted. Confidence values from weakest to strongest:
FALSE_POSITIVE, UNCONFIRMED, LOW, MEDIUM, HIGH.
Keep only HIGH and MEDIUM by default. Widen only when the user explicitly asks.
4. Fetch full detail in batches of 25
batch-get-findings accepts at most 25 ids per call. Chunk the filtered finding ids into
groups of 25:
aws securityagent batch-get-findings \
--agent-space-id <as-...> \
--finding-ids <fid-1> <fid-2> ... <fid-25>
Tag each returned finding with its source (pentest or code-review) before writing,
so triage in Stage 3 can tell them apart.
5. Write findings into .security-agent/
Group findings by job id. For each job, write a full markdown report to
.security-agent/findings_<jobId>.md with ALL fields returned by the API (findingId,
name, description, riskLevel, riskType, confidence, status, codeLocations, remediationCode,
and any other fields). Do not leave off any fields.
Edge cases
- No agent space, scan, or COMPLETED job — stop and surface that to the user rather than retrying.
- Credentials or service unavailable — confirm with
aws sts get-caller-identityand check the Region (defaultus-east-1; Security Agent is regional). - Don't paste finding contents into chat beyond short titles and counts. The detail belongs in the gitignored files.
Stage 3: Triage into a prioritized plan
Rank by risk, because remediation time is finite and a CRITICAL unauthenticated RCE
outranks a LOW informational finding every time. Read the exported findings_*.md
files from .security-agent/ and sort them deterministically.
Ranking rules
Sort ascending by this composite key (lower wins, i.e. more urgent first):
- Risk level, in this order:
CRITICAL(0) →HIGH(1) →MEDIUM(2) →LOW(3) →INFORMATIONAL(4) →UNKNOWN/ missing (5). - Risk score, highest first.
riskScoreis a numeric string on pentest findings (e.g."10.0"), often absent on code-review findings — treat missing as the lowest possible score so it sorts after scored findings of the same level. - Confidence, in this order:
HIGH(0) →MEDIUM(1) →LOW(2) →UNCONFIRMED(3) →FALSE_POSITIVE(4).
Also compute a severity-count summary across all findings (e.g. 2 CRITICAL · 5 HIGH · 3 MEDIUM) for the header of the report.
Pulling the code location
For each finding, derive a single short location string:
- If
filePathis set, use it as-is. - Otherwise, take
codeLocations[0]. Strip the scanner's sandbox prefix fromfilePath(everything up to and including that marker) so the path is repo-relative; if that marker isn't present, fall back to the basename. Append:<lineStart>when present. - If neither is available (typical for some pentest findings), leave it blank and describe the affected endpoint or attack chain in the impact line instead.
Summary format
Write a compact summary for the user:
## Security Agent triage — <agent space name>
<N> findings exported (<P pentest, C code review>) · confidence: <levels> · severity: <counts>
### Priority order
1. [CRITICAL · score 10.0 · HIGH confidence] <finding name>
- Type: <riskType> · Source: <pentest|code-review>
- Where: <file:line or endpoint, if present>
- Impact: <one-line plain-language summary>
2. [HIGH · ...] ...
### Recommended remediation order
<short rationale: which to fix first and why — e.g. "1 and 3 are both
unauthenticated RCE on internet-facing endpoints; fix those before the
stored-XSS issues.">
If more than ~10 findings, show the top N in detail and summarize the rest as a count by severity at the bottom.
What to keep out of chat
The full description, reasoning, and attackScript stay in the gitignored files —
they contain working exploit detail. In the chat summary keep impact lines to one line
each, in plain language. Code-review findings usually carry a filePath/location and a
suggestedFix; call those out since they map directly to repo changes. Pentest findings
describe endpoints and attack chains; map them to the responsible code where you can.
Look for findings that corroborate each other (a pentest and a code review flagging the
same root cause) — those are strong signals for what to fix first.
Stage 4: Offer to remediate
After presenting the triage, offer to start fixing — don't silently begin editing code.
Ask the user something like: "Want me to start fixing the top finding(s)? I'd recommend starting with #1 (<name>)." If they agree, work top-down by priority:
- Read the finding detail from the gitignored export file (location, description, suggested fix).
- Open the affected file and apply the fix via the editor.
- Report one line per fix: "Fixed {name} in
{filePath}:{lineStart}."
If the user wants to handle several findings, fix one at a time (or one cluster of related findings) so each change stays reviewable, and proceed in the priority order from Stage 3.
Notes and edge cases
- No completed jobs: a scan may still be
IN_PROGRESS. Tell the user; offer to re-check later rather than exporting a partial job. - Re-running: each run overwrites the files for that job id. The directory is safe to delete; it only holds exported copies, not source-of-truth data.
- Multiple accounts/Regions: findings are Region-scoped. If the user expected results and got none, confirm the region matches where Security Agent is configured.
- Data handling: treat exported findings as sensitive. They are copies of verified exploits against the user's own systems.
FAQ
What does the remediating-with-aws-security-agent skill do?
Pull AWS Security Agent findings (penetration tests and code reviews) and drive remediation. Use this whenever the user mentions Security Agent, security findings, pentest or penetration test results, code review findings, vulnerabilities found in their AWS account, "what did the security scan find", remediating or triaging security risks, or wants to start fixing reported vulnerabilities — even if they don't name the service explicitly. Trigger it for phrases like "get my security findings", "what vulnerabilities do we have", "let's fix the pentest results", or "triage the security report". The skill discovers scans, exports findings to a gitignored local directory (so sensitive exploit detail is never committed), produces a prioritized triage summary, and offers to start fixing the highest-risk issues.
How do I install remediating-with-aws-security-agent?
Run npx skills add https://github.com/aws/agent-toolkit-for-aws --skill remediating-with-aws-security-agent in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/remediating-with-aws-security-agent/ (personal) or .claude/skills/remediating-with-aws-security-agent/ (project).
Which AI agents can use remediating-with-aws-security-agent?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is remediating-with-aws-security-agent safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains remediating-with-aws-security-agent?
It is published by aws in aws/agent-toolkit-for-aws, and it is an official skill from the maker of the technology it covers. It has 1,472 recorded installs.
More from aws/agent-toolkit-for-aws
aws-iam
aws/agent-toolkit-for-aws
Provides verified corrections for IAM behaviors that AI agents frequently get wrong — policy evaluation edge cases, trust policy gotchas, STS session limits, Organizations quirks, and SAML/MFA specifics. Also provides structured workflows for IAM role management and baseline policy generation from application source code or a Terraform plan JSON. Covers condition operator safety (ForAnyValue/ForAllValues with Null checks), bucket policy deny patterns (VPC endpoint restrictions, org paths), confused deputy protection, and service role creation for AWS services (Glue, CloudTrail, Lambda, ECS, etc.) with aws:SourceAccount/aws:SourceArn trust conditions. Applies when creating IAM roles, writing IAM or bucket policies, generating policies from application source code or a Terraform plan JSON, working with STS, Organizations, or condition operators, or any task needing a service or execution role. Does not cover non-IAM authorization like Cognito user-pool policies or app-level RBAC.
aws-serverless
aws/agent-toolkit-for-aws
Routes serverless requests to a compute form factor and the skill that owns it. Applies first to Lambda, API Gateway, EventBridge, Step Functions and event-driven work while the compute, orchestration or integration choice is open — API backends, webhooks, jobs, cron, queue/stream consumers, durable workflows, event routing, Step Functions vs Durable Functions, and Pipes vs native event source mappings for queues and streams. Decides Event Functions on-demand vs Managed Instances, Web Functions, MicroVMs, EventBridge rules/Scheduler/Pipes/bus, HTTP vs REST API. Owns shared Lambda references (cold starts, SnapStart, concurrency, event sources, function URLs, throttling, troubleshooting). Defers to the specialized skill once a request commits to one form factor or service, or describes its defining feature, even unnamed (durable checkpointing and automatic step retries, Firecracker sandbox, managed instances, Node.js server). Not for EC2, ECS/EKS/Fargate or Amplify hosting.
aws-observability
aws/agent-toolkit-for-aws
Builds, configures, debugs, and optimizes AWS observability - operator-symptom questions and detecting Omni vs classic CloudWatch. CloudWatch on an already-reporting service: Log Insights, metric/composite/anomaly alarms, custom metrics/EMF, dashboards, X-Ray/ADOT tracing, canaries, CloudTrail, Dynamic Instrumentation (live breakpoints/snapshots), the Application Signals service map, and fleet health views. CloudWatch Omni on an existing Space: SQL over logs and traces, PromQL over metrics, Omni dashboards, Omni alerts, context graph for root cause, programmatic/IaC access (API/SDK/CLI/CloudFormation), driving Omni from a coding agent or skills, and evaluating AI agent quality from traces - on-demand and online scoring of live traffic, readback, custom evaluators. For first-time setup - creating an Omni Space, granting access, ingestion, or ADOT instrumentation for Application Signals (ServiceEvents, CI/CD metadata) or Omni - use setting-up-cloudwatch-observability. Not for app logging
aws-cdk
aws/agent-toolkit-for-aws
Authors, deploys, and troubleshoots AWS infrastructure using CDK with TypeScript or Python. Covers best practices, stack architecture, and construct patterns. Applies when writing CDK constructs, bootstrapping environments, running cdk deploy/synth/diff, fixing CDK or CloudFormation errors, planning stack structure, importing existing resources, resolving drift, or refactoring stacks without resource replacement.
aws-containers
aws/agent-toolkit-for-aws
Builds and deploys containerized workloads on Elastic Kubernetes Service (EKS), Elastic Container Service (ECS), Fargate, and ECR (Elastic Container Registry). Covers general EKS knowledge, Karpenter, AWS Load Balancer Controller and leveraging various open source Kubernetes projects with EKS. Covers general ECS knowledge, task definitions, Fargate services, ECS Exec, ECS Express Mode and ECS Managed Instances. Covers general Elastic Beanstalk knowledge, Elastic Beanstalk configuration and platforms supported by Elastic Beanstalk. Covers general ECR knowledge, ECR repository setup and lifecycle policies. Includes recommending, enabling, and reading Amazon ECS Action Logs to troubleshoot control-plane failures (deployment rollback/circuit-breaker, task placement, scaling, task replacement). Applies when deploying, debugging, or optimizing containers on AWS. Should be used instead of relying on internal knowledge for these services.
aws-billing-and-cost-management
aws/agent-toolkit-for-aws
Analyze AWS costs, find savings, manage budgets, evaluate Savings Plans and Reserved Instances, right-size EC2/Lambda/RDS/EBS with Compute Optimizer, look up service pricing, query CUR with Athena, detect cost anomalies, scope costs to billing views, and monitor Free Tier usage. Triggers on: AWS bill, cost analysis, reduce spend, savings plan, reserved instance, right-size, budget alert, cost optimization, pricing, free tier, cost anomaly, CUR, cost audit, billing view, billing view ARN.
Popular security skills
azure-compliance
microsoft/azure-skills
Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.
minimal-run-and-audit
lllllllama/rigorpilot-skills
Rigor Run skill for README-first deep learning repo reproduction. Use when the task is specifically to capture or normalize evidence from the selected smoke test or documented inference or evaluation command and write standardized reprooutputs/ files, including patch notes when repository files changed. Do not use for training execution, initial repo intake, generic environment setup, paper lookup, target selection, hidden scientific-meaning changes, or end-to-end orchestration by itself.
seo-audit
coreyhaines31/marketingskills
When the user wants to audit, review, or diagnose SEO issues on their site. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking," "SEO issues," "on-page SEO," "meta tags review," "SEO health check," "my traffic dropped," "lost rankings," "not showing up in Google," "site isn't ranking," "Google update hit me," "page speed," "core web vitals," "crawl errors," "indexing issues," "stuck on page 2," "striking distance keywords," "title tag rewrite," "low CTR," "local SEO," "Google Business Profile," or "map pack." Use this even if the user just says something vague like "my SEO is bad" or "help with SEO" — start with an audit. For building pages at scale to target keywords, see programmatic-seo. For adding structured data, see schema. For AI search optimization, see ai-seo.
firebase-security-rules-auditor
firebase/agent-skills
Audits Firebase (Firestore, Cloud Storage) security rules for vulnerabilities, privilege escalation, role bypasses, create vs update inconsistencies, resource exhaustion, type safety, size limits, and hasOnly ownership checks. Use when auditing/reviewing rules, running red-team rule assessments, or scoring against auditor checklists. Don't use for Firebase CLI (login, deploy), Auth, Crashlytics, Remote Config, or database queries.
audit
pbakaus/impeccable
Run technical quality checks across accessibility, performance, theming, responsive design, and anti-patterns. Generates a scored report with P0-P3 severity ratings and actionable plan. Use when the user wants an accessibility check, performance audit, or technical quality review.
competitors
coreyhaines31/marketingskills
When the user wants to create competitor comparison or alternative pages for SEO and buyer-facing use. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' 'competitive landing pages,' 'how do we compare to X,' 'competitor teardown,' 'audit our competitor pages,' 'are our comparison pages out of date,' or 'competitive asset audit.' Use this for any content that positions your product against competitors. Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. For auditing existing claims (not researching competitors from scratch, which is competitor-profiling; not technical SEO on these pages, which is seo-audit), use the asset audit here. For internal battle cards and sales-specific competitor docs, see sales-enablement.