attestify-langgraph
Governed AI loop execution for LangGraph — signed receipts, audit trails, and x402 payments on Base.
Installation
pip install attestify-langgraph
Usage — State Node
Drop a governed Attestify run directly into your graph as a node:
from attestify_langgraph import attestify_node, AttestifyState
from langgraph.graph import StateGraph, END
import os
builder = StateGraph(AttestifyState)
builder.add_node("run", attestify_node(api_key=os.environ["ATTESTIFY_API_KEY"]))
builder.set_entry_point("run")
builder.add_edge("run", END)
graph = builder.compile()
result = graph.invoke({"task": "Analyse Q2 revenue trends"})
print(result["loop_id"], result["cost_usdc"], result["receipt_url"])
Usage — ToolNode
Use Attestify as tool-calling tools inside a LangGraph ToolNode:
from attestify_langgraph import make_attestify_tools
from attestify_langgraph._http import _Client
from langgraph.prebuilt import ToolNode
import os
client = _Client(api_key=os.environ["ATTESTIFY_API_KEY"])
tools = make_attestify_tools(client)
builder.add_node("tools", ToolNode(tools))
State Fields
| Field | Direction | Type | Description |
|---|---|---|---|
task |
input | str | Natural-language task to execute |
lane_id |
input | str | Optional specific lane to invoke |
session_id |
input | str | Optional memory continuity ID |
max_cost_usdc |
input | float | Optional per-run spend cap |
loop_id |
output | str | Assigned loop identifier |
status |
output | str | success or error |
cost_usdc |
output | float | Actual cost charged |
output |
output | str | Agent output text |
receipt_url |
output | str | URL to the signed receipt |
error |
output | str | None | Error message if status is error |
Tools (ToolNode)
When using make_attestify_tools, the following are also available as graph-callable tools:
| Tool | Description |
|---|---|
attestify_run_loop |
Submit a governed task to the loop router |
attestify_get_receipt |
Fetch a single receipt by loop_id |
attestify_get_recent_loops |
List recent loop receipts for this tenant |
attestify_get_control_tower |
Live governance data (Enterprise only) |
attestify_query_governance_docs |
Semantic search over Attestify's governance docs |
Links
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 attestify_langgraph-0.1.0.tar.gz.
File metadata
- Download URL: attestify_langgraph-0.1.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bda16b1f5ea0137a36c8d01f225113f911379a96cc38dddf4b75584c063a20ce
|
|
| MD5 |
1f8dc14dd0dbd2b6180db2a22a51fa33
|
|
| BLAKE2b-256 |
795103f4df286b3b79498b6ffb5627f2f09d2d26f938f836591ea316fb5c53c4
|
File details
Details for the file attestify_langgraph-0.1.0-py3-none-any.whl.
File metadata
- Download URL: attestify_langgraph-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8190c8e22290ea9403a0cff50e783b8e08fe634e3d03a89490f1d7f3ed688490
|
|
| MD5 |
e621875954852e9966f766828e0dd9d2
|
|
| BLAKE2b-256 |
c971009fd4ba3f43189bda9f5f12a42ad67797aab23d7b02aae1a7bdcbfe0c5a
|