autonomous-agent-patterns
Warn
Audited by Gen Agent Trust Hub on Mar 10, 2026
Risk Level: MEDIUMREMOTE_CODE_EXECUTIONCOMMAND_EXECUTIONPROMPT_INJECTION
Full Analysis
- [REMOTE_CODE_EXECUTION]: The
MCPAgent.create_toolpattern inSKILL.mddemonstrates a design where Python code is generated by an LLM based on user descriptions and then written directly to a file (server.py) to be loaded and executed. This pattern facilitates arbitrary code execution if the LLM-generated content is influenced by malicious input. - [COMMAND_EXECUTION]: The
SandboxedExecutionclass utilizessubprocess.runwithshell=Trueto execute commands. While it implements a whitelist, the use of a shell environment is a significant security risk that can allow command injection through shell metacharacters and operators. - [PROMPT_INJECTION]: The
ContextManagerclass implements a pattern that is vulnerable to indirect prompt injection. - Ingestion points: Untrusted data is ingested from remote URLs via
add_urland local files viaadd_fileinSKILL.md. - Boundary markers: The
format_for_promptmethod uses markdown headers and code blocks as delimiters but lacks explicit 'ignore' instructions to prevent the model from following commands embedded within the external data. - Capability inventory: The agent architecture includes capabilities for file modification (
edit_file), system command execution (run_command), and browser automation (open_browser). - Sanitization: There is no evidence of sanitization or filtering of the fetched content before it is interpolated into the agent's prompt context.
- [COMMAND_EXECUTION]: The
CheckpointManagerclass executes shell commands viasubprocess.getoutputto capture git state. Executing shell commands based on the state of the workspace can be exploited if the environment contains maliciously crafted git metadata.
Audit Metadata