
AWS Security Agent Penetration Test
OfficialFreeConduct thorough penetration tests on AWS-hosted applications.
Free · Opens the source repo
What AWS Security Agent Penetration Test does
The AWS Security Agent Penetration Test skill is designed for developers and security professionals looking to perform penetration tests on live web applications hosted on AWS. This skill automates the setup, execution, and reporting of penetration tests using the AWS Security Agent service. It begins by ensuring that the necessary configurations are in place, such as agent space, role, and bucket setup, which can be handled by the setup-security-agent skill if not already configured. Once the environment is ready, users can register their target domains and create pentests to evaluate the security posture of their applications.
Pentesting with this skill is a methodical process that can take anywhere from 1 to 24 hours, as it actively probes the application to identify vulnerabilities. Before initiating a test, the skill ensures that users have the proper authorization to conduct the test on the target domain, emphasizing responsible security practices. The workflow includes registering the target domain, creating a pentest, starting the pentest job, and polling for results, which keeps the user informed of the test's status throughout its duration.
Once the pentest is complete, the skill retrieves and organizes findings based on severity, providing a clear report that documents vulnerabilities discovered during the test. This report is saved in Markdown format, allowing for easy sharing and review. The skill is particularly useful for security teams and developers who need to assess their applications' attack surfaces and ensure compliance with security standards.
When to use it
Use this skill when you need to perform a penetration test on a live web application hosted on AWS, especially when assessing its security posture or compliance.
When not to use it
Avoid using this skill if you do not have explicit permission to test the target domain or if the application is not hosted on AWS.
What you can build with it
Testing a New Application
You have just deployed a new web application on AWS and want to ensure its security posture before going live.
Regular Security Assessments
As part of your security compliance requirements, you need to perform regular penetration tests on your AWS-hosted applications.
Identifying Vulnerabilities
You suspect that your application may have vulnerabilities and want to conduct a thorough assessment using automated tools.
How to install AWS Security Agent Penetration Test
View source1. Install with the skills CLI
npx skills add aws/agent-toolkit-for-aws/pentesting-with-aws-security-agent --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by awsAWS Security Agent — Penetration Test
This skill handles pentest setup, execution, and findings. Initial Security Agent setup (agent space, role, bucket) is handled by the setup-security-agent skill — if .security-agent/config.json is missing, the pentest workflow auto-runs setup inline first.
Pentests are slow (1-24 hours) and active — they probe a real running app. Always confirm the user is authorized to test the target before starting.
Resolving the values you need
The CLI examples below use placeholders. Resolve them at the start of every pentest:
| Placeholder | How to resolve |
|---|---|
<id> (agent space) | config.agent_space_id |
<region> | config.region (default us-east-1) |
<account> | aws sts get-caller-identity --query Account --output text (cache for the rest of the turn) |
<role-arn> | arn:aws:iam::<account>:role/SecurityAgentScanRole |
<td-id> | targetDomainId returned by create-target-domain (cache under config.target_domains[<domain>]) |
<pentest-id> | pentestId returned by create-pentest |
<pj-id> | pentestJobId returned by start-pentest-job |
Pre-pentest checks
-
Read
.security-agent/config.json. If missing → tell the user one line — "First pentest in this workspace — running setup first." — and run thesetup-security-agentworkflow inline before continuing. -
Verify agent space still exists:
aws securityagent batch-get-agent-spaces --agent-space-ids <id>If missing, clear
agent_space_idfromconfig.jsonand runsetup-security-agentagain. -
Resolve account and role ARN from the table above.
-
Authorization check: ask the user "Do you own or have explicit permission to pentest
<target>?" if it's not obvious from context. Do not proceed without confirmation.
Workflow
1. Register target domain (one-time per domain)
aws securityagent create-target-domain --agent-space-id <id> \
--target-domain-name <domain> --verification-method HTTP_ROUTE
The response includes a verification token / route. Tell the user what to put on their server (typically a .well-known/... file or HTTP route returning a token), then:
aws securityagent verify-target-domain --agent-space-id <id> --target-domain-id <td-id>
Persist the verified target_domain_id in .security-agent/config.json under target_domains: { "<domain>": "<td-id>" } so future pentests can reuse it.
2. Create a pentest
Ask the user for:
- Title (no spaces — use hyphens; default
pentest-<timestamp>) - Endpoints to test (one or more URIs under the verified domain)
aws securityagent create-pentest --agent-space-id <id> --title <title> \
--service-role <role-arn> \
--assets endpoints=[{uri=https://example.com/api/login},{uri=https://example.com/api/upload}]
Capture pentestId.
3. Start the pentest job
aws securityagent start-pentest-job --agent-space-id <id> --pentest-id <pentest-id>
Capture pentestJobId. Append to .security-agent/pentests.json (create as [] if it doesn't exist yet — the directory itself is already created by setup):
{
"pentest_id": "p-...",
"pentest_job_id": "pj-...",
"agent_space_id": "as-...",
"title": "pentest-...",
"endpoints": ["https://..."],
"started_at": "2026-06-01T20:00:00Z",
"status": "IN_PROGRESS"
}
Tell user: "Pentest started ({pentest_job_id}). Pentests typically run 1-24 hours depending on scope. I'll check every 15 minutes — say 'stop polling' to opt out."
4. Polling loop
-
sleep 900(15 minutes) between checks. Do not poll faster. -
Status:
aws securityagent batch-get-pentest-jobs --agent-space-id <id> --pentest-job-ids <pj-id> -
Only respond when
statuschanges or on terminal state (COMPLETED,FAILED,STOPPED). -
On
COMPLETED→ run the Findings workflow.
5. Findings
aws securityagent list-findings --agent-space-id <id> --pentest-job-id <pj-id>
If nextToken is returned, call again with --next-token <token> until empty.
aws securityagent batch-get-findings --agent-space-id <id> --finding-ids <id1> <id2> ...
Present in chat grouped by severity (same icons + format as code scans):
🟣 CRITICAL: {name}
Endpoint: {endpoint}
{description}
Write a full report to .security-agent/pentest-{pentest_job_id}.md with every field returned (findingId, name, description, riskLevel, riskType, confidence, status, endpoint, request/response samples if present, and remediationCode if present).
Tell user: "Full details written to .security-agent/pentest-{pentest_job_id}.md"
6. Stop a pentest
aws securityagent stop-pentest-job --agent-space-id <id> --pentest-job-id <pj-id>
Rules
- Always confirm authorization to test the target before starting
- Verify the target domain before creating a pentest —
create-pentestwill fail otherwise - Reuse a verified
target_domain_idfromconfig.jsoninstead of re-verifying - Pentest titles must not contain spaces — use hyphens
- Poll every 15 minutes max — pentests are long-running
- Don't auto-restart a failed pentest — show the failure to the user first
Troubleshooting
ValidationExceptiononverify-target-domain→ the verification route isn't responding correctly yet. Ask user to confirm the route is live and serving the expected token.target domain not verified→ run verify-target-domain (step 1) again.- Pentest stuck in
IN_PROGRESSfor >24 hours → likely a backend issue or the target is unreachable. Stop and inspect. AccessDeniedon the service role → the service role doesn't have the network/runtime permissions a pentest needs. The defaultSecurityAgentScanRoleis for code scans only — pentests against AWS resources may need broader permissions. Direct user to the AWS Security Agent console to configure a pentest-specific role.
Frequently asked questions about AWS Security Agent Penetration Test
Similar skills
Cloudflare Security Audit
Perform authorized security audits on codebases.
Authenticated Scan with OpenVAS
Perform deep vulnerability scans using OpenVAS with credentials.
Active Directory Penetration Test
Conduct focused AD penetration tests with ease.
Active Directory BloodHound Analysis
Visualize Active Directory attack paths and risks.
Orchestrating LLM Attacks with PyRIT
Automate multi-turn adversarial attacks against LLMs.
Operating Sliver C2
Deploy and manage Sliver C2 for red-team engagements.
