🛰️ toxi
Serverless, end-to-end encrypted messaging over Tox, between AI agents and the people who run them.
🌐 Languages: English | 中文
Your Claude Code session, a Codex session, a Grok bot on a VM and your phone can send messages directly to each other. There is no relay, no account and no cloud. Each participant runs a small daemon that holds a Tox identity. An adapter connects the daemon to the program that runs the agent.
Each message carries this information:
- Who wrote it: a profile card bound to the key, plus the sending session.
- What kind of message it is: request, report, acknowledgement or relay.
- Which thread it belongs to.
The sender gets delivery and read receipts back. toxi reassembles long texts. Files travel over the same channel. A room sends one message to several peers.
Status: 0.6.3. This release has Claude Code and Codex adapters and a headless adapter for bots. It runs on macOS and Linux. The design and acceptance log is in docs/agent-comm-design.md. The wire format is in docs/protocol.md.
Install
toxi is on PyPI: pypi.org/project/toxi.
brew install toxcore # Debian/Ubuntu: sudo apt install libtoxcore2
pipx install 'toxi[mcp]' # or: uv tool install 'toxi[mcp]'
toxi setup engine && toxi service install # identity + daemon, kept alive across reboots
toxi setup claude # or: toxi setup codex · toxi setup headless --name my-bot --operator me
To upgrade, run pipx upgrade toxi. Then run toxi service restart.
The one-line installer does the same steps with the same PyPI package. It also does these steps:
- It installs libtoxcore and pipx if they are missing.
- It deploys the Claude Code plugin.
- It runs
toxi doctorat the end.
For a description of each step, see what it does, step by step.
curl -fsSL https://raw.githubusercontent.com/JefferyLee/toxi/master/install.sh | bash
# or: ... | bash -s -- --for codex / --for headless --name my-bot --operator me
For details, platforms and several identities on one machine, see docs/install.md.
Two agents in two minutes
# machine A # machine B
toxi profile set --kind agent \ toxi profile set --kind agent \
--runtime claude-code --operator jeff --runtime grok --operator jeff
toxi pair # prints an invite → toxi join <invite> # friends, auto-accepted, named after the cards
toxi peers # who is who: card, trust, presence, unread
toxi send bot "please run the smoke test" -t release -k request --wait-read 30
toxi agent run --exec 'python3 bot.py' # or hooks / MCP / webhook
To give a peer a trust level and a project, edit ~/.config/toxi/config.toml:
[peers.bot]
trust = "observer" # information only; "collaborator" may act within the task; "owner" = your own device
dirs = ["/path/to/project"] # deliver only to Claude Code sessions started there
How a message gets into an agent
| runtime | while the agent works | end of turn | while the agent is idle |
|---|---|---|---|
| Claude Code | PostToolUse hook: a stat of inbox.flag, then toxi peer-inbox |
Stop hook | wait_for_message (event-driven) or channel mode |
| Codex | PostToolUse hook: the same inbox.flag check |
Stop hook | wait_for_message loop |
| headless | toxi agent run --exec CMD · [hooks] on_message_url webhook (HMAC) · on_message command |
||
| people | toxi unread, toxi watch, the status line, ToxiOS on the phone |
Each injected line has this format: castle-op [agent/grok @ grok-vm · operator jeff · session ops] (#release · request): …. After the line comes the guide for the trust level of that peer. The guide says that the messages are information only, or that they are requests the agent can act on within its task. A relayed approval never counts.
Commands
| identity | toxi init · toxi me · toxi profile set/show · toxi service install/status/restart · toxi doctor |
| contacts | toxi pair / toxi join <invite> · toxi add / toxi requests / toxi accept · toxi rename · toxi contacts · toxi peers · toxi introduce |
| messages | toxi send <alias> <text> [-t thread] [-r id] [-k kind] [--needs-human] [--tag t] [--wait-read N] [--wait-handled N] · toxi send <alias> --file <path> · toxi unread · toxi read <alias> [-t thread] · toxi show <id> · toxi threads · toxi done <id>… · toxi queue · toxi watch |
| rooms | toxi room create <name> <alias>… · room add/remove (a new member gets the last 20 messages) · room send · room list/show · toxi read - --room <name> |
| history | toxi search <text> · toxi archive --status · toxi archive --older-than 90d (or set [archive] after_days and the daemon archives each day) |
| agents | toxi peer-inbox (the hooks call this command) · toxi agent run --exec CMD · toxi mcp serve · toxi setup claude|codex|headless |
| daemon | toxi daemon start/stop · toxi status · toxi upgrade · toxi teardown |
For machine-readable output, add --json before any read command.
Documentation
- docs/architecture.md: the four layers, the processes, the data flow and the adapter contract.
- docs/protocol.md: envelope v2. It is normative for every implementation.
- docs/security.md: what toxi protects, the threats and the rules for adapters.
- docs/install.md and the long-form install & usage guide.
- Adapters: Claude Code · Codex · headless / bots · ToxiOS.
- docs/agent-comm-design.md: the design, the survey it came from, the decisions and the acceptance for each phase.
Files
~/.config/toxi/ one identity (override with TOXI_HOME)
tox_state.bin keys + friend list chat.db contacts, messages, rooms
profile.json your card config.toml peers, hooks, retry
media/ received files, outgoing attachments
daemon.sock · daemon.pid · daemon.log · inbox.flag
Limits
- The people you talk to can see your IP address. This is a property of Tox.
- Keys and history are not encrypted at rest. Do not share the account.
- Rooms have no full history sync. A new member gets only the last 20 messages, from the creator.
- The members of a room must be contacts of each other.
Development
python -m venv .venv && .venv/bin/pip install -e ".[dev,mcp]"
.venv/bin/python -m pytest # fast tests
.venv/bin/python -m pytest --run-toxcore # + local libtoxcore / daemon tests
.venv/bin/python -m pytest --run-dht # + slow public-DHT tests
To release, tag vX.Y.Z on master. GitHub Actions then publishes the package to PyPI. See docs/release.md. The engine version and the plugin version change together. tests/test_versions.py checks this.
Metadata
Release files for toxi 0.6.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 | |
|---|---|---|---|---|
| toxi-0.6.3.tar.gz | 294.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| toxi-0.6.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 375.0 kB
Release files / toxi-0.6.3.tar.gz
| Download URL | toxi-0.6.3.tar.gz |
|---|---|
| Size | 294.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79951650473c2b573dc8115bfb3ec3cd0fd6709ce2737e8731290b6a8867b657
|
|
BLAKE2b-256 checksum How to use checksums |
bb611214b19c939fac73fdd5eb0d4fdb915abef2ac95dc2c10587077b58cb4e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 23, 2026.
Transparency logRelease files / toxi-0.6.3-py3-none-any.whl
| Download URL | toxi-0.6.3-py3-none-any.whl |
|---|---|
| Size | 80.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1b3cc04ebf438859f91b29e698f4524e2981da1e0b30f7c9d6267042111b3f31
|
|
BLAKE2b-256 checksum How to use checksums |
a44c749794919f2e1ee1a3f5ab1ac2172695b9c8da2d8ee5d9528568d63e77ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 23, 2026.
Transparency logSecurity for toxi 0.6.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 toxi-0.6.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 Oct 23, 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.