Chio/Docs

ReferenceSpec

Schemas and Errors

The Chio JSON Schema set, the error-code registry, the IETF protocol draft, and the versioning policy that governs compatibility across revisions.

Source

This page reflects the contents of spec/schemas/, spec/errors/, spec/ietf/, and spec/versions/ in the chio repository. The schema set defines the Chio v1 wire contract; SDKs, codegen pipelines, and conformance harnesses resolve types from these files first and treat hand-typed bindings as derived bindings.

Current schema bundle version: 1.0.0 (spec/schemas/VERSION).


Schemas

spec/schemas/ holds more than twenty schema families. The two documented in full below are the ones agents and sidecars parse directly: chio-wire/v1/ for the native framed transport and chio-http/v1/ for the hosted HTTP interface. The rest cover the wider protocol interfaces — among the larger ones chio-pheromone/v1, chio-runtime/v1, chio-federation/v1, chio-commerce/v1, chio-transaction/v1, chio-attest/v1, and chio-swarm/v1 — alongside chio-trust/v1, chio-proof-room/v1, chio-web3/v1, chio-disclosure/v1, chio-lineage/v1, chio-oracle/v1, chio-risk/v1, chio-enterprise/v1, chio-agent-web/v1, chio-transparency/v1, chio-workflow/v1, and chio-crypto/v1 (a single verification-context schema). Outside the wire and HTTP trees sit the one-file chio-replay-report/ family (chio-replay-report/v1.schema.json, the report shape emitted by chio replay --json) and a set of top-level schemas for shared objects. Full per-file tables for every family live in spec/schemas/COVERAGE.md. Every JSON Schema is draft 2020-12.

chio-wire/v1/agent

Messages an agent sends to the kernel.

FileScope
agent/heartbeat.schema.jsonLiveness ping from agent
agent/list_capabilities.schema.jsonRequest the kernel's capability list view
agent/tool_call_request.schema.jsonInvoke a tool under a presented capability

chio-wire/v1/kernel

Messages the kernel sends back.

FileScope
kernel/capability_list.schema.jsonCapability inventory response
kernel/capability_revoked.schema.jsonNotification of revocation propagation
kernel/heartbeat.schema.jsonLiveness ping from kernel
kernel/tool_call_chunk.schema.jsonStreaming chunk for an in-flight tool call
kernel/tool_call_response.schema.jsonFinal tool-call response with signed receipt

chio-wire/v1/result

Tool-call result variants embedded in tool_call_response.

FileScope
result/ok.schema.jsonSuccessful invocation
result/stream_complete.schema.jsonStream finished after one or more chunks
result/cancelled.schema.jsonCaller-cancelled invocation
result/incomplete.schema.jsonPartial result without a clean terminal state
result/err.schema.jsonError result envelope

chio-wire/v1/error

Error code + detail shapes used inside err.schema.json. Each schema pins the discriminating code string and the structured detail body.

FileScope
error/capability_denied.schema.jsonCapability presented but denied by signature, scope, or subject binding
error/capability_expired.schema.jsonCapability past its validity window
error/capability_revoked.schema.jsonCapability matched a revocation entry
error/policy_denied.schema.jsonGuard pipeline denied with named guard and reason
error/tool_server_error.schema.jsonTool server failure
error/internal_error.schema.jsonKernel-internal failure (fail-closed)

chio-wire/v1/capability

Capability primitives backing the authority model in protocol section 3. The Rust types live in crates/core/chio-core-types/src/capability.rs; schemas mirror them and are validated against every case in tests/bindings/vectors/capability/v1.json.

FileScope
capability/token.schema.jsonCanonical issued CapabilityToken
capability/grant.schema.jsonSingle grant carried inside a token's scope (ToolGrant, ResourceGrant, PromptGrant via oneOf)
capability/revocation.schema.jsonSingle RevocationRecord (wire companion to the kernel revocation notification)
capability/capabilities.schema.jsonFeature bitset exchanged during federation trust establishment; malformed feature names and unsupported schema IDs fail closed

chio-wire/v1/receipt

Receipt primitives for the audit log; mirror ChioReceipt and MerkleProof in crates/core/chio-core-types/. Validated against tests/bindings/vectors/receipt/v1.json on every PR; M04 deterministic-replay consumes them as the golden-bundle contract.

FileScope
receipt/record.schema.jsonSigned receipt envelope (Decision, ToolCallAction, GuardEvidence)
receipt/inclusion-proof.schema.jsonMerkle inclusion artifact proving membership in the receipt-log tree
receipt/lineage_statement.schema.jsonSigned pairwise receipt lineage statement; multi-parent lineage views are derived aggregates over these signed parent-child statements

