Chio/Docs
LOGIN · JOIN

ReferenceSDKs

SDK Overview

Bring Chio’s authority, policy, and verifiable evidence into your application. Choose the integration boundary, then the language.

Every SDK carries the Computer API from the Quickstart: open a computer, fork it, grant an agent part of the fork, run work, read the receipts, and apply what you keep. Beneath it, each SDK exposes the protocol-level clients that connect the kernel to agent runtimes, web services, browsers, and mobile applications. The package you need depends on who executes the operation and where enforcement runs.

Choose the integration boundary

You are buildingStart withWhat it does
Agents working on a computer you own
Fork the computer, grant each agent a slice, run work, and apply the result. Your kernel signs every decision.
An agent using a hosted Chio edge
Open an authenticated MCP session, discover the available tools, and submit calls to the remote kernel.
An API protected by a colocated kernel
Evaluate the request before the application handler runs; expose the verdict and receipt through the adapter’s response contract.
An application with an embedded decision core
Integrate local evaluation with the host’s identity, state, storage, and execution responsibilities.
A verifier or market participant
Verify signed records offline, query evidence, or use the TypeScript and Python cognition-market clients.

A hosted client’s local cryptography does not put the execution kernel inside the agent. HTTP sidecars, hosted MCP sessions, and embedded kernels have different setup and failure contracts; select one explicitly.

Install

One package per language, from that language's registry. Each one exports the Computer API.

LanguageInstallImport
npm install @chio-protocol/sdk
import { Computer, USD } from "@chio-protocol/sdk"
pip install chio-sdk
from chio import Computer, USD
cargo add chio
use chio::{Computer, Grant, USD};
go get github.com/backbay-labs/chio/sdks/go/chio-go
chio "github.com/backbay-labs/chio/sdks/go/chio-go"
implementation("world.chio:chio-sdk-jvm:0.1.0")
import world.chio.sdk.Computer
dotnet add package Backbay.Chio
using Backbay.Chio;
.package(url: "https://github.com/backbay-labs/chio-swift", from: "0.1.0")
import Chio
vcpkg add port chio
#include <chio/computer.hpp>

Distributions and imports

The low-level clients ship in the same packages or beside them. These are the exact strings, with the version each manifest declares and the runtime floor it requires.

LanguagePackage or distributionModule or importVersionRuntime
Python
chio-sdk
chio (Computer, hosted client), chio_sdk (sidecar client)
0.1.0
python >=3.11
TypeScript
@chio-protocol/sdk
@chio-protocol/sdk
0.1.0
Node.js 22 or newer
Go, Computer and client
github.com/backbay-labs/chio/sdks/go/chio-go
chio, client, session, invariants
release tag
go 1.23.0
Go, HTTP middleware
github.com/backbay-labs/chio/sdks/go/chio-go-http
chio
release tag
go 1.21
JVM core
world.chio:chio-sdk-jvm
world.chio.sdk
0.1.0
Java 17
JVM servlet filter
world.chio:chio-spring-boot
world.chio.ChioFilter
0.1.0
Java 17
.NET core
Backbay.Chio
using Backbay.Chio;
0.1.0
net8.0
.NET middleware
Backbay.Chio.Middleware
using Backbay.Chio;
0.1.0
net8.0
Rust
chio, chio-binding-helpers
chio, chio_binding_helpers
0.1.0
Rust 1.94

Install chio-sdk, import chio

The PyPI name chio belongs to an unrelated project. Install chio-sdk; it provides both chio and chio_sdk.

HTTP interception in application code

A service that keeps its own HTTP stack puts the kernel in front of its routes with a framework adapter. Each excerpt below is your pricing service in that framework, behind the same sidecar: GET /healthz excluded from evaluation, POST /v1/quote allowed for a caller whose grant covers quotes, and POST /v1/refund refused unless the grant names refunds. Each adapter installs from its registry under its own name.

pricing/app.pypricing/server.mjspricing/main.goPricingApplication.ktProgram.cs
from chio_asgi import ChioASGIMiddleware, ChioASGIConfig

app.add_middleware(
    ChioASGIMiddleware,
    config=ChioASGIConfig(
        sidecar_url="http://127.0.0.1:9090",
        exclude_paths=frozenset({"/healthz"}),
    ),
)

What a refusal returns

A refusal is a record. The two middlewares that front an application, the Python ASGI one and the Node interception layer every JavaScript adapter shares, both answer a denied request with a JSON body and a receipt id on a response header.

MiddlewareDeny bodyReceipt header
chio-asgi
{ error, message, status }, where error is the guard name and message the verdict reason
X-Chio-Receipt
@chio-protocol/node-http
{ error, message, receipt_id, suggestion }, where error is one of six CHIO_ERROR_CODES values
X-Chio-Receipt-Id

The ASGI status is the receipt verdict's own HTTP status when it carries one and 403 otherwise. The Node layer sends chio_access_denied on a deny and chio_invalid_receipt with status 502 when the sidecar answers with a receipt that fails verification. Both paths fail closed.

