> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flintai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Arbitrary code execution

> Agent executes shell commands or eval() with parameters derived from LLM output or user input

Agent executes shell commands or eval() with parameters derived from LLM output or user input

## How to resolve

Replace eval()/exec() with safe alternatives (ast.literal\_eval(), operator-based parsers). Use subprocess with argument lists, never shell=True. Sandbox code execution in containers.

## Risk

**Governance/Compliance**

This vulnerability falls under [ASI05:2026 — Unexpected Code Execution](https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/) in the OWASP Top 10 for Agentic Applications. Agent generates or runs code, commands, or scripts without safe sandboxing or review.

**Security**

Agent executes shell commands or eval() with parameters derived from LLM output or user input. If exploited, this can compromise the agent's integrity, confidentiality, or availability, potentially affecting downstream systems and data.

## Explanation

Agent executes shell commands or eval() with parameters derived from LLM output or user input. This falls under ASI05 (Unexpected Code Execution): Agent generates or runs code, commands, or scripts without safe sandboxing or review.

## Specifications

**Trigger**

* Agent scan detects agent executes shell commands or eval() with parameters derived from LLM output or user input

The scanner looks for patterns such as:

* eval(x) where x comes from LLM or user
* exec(script\_content)
* subprocess.run(shell=True)
* os.system(cmd)
* CodeInterpreterTool with no sandbox

**Severity**

* CRITICAL

**Applies to**: Agent