chio-wire/v1/jsonrpc

JSON-RPC 2.0 framing used by the hosted MCP HTTP edge and the A2A peer transports. Wire-compatible with the JSON-RPC 2.0 specification. Chio-specific extensions appear only in the error-code registry and recognized notification method names; field shapes remain canonical JSON-RPC 2.0.

FileScope
jsonrpc/request.schema.jsonCorrelated call (requires id and method)
jsonrpc/response.schema.jsonSuccess or error reply (requires id plus exactly one of result or error via oneOf)
jsonrpc/notification.schema.jsonFire-and-forget message (requires method, forbids id)

chio-wire/v1/trust-control

Trust-control plane primitives anchoring protocol section 9. The four schemas describe the lifecycle envelope of one operator-visible authority lease.

FileScope
trust-control/lease.schema.jsonAuthority lease projection (mirrors ClusterAuthorityLeaseView)
trust-control/heartbeat.schema.jsonLease refresh request
trust-control/terminate.schema.jsonVoluntary lease release request
trust-control/attestation.schema.jsonNormalized runtime attestation evidence statement (mirrors RuntimeAttestationEvidence)

Wire naming

lease, heartbeat, and terminate use camelCase field names across the family so the lease projection, refresh request, and termination request stay consistent on the wire.

chio-wire/v1/provenance

Provenance-graph types for the M07 tool-call graph.

FileScope
provenance/stamp.schema.jsonM07 ProvenanceStamp (provider, request_id, api_version, principal, received_at)
provenance/context.schema.jsonMirrors GovernedCallChainContext
provenance/attestation-bundle.schema.jsonOrdered list of normalized attestation evidence bound to a governed chainId
provenance/verdict-link.schema.jsonBinds a Chio policy verdict back to the provenance graph via requestId, optional receiptId, and chainId

chio-wire/v1/federation

Bilateral signature-slice envelopes for cross-kernel cosignature.

FileScope
federation/bilateral-signature-slice.schema.jsonA single cross-kernel signature slice
federation/bilateral-signature-slice-envelope.schema.jsonEnvelope collecting bilateral signature slices for cosignature

chio-wire/v1/anchor

Backs the accepts_anchor_batch_v1 federated capability-negotiation feature bit.

FileScope
anchor/batch.schema.jsonBatched anchor payload negotiated over the federation feature bitset

chio-http/v1

Hosted HTTP API schemas. See the HTTP sidecar reference.

FileScope
caller-identity.schema.jsonCaller identity envelope (bearer hash, API key hash, anonymous)
chio-http-request.schema.jsonHTTP request projection used during evaluation
error-envelope.schema.jsonStructured HTTP error body (chio_access_denied and friends)
evaluate-request.schema.jsonSidecar evaluator request body
evaluate-response.schema.jsonSidecar evaluator response body
http-receipt.schema.jsonHTTP receipt fields (route_pattern, verdict, evidence, policy_hash, kernel_key)
session-init.schema.jsonMCP session initialize
session-resume.schema.jsonMCP session resume
stream-frame.schema.jsonHosted stream frame envelope
verdict.schema.jsonTagged-union verdict (allow or deny with reason and guard)

Top-level schemas

Loose schema files at the root of spec/schemas/, covering cross-cutting artifacts that do not belong to a single family.

FileScope
signature.v1.jsonAlgorithm-aware public-key and signature string encodings used by signed artifacts
model-card.v1.jsonSigned declaration binding a model's loaded weights to an allowed capability set, banned tools, and training-data class; consumed by chio bind
receipt-provenance-v1.jsonReceipt-provenance record shape
chio-tee-frame-v1.jsonCapture frame emitted by the chio-tee shadow runner per kernel evaluation
registry.jsonVerifier-facing registry of signed artifact schema IDs; load-time and verify-time code rejects signed artifacts whose schema string is not listed there

Manifest and Coverage

  • spec/schemas/MANIFEST.sha256: per-file SHA-256 manifest covering every schema in the bundle. Every PR that adds or changes a schema MUST update this manifest.
  • spec/schemas/COVERAGE.md: a coverage map of the shipped schema families as they exist today, not a planning document. It tables every file per family; the current map records forty schema files across eleven subtrees under chio-wire/v1/ and ten under chio-http/v1/. Update it whenever a schema is added, removed, or renamed.
  • spec/schemas/VERSION: current bundle version (currently 1.0.0).

