Getting Started
Generate cryptographically verifiable receipts for your AI agents in 60 seconds.
RunProof = cryptographically verifiable record of an agent execution
Installation
pip install substr8-langgraph substr8Quick Start
1. Wrap your LangGraph
from langgraph.graph import StateGraph
from substr8_langgraph import instrument_graph
import json
# Build your graph normally
graph = StateGraph(MyState)
graph.add_node("search", search_node)
graph.add_node("analyze", analyze_node)
graph.set_entry_point("search")
graph.add_edge("search", "analyze")
# Compile it
compiled = graph.compile()
# Wrap with Substr8 instrumentation (one line)
instrumented = instrument_graph(
compiled,
agent_id="my-agent",
project="my-project",
)
# Run the agent
result = instrumented.invoke({"query": "..."})
# The result includes the proof
print(f"Run ID: {result['run_id']}")
print(f"Proof status: {result['proof_status']}")2. Save the RunProof
The proof is in result["proof"]. Save it to a file:
# Save proof to runproof.json
with open("runproof.json", "w") as f:
json.dump(result["proof"].model_dump(mode="json"), f, indent=2)Now you have runproof.json — a portable, verifiable receipt.
3. Verify locally (CLI)
pip install substr8
substr8 proof verify runproof.jsonOutput:
╭─────────────────── Verification Result ───────────────────╮
│ ✓ RunProof: VALID │
╰───────────────────────────────────────────────────────────╯
Proof ID proof_abc123...
Run ID run_xyz789...
Agent my-agent
Checks:
✓ schema
✓ hash_chain
✓ merkle_root
✓ signature4. Verify in browser
Upload runproof.json to runproof.substr8labs.com
What Gets Tracked
Every instrumented run produces a RunProof containing:
| Event | When |
|---|---|
run_started | Execution begins |
node_started | Graph node begins |
node_ended | Graph node completes |
tool_called | Tool invocation |
tool_result | Tool result |
run_ended | Execution finished |
All events are:
- Hash-chained — tamper-evident sequence
- Merkle-rooted — single commitment to all events
- Ed25519-signed — cryptographic proof of origin
Full Example
See the complete demo: substr8-langgraph-demo
git clone https://github.com/Substr8-Labs/substr8-langgraph-demo
cd substr8-langgraph-demo
pip install -r requirements.txt
python demo_agent.py
substr8 proof verify runproof.jsonNext Steps
- CLI Reference — Verification commands
- RunProof — What’s in a proof
- SDK Reference — All SDK functions
- Architecture — How it works