Choose an SDK

Choose the language that already hosts your application, then the package that matches its enforcement boundary. Core verification libraries and framework adapters expose different APIs.

LanguagePackageFitsReference
Python
chio-sdk
FastAPI, Django, Airflow, Temporal, Prefect, Dagster, Ray, LangChain, LangGraph, LlamaIndex, CrewAI, and AutoGen, each a separate companion distribution.
TypeScript
@chio-protocol/sdk
Node.js servers, edge workers, and agents. The 17 npm package manifests cover Express, Fastify, Elysia, Next.js, the Vercel AI SDK, Cloudflare Workers, Deno, and the browser.
Go
chio-go, chio-go-http
Cloud infrastructure. chio-go carries the Computer API and the context-aware client and session; chio-go-http wraps any http.Handler. Both build without cgo.
JVM
chio-sdk-jvm, chio-spring-boot
Kotlin and Java services and Spring Boot, with separate Flink integration described in the JVM reference. The core targets Java 17 and pulls in no Spring types; the filter is a separate coordinate.
.NET
Backbay.Chio, Backbay.Chio.Middleware
.NET on net8.0: the Computer API, fail-closed ASP.NET Core middleware, and a standalone sidecar client.
Rust
chio, chio-binding-helpers
The Computer API, and the reference invariants crate every other SDK conforms against. Guard authoring and in-process evaluation have their own crates.
Swift
Chio
macOS and iOS applications: the Computer API and the embedded mobile kernel with App Attest.
C++
chio
Native services: the Computer API, a session client, and offline invariants, with Drogon middleware for HTTP.

The common verification vocabulary is defined by the Bindings API, the low-level binding contract: canonical JSON, hashing, signing, receipt and capability and manifest verification, delegation chains, Merkle proofs, and the stable error taxonomy. Read it if you are porting to a new language or writing an offline verifier.

Shared functionality

Every SDK carries the Computer API. Beneath it, the TypeScript, Python, and Go packages carry MCP clients and sessions, and Rust’s binding helpers provide local verification. The JVM and .NET low-level clients are sidecar clients: they evaluate, verify, and filter HTTP requests, and they open no MCP session.

LayerTypeScriptPythonGoRust
Computer API
Yes
Yes
Yes
Yes
Invariants
Yes
Yes
Yes
Yes
Transport
Yes
Yes
Yes
No
Client and session
Yes
Yes
Yes
No
Receipt query
Yes
Yes
No
No
DPoP proof signing
Yes
No
No
No
Cognition market
Yes
Yes
No
No
  • Computer API. Computer.open, fork, grant, run, history, policy, service, and treaty, with the same semantics in every language.
  • Invariants. Pure functions for canonical JSON, SHA-256, Ed25519, and verification of receipts, capabilities, and signed manifests. They make no network call.
  • Transport. Streamable HTTP MCP transport with an explicit session lifecycle.
  • Client and session. Opening a session against a Chio edge and calling tools over it.
  • Receipt query. A typed client over GET /v1/receipts/query with pagination. From Go or Rust, call the endpoint directly.
  • DPoP proof signing. signDpopProof builds and signs a proof bound to a capability, a tool, and an action-argument hash. The Python sidecar client accepts a caller-supplied dpop_proof on pre-execution evaluation but constructs none. Signing a proof does not attach it to a hosted MCP call.
  • Cognition market. Buyer, seller, and hosted clients for the Finding market, plus the buyer-local bid ceiling.

Platform SDKs

Two integrations govern infrastructure rather than application code. Neither calls the sidecar over POST /chio/evaluate.

  • chio-tower. A Rust tower::Layer that wraps any Tower or Axum HTTP service and runs the kernel in process. It exports ChioLayer, ChioService, ChioEvaluator, EvaluationResult, ChioTowerError, extract_identity, IdentityExtractor, DEFAULT_MAX_BODY_BYTES, and the KernelService stack (build_layered, KernelTraceLayer, TenantConcurrencyLimitLayer, TenantId). It fails closed.
  • Kubernetes controller and webhooks. The controller watches Jobs labeled chio.world/governed: "true", reads the requested scopes off chio.world/scopes, mints a capability grant at creation, writes chio.world/capability-id, chio.world/capability-token, and chio.world/capability-expires-at onto the pod template, holds the Job with the chio.world/capability-finalizer finalizer, and harvests the chio.world/receipt annotations the sidecar posted. The validating webhook admits a pod only when the token on chio.world/capability-token verifies against the operator's configured trust set, and it denies any pod that carries chio.world/required-scopes or chio.world/exempt, because a workload must not set its own policy. The mutating webhook runs the same verification and emits no patch. A namespaced ChioPolicy custom resource in the chio.world group carries the operator's policy.

Everything under sdks/

