SOX Protocol — reference Python implementation of the inter-agent channels protocol.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sox_protocol-0.2.2.tar.gz.
File metadata
- Download URL: sox_protocol-0.2.2.tar.gz
- Upload date:
- Size: 329.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d026fc7c842c9fa88d54ac93aaf9c083f9cb43499c4c318b472acff1a9613035
|
|
| MD5 |
7ae07075fa7b9d379c8a0c600992490e
|
|
| BLAKE2b-256 |
c58eb7ebe4267f26807c1f3b532d1b73acc625ead87403f318d6fe7eeca1cd21
|
Provenance
The following attestation bundles were made for sox_protocol-0.2.2.tar.gz:
Publisher:
python-publish.yml on PseudoSky/sox-protocol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sox_protocol-0.2.2.tar.gz -
Subject digest:
d026fc7c842c9fa88d54ac93aaf9c083f9cb43499c4c318b472acff1a9613035 - Sigstore transparency entry: 1445018485
- Sigstore integration time:
-
Permalink:
PseudoSky/sox-protocol@a6ee25e18bef712b3c7df274e2bae44240858836 -
Branch / Tag:
refs/tags/python-v0.2.2 - Owner: https://github.com/PseudoSky
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@a6ee25e18bef712b3c7df274e2bae44240858836 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sox_protocol-0.2.2-py3-none-any.whl.
File metadata
- Download URL: sox_protocol-0.2.2-py3-none-any.whl
- Upload date:
- Size: 491.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26d924d9b69b3cbfa243bdd1cb4c0c142e14a46e794efd20ea309066d1b2c791
|
|
| MD5 |
ae992dd079c0ff593428e7fc16ea7e92
|
|
| BLAKE2b-256 |
e39dd9bfd77911cd2b20777c1b48c21229ff3ff320b19ba85a39b0a13bf25b9c
|
Provenance
The following attestation bundles were made for sox_protocol-0.2.2-py3-none-any.whl:
Publisher:
python-publish.yml on PseudoSky/sox-protocol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sox_protocol-0.2.2-py3-none-any.whl -
Subject digest:
26d924d9b69b3cbfa243bdd1cb4c0c142e14a46e794efd20ea309066d1b2c791 - Sigstore transparency entry: 1445018632
- Sigstore integration time:
-
Permalink:
PseudoSky/sox-protocol@a6ee25e18bef712b3c7df274e2bae44240858836 -
Branch / Tag:
refs/tags/python-v0.2.2 - Owner: https://github.com/PseudoSky
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@a6ee25e18bef712b3c7df274e2bae44240858836 -
Trigger Event:
push
-
Statement type: