ReferenceCLI

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

FlagDescription
-j, --jsonForce JSON output (the default; agent-native). Conflicts with --human
--humanRender 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

ArgumentDescription
<ID>Policy id (becomes the file stem and the id: field)

Options

FlagDescription
--dir <DIR>Policy directory. Default matches the assembly default [default: ./policies]
-j, --jsonForce JSON output (the default; agent-native). Conflicts with --human
--humanRender 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

ArgumentDescription
<NAME>Policy name written under policies:

Options

FlagDescription
-j, --jsonForce JSON output (the default; agent-native). Conflicts with --human
--preset <PRESET>Preset users select as @preset or @preset:variant
--humanRender 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-code

Writes 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

FlagDescription
-c, --config <CONFIG>
-j, --jsonForce JSON output (the default; agent-native). Conflicts with --human
--humanRender 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

FlagDescription
-c, --config <CONFIG>
-j, --jsonForce JSON output (the default; agent-native). Conflicts with --human
--humanRender 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

ArgumentDescription
<NAME>

Options

FlagDescription
-c, --config <CONFIG>
-j, --jsonForce JSON output (the default; agent-native). Conflicts with --human
--humanRender 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

FlagDescription
-c, --config <CONFIG>
-j, --jsonForce JSON output (the default; agent-native). Conflicts with --human
--humanRender 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

FlagDescription
--applyPublish the candidate. Without this flag, print a dry-run report
-j, --jsonForce JSON output (the default; agent-native). Conflicts with --human
-c, --config <CONFIG>
--humanRender 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 lock

Only 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

FlagDescription
-c, --config <CONFIG>
-j, --jsonForce JSON output (the default; agent-native). Conflicts with --human
--humanRender 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

FlagDescription
-c, --config <CONFIG>
-j, --jsonForce JSON output (the default; agent-native). Conflicts with --human
--humanRender the human-readable view to stdout instead of JSON

How is this guide?

On this page