Skip to main content

Talos: A secure, decentralized protocol for AI Agent communication

Project description

Talos Protocol

Secure, Decentralized Communication for the AI Agent Era

Python 3.11+ License: MIT Tests Coverage

v2.0.5 Features

Feature Status Description
๐Ÿ”„ Double Ratchet โœ… Signal protocol for per-message forward secrecy
โœ… Validation Engine โœ… 5-layer block validation with audit reports
๐Ÿ”’ Fine-Grained ACLs โœ… Tool/resource permissions per peer
๐Ÿ“ฆ Python SDK โœ… Clean TalosClient and SecureChannel API
๐Ÿ’ก Light Client โœ… SPV proof verification, ~99% storage reduction
๐Ÿ†” DIDs/DHT โœ… W3C DIDs with Kademlia peer discovery
๐Ÿค– MCP Integration โœ… Native CLI commands for Agent tunneling
โšก Enterprise Performance โœ… Batch crypto, LMDB storage, Parallel validation
๐Ÿšข Infrastructure โœ… Docker, Docker Compose, Helm charts
# Quick Example
from talos import TalosClient

async with TalosClient.create("my-agent") as client:
    await client.establish_session(peer_id, peer_bundle)
    await client.send(peer_id, b"Hello with forward secrecy!")

๐Ÿ“– Documentation Wiki | ๐Ÿ“š Examples | ๐Ÿ“‹ CHANGELOG | ๐Ÿ—บ๏ธ Roadmap


MCP Integration

Securely tunnel Model Context Protocol (MCP) traffic over the blockchain.

1. Connect (Client/Agent)

You can use the native CLI command to connect your Agent to a remote tool:

talos mcp-connect <REMOTE_PEER_ID> --port 8766

Or for development, use the example script:

python examples/mcp_connect_demo.py --peer <REMOTE_PEER_ID>

2. Serve (Host/Tool)

Expose a local tool (e.g. a filesystem) to a specific remote Agent:

talos mcp-serve \
  --authorized-peer <AGENT_PEER_ID> \
  --command "npx -y @modelcontextprotocol/server-filesystem /path/to/share"

Or for development:

python examples/mcp_serve_demo.py \
  --authorized-peer <AGENT_PEER_ID> \
  --command "npx -y @modelcontextprotocol/server-filesystem /path/to/share"

๐Ÿ‘‰ See full MCP Documentation for architecture and security details.


Evaluation

Test Suite

# Run all tests (442+ tests)
pytest tests/ -v

# Run specific test modules
pytest tests/test_crypto.py -v               # Cryptographic primitives
pytest tests/test_blockchain.py -v           # Basic blockchain operations
pytest tests/test_validation.py -v           # Block validation engine (19 tests)
pytest tests/test_session.py -v              # Double Ratchet (16 tests)
pytest tests/test_acl.py -v                  # ACL system (16 tests)
pytest tests/test_light.py -v                # Light client (24 tests)
pytest tests/test_did_dht.py -v              # DIDs/DHT (41 tests)
pytest tests/test_sdk.py -v                  # SDK (19 tests)

Security Considerations

Threat Mitigation
Man-in-the-Middle End-to-end encryption with authenticated key exchange
Replay Attacks Message IDs + timestamps + blockchain ordering
Impersonation Ed25519 digital signatures
Message Tampering Poly1305 MAC + blockchain immutability
Metadata Analysis Future: onion routing integration

Performance Metrics (Apple M1/M2)

Component Operation Throughput Latency
Crypto Ed25519 Verify ~6,600 ops/s 0.15ms
Crypto ChaCha20 Encrypt ~295,000 ops/s 0.003ms
Storage LMDB Read ~3,600,000 ops/s 0.0003ms
Storage LMDB Write ~2,100,000 ops/s 0.0005ms
Network JSON Serialize ~1,200,000 ops/s 0.0008ms
Validation Block Validation ~3,700 blocks/s 0.27ms

