Routing policy
Bind model-selection policy to a preset, collect evidence, and publish reviewed routing changes.
A routing policy controls model selection for a bound preset such as bitrouter/auto. Its versioned decisions live in policy-lock.yaml; bitrouter.yaml connects that artifact to the running router. Deployment configuration and caller access-control policies have separate responsibilities.
Start with bitrouter/auto to initialize a binding and send requests. Use Configuration for file discovery, secrets, schema validation, and reload behavior.
Let evidence improve the policy
The policy starts conservatively: an unmatched request fingerprint uses its configured default tier. With adequacy enabled, BitRouter records deterministic outcome observations for policy-bound traffic.
# policy-lock.yaml
adequacy:
enabled: true
escalation_tier: strong
escalation_threshold: 2
pin_cooldown_secs: 1800
explore_enabled: true
explore_tier: economy
explore_threshold: 3
explore_interval: 5The two directions are intentionally asymmetric:
- Escalation: repeated hard failures pin a downgraded fingerprint back to the strong tier; the pin expires after its cooldown.
- Exploration: a cheaper tier must succeed repeatedly before its fingerprint qualifies for that route; a failed trial stops the downgrade.
Qualified changes remain in the local evidence store until you explicitly project and publish them:
bro policy status
bro policy evolve # dry-run the candidate
bro policy unlock
bro policy evolve --apply # atomically update policy-lock.yaml
bro policy reload
bro policy lockevolve --apply adds qualified routes without overwriting routes you authored, and it aborts when the policy changed after the candidate was derived. Review and commit the resulting lock-file diff.
Evaluation and optimization
Runtime adequacy and objective-scored evaluations are separate evidence paths. Evaluations documents sealed subjects, admitted results, frozen snapshots, and the bro optimize and bro policy compile workflow. Review the candidate before making it active; collecting evidence alone does not authorize publication.
Use Telemetry to inspect the route and cost that actually served a request, and Model routing to understand selectors, candidate eligibility, and fallback.
How is this guide?