creating-internal-agents
Fail
Audited by Gen Agent Trust Hub on Jun 20, 2026
Risk Level: HIGHREMOTE_CODE_EXECUTIONCOMMAND_EXECUTIONDATA_EXFILTRATION
Full Analysis
- [REMOTE_CODE_EXECUTION]: The
executeCodefunction located inreference/medusa-exec.mdusesfs.writeFileSyncto write AI-generated content to a temporary.tsfile on disk and then immediately executes it using therequire()function. This enables the agent to execute arbitrary logic with the full privileges and context of the server process. - [COMMAND_EXECUTION]: The
MedusaExectool, as described inSKILL.mdandreference/medusa-exec.md, is designed to give the AI agent the capability to perform any data operation or system task by generating and running scripts. This effectively bypasses standard API constraints and security boundaries by allowing the agent to define its own execution logic at runtime. - [DATA_EXFILTRATION]: Because the
MedusaExectool provides full access to theMedusaContainerand the underlying Node.js runtime, an agent could be instructed (maliciously or otherwise) to read sensitive environment variables, database secrets, or customer data and transmit them to external endpoints using standard networking modules. - [INDIRECT_PROMPT_INJECTION]: The skill architecture creates a significant surface for indirect prompt injection by processing untrusted data with high-privilege tools.
- Ingestion points: Untrusted user input enters through the POST route in
src/api/admin/agent/<agent-type>/route.tsand is stored in theAgentMessagemodel viareference/api-route.md. - Boundary markers: The implementation lacks delimiters or explicit instructions for the model to ignore potential injection attempts within the conversation history.
- Capability inventory: The skill includes powerful capabilities such as arbitrary code execution via
MedusaExecand full database access through theMedusaContainer. - Sanitization: There is no validation or sanitization of the AI-generated TypeScript code before it is passed to the executor in
reference/medusa-exec.md.
Recommendations
- AI detected serious security threats
Audit Metadata