Note: Results may vary based on hardware and load.

# Run benchmarks
python -m benchmarks.run_benchmarks

Documentation

๐Ÿ“š Full documentation available in the Wiki:

Guide Description
๐Ÿ  Home Overview and quick links
๐Ÿš€ Getting Started Installation and first steps
๐Ÿ—๏ธ Architecture System design and data flows
๐Ÿ” Cryptography Security model and primitives
โ›“๏ธ Blockchain Chain design and sync protocol
๐Ÿ“ File Transfer Media exchange protocol
๐Ÿ“Š Benchmarks Performance metrics
๐Ÿ“– API Reference Complete API documentation
๐Ÿงช Testing Test suite and coverage

Future Work

  1. Post-Quantum Cryptography: CRYSTALS-Kyber/Dilithium integration
  2. Onion Routing: Tor-style routing for metadata protection
  3. WebRTC Integration: Real-time audio/video
  4. TypeScript SDK: Browser and Node.js support
  5. Formal Verification: ProVerif/Tamarin security proofs
  6. BFT Consensus: Byzantine fault-tolerant consensus layer

๐Ÿ”ฎ See Full Future Roadmap


Directory Structure

talos/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ core/           # Blockchain, crypto, validation, session, light, did
โ”‚   โ”œโ”€โ”€ network/        # P2P networking, DHT
โ”‚   โ”œโ”€โ”€ mcp_bridge/     # ACL system, MCP integration
โ”‚   โ”œโ”€โ”€ server/         # Registry server
โ”‚   โ”œโ”€โ”€ client/         # CLI client
โ”‚   โ””โ”€โ”€ engine/         # Transmission engine, chunking
โ”œโ”€โ”€ talos/              # Python SDK
โ”œโ”€โ”€ examples/           # 8 copy-paste ready examples
โ”œโ”€โ”€ tests/              # 261 tests
โ”œโ”€โ”€ deploy/
โ”‚   โ””โ”€โ”€ helm/talos/     # Kubernetes Helm chart
โ”œโ”€โ”€ Dockerfile          # Multi-stage production image
โ”œโ”€โ”€ docker-compose.yml  # Local development
โ””โ”€โ”€ docs/wiki/          # 22 documentation pages

References

[1] A. Acquisti and R. Gross, "Imagined Communities: Awareness, Information Sharing, and Privacy on the Facebook," Privacy Enhancing Technologies, 2006.

[2] R. Dingledine, N. Mathewson, and P. Syverson, "Tor: The Second-Generation Onion Router," USENIX Security Symposium, 2004.

[3] S. Burnett and N. Feamster, "Encore: Lightweight Measurement of Web Censorship with Cross-Origin Requests," ACM SIGCOMM, 2015.

[4] K. Ermoshina, F. Musiani, and H. Halpin, "End-to-End Encrypted Messaging Protocols: An Overview," F. Bagnoli et al. (eds.), INSCI 2016, LNCS, vol. 9934, 2016.

[5] Protocol Labs, "libp2p: A Modular Network Stack," https://libp2p.io/, 2023.

[6] S. Nakamoto, "Bitcoin: A Peer-to-Peer Electronic Cash System," 2008.

[7] D. J. Bernstein and T. Lange, "SafeCurves: Choosing Safe Curves for Elliptic-Curve Cryptography," https://safecurves.cr.yp.to/, 2014.

[8] A. J. Menezes, P. C. van Oorschot, and S. A. Vanstone, Handbook of Applied Cryptography, CRC Press, 1996.

[9] J. Warren, "Bitmessage: A Peer-to-Peer Message Authentication and Delivery System," 2012.

[10] Loki Foundation, "Session: A Model for End-to-End Encrypted Conversations with Minimal Metadata Leakage," Whitepaper, 2020.

[11] Status.im, "Status: A Mobile Ethereum OS," https://status.im/whitepaper.pdf, 2017.

