SecurityIntermediate

AWS Security Agent: Autonomous Pentesting, Explained

DeveloperHat Team
14 min read

TL;DR

AWS Security Agent brings autonomous penetration testing to AWS: what it does, how a test runs, what $50 per task-hour buys, and when manual testing still wins.

AWS Security Agent is Amazon's answer to a familiar bottleneck: penetration testing is slow, expensive, and hard to schedule, so teams test too rarely. The agent reads your design documents and code, builds its own attack plan, and tries real exploits against a running application, reporting each finding with a CVSS score, severity, reproduction steps, and remediation guidance.

It was previewed at re:Invent 2025, announced on December 2, 2025, by AWS CEO Matt Garman. On-demand penetration testing went generally available on March 31, 2026, in six regions: US East (N. Virginia), US West (Oregon), Europe (Ireland), Europe (Frankfurt), Asia Pacific (Sydney), and Asia Pacific (Tokyo). Penetration testing costs $50 per task-hour, metered per second, where a task-hour is time the agent actively works, not wall-clock time. New customers get a two-month free trial.

One agent reads everything, then attacks it like a tester Design docs specs + diagrams Source code repos + PRs IaC + threat models how it is deployed AWS Security Agent frontier agent Threat model STRIDE, from code Code review findings in PRs Pentest live exploit chains Every finding is validated by a real exploit before it reaches you.

What AWS Security Agent actually is

AWS Security Agent is an AI agent for application security that works across the development lifecycle, not only at release time. It integrates natively with Kiro, works with Claude Code through a plugin, and connects to any AI-powered IDE through an open MCP integration, which is how the agent reaches editors beyond AWS-native tooling.

The agent covers four capabilities. Design security review examines architecture and design documents before code is written, looking for a trust boundary drawn in the wrong place, an authentication flow with a gap, or a data flow exposing sensitive information where it should not go. Threat modeling produces a structured model of what could go wrong, using STRIDE: Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, and Elevation of privilege. Because the model is generated from your actual architecture rather than a generic checklist, its threats are tied to components your team recognises.

Code security review analyses source code, carrying context from the design review and threat model into the code: a pattern that looks harmless in isolation can be a real issue when the agent knows the data flowing through it is sensitive, or that the caller is unauthenticated.

On-demand penetration testing, the capability that went generally available on March 31, 2026, is active testing against a running application. The agent attempts real exploits with targeted payloads and attack chains to validate findings, rather than merely reporting that a vulnerability might exist. It tests the OWASP Top 10 plus application-specific business-logic flaws, the kind a generic scanner rarely finds because they depend on how your application is supposed to work, such as a user changing an item's price by editing a request. The first three capabilities were free in preview; penetration testing is the paid generally available capability.

The agent is not limited to AWS-hosted applications: it works across AWS, other clouds, and on-premises, provided it can reach the target and has the context it needs. The agent can also generate fix pull requests for human review, either auto-submitted or triggered manually.

How a test actually runs

A test starts before the agent touches your application. You define the scope, provide the context, and set the budget; the setup determines the quality of the result. The agent ingests design documents, architecture diagrams, infrastructure-as-code, source code, user stories, and threat models, then builds a custom attack plan from that context. Thorough design documents and current source produce a plan that reflects your actual attack surface; a bare URL produces a generic one.

You also verify ownership of the domain, via DNS or HTTP, and provide test credentials through Secrets Manager or Lambda, so the agent can log in as a test user and exercise authenticated flows. This is where many first tests underperform: an unauthenticated test reaches only the public surface, while the interesting business-logic flaws usually sit behind login. For guidance on handling those credentials safely, see our guide to secrets management at scale, rotation, and audit.

Once scope and context are set, the agent combines SAST, DAST, and penetration testing into one workflow: static analysis shows where the code looks fragile, dynamic testing shows how the running application behaves, and the penetration-testing step attempts real exploits to confirm which signals are genuine, chaining steps into attack sequences. A validated exploit is still a finding in a test environment, against test data, with test credentials; a person must judge its severity in production and whether the fix addresses the root cause.

