mermaid-architecture

Pass

Audited by Gen Agent Trust Hub on Sep 13, 2026

Risk Level: SAFECOMMAND_EXECUTIONEXTERNAL_DOWNLOADSINDIRECT_PROMPT_INJECTION
Full Analysis
  • [COMMAND_EXECUTION]: The skill executes external processes via subprocess.run within scripts/extract_mermaid.py, scripts/mermaid_to_image.py, and scripts/resilient_diagram.py to invoke the Mermaid CLI (mmdc).
  • These operations are used exclusively for validating and rendering diagram files.
  • The implementation is secure as it avoids shell=True and sanitizes input parameters, such as filenames, to prevent injection attacks.
  • [EXTERNAL_DOWNLOADS]: The skill automatically downloads and executes the Mermaid CLI if it is not already installed in the environment.
  • The _get_mmdc_cmd function in the provided scripts utilizes npx -y @mermaid-js/mermaid-cli as a fallback.
  • This downloads the official package from the NPM registry, which is an established well-known service.
  • [INDIRECT_PROMPT_INJECTION]: The skill architecture includes a surface for indirect prompt injection since it processes Mermaid diagram code provided in user-accessible markdown files or standard input.
  • Ingestion points: Mermaid code blocks are extracted from markdown files or accepted as command-line arguments in scripts/resilient_diagram.py.
  • Boundary markers: The skill utilizes markdown code fences and directory-based scoping (docs/architecture/) to isolate diagram data.
  • Capability inventory: The skill is capable of writing source and image files to the filesystem and executing the diagram renderer.
  • Sanitization: Filenames are sanitized using regex ([^a-zA-Z0-9_-]) to prevent path traversal or command injection, and diagram code is processed by the official Mermaid parser.
Audit Metadata
Risk Level
SAFE
Analyzed
Sep 13, 2026, 01:05 AM
Security Audit — agent-trust-hub — mermaid-architecture