behavry-langchain
Behavry integration for LangChain and LangGraph agents.
Load your agent's MCP tools through the Behavry MCP gateway, so every tool call is bound to the agent's identity, evaluated against policy, and written to the signed record before it reaches the target system.
pip install "behavry-langchain[mcp]"
from langchain.agents import create_agent
from behavry_langchain import behavry_mcp_tools
tools = await behavry_mcp_tools() # reads BEHAVRY_PROXY_URL / _CLIENT_ID / _CLIENT_SECRET
agent = create_agent("anthropic:claude-sonnet-5", tools)
What the helper handles for you:
- Auth that lasts the whole run. It authenticates with the agent's client credentials (HTTP Basic), which the gateway exchanges server-side on every request, so nothing expires partway through a long run.
- Refusals the model can read. When policy blocks a call, the agent gets an error tool result explaining why, instead of the run crashing.
- Calls held for approval. When policy holds a call for a person to approve, the gateway answers "pending" within a minute and the helper resends the identical call until it is decided. The call runs once, when approved, and the agent gets its real result, however long the approval takes.
- Workflow sessions. If the run belongs to a declared Behavry workflow, pass the session's
wf_token(workflow_token=...orwith workflow_session(wf_token):) and the calls are grouped into that workflow's Decision Trace. - A
behavry:governedtag on every tool, so agent-side reporting can tell these calls are already recorded by the gateway.
Local Python tools never reach Behavry. Report them with one line; they are recorded as Agent-reported (signed, not enforced), and by default only hashes and sizes of their input and output leave your process:
from behavry_langchain import BehavryCallbackHandler
handler = BehavryCallbackHandler()
agent.invoke(inputs, config={"callbacks": [handler]})
Full guide: docs/integrations/langchain.md.
License: Apache-2.0.
Metadata
Release files for behavry-langchain 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| behavry_langchain-0.5.1.tar.gz | 11.9 kB | With provenance | Details for behavry_langchain-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| behavry_langchain-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for behavry_langchain-0.5.1-py3-none-any.whl |
Total release size: 24.9 kB
Release files / behavry_langchain-0.5.1.tar.gz
| Download URL | behavry_langchain-0.5.1.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13787a80e3a38c10220c81efb2613d6ea778c2e879cbcfee0b824c848d993a5e
|
|
BLAKE2b-256 checksum How to use checksums |
cdb7fd90e59fc568b43aea16db2803dc34e2f96b89a1fc948527c45e77e98557
|
| 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 Nov 19, 2026.
Transparency logRelease files / behavry_langchain-0.5.1-py3-none-any.whl
| Download URL | behavry_langchain-0.5.1-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
adb007c2562de65445f273784084e962091cb9aee769b56952bcd5a2feac59c4
|
|
BLAKE2b-256 checksum How to use checksums |
2803f10e863185d30d2a7bf25142099042bf45ee856f446fd67f2295a6986f2e
|
| 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 Nov 19, 2026.
Transparency logSecurity for behavry-langchain 0.5.1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for behavry_langchain-0.5.1.tar.gz
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 Nov 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.