The operational surface is the aws securityagent CLI, alongside the console and the securityagent API. The CLI exposes the core jobs directly: start-code-review-job, start-pentest-job, and list-findings. A minimal flow looks like this:

# Start a penetration test against a configured pentest
aws securityagent start-pentest-job --pentest-id <pentest-id>

# List findings for the agent space
aws securityagent list-findings --agent-space-id <agent-space-id> --output table

In practice, teams wrap the CLI in a script or CI step that waits for the job, pulls the findings, and decides what happens next. The sketch below shows that shape: fetch the findings, fail the build on critical results. Treat it as a starting point, not a drop-in script.

#!/bin/bash
# Sketch: gate a deployment on AWS Security Agent findings.
set -euo pipefail
AGENT_SPACE_ID="${SECURITY_AGENT_SPACE_ID:?set SECURITY_AGENT_SPACE_ID}"
aws securityagent list-findings --agent-space-id "$AGENT_SPACE_ID" --output json > findings.json
CRITICAL_COUNT=$(jq '[.findings[]? | select(.severity == "CRITICAL")] | length' findings.json)
if [ "$CRITICAL_COUNT" -gt 0 ]; then
  echo "Failing build: critical findings need review before release."
  exit 1
fi

The default quota is 5 concurrent penetration test runs per account per region: enough for most teams, but a constraint if you test many services at once or trigger a test from every pull request.

The architecture: one agent across the lifecycle

The design worth understanding is the shared-context model. A traditional setup chains separate tools: a SAST tool reads code, a DAST tool probes the running application, and a penetration tester reads both reports and works from experience, losing context at each handoff. AWS Security Agent keeps the context in one place, so design documents, the threat model, the code, and live behaviour all feed the same agent, and a finding in one stage can inform the next.

That shared context is also why results depend so heavily on the inputs. A threat model built from a thin design document will be thin, and a code review without the infrastructure-as-code that defines the network boundaries will miss issues that only appear when code and infrastructure are read together. The agent is no substitute for documenting your system; its output reflects the quality of what you feed it. The trade-off is breadth against depth: one service covering the full lifecycle versus best-of-breed point tools per stage.

Four phases, one agent, one context Design review — specs vs your security requirements Threat modeling — STRIDE, built from code + docs Code review — PRs and repos, continuously Penetration testing — live exploit chains, $50 / task-hour Findings — CVSS · reproduction steps · fix PRs The same context feeds every phase — the pentest knows what the design review found. Pentesting is GA since Mar 31, 2026; the other three phases were free in preview.

Cost math and budget controls

Penetration testing is priced at $50 per task-hour, metered per second, where a task-hour is time the agent actively works, not wall-clock time. A test that runs for three wall-clock hours while the agent waits on a slow application does not necessarily cost three task-hours; estimate from the active work required instead.

The budget controls added on August 19, 2026, let you cap that cost: you set a maximum task-hour limit when creating a test. The smallest allowed limit is 20 hours, a $1,000 floor at $50 per hour, and a 30-hour preset is recommended for larger applications, putting a larger test at $1,500. This is not a tool to run casually against every small change, so compare it against the manual testing it replaces, and the cost of not testing at all.

The same August 19, 2026, update added finding revalidation. After deploying a fix, the agent re-tests only the selected findings and returns Active or Resolved for each one. The first three revalidations per finding are free, so you can confirm a fix without a full re-test and iterate up to three times per finding before revalidation costs task-hours.

New customers get a two-month free trial: use it on a scoped, representative application, with full context, and compare the findings against what you already know. A trial run against a bare target with no context will tell you little. Availability is part of the cost picture too: the service went generally available on March 31, 2026, in six regions, and there is no India region, a real constraint for data-residency requirements. If your compliance posture requires testing data or test traffic to stay in India, the current footprint does not support that.