Errors

The error code taxonomy lives in spec/errors/chio-error-registry.v1.json (schema id chio.error-registry.v1). Codes are grouped by category; each entry carries a numeric code, a stable name, the category, a transient flag, retry guidance, and (where applicable) a jsonrpcCode or nativeWireName tying the registry entry to a specific wire schema.

Categories

protocol, auth, capability, guard, budget, tool, internal, transaction.

Error Codes

CodeNameCategoryTransientRetry strategyWire mapping
1000protocol_version_unsupportedprotocolnodo_not_retry_until_version_changeJSON-RPC -32600
1001session_not_initializedprotocolnoreinitializeJSON-RPC -32002
1002invalid_request_shapeprotocolnodo_not_retryJSON-RPC -32600
1100auth_missing_or_invalidauthyesretry_after_refresh--
2100capability_deniedcapabilitynodo_not_retrynative capability_denied
2101capability_expiredcapabilitynoretry_after_reissuenative capability_expired
2102capability_revokedcapabilitynoretry_after_reissuenative capability_revoked
3100guard_deniedguardnodo_not_retrynative policy_denied
4100budget_exhaustedbudgetyesretry_after_budget_change--
5100tool_server_errortoolyesretry_with_backoffnative tool_server_error
6100internal_errorinternalyesretry_with_backoffnative internal_error
7100transaction_passport_schema_unsupportedtransactionnodo_not_retrynative transaction_passport_schema_unsupported
7101transaction_passport_hash_mismatchtransactionnodo_not_retrynative transaction_passport_hash_mismatch
7102transaction_graph_not_closedtransactionnodo_not_retrynative transaction_graph_not_closed
7103transaction_graph_cycletransactionnodo_not_retrynative transaction_graph_cycle
7104transaction_required_claim_missingtransactionnodo_not_retrynative transaction_required_claim_missing
7105transaction_artifact_hash_mismatchtransactionnodo_not_retrynative transaction_artifact_hash_mismatch
7106transaction_identity_not_boundtransactionnodo_not_retrynative transaction_identity_not_bound
7107transaction_authorization_not_boundtransactionnodo_not_retrynative transaction_authorization_not_bound
7108transaction_receipt_uncheckpointedtransactionnodo_not_retrynative transaction_receipt_uncheckpointed
7109transaction_runtime_proof_rejectedtransactionnodo_not_retrynative transaction_runtime_proof_rejected
7110transaction_buyer_review_rejectedtransactionnodo_not_retrynative transaction_buyer_review_rejected
7111transaction_settlement_unverifiedtransactionnodo_not_retrynative transaction_settlement_unverified
7112transaction_dispute_unboundtransactionnodo_not_retrynative transaction_dispute_unbound
7113transaction_transparency_preview_not_allowedtransactionnodo_not_retrynative transaction_transparency_preview_not_allowed

When Each Error Is Emitted

  • protocol_version_unsupported: peer requested a version outside the supported set; on native this triggers transport close, on hosted MCP this is a JSON-RPC error.
  • session_not_initialized: caller invoked an operation before initialize. Resolution: open a new session and rerun initialize.
  • invalid_request_shape: the request fails JSON-RPC framing or schema validation. Resolution: fix the shape; do not retry as-is.
  • auth_missing_or_invalid: hosted edge or trust-control credential is absent or invalid. Resolution: refresh credentials.
  • capability_denied: capability presented but rejected (signature, scope, subject binding). Resolution: do not retry the same capability.
  • capability_expired: capability past validity. Resolution: obtain a fresh capability.
  • capability_revoked: capability matched a revocation entry. Resolution: obtain a newly issued capability; the revoked one MUST NOT be retried.
  • guard_denied: guard pipeline denied with a named guard and reason. Resolution: adjust the request or policy inputs before retrying.
  • budget_exhausted: budget guard denied. Resolution: retry only after replenishment, grant widening, or billing reconciliation.
  • tool_server_error: tool server failed. Resolution: bounded exponential backoff unless upstream tooling documents a permanent failure.
  • internal_error: kernel-internal failure. Resolution: bounded backoff; escalate if persistent.
  • transaction_* (7100–7113): the Transaction Passport verifier rejected a governed transaction because a bound artifact failed a schema, hash, graph-closure, binding, evidence, settlement, or transparency check. All fourteen are non-transient (do_not_retry) and carry entry-specific guidance — for example, 7100 transaction_passport_schema_unsupported resolves by regenerating the passport with a registered transaction passport schema, and 7102 transaction_graph_not_closed by including every required evidence, claim-set, policy, and receipt node in the transaction graph. Resolution: correct or rebind the failing evidence, then resubmit the transaction as a fresh proof.

