autonomous-agent-patterns
Fail
Audited by Gen Agent Trust Hub on Mar 10, 2026
Risk Level: HIGHCOMMAND_EXECUTIONREMOTE_CODE_EXECUTIONDATA_EXFILTRATIONEXTERNAL_DOWNLOADSPROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The
SandboxedExecutionclass usessubprocess.runwithshell=True. While it attempts to validate commands against an allowed list, the logic is flawed as shell metacharacters (e.g.,;,&&) can be used in the command arguments to execute unauthorized secondary commands after a legitimate one. - [REMOTE_CODE_EXECUTION]: The
MCPAgentpattern implements a method that uses an LLM to generate Python code, writes it to a file, and then dynamically loads it. This creates a direct pathway for arbitrary code execution if the LLM output is manipulated or if the input description contains malicious instructions. - [DATA_EXFILTRATION]: Multiple tools, including
ReadFileToolandEditFileTool, enable direct reading and writing of files using absolute paths. TheContextManagercan ingest entire directories into the agent's context, which could lead to the unauthorized exposure of sensitive files such as SSH keys, configuration secrets, or environment files. - [EXTERNAL_DOWNLOADS]: The
ContextManageruses therequestslibrary to fetch content from external URLs. This functionality allows the agent to pull remote content into its reasoning loop, which could include malicious payloads or hidden instructions. - [PROMPT_INJECTION]: The skill architecture is susceptible to Indirect Prompt Injection through the ingestion of untrusted external data.
- Ingestion points:
ContextManager.add_urlandContextManager.add_fileingest data from the web and filesystem respectively. - Boundary markers: No explicit boundary markers or safety instructions are used when interpolating external content into the LLM prompt context.
- Capability inventory: The agent has access to subprocess execution, filesystem read/write, network requests, and browser automation.
- Sanitization: The provided validation mechanisms for paths and shell commands are insufficient to prevent exploitation of the system's capabilities by an attacker providing malicious input through a processed file or URL.
Recommendations
- AI detected serious security threats
Audit Metadata