One naming note. In November 2026, AWS's best-practices guide said that AWS Security Agent is now Continuum for penetration testing, part of AWS Continuum. The console, the securityagent API and CLI, IAM policy names, and the User Guide still use the name AWS Security Agent. Until AWS renames the operational surface, search for AWS Security Agent in the console, the CLI, and the documentation.

Autonomous testing versus manual pentesting

The honest comparison is not agent versus human as a winner-takes-all contest; it is about which kind of testing fits which situation. Autonomous testing wins on speed, frequency, and cost for repeatable checks. Preview customers report pentesting timelines compressed from weeks to hours. HENNGE reported reducing typical testing duration by more than 90 percent. AWS cites customer reports of 70-90 percent savings against manual testing. SmugMug runs tests that complete in hours rather than days. Those are customer reports cited by AWS, not independent benchmarks, and they describe time and cost savings, not a claim that the agent finds everything a human would find.

The agent is strongest where the attack surface is well documented and the application is accessible with test credentials. It can run on demand, after a significant change, before a release, or on a regular cadence, without waiting for a tester's calendar. That frequency is the real gain: a team that tests once a year can test after every major change. Its findings are consistent and reproducible, with CVSS scores and reproduction steps, making it easier to track whether a vulnerability is genuinely fixed or merely hidden.

Manual testing wins on creativity, context, and judgement. A human tester brings intuition about where a business-logic flaw might hide, the ability to chain unusual observations into a novel attack, and judgement about business impact that a CVSS score alone cannot capture. A human can also test what the agent cannot reach: a flow needing a real device, a social-engineering vector, a physical control, or a nuanced understanding of a regulated workflow. For regulated organisations, that judgement is not optional: AWS's own position is that AWS Security Agent is not a professional penetration testing service, and it does not replace manual penetration testing for regulated organisations.

The supply-chain angle is worth noting. The agent's code review reads your source, but the risk in modern applications often sits in dependencies, and a compromised package can undermine an otherwise well-tested application. Our coverage of the PyPI compromise and supply-chain defence explains how that attack works and what to check beyond your own code.

How do you test this app today? Current testing? annual · none · regulated Annual manual test one snapshot a year Shipping, no testing weekly deploys, blind Regulated audit compliance requires it Agent between tests continuous, $50 / hr Agent first then manual, critical apps Manual stays agent adds coverage AWS is explicit: the agent is not a professional pentest service — use both.

Recommendation

Use AWS Security Agent as a frequent, on-demand layer in your security testing, not as a replacement for human testing.

Start with a single scoped application your team knows well. Provide the full context: design documents, architecture diagrams, infrastructure-as-code, source code, user stories, and the threat model. Verify the domain, provide test credentials through Secrets Manager or Lambda, and set a maximum task-hour limit for the application, starting from the 20-hour minimum, or the 30-hour preset for larger ones. Run the test, review every finding with a human, fix the confirmed issues, then use the free revalidation, up to three times per finding, to confirm the fixes.

If that first test produces useful, validated findings with clear reproduction steps, expand the cadence: run the agent after significant changes, before releases, and on schedule for your most exposed applications. If it produces only generic findings, or ones you already knew about, the problem is likely the context you provided, so improve the scope documents and credentials before you judge the tool. Keep manual testing for regulated workloads, high-value targets, major architectural changes, and any assessment where a compliance framework or a customer contract requires a professional test. Use the agent to keep the application clean between manual tests, so the human tester spends time on novel, high-impact issues rather than OWASP Top 10 findings the agent could have caught weeks earlier.

If your developers work in an AI-powered IDE, connect the agent through the open MCP integration, the Kiro native integration, or the Claude Code plugin, so findings appear where the fix will be written. A finding that lives only in a console is a finding that gets deferred. Before you connect an agent to your development workflow, our guide to MCP security hardening for gateways covers the gateway controls worth putting in place.