Wire mapping

The six error-category codes (2100–6100) name one of the schemas under chio-wire/v1/error/ through nativeWireName and map directly to it. The fourteen transaction codes (7100–7113) carry a registered nativeWireName emitted by the Transaction Passport verifier but are not each backed by a standalone error schema in this bundle. In both cases the native channel surfaces the structured detail body; consumers MUST use both the numeric code and the code string when classifying errors.

URN Error Registry

A second, more granular registry lives in spec/errors/registry.yaml (schema id chio.error-urn-registry.v1, version 0.1.0), with spec/errors/registry.schema.json pinning its shape. Every entry is addressed by a stable URN of the form urn:chio:error:<domain>:<code>. It currently defines 104 codes across 20 domains.

Domains carry a class. Core domains are populated today: capability, policy, guard, attest, replay, provider, manifest, kernel, transport, mobile, cli, custody, weights, and transaction. Reserved domains are declared but not yet populated, holding namespace for future work: delegation, adversarial, threat, arena, economy, and lineage.

Each entry carries:

  • urn and domain: the addressable identity and its owning domain.
  • severity: one of info, warning, error, or fatal.
  • summary and help: the human-readable condition and the operator remediation.
  • string_code: the stable machine token (for example CHIO-TRANSACTION-PASSPORT-SCHEMA-UNSUPPORTED).
  • jsonrpc_code (optional): the numeric code when the same condition also surfaces over JSON-RPC.
  • since and stability: the introducing version and one of stable, unstable, or deprecated.
  • consumed_by: the crates that emit or classify against the entry.

IETF Drafts

The repository includes one IETF Internet-Draft.

DocumentStatusScope
spec/ietf/draft-chio-protocol-00.mddraft (April 2026, expires October 2026)Protocol and runtime profile for mediated tool execution under signed capabilities, signed receipts, explicit versioning, and bounded transport security. Defines the native framed transport, the MCP-compatible hosted edge, and the trust-control lifecycle endpoints. Intended status: Standards Track.

The draft references this repository's machine-readable registries directly: spec/versions/chio-protocol-negotiation.v1.json and spec/errors/chio-error-registry.v1.json. It cites RFC 8785 (JSON Canonicalization) and RFC 9449 (DPoP) as normative references, and lists GNAP, SCITT, RATS, W3C Verifiable Credentials, OID4VCI, and OID4VP as informative references.


Versioning

Chio versioning policy is published in spec/versions/chio-protocol-negotiation.v1.json (schema id chio.protocol-negotiation.v1). It defines exact-match compatibility and rejection behavior across the three protocol surfaces.

Per-Surface Rules

SurfaceMechanismCompatibilityRejection behavior
Native ChioOut-of-band exact match on wire version chio-wire-v1exact match; no in-band downgradeTransport close_or_reset_transport; Chio error 1000
Hosted MCPinitialize.params.protocolVersion echoed in result.protocolVersion; MCP-Protocol-Version session headerexact match from supported set; supported versions: ["2025-11-25"]JSON-RPC -32600; Chio error 1000
Trust-controlPath prefix /v1exact prefix matchStandard 404; downgrade behavior not applicable

Schema, Capability, Receipt, and Manifest Versioning

  • Schema bundle: pinned by spec/schemas/VERSION (currently 1.0.0) and the per-file spec/schemas/MANIFEST.sha256. SDKs and codegen pipelines validate against the bundle.
  • Capability tokens: the schema is chio.capability.v1; canonical fields are pinned by capability/token.schema.json.
  • Receipts: the schema is chio.receipt.v1; bridged invocations MUST use the same schema so the receipt log remains uniform.
  • Manifests: the schema is chio.manifest.v1; the OpenAPI bridge MUST emit a manifest that conforms to it.

Compatibility Policy

  • Additive fields MAY appear in JSON responses and signed artifacts; consumers MUST tolerate unknown fields.
  • Schema identifiers (chio.*.v1) are exact-match. Unknown schema identifiers for schema-tagged artifacts MUST be rejected.
  • The protocol requires fail-closed behavior. It does not define downgrade or speculative compatibility.
  • Wire-version negotiation on the native surface is intentionally narrow (exact match, no downgrade). Operators upgrading the wire version run kernels and agents on the new wire in lockstep.