autonomous-agent-patterns
Fail
Audited by Gen Agent Trust Hub on Sep 30, 2026
Risk Level: HIGHDYNAMIC_EXECUTIONCOMMAND_EXECUTIONINDIRECT_PROMPT_INJECTIONEXTERNAL_DOWNLOADS
Full Analysis
- [DYNAMIC_EXECUTION]: The
MCPAgent.create_toolmethod implements a pattern where the agent generates Python code through an LLM, writes it to a file, and then executes it by connecting to it as an MCP server. This allows for the runtime execution of unvalidated code, which could be manipulated to perform malicious actions.\n- [COMMAND_EXECUTION]: TheSandboxedExecutionimplementation is vulnerable to shell injection. It usessubprocess.run(command, shell=True)with the original command string. While it checks if the base command is in an allowed list usingshlex.split, it does not sanitize the arguments, allowing an attacker to escape the intended command using shell metacharacters like;,&&, or|.\n- [INDIRECT_PROMPT_INJECTION]: The skill defines a significant attack surface for indirect prompt injection by ingesting untrusted data from multiple sources.\n - Ingestion points: Data is pulled from external URLs (
add_url), local files (add_file), and browser content (get_page_content) into the agent context inSKILL.md.\n - Boundary markers: Ingested content is formatted using simple Markdown headers in
ContextManager.format_for_promptbut lacks robust delimiters or safety instructions to prevent the LLM from following instructions embedded in the data.\n - Capability inventory: The agent is designed with high-impact tools including shell execution (
subprocess.run), file modification (write_file), and network access (requests.get).\n - Sanitization: No sanitization or filtering is applied to the ingested content before it is added to the agent's prompt context.\n- [EXTERNAL_DOWNLOADS]: The
ContextManager.add_urlmethod performs arbitrary network requests usingrequests.get(). This can be leveraged by an attacker to conduct SSRF attacks or exfiltrate sensitive information retrieved from the local environment.
Recommendations
- AI detected serious security threats
Audit Metadata