Kyvvu

OWASP agentic · ASI05

ASI05: Unexpected Code Execution (RCE)

Agents that write and run code, including coding assistants, can be pushed into executing code an attacker wants. Prompt injection, hallucinated code, unsafe deserialization or eval-style memory features can turn text into execution on a host or container. Because the code is generated on the fly, it can slip past controls built for code that was reviewed in advance.

What it looks like

  • A prompt carries shell commands disguised as a file name, and the agent runs them.
  • An agent fixing a build regenerates a lockfile from unpinned versions and pulls in a backdoored package.
  • Code embedded in a prompt reaches an unsafe eval() in the agent's memory system and executes.

What OWASP recommends

  • Validate and sanitize agent-generated code before it runs, and ban eval and similar evaluators in production agents.
  • Run generated code in sandboxed, non-root environments with network and filesystem limits.
  • Separate code generation from execution with validation gates, and require human approval for elevated runs; keep auto-execution allowlists under version control.
  • Scan code statically before running it and monitor and log every generation and execution.

How Kyvvu's policies address it

These policies from the open library are written for this threat. Runtime policies judge each step against everything the agent did earlier in the task; registration policies check what an agent declares before it runs.

Based on the OWASP Top 10 for Agentic Applications for 2026 by the OWASP GenAI Security Project, licensed CC BY-SA 4.0. The names are OWASP's; the summaries are ours.

An example policy

Code execution requires a preceding gate

From the OWASP agentic default pack. Severity critical: the step is blocked before it runs.

- name: "Code execution requires a preceding gate"  description: |    ASI05 (Unexpected Code Execution):    Direct mitigation for OWASP's most concrete RCE-class threat.    Any step.exec must be preceded by a step.gate (human approval,    static check, or sandboxed dry-run).    Applies to: ALL agents.  rule_type: step_requires_gate  params:    target_kinds: ["step.exec"]  severity: critical  enforcement_point: step_execution

Your agents

Is ASI05 a risk for yours?

For security teams

Request a demo

We walk through your agents' riskiest paths, and the policies that close them.

For developers

Build the path yourself

Recreate the attack in the playground and see which policies stop it.