autonomous-agent-patterns

Warn

Audited by Gen Agent Trust Hub on Nov 13, 2026

Risk Level: MEDIUMDYNAMIC_EXECUTIONCOMMAND_EXECUTIONINDIRECT_PROMPT_INJECTIONDATA_EXFILTRATION
Full Analysis
  • [DYNAMIC_EXECUTION]: The MCPAgent.create_tool method provides a pattern for dynamically generating Python code using an LLM based on user-provided descriptions, writing that code to the filesystem (e.g., ./mcp_servers/server.py), and subsequently executing it as an MCP server. This creates a critical surface for arbitrary code execution if the input description originates from an untrusted source.
  • [COMMAND_EXECUTION]: The skill demonstrates patterns for executing system shell commands through subprocess.run and subprocess.getoutput. The SandboxedExecution example utilizes shell=True, which is a high-risk pattern that can lead to command injection if arguments are not perfectly sanitized.
  • [INDIRECT_PROMPT_INJECTION]: The ContextManager class (SKILL.md) demonstrates patterns for ingesting untrusted data from local files and external URLs into the agent's context. Evidence: 1. Ingestion points: add_file, add_folder, and add_url methods. 2. Boundary markers: Absent in the provided format_for_prompt logic. 3. Capability inventory: The skill includes file-read/write tools, network fetching, and shell execution capabilities. 4. Sanitization: Absent; content is directly interpolated into markdown blocks without escaping or validation.
  • [DATA_EXFILTRATION]: The ContextManager.add_url method utilizes the requests library to perform network operations (GET requests) to arbitrary external domains, which represents a potential surface for data exfiltration if the agent is instructed to send sensitive data as part of a URL or request.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Nov 13, 2026, 01:31 AM