autonomous-agent-patterns
Warn
Audited by Gen Agent Trust Hub on Oct 29, 2026
Risk Level: MEDIUMDYNAMIC_EXECUTIONCOMMAND_EXECUTIONEXTERNAL_DOWNLOADSINDIRECT_PROMPT_INJECTION
Full Analysis
- [DYNAMIC_EXECUTION]: The
MCPAgentclass implementation includes acreate_toolmethod that generates Python code via an LLM, writes it to the local filesystem, and then loads it for execution by connecting to it as a new server. This creates a significant risk of arbitrary code execution if the tool description is derived from untrusted input. - [COMMAND_EXECUTION]: The skill defines patterns for executing system commands, including a
run_commandtool and aSandboxedExecutionclass. The sandboxing implementation usessubprocess.runwithshell=True, which is susceptible to command injection if command strings are not meticulously sanitized. - [EXTERNAL_DOWNLOADS]: The
ContextManagerclass provides a pattern for fetching content from arbitrary external URLs using therequests.getmethod to augment the agent's context. - [INDIRECT_PROMPT_INJECTION]: The skill documents an architecture that ingests untrusted data from external URLs and files while maintaining access to high-privilege tools (file writing, command execution), creating a vulnerability surface for indirect prompt injection.
- Ingestion points:
ContextManager.add_urlandContextManager.add_filemethods inSKILL.md. - Boundary markers: None are present in the provided design patterns to distinguish between instructions and data.
- Capability inventory:
run_command,write_file,edit_file, and dynamic tool creation/execution. - Sanitization: While basic path validation is included in
SandboxedExecution, no sanitization or escaping is applied to content fetched from URLs or generated by the LLM.
Audit Metadata