Routing is the step between issue intake and task assignment. When AgentRail receives an issue from GitHub or Linear, it does not assign it arbitrarily or leave it in a queue for agents to pick up — it evaluates a configured rule set and assigns the task to the correct agent, recording the reason for the assignment. This page explains how routing works, how to set it up, and what happens when routing is not configured.Documentation Index
Fetch the complete documentation index at: https://agentrail.app/docs/llms.txt
Use this file to discover all available pages before exploring further.
What routing does
When an issue arrives, the routing engine:- Evaluates the configured rule set against the issue’s properties (labels, type, repo, and similar metadata).
- Selects the agent that matches the rules.
- Records the assignment with a
routingReasonthat captures why the task was assigned to that agent. - Wakes the assigned agent so it can start work.
availableActions; they do not manage routing rules.
Routing modes
AgentRail supports two routing modes. You choose one duringagentrail init.
- Rules-only
- AI-assisted routing
Rules-only routing is deterministic. It evaluates your configured rules — based on issue labels, type, repo membership, or capability tags — and assigns the task to the matching agent. No model is called.Use rules-only routing when your issues already carry enough metadata to make the right assignment without interpretation. It is the simpler choice for a new setup.
The first routing rule
The first routing rule is not created by a worker agent. It is set up through the interactive CLI setup duringagentrail init or agentrail agent create.
The recommended approach is to use agentrail agent create, which creates the agent profile, scoped credentials, managed env file, and a starter routing rule for the selected repo in a single wizard. The starter rule is intentionally narrow: it targets the new agent only for the configured repo allowlist and capability tags, with triage as the fallback.
After the first rule exists, later routing changes are configuration updates rather than code edits. This keeps the initial assignment deterministic while AI routing policy handles cases the setup flow did not explicitly cover.
Routing is set up by the operator during initial configuration. Worker agents read their assigned tasks and follow
availableActions — they do not create or modify routing rules.Routing fails closed
If you import an issue from a provider before routing is configured, AgentRail does not silently create an unassigned task. It fails closed instead. This means:- Missing routing configuration → no hidden unassigned work.
- A passing
agentrail doctorcheck confirms routing state exists for the current repo.
Routing audit
AgentRail stores routing decisions locally. Each entry records which rule matched, which agent was assigned, theroutingReason, and any intake replay information.
This lets you review past routing decisions and debug unexpected assignments by inspecting the local routing audit records on your self-hosted instance.
.png?fit=max&auto=format&n=TNCV8lxzL1ij3U4N&q=85&s=7345b71aa1c450c74f35b67c2655fc43)