sox-protocol
Runtime-agnostic peer messaging for LLM agents. SOX Protocol gives multi-agent systems a documented, conformant pattern for speculative-execute-while-awaiting-clarification: when agent A needs input from agent B, A posts the question, continues working under a best-guess interpretation, and non-destructively integrates B's late-arriving answer into its in-progress reasoning — without blocking.
Existing frameworks offer turn-taking schedulers, handoffs, or actor primitives. None ship a packaged discipline for the speculate-then-reconcile pattern. SOX does.
This package is the reference Python implementation. It's SOX v1.0-conformant on both stdio and HTTP transports (33/33 fixtures pass on each).
Install
pip install sox-protocol sox-plugin-schema-strict
sox-protocol install # in your Claude Code project root
The installer writes:
.mcp.json— registers the SOX MCP server with Claude Code.claude/settings.json— allows the server + adds cadence hooks.claude/skills/inter-agent-channels/SKILL.md— the discipline documenttools/sox-hooks/{post_tool_use,stop}.sh— inbox-cadence reminder hooks
Verify:
claude mcp list # → sox: ... ✓ Connected
sox-protocol verify # full backing-store / MCP / hook / skill probe
Install the schema-strict plugin non-editable (no
-e). Itssox-plugin.yamlmanifest isn't exposed via editable installs and the MCP server fails plugin discovery without it.
CLI surface
sox-protocol --help
serve Start the SOX server (stdio | http transport)
chat Launch the interactive Textual TUI
install Install the SOX adapter into a Claude Code project
upgrade PyPI check + pip-upgrade + file refresh + SQLite migration
verify Health-check the project's SOX install
lint-discipline Validate a discipline markdown file
version Print the installed version
-V, --version Print the installed version and exit
Two practical recipes
Boot a long-running agent companion. Two terminals against the same project:
# Terminal 1 — interactive TUI; auto-discovers the project's .mcp.json
sox-protocol chat --agent-id $(whoami) --channel agent/companion
# Terminal 2 — Claude Code as the agent
SOX_AGENT_ID=companion claude
The TUI and Claude Code share the same SQLite store automatically.
One-step skill activation. When you want the skill itself to subscribe an agent on load (instead of needing a follow-up prompt), use --auto-subscribe:
sox-protocol install --auto-subscribe --channel team/eng
The installed SKILL.md then includes an Activation block that tells the LLM to subscribe to agent/<your-id> + team/eng, drain pending messages once, and emit a heartbeat — all on first skill load.
Upgrade-in-place
sox-protocol upgrade
# Step 1/3: checking PyPI for newer versions…
# sox-protocol local=0.1.5 latest=0.1.6 → upgrade available
# sox-plugin-schema-strict local=1.0.0 latest=1.0.0
# Upgrading 1 package(s) via pip…
# (auto re-execs with the new code)
# Step 2/3: refreshing installed files…
# Step 3/3: SQLite schema migration…
Single command from "I just heard there's a new release" to "everything aligned": pip packages, project files, schema migrations, all converged in one run. Add --check-only for drift detection without changes.
What's in the box
- Four MCP tools —
channels__send,channels__recv,channels__subscribe,channels__list_channels. All non-blocking; the discipline + cadence enforcer keep the pull-based design from causing starvation. - Three backing stores — SQLite (default, WAL mode), filesystem, in-memory (tests only). NATS / Redis pluggable via the
BackingStoreport. - Two transports — stdio (Claude Code default) and HTTP (
sox-protocol serve --transport http). Both pass the same conformance suite. - Plugin contract — third-party plugins extend the pipeline (schema validation, audit logging, rate limiting) via the
sox_protocol.pluginsentry-point group. The schema-strict reference plugin proves the contract end-to-end. - Cadence enforcer — pure-function decision engine that injects "drain your inbox" reminders after N tool calls without a recv, and blocks agent exit while the inbox is non-empty. Operator-tunable via env vars.
- Live install e2e test —
pytest -m livespawns two realclaudeCLI subprocesses against a tmp venv, has them exchange messages via the protocol, asserts on the SQLite state. Verified end-to-end on both Anthropic API and Claude Max subscription auth paths.
Project layout
The sox-protocol PyPI distribution is one component of the pseudosky/sox-protocol monorepo:
| Path | Contents |
|---|---|
packages/python/ |
this package — reference Python implementation |
plugins/sox-plugin-schema-strict/ |
the canonical reference plugin, published as sox-plugin-schema-strict on PyPI |
spec/ |
language-neutral protocol artefacts (JSON Schema for tools/events, conformance fixtures, discipline markdown, port behaviour contracts) |
docs/ |
design rationale, integration guide, ADRs |
tools/conformance_runner.py |
language-neutral conformance harness — runs spec/conformance/*.yaml against any implementation |
For full design rationale and the formal spec see the GitHub repo and especially docs/DESIGN.md, docs/USAGE.md, and docs/INSTALL.md.
Status & conformance
| Component | Status | Conformance |
|---|---|---|
| Spec (v1.0) | Frozen; language-neutral | n/a |
| Python (this package) | Production-ready | 33/33 stdio · 33/33 HTTP |
| TypeScript | Placeholder; open to contributions | Must pass conformance suite to merge |
| Rust | Placeholder; open to contributions | Same |
python -m pytest -q
# 1300+ passed
python tools/conformance_runner.py --target packages/python --transport stdio --strict
# Results: 33 passed, 0 failed, 34 skipped / 67 total
License
Apache 2.0, including the express patent grant in §3. Contributors and adopters are protected from patent assertions on the protocol primitives they help build or use. See the repo's docs/ip/ for the IP strategy and OIN application tracker.
Metadata
Release files for sox-protocol 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sox_protocol-0.2.3.tar.gz | 332.8 kB | With provenance | Details for sox_protocol-0.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sox_protocol-0.2.3-py3-none-any.whl | Python 3 | none | any | Details for sox_protocol-0.2.3-py3-none-any.whl |
Total release size: 828.0 kB
Release files / sox_protocol-0.2.3.tar.gz
| Download URL | sox_protocol-0.2.3.tar.gz |
|---|---|
| Size | 332.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d35cadd0dc4e318acf01a9fa01e5ef3855934a027970c5873c6ea025b4e0ebe
|
|
BLAKE2b-256 checksum How to use checksums |
a5c8d3dc634e64946bfc3a5f1c3491aa1b73a0be7fdf051a100eadcc58e14b76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 6, 2026.
Transparency logRelease files / sox_protocol-0.2.3-py3-none-any.whl
| Download URL | sox_protocol-0.2.3-py3-none-any.whl |
|---|---|
| Size | 495.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed218bb18eea0461f3865c8a479f4c8831fc916a9c68c3f6c4a6f282d95531db
|
|
BLAKE2b-256 checksum How to use checksums |
32bbc353934e0fc5c42e3d09ddeb3056ad573cb0545c45bc5e7bc81c7a6df024
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 6, 2026.
Transparency logSecurity for sox-protocol 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for sox_protocol-0.2.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.