AI Security Atlas › All entries › Autonomous Agent & MCP Security

ThreatHigh severity

Prompt-to-Code Execution in Agents

Injected instructions make an agent write and run code, shell commands, or package installs on infrastructure it can reach.

Open in the interactive atlas →

Impact

Remote code execution through natural language, often with the agent's credentials and network access.

Why this severity

Impact High × Likelihood Medium = High

Impact high: host and credential compromise. Likelihood medium: shown against Cursor, Claude computer use, and OpenClaw, but catalogued only as demonstrations.

Impact High: Code execution, credential compromise, exposure of regulated or confidential data, irreversible actions, or system-wide failure.
Likelihood Medium: Publicly demonstrated against real products or in peer-reviewed research, or seen in the wild only with a prior foothold such as stolen credentials.

Method: OWASP Risk Rating Methodology

Evidence

Related

Exploits

Follows from

Mitigated by

Remediation

  1. Run generated code only in an isolated, ephemeral sandbox.
  2. Ban eval/exec on model output in the agent's own process.
  3. Require approval for package installs and elevated runs.

How to verify

Framework mapping

OWASP Top 10 for Agentic Applications 2026

OWASP Top 10 for LLM Applications 2025

MITRE ATLAS

NIST AI RMF 1.0