agent-router-setup

Pass

Audited by Gen Agent Trust Hub on Oct 8, 2026

Risk Level: SAFECOMMAND_EXECUTIONPERSISTENCEINDIRECT_PROMPT_INJECTIONDYNAMIC_EXECUTION
Full Analysis
  • [COMMAND_EXECUTION]: The skill uses the Bash tool to resolve local plugin paths, verify the presence of assets, and gather status information about the project's hook configuration. It also configures a command hook in settings.json that executes a local Node.js script.
  • [PERSISTENCE]: The skill modifies the project's .claude/settings.json file to register a PreToolUse hook. This ensures that the agent-routing logic persists for the project across different sessions of the AI agent.
  • [INDIRECT_PROMPT_INJECTION]: The installed hook script (agent-router.mjs) ingests untrusted task descriptions and prompts from agent tool inputs to perform regex-based routing and scoring decisions.
  • Ingestion points: agent-router.mjs reads the Agent tool input from stdin during the PreToolUse event.
  • Boundary markers: The script treats the ingested input as raw text data for internal matching and scoring logic rather than instructions to be followed.
  • Capability inventory: The hook script has the capability to issue a permissionDecision: "deny" to block the Agent tool call if it identifies a better-fitting expert.
  • Sanitization: The script implements a normalizeText function that converts input to lowercase and collapses punctuation, providing basic protection against some prompt injection patterns.
  • [DYNAMIC_EXECUTION]: The skill copies the agent-router.mjs asset into the project's .claude/hooks/ directory and modifies the configuration to execute this script via node at runtime. The 'strict' level additionally inlines a markdown-based judge prompt into the settings file for LLM-based adjudication.
Audit Metadata
Risk Level
SAFE
Analyzed
Oct 8, 2026, 06:27 PM