Architecture Decision

Decision: Adopt AWS Security Agent as a frequent on-demand penetration-testing layer, keeping manual penetration testing for regulated workloads and high-value assessments.

Context: Penetration testing is slow to schedule and expensive to run, so most teams test too infrequently. The agent offers on-demand testing at $50 per task-hour, metered per second, with a 20-hour minimum limit, combining SAST, DAST, and penetration testing into one workflow across AWS, other clouds, and on-premises.

Options considered: Manual penetration testing only, on an annual or per-release cadence; a traditional vulnerability scanner plus manual testing; AWS Security Agent as the sole testing method; AWS Security Agent as a frequent layer alongside periodic manual testing.

Why this one: The agent compresses timelines from weeks to hours for scoped tests, according to customer reports cited by AWS, and runs after significant changes without waiting for a tester's calendar. Keeping manual testing alongside it preserves human judgement and meets the compliance requirement AWS states.

What it costs you: A minimum of $1,000 per test at the 20-hour limit, $1,500 at the 30-hour preset for larger applications, plus setup time for design documents, code, scope, domain verification, and test credentials. Findings need human review, and fix pull requests need human approval before they merge. Six regions are available, with no India region, so data-residency requirements may limit where you can run it.

When to reverse it: Reverse it if the agent consistently produces only generic or already-known findings after you have provided full context, if the cost per test exceeds the value of the findings, or if compliance demands manual testing as the sole method and the agent layer adds overhead without adding findings. Also revisit it if AWS expands the regional footprint or renames the operational surface, which still uses AWS Security Agent today.

When NOT to use it

Do not use AWS Security Agent as your only penetration test when a regulator, a customer contract, or a compliance framework requires a professional manual test; it complements manual testing but does not substitute for it in regulated contexts.

Do not use it without the setup it needs. The agent is only as good as the context you give it: without scope documents, code, test credentials via Secrets Manager or Lambda, and domain verification via DNS or HTTP, it will not produce useful results. If you cannot provide that context, do not spend the minimum $1,000 to learn that lesson. Write the scope first, then run the test.

Do not use it where data residency blocks you: there is no India region, so if testing traffic or test data must stay in India, the current footprint does not meet that need.

Do not treat its findings as final without human review. Every finding carries a CVSS score, severity, reproduction steps, and remediation suggestions, but a score is not a business-impact assessment. A person needs to confirm the finding, judge its severity in production, and check the fix addresses the root cause. The same applies to generated fix pull requests: a starting point for human review, not an automatic merge.

Do not expect it to find everything. The agent tests the OWASP Top 10 plus application-specific business-logic flaws it can infer from your context, and validates findings with real exploits, but that capability is bounded by the context you provide and the surface it can reach. A human tester will still find issues the agent misses, especially novel chains and flows needing real-world context.

For the full announcement and pricing details, see the AWS Security Blog post on on-demand penetration testing now generally available, the AWS What's New entry for AWS Security Agent on-demand penetration, the best-practices guide at AWS Security Agent best practices, and the hands-on walkthrough on AWS Security Agent pentesting and threat modeling on demand.

Why This Matters

Understanding the business and technical context helps you make informed decisions rather than blindly following patterns.

Trade-offs to Consider

Every architectural decision involves trade-offs. Consider your specific requirements, team expertise, and scale when evaluating options.

When NOT to Use This

Knowing when a solution doesn't apply is as valuable as knowing when it does. Consider alternatives for your specific situation.

Decision Framework

Use this framework to evaluate whether this approach is right for your use case based on your specific constraints and requirements.

Share this articleShare on XShare on LinkedIn

Keep the decision frameworks coming

One practical architecture guide a week — patterns, trade-offs, and when not to use them. No spam, unsubscribe anytime.