Most directories under sdks/ hold one language. Three do not: guard/ holds the WASM guard guest SDKs, which are built out of tree and loaded as components rather than linked as host clients; k8s/ holds the Kubernetes controller, its custom resource, and the admission webhooks; and lambda/ holds the AWS Lambda pair. Every package, module, and project the manifests declare appears below.

DirectoryLanguagePackages and projects
sdks/cpp/
C++
ChioCpp, ChioCppKernel, ChioDrogon
sdks/dotnet/
.NET
Backbay.Chio.Middleware
sdks/go/
Go
github.com/backbay-labs/chio/sdks/go/chio-go, github.com/backbay-labs/chio/sdks/go/chio-go-http
sdks/guard/
C++, Go, Python, TypeScript
@chio-protocol/guard-ts, ChioGuardCpp, chio-guard-py, github.com/backbay-labs/chio/sdks/guard/chio-guard-go
sdks/jvm/
JVM
world.chio:chio-sdk-jvm, world.chio:chio-spring-boot, world.chio:chio-streaming-flink
sdks/k8s/
Go
github.com/backbay-labs/chio-k8s-controller, github.com/backbay-labs/chio-k8s-webhooks
sdks/lambda/
Python, Rust
chio-lambda-extension, chio-lambda-python
sdks/python/
Python
chio-adapter-base, chio-airflow, chio-asgi, chio-autogen, chio-bedrock, chio-code-agent, chio-crewai, chio-dagster, chio-django, chio-fastapi, chio-hermes, chio-iac, chio-langchain, chio-langgraph, chio-llamaindex, chio-observability, chio-prefect, chio-ray, chio-sdk, chio-sdk-python, chio-streaming, chio-temporal
sdks/rust/
Rust
chio-guard-sdk-compat
sdks/swift/
Swift
Chio
sdks/typescript/
TypeScript
@chio-protocol/ai-sdk, @chio-protocol/ai-sdk-middleware, @chio-protocol/browser, @chio-protocol/codegen-tools, @chio-protocol/conformance, @chio-protocol/deno, @chio-protocol/edge, @chio-protocol/elysia, @chio-protocol/express, @chio-protocol/fastify, @chio-protocol/mobile, @chio-protocol/next, @chio-protocol/node-http, @chio-protocol/passkey, @chio-protocol/sdk, @chio-protocol/typescript-sdks, @chio-protocol/wasm-core, @chio-protocol/workers, create-chio-app

The C++ and Swift references cover those packages.

Source

Package names, versions, imports, dependencies, and runtime floors come from the SDK manifests. The public SDK tree contains the implementations; examples/ contains the worked applications.

The Bindings API defines the shared verification contract; the Protocol Reference defines the wire semantics.

Cross-language conformance

TypeScript, Python, Go, and Rust run the same conformance vectors: canonical JSON, hashing, signature verification, receipt parsing, capability parsing, and manifest parsing. Rust is the reference, and the other three produce byte-identical output against its vectors. The JVM SDK asserts the same byte-equality under a parity JUnit tag on canonical JSON, the DLQ router, and synthetic deny receipts.

Signed protocol records use RFC 8785 canonical JSON. Fixture parity applies to the tested inputs and does not establish that every SDK serializer has the same contract. The JVM streaming serializer, for example, follows its Python-compatible escaping rules. The Bindings API carries the binding contract; each language reference names its supported verification surface.

The installed CLI runs the corpus against the published packages:

bash
chio conformance run --peer all
Python SDKRun agents on a computer from Python, or connect services to a kernel through the sidecar and hosted clients beneath it.TypeScript SDKThe Computer API, hosted sessions, local verification, and cognition markets from TypeScript.Go SDKRun agents on a computer from Go, call governed tools, verify signed records locally, or put an HTTP service behind kernel policy.JVM SDKRun agents on a computer from Kotlin or Java, bring services under Chio policy, and carry execution evidence into streaming systems..NET SDKRun agents on a computer from C#, and put ASP.NET Core services under kernel policy.Rust SDKRun agents on a computer from Rust, then build on the crates beneath it: evidence verification, custom guards, and the decision core.Bindings APIthe invariants contract every SDK conforms to.CLI Referencestandalone governance of an MCP server without embedding an SDK.Receipt FormatLook up the v1 receipt fields, signed payload, decision semantics, metadata, and verification requirements for Chio execution evidence.Receipt Query APIQuery the evidence of agent execution: retrieve signed receipts, page through decisions, and inspect aggregate activity through the trust-control API.PythonBring Python services into a Chio-governed operating system with framework-native interception and a shared Rust authority core.NodeGive Express, Fastify and Elysia services programmable authority through Chio's Rust kernel, while keeping each framework's native request lifecycle.Go and C++Give native services a governed entry point: framework middleware backed by Chio’s Rust authority core, with a real application and inspectable decisions.JVM and .NETBring managed services into a Chio-governed operating system with native framework interception, a shared Rust authority core, and signed admission evidence.