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 building | Start with | What 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- |
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.
0 entries. Choose a section or search the full text.
Install
One package per language, from that language's registry. Each one exports the Computer API.
| Language | Install | Import |
|---|---|---|
npm install @chio- | import { Computer, USD } from "@chio- | |
pip install chio-sdk | from chio import Computer, USD | |
cargo add chio | use chio::{Computer, Grant, USD}; | |
go get github. | chio "github. | |
implementation("world.chio:chio-sdk-jvm:0.1.0") | import world. | |
dotnet add package Backbay.Chio | using Backbay.Chio; | |
.package(url: "https://github. | import Chio | |
vcpkg add port chio | #include <chio/ |
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.
| Language | Package or distribution | Module or import | Version | Runtime |
|---|---|---|---|---|
Python | chio-sdk | chio (Computer, hosted client), chio_sdk (sidecar client) | 0.1.0 | python >=3.11 |
TypeScript | @chio- | @chio- | 0.1.0 | Node.js 22 or newer |
Go, Computer and client | github. | chio, client, session, invariants | release tag | go 1.23.0 |
Go, HTTP middleware | github. | 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- | world. | 0.1.0 | Java 17 |
.NET core | Backbay.Chio | using Backbay.Chio; | 0.1.0 | net8.0 |
.NET middleware | Backbay. | using Backbay.Chio; | 0.1.0 | net8.0 |
Rust | chio, chio- | chio, chio_ | 0.1.0 | Rust 1.94 |
Install chio-sdk, import chio
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.
from chio_asgi import ChioASGIMiddleware, ChioASGIConfig
app.add_middleware(
ChioASGIMiddleware,
config=ChioASGIConfig(
sidecar_url="http://127.0.0.1:9090",
exclude_paths=frozenset({"/healthz"}),
),
)import { chio } from "@chio-protocol/express";
app.use(
chio({
sidecarUrl: "http://127.0.0.1:9090",
skip: ["/healthz"],
}),
);func protectedHandler(sidecarURL string) http.Handler {
return chio.Protect(
newRouter(),
chio.WithSidecarURL(sidecarURL),
)
} @Bean
fun chioFilterRegistration(): FilterRegistrationBean<ChioFilter> {
val filter = ChioFilter(
ChioFilterConfig(
sidecarUrl = System.getenv("CHIO_SIDECAR_URL") ?: "http://127.0.0.1:9090",
),
)
return FilterRegistrationBean<ChioFilter>().apply {
setFilter(filter)
addUrlPatterns("/v1/quote", "/v1/refund")
order = Ordered.HIGHEST_PRECEDENCE
}
}using Backbay.Chio;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddChioProtection();
var app = builder.Build();
app.UseChioProtection();
app.MapPost("/v1/quote", (QuoteRequest request) => Pricing.Quote(request.Sku, request.Percent));
app.MapPost("/v1/refund", (RefundRequest request) => Pricing.Refund(request.Order));
app.Run();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.
| Middleware | Deny body | Receipt header |
|---|---|---|
chio-asgi | { error, message, status }, where error is the guard name and message the verdict reason | X-Chio-Receipt |
@chio- | { error, message, receipt_id, suggestion }, where error is one of six CHIO_ values | X- |
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.
| Language | Package | Fits | Reference |
|---|---|---|---|
Python | chio-sdk | FastAPI, Django, Airflow, Temporal, Prefect, Dagster, Ray, LangChain, LangGraph, LlamaIndex, CrewAI, and AutoGen, each a separate companion distribution. | |
TypeScript | @chio- | 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- | 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. | .NET on net8.0: the Computer API, fail-closed ASP.NET Core middleware, and a standalone sidecar client. | |
Rust | chio, chio- | 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.
| Layer | TypeScript | Python | Go | Rust |
|---|---|---|---|---|
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, andtreaty, 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/querywith pagination. From Go or Rust, call the endpoint directly. - DPoP proof signing.
signDpopProofbuilds and signs a proof bound to a capability, a tool, and an action-argument hash. The Python sidecar client accepts a caller-supplieddpop_proofon 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::Layerthat wraps any Tower or Axum HTTP service and runs the kernel in process. It exportsChioLayer,ChioService,ChioEvaluator,EvaluationResult,ChioTowerError,extract_identity,IdentityExtractor,DEFAULT_MAX_BODY_BYTES, and theKernelServicestack (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 offchio.world/scopes, mints a capability grant at creation, writeschio.world/capability-id,chio.world/capability-token, andchio.world/capability-expires-atonto the pod template, holds the Job with thechio.world/capability-finalizerfinalizer, and harvests thechio.world/receiptannotations the sidecar posted. The validating webhook admits a pod only when the token onchio.world/capability-tokenverifies against the operator's configured trust set, and it denies any pod that carrieschio.world/required-scopesorchio.world/exempt, because a workload must not set its own policy. The mutating webhook runs the same verification and emits no patch. A namespacedChioPolicycustom resource in thechio.worldgroup 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.
| Directory | Language | Packages and projects |
|---|---|---|
sdks/cpp/ | C++ | ChioCpp, ChioCppKernel, ChioDrogon |
sdks/dotnet/ | .NET | Backbay. |
sdks/go/ | Go | github., github. |
sdks/guard/ | C++, Go, Python, TypeScript | @chio-, ChioGuardCpp, chio-guard-py, github. |
sdks/jvm/ | JVM | world.chio:chio-sdk-jvm, world.chio:chio-, world.chio:chio- |
sdks/k8s/ | Go | github., github. |
sdks/lambda/ | Python, Rust | chio-, chio- |
sdks/python/ | Python | chio-, 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-, chio-prefect, chio-ray, chio-sdk, chio-sdk-python, chio-streaming, chio-temporal |
sdks/rust/ | Rust | chio- |
sdks/swift/ | Swift | Chio |
sdks/typescript/ | TypeScript | @chio-, @chio-, @chio-, @chio-, @chio-, @chio-, @chio-, @chio-, @chio-, @chio-, @chio-, @chio-, @chio-, @chio-, @chio-, @chio-, @chio-, @chio-, create-chio-app |
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:
chio conformance run --peer all