Skip to main content

Multi-agent cryptographic session for PiQrypt — co-signed A2A handshakes between AI agents

Project description

piqrypt-session

Standard: AISS v2.0 · Full stack: piqrypt.com

Multi-agent cryptographic session for PiQrypt.

PyPI Downloads License: MIT PiQrypt

Establishes co-signed A2A handshakes between all agents before any action takes place. Each agent keeps its own verifiable memory. Every interaction references a shared session — provable, tamper-proof, non-repudiable.

pip install piqrypt-session

Works with any framework — LangChain, AutoGen, CrewAI, OpenClaw, or plain Python.


The idea

When multiple AI agents collaborate, today's systems record what each agent did — but not that they agreed to work together, and not that one agent's action was seen and acknowledged by another.

piqrypt-session fills that gap:

Before any action:
  LLM ↔ TradingBot    → co-signed handshake ✅
  LLM ↔ OpenClaw      → co-signed handshake ✅
  TradingBot ↔ OpenClaw → co-signed handshake ✅

During the session:
  LLM recommends BUY AAPL
    → LLM memory:         "I sent this recommendation to TradingBot"
    → TradingBot memory:  "I received this recommendation from LLM"
    → Both events share the same interaction_hash
    → Neither can deny it happened

Quickstart

from piqrypt_session import AgentSession

# Define your agents — any framework, any setup
session = AgentSession([
    {"name": "llm",          "identity_file": "llm.json"},
    {"name": "trading_bot",  "identity_file": "trading-bot.json"},
    {"name": "openclaw",     "identity_file": "openclaw.json"},
])

# Start — performs all pairwise handshakes automatically
session.start()
# [PiQrypt Session] ✅ Session started: sess_a3f9b2c1d4e5f6a7
#   Agents    : llm, trading_bot, openclaw
#   Handshakes: 3 co-signed
#   Timestamp : 1740477600

# Stamp a co-signed interaction between two agents
session.stamp("llm", "recommendation_sent", {
    "symbol": "AAPL",
    "action": "buy",
    "confidence": 0.87,
    "reasoning": "Strong Q4 earnings, positive momentum",
}, peer="trading_bot")
# → event in LLM memory:         "I sent recommendation to TradingBot"
# → event in TradingBot memory:  "I received recommendation from LLM"
# → both share interaction_hash

# Stamp a unilateral action
session.stamp("trading_bot", "order_executed", {
    "symbol": "AAPL",
    "action": "buy",
    "price": 182.50,
    "quantity": 100,
    "order_id": "ORD-20260225-001",
})

# End session
session.end()

# Export full audit — all agents, all events, all handshakes
session.export("trading-session-audit.json")
# $ piqrypt verify trading-session-audit.json

What each agent's memory contains

LLM memory (~/.piqrypt/llm/events/):

{ "event_type": "session_start",         "session_id": "sess_a3f9..." }
{ "event_type": "a2a_handshake",         "peer_agent_id": "trading_bot_id", "peer_signature": "..." }
{ "event_type": "a2a_handshake",         "peer_agent_id": "openclaw_id",    "peer_signature": "..." }
{ "event_type": "recommendation_sent",   "interaction_hash": "c7d2...", "peer_agent_id": "trading_bot_id" }
{ "event_type": "session_end",           "session_id": "sess_a3f9..." }

TradingBot memory (~/.piqrypt/trading_bot/events/):

{ "event_type": "session_start",                    "session_id": "sess_a3f9..." }
{ "event_type": "a2a_handshake",                    "peer_agent_id": "llm_id", "peer_signature": "..." }
{ "event_type": "recommendation_sent_received",     "interaction_hash": "c7d2...", "peer_agent_id": "llm_id" }
{ "event_type": "order_executed",                   "session_id": "sess_a3f9..." }
{ "event_type": "session_end",                      "session_id": "sess_a3f9..." }

What links them:

  • Same session_id across all memories
  • Same interaction_hash in co-signed events
  • Each memory has the peer's signature embedded

Framework-agnostic

piqrypt-session works independently of any agent framework. Combine with framework bridges for full coverage:

# LangChain agent + AutoGen agent in the same session
from piqrypt_langchain import PiQryptCallbackHandler
from piqrypt_autogen import AuditedAssistant
from piqrypt_session import AgentSession

# Each framework stamps its own actions
lc_handler = PiQryptCallbackHandler(identity_file="langchain-agent.json")
ag_assistant = AuditedAssistant(name="analyst", llm_config=llm_config,
                                 identity_file="autogen-agent.json")

# Session links them together
session = AgentSession([
    {"name": "langchain_agent", "identity_file": "langchain-agent.json"},
    {"name": "autogen_agent",   "identity_file": "autogen-agent.json"},
])
session.start()

# All individual actions are stamped by the bridges
# All interactions between agents are co-signed by the session
session.stamp("langchain_agent", "analysis_sent", {
    "result": analysis_output
}, peer="autogen_agent")

N agents — automatic handshakes

Agents Handshakes
2 1
3 3
4 6
5 10
N N*(N-1)/2

All handshakes happen automatically on session.start().


Verify

piqrypt verify trading-session-audit.json
# ✅ Session sess_a3f9b2c1d4e5f6a7
#    Agents    : 3
#    Handshakes: 3 co-signed
#    Events    : 14 total
#    Integrity : verified
#    Forks     : 0

Scope

Use case Profile
Development / PoC AISS-1 (Free, included)
Non-critical production AISS-1 (Free)
Regulated production AISS-2 (Pro)

Links


PiQrypt — Verifiable AI Agent Memory

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

piqrypt_session_multi_ai_agents-1.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file piqrypt_session_multi_ai_agents-1.1.0.tar.gz.

File metadata

File hashes

Hashes for piqrypt_session_multi_ai_agents-1.1.0.tar.gz
Algorithm Hash digest
SHA256 062a3e5fe74e6fe769744589e956fa67ded1cf08345bd62e12cbfd7c1a14a4a8
MD5 d95dee6671dc894a7575cc03f617ca2e
BLAKE2b-256 0a1301ad102b118f4b004d35e5a3006b1598430a3935cd9881fa4544d016ba3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqrypt_session_multi_ai_agents-1.1.0.tar.gz:

Publisher: publish.yml on PiQrypt/piqrypt-session-multi-ai-agents

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

File details

Details for the file piqrypt_session_multi_ai_agents-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for piqrypt_session_multi_ai_agents-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4094e00ca16eab60e4cafa2e701c9bf928d827032ac680cc27db2c819387c36a
MD5 f6a76df30af3969c7ba7734cffbb35d9
BLAKE2b-256 a0c9bed79fe69c79e1403b986ba2b23667c9e9761b7440732ed4c608ee229f51

See more details on using hashes here.

Provenance

The following attestation bundles were made for piqrypt_session_multi_ai_agents-1.1.0-py3-none-any.whl:

Publisher: publish.yml on PiQrypt/piqrypt-session-multi-ai-agents

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