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
Bashtool 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 insettings.jsonthat executes a local Node.js script. - [PERSISTENCE]: The skill modifies the project's
.claude/settings.jsonfile to register aPreToolUsehook. 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.mjsreads theAgenttool input from stdin during thePreToolUseevent. - 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 theAgenttool call if it identifies a better-fitting expert. - Sanitization: The script implements a
normalizeTextfunction that converts input to lowercase and collapses punctuation, providing basic protection against some prompt injection patterns. - [DYNAMIC_EXECUTION]: The skill copies the
agent-router.mjsasset into the project's.claude/hooks/directory and modifies the configuration to execute this script vianodeat runtime. The 'strict' level additionally inlines a markdown-based judge prompt into the settings file for LLM-based adjudication.
Audit Metadata