Skip to the content
AI and Cybersecurity Learning and Practice Center Test automation Open the Learning Center

WeaknessASC-2026-0005Major weakness

Unexpected code execution by agents

CriticalMitigated

Agent-generated code or commands run on hosts with real credentials, network access or data.

How to detect it

  • A tool exposes shell or code execution
  • Tool calls contain download-and-run commands, reverse shells or encoded PowerShell

How to resolve it

  • Run generated code in ephemeral sandboxes with no host network by default
  • Keep credentials out of sandbox environments
  • Cap CPU, memory and runtime

How to investigate

  1. Collect every command and code block the agent executed
  2. Check the host for new processes, scheduled tasks, users and outbound connections
  3. Rebuild affected hosts from a known-good image and rotate their secrets

Sources

Open it in the Learning Center's vulnerability database