Skip to main content

maigp-langchain

AIGP governance for LangChain / LangGraph.

Part of MAIGP — the Mediated AI Governance Protocol: a runtime consent / scope / evidence layer for AI systems. Every governed call is CHECKed before it runs (policy, scope, jurisdiction, circuit-breaker) and RECORDed + TRACEd as tamper-evident evidence after.

What it governs

Governs LangChain / LangGraph runs via a callback handler.

Governance model

This adapter maps the framework's lifecycle onto the AIGP agent-governance loop provided by maigp-agent-core:

Framework event AIGP action
run / invocation start CHECK (pre_invoke) — allowed? under what authority?
each model reply token accounting (on_model_call)
each tool / function call tool governance (on_tool_call)
run complete RECORD + TRACE (post_invoke)
failure on_error (recorded, then re-raised)

Install

pip install maigp-langchain

Pulls in maigp-agent-core (shared lifecycle) and, transitively, maigp-client.

Quick start

from aigp_langchain import AigpCallbackHandler

handler = AigpCallbackHandler(gov_url="https://gov.example.com",
                              app_id="my-chain", hmac_secret="secret")

# Pass as a callback to any chain / graph / LLM call
chain.invoke(inputs, config={"callbacks": [handler]})

Links


License: Proprietary. © Kanjani AI Research & Causum.

Metadata

Release files for maigp-langchain 1.0.1

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

Source distribution (sdist)

Source distribution for maigp-langchain 1.0.1
File Size Uploaded
maigp_langchain-1.0.1.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for maigp-langchain 1.0.1
File Interpreter ABI Platform
maigp_langchain-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / maigp_langchain-1.0.1.tar.gz

Download URL maigp_langchain-1.0.1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
46b13fa899490a55a7ec49f5de72c56c06e5b58702da1dd7c508f6da4ba7919f
BLAKE2b-256 checksum
How to use checksums
c4b7f14346bcb6050af328af19414277fe824403628f44ce49b3b8f563dd0c86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / maigp_langchain-1.0.1-py3-none-any.whl

Download URL maigp_langchain-1.0.1-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34448959a8129572120bfa94df7c2e6dbf1117fb1e74e8c17417280d7d14959b
BLAKE2b-256 checksum
How to use checksums
0d5bd9c2a1586e4031c8f494eac9f26e1169d76b0f68bb5c141dcc0b1cc4e845
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.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