Potential Destructive AWS CLI Command Executed by GenAI Agent
Identifies a cloud CLI command that destroys infrastructure or identities, such as terminating EC2 instances, removing S3 buckets, or deleting IAM users, when it is spawned by a GenAI coding agent directly or through…
Description
Identifies a cloud CLI command that destroys infrastructure or identities, such as terminating EC2 instances, removing S3 buckets, or deleting IAM users, when it is spawned by a GenAI coding agent directly or through the agent's shell wrapper. A compromised or prompt-injected agent can be steered into wiping the developer's environment and cloud account using the credentials it already holds, as seen in the malicious Amazon Q Developer for VS Code v1.84.0 release (AWS-2025-015).
Detection logic
Its licence does not clear it for publishing here
Sunturai publishes a detection's own text where the licence it arrived under has been reviewed and permits it, and Elastic License 2.0 has not. The query as its source wrote it, its canonical form and the hash that pins this revision are in the workspace record.
Detection requirements
- Platform
- ContainersESXiIaaSIdentity ProviderLinuxmacOSNetwork DevicesOffice SuiteSaaSWindows
The rule states no platform. This is derived from the 3 ATT&CK techniques it maps to.
- Log source category
- event_index
Known benign triggers
- Authorized infrastructure teardown automation may legitimately invoke these commands. Correlate with change management records and known deployment pipeline identities before escalating.
- Developers who explicitly instruct an agent to tear down a development environment or rotate access keys will trigger this rule. Confirm intent with the user before escalating.
MITRE ATT&CK mappings
0 exclusive techniques.This is coverage no other published rule has; it is not this rule's total technique count.
References
| Reference | Cited by |
|---|---|
| aws.amazon.com/security/security-bulletins/AWS-2025-015/ | Only this detection cites it |
| github.com/aws/aws-toolkit-vscode/security/advisories/GHSA-7g7f-ff96-5gcw | Only this detection cites it |
| www.pointguardai.com/blog/clean-to-factory-state-the-ai-prompt-that-nearly-wiped-aws-accounts | Only this detection cites it |
| www.theregister.com/2025/07/24/amazon_q_ai_prompt/ | Only this detection cites it |
From the source
- At source
- Open at source
- Upstream identifier
- 2635d2ba-51e7-404a-9b17-db413a1351d5
- Tagged by the source as
- Data Source: Elastic DefendDomain: CloudDomain: EndpointDomain: GenAIMitre Atlas: T0051OS: LinuxOS: macOSOS: WindowsPlatform: AWSPlatform: KubernetesPlatform: LinuxPlatform: macOSPlatform: WindowsResources: Investigation GuideRule Type: Custom Query (KQL)Service: AWS EC2Service: AWS IAMService: AWS LambdaService: AWS RDSService: AWS S3Tactic: Defense EvasionTactic: Impact
Licence
- Published under
- Elastic License 2.0Read the licence
- Attribution
- Required
Authorship
- Written by
- Published
- Sep 29, 2026
- Version
- 1