[12] D. J. Bernstein, "Curve25519: New Diffie-Hellman Speed Records," Public Key Cryptography โ€“ PKC 2006, LNCS, vol. 3958, 2006.

[13] D. J. Bernstein, "A State-of-the-Art Diffie-Hellman Function," https://cr.yp.to/ecdh.html, 2006.

[14] D. J. Bernstein, N. Duif, T. Lange, P. Schwabe, and B.-Y. Yang, "High-Speed High-Security Signatures," Journal of Cryptographic Engineering, vol. 2, no. 2, pp. 77-89, 2012.

[15] C. Boyd and A. Mathuria, Protocols for Authentication and Key Establishment, Springer, 2003.

[16] H. Krawczyk, "The Order of Encryption and Authentication for Protecting Communications (Or: How Secure Is SSL?)," CRYPTO 2001, LNCS, vol. 2139, 2001.

[17] H. Krawczyk and P. Eronen, "HMAC-based Extract-and-Expand Key Derivation Function (HKDF)," RFC 5869, 2010.

[18] D. J. Bernstein, "ChaCha, a Variant of Salsa20," SASC 2008, 2008.

[19] M. Marlinspike and T. Perrin, "The Double Ratchet Algorithm," Signal Specifications, 2016.

[20] J. Bankoski et al., "VP9 Bitstream & Decoding Process Specification," Google, 2016.

[21] R. Dingledine, N. Mathewson, and P. Syverson, "Tor: The Second-Generation Onion Router," USENIX Security, 2004.

[22] A. Johnston and D. Burnett, WebRTC: APIs and RTCWEB Protocols of the HTML5 Real-Time Web, Digital Codex LLC, 2014.

[23] W3C, "Decentralized Identifiers (DIDs) v1.0," https://www.w3.org/TR/did-core/, 2022.

[24] B. Blanchet, "Modeling and Verifying Security Protocols with the Applied Pi Calculus and ProVerif," Foundations and Trends in Privacy and Security, vol. 1, no. 1โ€“2, 2016.


License

MIT License

Authors

  • Nilesh Chakraborty

Acknowledgments

This work builds upon foundational research in distributed systems, cryptography, and blockchain technology. We acknowledge the contributions of the open-source community, particularly the developers of the cryptography, websockets, and click Python libraries.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

talos_protocol-2.0.6.tar.gz (144.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

talos_protocol-2.0.6-py3-none-any.whl (115.8 kB view details)

Uploaded Python 3

File details

Details for the file talos_protocol-2.0.6.tar.gz.

File metadata

  • Download URL: talos_protocol-2.0.6.tar.gz
  • Upload date:
  • Size: 144.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for talos_protocol-2.0.6.tar.gz
Algorithm Hash digest
SHA256 36f0e7ea693ba6dd011f705120665d743145ec14a79042beb95128c3ce45e6da
MD5 2cef8f631b4dd5e623abd5823b23bee3
BLAKE2b-256 58332c6d3c6342aec440476db26fcc09250661d2c54e28855f1606f7fba40b4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for talos_protocol-2.0.6.tar.gz:

Publisher: deploy.yml on nileshchakraborty/talos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file talos_protocol-2.0.6-py3-none-any.whl.

File metadata

  • Download URL: talos_protocol-2.0.6-py3-none-any.whl
  • Upload date:
  • Size: 115.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for talos_protocol-2.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1cdf4473ef955999cebe06c871eddd170b2e4bd0c34475c1f97bd3119327891d
MD5 eded22c83f60fe01b165317402288a82
BLAKE2b-256 c0e83d99db6b5efe0d176611526ff0fbf1c4d20ec078fcf78a1386d1d46f0341

See more details on using hashes here.

Provenance

The following attestation bundles were made for talos_protocol-2.0.6-py3-none-any.whl:

Publisher: deploy.yml on nileshchakraborty/talos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page