How a decision is made
The kernel takes a catalog, a policy snapshot and a request, and returns one action. These are the words for what happens in between.
Deterministic decision
A decision that depends only on the catalog, the policy snapshot and the request. The kernel reads no clock, ranks with a total order and uses integer arithmetic, so the same inputs give the same decision on any machine and under every 1.x release. A decision that depended on when it was replayed would not be replayable.
Source: DECISION_SEMANTICS: Time, TiesCatalog, policy snapshot and request
The three inputs of every decision. The catalog is the candidates you bring: suppliers, carriers, models. The policy snapshot is the frozen set of rules and limits in force. The request is the typed question being decided. Nothing else reaches the kernel, which returns one action plus an audit bundle.
Source: README: What is this?Hard gate
A limit a candidate must pass before it can be ranked. Every candidate meets the same gates in the same order and is reported against the first one it fails: enabled, quality, latency, capability, provider, region, risk ceiling, then cost against budget and positive utility. A candidate failing three gates is counted once.
Source: DECISION_SEMANTICS: The gates, in orderUtility
The one number survivors are ranked on: quality_adjusted minus risk_penalty minus cost minus latency_penalty, computed in 128-bit integers and clamped rather than wrapped. A candidate whose utility is not strictly above zero is not eligible. Ties break on lower cost, then higher quality, then lower model id; catalog order never decides.
Source: DECISION_SEMANTICS: Utility, Tiesexplain()
Returns one row per candidate in the catalog: which gate turned it away, what was measured against which limit, and for the survivors the terms that add up to the utility the kernel ranked on. It runs the same evaluation as the decision itself, so it cannot become a second opinion about it.
Source: README: Settled in 1.0.0Microunit and basis point
Money is counted in microunits, one millionth of the caller's unit; the kernel performs no currency conversion. Quality, risk and confidence are basis points, where 10,000 means 100%. Latency is milliseconds in a 32-bit integer, which caps it at roughly 49.7 days. Everything the kernel computes with is an integer.
Source: DECISION_SEMANTICS: UnitsReference mapping (routing decision)
The kernel does not know what a candidate is. Model routing, carrier selection, supplier choice and pre-trade admission are reference mappings of domain objects onto one API, not separate products. A routing decision is the kernel choosing among model candidates under quality, latency, risk, provider and budget limits.
Source: README: What is this?, Use casesAgentBudget (settle-once reservation)
A shared budget across paid calls. You reserve before a call and commit or release after it, and uncertain usage is reconciled explicitly. The ledger always satisfies remaining plus reserved plus committed equals what you started with. In Rust, the reservation type is settle-once: a double spend is a compile error.
Source: docs/AGENT_BUDGET.mdWhat gets proved
Calybris does not only decide; it leaves a record anyone can re-check. These are the pieces of that record.
Replay verification
Rebuilding a decision from the catalog, policy and request you persisted, then matching it field for field. verify() never reads a self-declared flag; it recomputes the whole result. That is why those three inputs are stored beside each decision: months later, on another computer, they reproduce the same decision.
Source: README: QuickstartAudit bundle
A record binding one decision to its policy and input through three SHA-256 digests plus a replay_valid result. A verifier accepts it only if it can recompute all three digests from the disclosed artifacts and, when the policy is disclosed, re-derive the decision. Fail-closed producers never emit a bundle whose replay failed.
Source: CALY_PROOF §4CALY-PROOF
The written, byte-exact format of every Calybris digest and hash chain, so an independent implementation can verify a decision trail without running Calybris. Each digest is domain-separated by a nine-byte version tag. Golden vectors pin the values across versions and platforms; a vector mismatch is a breaking change.
Source: CALY_PROOF §0, §10Write-ahead log (WAL)
The decision log: one JSON object per line, each entry hashing the one before it, starting from the literal string genesis. Keyed mode uses HMAC-SHA256. Altering, reordering or deleting a record in the middle breaks the chain. The chain alone cannot show that a final stretch was cleanly removed; that needs an anchor.
Source: CALY_PROOF §5WAL anchor
A small record of the log's head: its sequence number, its last hash and whether it is keyed. Verifying against it detects a cleanly removed suffix, which a hash chain cannot detect by itself. The anchor must be stored outside the WAL file, in trusted durable storage, or it adds nothing.
Source: CALY_PROOF §5.3Decision receipt
A signed claim set for one decision. Its claims digest covers the policy, input and decision digests and the replay result, and optionally a state step and a WAL entry; an Ed25519 signature authenticates all of it. Verifying replay, signature, state anchor and WAL anchor is one fail-closed operation.
Source: CALY_PROOF §8Signed policy provenance
An Ed25519 signature over a policy's digest, with a signer id and a timestamp, so the policy in force cannot later be repudiated. The signed message is domain-separated, which makes the signature non-transferable across policies, signers and timestamps. The timestamp is asserted by the signer, not proven by the core.
Source: CALY_PROOF §7, THREAT_MODELIntegrity of the trail
The single claim of the proof system: given the disclosed policy, input and decision, anyone can confirm the decision is the exact deterministic output of that policy on that input, and that the records were not altered or reordered. It does not prove the inputs were true, the policy was good, or provide confidentiality.
Source: THREAT_MODEL: CALY-PROOF proof surfacesThe trust layer and the questions after a decision
Added in 1.2.0 and 1.3.0 behind the preview flags: released and tested, but outside the 1.x stability promise until reviewed.
Signed checkpoint
The log's state as a signed note in the C2SP format: its name, how many decisions it holds and the Merkle root of all of them, signed by the log. Change any past decision and the root changes. Checkpoints arrived in 1.3.0 as a preview feature, outside the 1.x stability promise until reviewed.
Source: README: In this release, 1.3.0Witness
A party that cosigns a checkpoint only if it extends everything it signed before, so a log cannot show two histories to two witnesses. In 1.3.0 the only witness for the public demo log is run by the maintainer, so it shows the mechanism, not yet an independent guarantee.
Source: README: In this release, 1.3.0RFC 3161 and OpenTimestamps evidence
Independent dating of a checkpoint. An RFC 3161 token comes from a timestamping authority whose certificate you pin. An OpenTimestamps proof is checked against a Bitcoin block header and reads Pending until one exists. The core is clock-free, so without such evidence a signer can backdate.
Source: README: 1.3.0; THREAT_MODEL item 6Merkle inclusion and consistency proof
An RFC 9162 inclusion proof shows one record is in the log without the rest of the log. A consistency proof shows an earlier published head is a prefix of a later one, so a rewritten history cannot prove itself consistent. Both match the Certificate Transparency reference vectors. Added in 1.2.0 as a preview feature.
Source: README: Added in 1.2.0Counterfactual (what would win)
The smallest single change to a losing candidate, in quality, latency, price or risk ceiling, after which the kernel selects it. A companion function reports how far the winner can move before it loses. Both run the real kernel, so they cannot disagree with the decision. Added in 1.2.0 as a preview feature.
Source: README: Added in 1.2.0Off-policy estimate and propensity
An estimate of what a different policy would have achieved, computed from logged outcomes. It needs the exact probability that each logged action was chosen, its propensity, which keyed replayable exploration records at decision time and which cannot be recovered afterwards. The estimate says so plainly when the log cannot answer.
Source: README: Added in 1.2.0, Settled in 1.0.0Install
The commands from the calybris-core 1.3.0 README. Calybris Core is free and Apache-2.0.
# Rust (stable surface)
cargo add calybris-core
# Python (production-capable core binding; stable API)
pip install calybris
# the calybris-verify binary
cargo install calybris-core
Source: README: Install. A local Python build uses maturin develop --release; see docs/PYTHON.md. Packages: crates.io, PyPI.
Calybris next to adjacent tools
Categories, not products. The left columns say what a category is generally for; the right column says only what the Calybris documents state about the kernel. Calybris is a kernel you call inside your own process, so it sits beside these tools rather than replacing them.
| Category | What it is generally for | What Calybris does, per its documents |
|---|---|---|
| Policy engines | Decide whether a request is allowed by a set of rules. | Selects among candidates: hard gates first, then one utility number. Returns one action plus an audit bundle that replays to the same answer; it reads no clock and uses integers only. (DECISION_SEMANTICS) |
| LLM gateways | Sit in front of model providers and carry the traffic. | Not a gateway and not a hosted routing API: a library that runs in your process, with no network calls. Model routing is one reference mapping; a gateway can call the kernel to pick a model and keep the proof. (README: What is this?, When to use) |
| Plain audit logs | Record what happened, in a store the operator controls. | Hash-chained, optionally HMAC-keyed records that replay to the same decision, so a changed, reordered or deleted record is detected. A clean cut of the latest records needs an external anchor; from 1.3.0, checkpoints, witnesses and timestamps address the operator rewriting the log. (CALY_PROOF §5, THREAT_MODEL) |
| Observability and tracing | Show timing and flow through a running system, to debug it. | Records the decision and proves its integrity, not performance. It gives no confidentiality and no liveness guarantee: pair the log with fsync. An optional observability feature emits tracing spans. (THREAT_MODEL items 1 and 8; README: Architecture) |
Questions the documents answer
Does Calybris prove that my policy was good?
No. It proves a decision followed a policy, not that the policy was wise, fair or compliant. A signature by an officer is accountability, not correctness. It also cannot vouch for inputs it never saw: wrong upstream data is faithfully turned into a wrong, provable decision.
Source: THREAT_MODEL items 2 and 3Can it tell if someone deleted the most recent decisions?
Only with an anchor. A hash chain proves the records that are present, and cannot tell a complete log from a cleanly truncated one. Store the WAL anchor outside the log, in trusted storage, and verify against it when completeness matters.
Source: CALY_PROOF §5.3; THREAT_MODEL item 10Do I still have to trust whoever runs the log?
Less in 1.3.0, through preview features: signed checkpoints, witness cosignatures and RFC 3161 and Bitcoin timestamps. The timestamp authorities and Bitcoin are independent of Calybris already; the witness on the public demo log is run by the maintainer, so it is not yet an independent guarantee.
Source: README: In this release, 1.3.0What happens when no candidate passes the gates?
The status is rejected and the selected candidate is None. The kernel never returns a fictitious zero. The explain() output still lists, for every candidate, the first gate that turned it away and what was measured against which limit.
Source: README: QuickstartWill a new 1.x release change decisions I already made?
No. The same catalog and request produce the same decision, digest and receipt as in 1.0.0, on any machine and in any build. A 1.x release may add capabilities or fix a forgery or replay defect; anything that would change a digest waits for a major version.
Source: COMPATIBILITYAre the logs encrypted?
No. Digests give integrity, not secrecy: WALs and certificates disclose inputs, decisions and values in the clear, so encrypt them separately. Key custody for HMAC and Ed25519 keys is also the caller's; a leaked key can forge chains and signatures.
Source: THREAT_MODEL items 1 and 5Every definition above is a paraphrase of the calybris-core 1.3.0 documentation, not a new claim. Preview features are released and tested but outside the 1.x stability promise until reviewed. A markdown version of this page is at /learn/index.md.