# AWS Security Agent: Autonomous Exploit Generation Against Real CVEs

> Source: <https://dev.to/mech_app_ai/aws-security-agent-autonomous-exploit-generation-against-real-cves-4c0i>
> Published: 2026-11-28 10:06:33+00:00

**Recommendation:** Validate agent exploit success with observable side effects (file artifacts, controlled callbacks, privilege escalation) and isolate runs with rollback, since 4 of 37 CVEs produced only unconfirmed partial attempts.
More in the playbook "Securing agents and AI tools": <https://wpnews.pro/playbooks/agent-security>

AWS just published results from their Security Agent, now part of AWS Continuum. The agent autonomously exploited 33 of 37 newly disclosed CVEs in real-world environments. This is not a benchmark against synthetic targets. This is production-grade offensive automation that discovers attack surfaces, chains exploits, validates success, and integrates with existing security pipelines.

The shift from manual penetration testing to continuous agent-driven validation exposes new orchestration challenges. How does an agent decide when to abandon a CVE versus when to try another exploit path? How do you validate that an exploit succeeded without damaging production systems? What state management is required to track partial attempts across multiple AWS services?

The Security Agent operates in a loop:

The agent does not rely on a single LLM call. It uses a multi-step reasoning loop with tool calls for network scanning, code execution, and environment introspection. Each step produces structured output that feeds the next decision point.

Building an exploit chain requires more than reading a CVE description. The agent must:

The agent tracks partial success. If an exploit fails at step three of a five-step chain, the agent logs the failure mode and tries an alternative path. This requires state management that persists across retries and handles timeouts gracefully.

Running exploits against real infrastructure introduces risk. AWS built several safety mechanisms:

The validation step is critical. The agent must distinguish between a successful exploit and a false positive. AWS uses observable side effects: did the exploit create a file in `/tmp`? Did it trigger a network callback to a controlled server? Did it escalate privileges to root?

The agent tracks multiple concurrent exploit attempts. Each attempt has:

This state must persist across agent restarts and be queryable for debugging. AWS uses a combination of DynamoDB for structured state and S3 for raw logs and payloads.

Security teams need to distinguish between agent-generated exploits and real attacks. AWS added observability hooks:

These hooks let teams run the agent in production-adjacent environments without polluting security alerts.

The Security Agent integrates with AWS CodePipeline and GitHub Actions. When a new CVE is published:

This shifts security testing left. Instead of waiting for a quarterly pen-test, teams get continuous validation against the latest CVEs.

| Aspect | Benefit | Risk | 
|---|---|---|
| Autonomous exploitation | Faster vulnerability validation | False positives block deployments | 
| Real-world CVE testing | High signal, low noise | Requires production-like environments | 
| Continuous execution | Catches regressions early | High compute and network costs | 
| Agent-generated exploits | Scales beyond manual pen-testing | Requires strong isolation and rollback | 
| Observable side effects | Clear validation signal | Some exploits have no observable effects | 

The biggest risk is over-reliance on the agent. It cannot replace manual security review. It excels at known CVEs with public exploits but struggles with novel attack vectors or logic bugs that require deep application knowledge.

The agent fails when:

AWS reports that 4 of the 37 CVEs could not be exploited. The agent logged partial attempts but could not confirm success. This is expected. Not every CVE is exploitable in every environment.

Here is a simplified validation function that checks for observable side effects after running an exploit:

``` python
import boto3
import time

def validate_exploit(target_ip, exploit_id, expected_artifact):
    """
    Validate exploit success by checking for an observable artifact.

    Args:
        target_ip: IP address of the target instance
        exploit_id: Unique identifier for this exploit attempt
        expected_artifact: Path to a file or network callback URL

    Returns:
        bool: True if exploit succeeded, False otherwise
    """
    ec2 = boto3.client('ec2')
    ssm = boto3.client('ssm')

    # Wait for exploit to complete
    time.sleep(5)

    # Check for file creation
    if expected_artifact.startswith('/'):
        response = ssm.send_command(
            InstanceIds=[get_instance_id(target_ip)],
            DocumentName='AWS-RunShellScript',
            Parameters={'commands': [f'test -f {expected_artifact} && echo SUCCESS || echo FAIL']}
        )
        command_id = response['Command']['CommandId']
        time.sleep(2)
        output = ssm.get_command_invocation(CommandId=command_id, InstanceId=get_instance_id(target_ip))
        return 'SUCCESS' in output['StandardOutputContent']

    # Check for network callback
    elif expected_artifact.startswith('http'):
        # Query CloudWatch Logs for callback
        logs = boto3.client('logs')
        response = logs.filter_log_events(
            logGroupName='/aws/security-agent/callbacks',
            filterPattern=f'"{exploit_id}"',
            startTime=int((time.time() - 60) * 1000)
        )
        return len(response['events']) > 0

    return False

def get_instance_id(ip_address):
    ec2 = boto3.client('ec2')
    response = ec2.describe_instances(
        Filters=[{'Name': 'private-ip-address', 'Values': [ip_address]}]
    )
    return response['Reservations'][0]['Instances'][0]['InstanceId']
```

This function uses SSM to check for file creation or queries CloudWatch Logs for network callbacks. Both approaches provide clear validation signals without relying on exploit-specific output.

**Use AWS Security Agent when:**

**Avoid it when:**

The 33 of 37 success rate is impressive, but the real value is in the orchestration pattern. This is not a one-shot tool. It is a continuous feedback loop that integrates with existing security and deployment pipelines. The plumbing matters more than the headline number.
