policy
The routing-policy lifecycle — init, check, status, show, evolve, lock/unlock, reload.
Routing policies are the artifact the self-improving loop learns into: init scaffolds policy-lock.yaml and binds it to a preset, live traffic teaches the adequacy ledger, and evolve --apply folds proven downgrades back into the file. The walkthrough is Set up looping; the table and ledger semantics are Policy.
bitrouter policy create + bitrouter key sign are a different surface — per-virtual-key access control (allowed models, budgets, rate limits), not routing. See Guardrails.
bitrouter policy
Policy management
Usage: bitrouter policy [OPTIONS] <COMMAND>
Options
| Flag | Description |
|---|---|
-j, --json | Force JSON output (the default; agent-native). Conflicts with --human |
--human | Render the human-readable view to stdout instead of JSON |
bitrouter policy create
Write a starter access-control policy file to the policy dir
Usage: bitrouter policy create [OPTIONS] <ID>
Arguments
| Argument | Description |
|---|---|
<ID> | Policy id (becomes the file stem and the id: field) |
Options
| Flag | Description |
|---|---|
--dir <DIR> | Policy directory. Default matches the assembly default [default: ./policies] |
-j, --json | Force JSON output (the default; agent-native). Conflicts with --human |
--human | Render the human-readable view to stdout instead of JSON |
bitrouter policy init
Create a routing policy lock and bind it to a preset
Usage: bitrouter policy init [OPTIONS] --preset <PRESET> --economy <ECONOMY> <NAME>
Arguments
| Argument | Description |
|---|---|
<NAME> | Policy name written under policies: |
Options
| Flag | Description |
|---|---|
-j, --json | Force JSON output (the default; agent-native). Conflicts with --human |
--preset <PRESET> | Preset users select as @preset or @preset:variant |
--human | Render the human-readable view to stdout instead of JSON |
--strong <STRONG> | Strong base model. Inferred from an existing preset when omitted |
--economy <ECONOMY> | Economy model explored as a replacement |
-c, --config <CONFIG> | Path to bitrouter.yaml |
bitrouter policy init coding --preset coding \
--economy moonshotai/kimi-k2.7-codeWrites policy-lock.yaml (strong/economy tiers, adequacy pre-seeded) and edits bitrouter.yaml comment-preservingly to bind the preset with writeback: locked.
bitrouter policy check
Parse and cross-validate bitrouter.yaml and its policy lock
Usage: bitrouter policy check [OPTIONS]
Options
| Flag | Description |
|---|---|
-c, --config <CONFIG> | |
-j, --json | Force JSON output (the default; agent-native). Conflicts with --human |
--human | Render the human-readable view to stdout instead of JSON |
bitrouter policy status
Show policy path, digest, writeback mode, and preset bindings
Usage: bitrouter policy status [OPTIONS]
Options
| Flag | Description |
|---|---|
-c, --config <CONFIG> | |
-j, --json | Force JSON output (the default; agent-native). Conflicts with --human |
--human | Render the human-readable view to stdout instead of JSON |
bitrouter policy show
Show one named policy after validation
Usage: bitrouter policy show [OPTIONS] <NAME>
Arguments
| Argument | Description |
|---|---|
<NAME> |
Options
| Flag | Description |
|---|---|
-c, --config <CONFIG> | |
-j, --json | Force JSON output (the default; agent-native). Conflicts with --human |
--human | Render the human-readable view to stdout instead of JSON |
bitrouter policy reload
Hot-reload the policy lock through the daemon control socket
Usage: bitrouter policy reload [OPTIONS]
Options
| Flag | Description |
|---|---|
-c, --config <CONFIG> | |
-j, --json | Force JSON output (the default; agent-native). Conflicts with --human |
--human | Render the human-readable view to stdout instead of JSON |
--socket <SOCKET> |
Hot-reloads the daemon's policy snapshot. An invalid lock is rejected and the daemon keeps its last-known-good.
bitrouter policy evolve
Project qualified database evidence into a deterministic policy lock
Usage: bitrouter policy evolve [OPTIONS]
Options
| Flag | Description |
|---|---|
--apply | Publish the candidate. Without this flag, print a dry-run report |
-j, --json | Force JSON output (the default; agent-native). Conflicts with --human |
-c, --config <CONFIG> | |
--human | Render the human-readable view to stdout instead of JSON |
bitrouter policy evolve # dry-run candidate projection
bitrouter policy unlock
bitrouter policy evolve --apply # atomically republish policy-lock.yaml
bitrouter policy lockOnly adds qualified routes — never overwrites or removes yours — and refuses to publish while writeback: locked.
bitrouter policy lock
Forbid optimizer writes to policy-lock.yaml
Usage: bitrouter policy lock [OPTIONS]
Options
| Flag | Description |
|---|---|
-c, --config <CONFIG> | |
-j, --json | Force JSON output (the default; agent-native). Conflicts with --human |
--human | Render the human-readable view to stdout instead of JSON |
bitrouter policy unlock
Permit policy evolve --apply to publish policy-lock.yaml
Usage: bitrouter policy unlock [OPTIONS]
Options
| Flag | Description |
|---|---|
-c, --config <CONFIG> | |
-j, --json | Force JSON output (the default; agent-native). Conflicts with --human |
--human | Render the human-readable view to stdout instead of JSON |
How is this guide?