Skip to main content

lodestar-langgraph

Govern a LangGraph agent's native tool calls with Lodestar — the open epistemic-governance framework for AI agents.

LangGraph runs tools natively in-process and does not speak MCP, so the MCP proxy cannot wrap it. This package is the thin native hook (ADR-0024): it spawns the TypeScript governance-gate sidecar (lodestar runtime gate) and remotes each native tool call through the Lodestar Action Kernel over newline-delimited JSON-RPC. The same machinery the MCP proxy runs — two-phase propose → arbitrate → execute, the signed policy gate, cognitive-core ingestion (external-document content can't auto-promote), sentinel arbitration, and the signed-approval L4 hold path — now applies to LangGraph, with no change to the engine.

The tool body runs only inside the gate's execute phase, reached only after the gate (and any approval hold) clears: "tools that do work before approval are bugs" — across the Python↔TS boundary.

Install

pip install "lodestar-langgraph[langgraph]"
# and the Lodestar CLI (Bun/npm), which provides `lodestar runtime gate`:
npm install -g @qmilab/lodestar-cli   # or: bun add -g @qmilab/lodestar-cli

Use

from langgraph.prebuilt import ToolNode
from lodestar_langgraph import GateClient, govern_tools, governed_call

with GateClient("runtime-gate.config.json") as gate:
    governed = govern_tools(gate, my_tools)      # register + wrap the toolset
    llm = llm.bind_tools(governed)               # the model only sees governed tools
    tool_node = ToolNode(governed)               # and so does the executor
    # ... build and run your graph as usual; every tool call is now governed.

    # A custom node invokes a governed tool through the helper, never raw:
    result = governed_call(gate, "search_web", {"q": "lodestar"})

The gate's config (runtime-gate.config.json) is a RuntimeGateConfig — the signed policy document, approver keys, sentinel ids, persistence, and durable log root all live there. The hook never holds credentials or policy.

Scope (honest, ADR-0004 lineage)

This is governance over declared actions, not OS containment of the process. Raw I/O performed outside the tool abstraction — a custom node that calls requests.get() directly instead of a registered tool — is outside the governed surface, exactly as guard.wrap() and the MCP proxy only govern the tools they are given. A call for an unregistered tool is denied (fail closed). Pair the adapter with network/filesystem controls for defense in depth.

Holds

An L4 action the trust-ladder floor parks for approval is resolved by block-polling the gate up to the deadline for a signed approval (hold_wait_ms) — the headless default. For the idiomatic LangGraph interrupt() integration, call gate.govern(...) directly, raise interrupt with the returned action_id / request_id, and call gate.resume(...) on Command(resume=…).

Apache-2.0. Part of the Lodestar monorepo (runtimes/langgraph/).

Metadata

Release files for lodestar-langgraph 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lodestar-langgraph 0.6.0
File Size Uploaded
lodestar_langgraph-0.6.0.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lodestar-langgraph 0.6.0
File Interpreter ABI Platform
lodestar_langgraph-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.0 kB

Release files / lodestar_langgraph-0.6.0.tar.gz

Download URL lodestar_langgraph-0.6.0.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3e155a913ed3f72a22d48b12caef0b99f383cf9e8bd495613513be1dae9acfc3
BLAKE2b-256 checksum
How to use checksums
1a4c6ef4160a4025a320d7b64b4b5f86c658bb318ba964b8a96ca9fc0711138b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 11, 2026.

Transparency log

Release files / lodestar_langgraph-0.6.0-py3-none-any.whl

Download URL lodestar_langgraph-0.6.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8df0913a63742f68de947bc9aace946b34d2e91ef527c5858a97d399000a23db
BLAKE2b-256 checksum
How to use checksums
6de06bac6379e6e432f24ac305855f1bd6b77f73528be1cfb8aa0e5e0472cdb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page