SecureVector SDK for LangGraph — brings the local threat monitor's three controls (tool-call permissions, secret/data-leak detection, threat detection) to every LangGraph tool call, with tamper-evident audit logging.
Project description
SecureVector SDK for LangGraph
Bring the SecureVector local threat monitor's three controls — tool-call permissions, secret / data-leak detection, and threat detection — to every LangGraph tool call, with tamper-evident audit logging. One import.
pip install securevector-sdk-langgraph
📦 One install — batteries included.
pip install securevector-sdk-langgraphalso installs the local SecureVector app (securevector-ai-monitor): the adapter and the detection engine + tamper-evident audit chain arrive in a singlepip install. The SDK is a thin interception layer — the app must be running locally (securevector-app --web) for it to do anything.
Quick start
Enforcement (recommended) — the documented wrap_tool_call middleware,
accepted by the langgraph-backed create_agent (note:
langgraph.prebuilt.create_react_agent does not take a middleware
argument — use create_agent):
from securevector_sdk_langgraph import secure_middleware
from langchain.agents import create_agent
agent = create_agent(
model, tools,
middleware=[secure_middleware(mode="enforce")],
)
A denied tool is short-circuited with a ToolMessage before it runs — no
exceptions, no crashed graph.
Observe-only logging for any graph (passes through langchain-core's
callback manager):
from securevector_sdk_langgraph import SecureVectorCallbackHandler
graph.invoke(state, config={"callbacks": [SecureVectorCallbackHandler()]})
Raw StateGraph with custom tool nodes (no middleware surface): gate the
tool with LangGraph's documented interrupt() for human/programmatic approval:
from langgraph.types import interrupt
@tool
def run_query(sql: str):
interrupt({"action": "run_query", "args": {"sql": sql}}) # pause for approval
...
Why these paths? LangGraph callbacks are observability-only — they cannot cleanly block a tool. The
wrap_tool_callmiddleware (forcreate_agent) andinterrupt()(for raw graphs) are the documented gates.
What happens on every tool call
Before a tool node runs, the SDK:
- (a) Permissions — resolves an allow/block verdict for the tool, using the app's own precedence: cloud-pushed synced policy → local override → essential registry → default-allow.
- (b)+(c) Secret & threat scan — sends the serialized tool input through the
app's
/analyzepipeline.
After the tool returns, the result is scanned the same way to catch secrets /
exfiltration in tool output. Every decision is written to the app's audit chain
tagged runtime_kind="langgraph".
observe vs enforce
| local app reachable | local app unreachable | |
|---|---|---|
| observe (default) | log + advisory verdict; tool always runs | tool runs (fail-open) |
| enforce (opt-in) | tool runs only if the verdict ≠ block | tool denied (fail-closed) |
agent = create_agent(model, tools, middleware=[secure_middleware(mode="enforce")])
Enforce mode prints a one-time disclosure to stderr. (Enforcement requires the
middleware or interrupt() path; the observe callback handler always logs only.)
Configuration
All optional, via env or install(...) kwargs:
| Env var | Default | Meaning |
|---|---|---|
SECUREVECTOR_SDK_APP_URL |
http://127.0.0.1:8741 |
local app base URL |
SECUREVECTOR_SDK_MODE |
observe |
observe or enforce |
SECUREVECTOR_SDK_TIMEOUT_MS |
3000 |
per-call verdict timeout |
SECUREVECTOR_SDK_RISK_THRESHOLD |
70 |
risk score that blocks in enforce mode |
SECUREVECTOR_SDK_DISABLED |
(unset) | set truthy to no-op |
Compliance
The tool-call-level, attributed, tamper-evident audit trail this produces is exactly the action-layer logging auditors ask for under EU AI Act Art. 12 / 15. This SDK produces the local evidence; the cloud governance surface turns it into an auditor-ready pack.
Trademarks
SecureVector is the product name of this SDK. LangGraph and LangChain are trademarks of LangChain, Inc. This is an independent, community SDK that integrates with LangGraph via its public callback API. It is not affiliated with, sponsored by, or endorsed by LangChain, Inc. The name uses "langgraph" only descriptively, to identify the framework this package works with (nominative fair use).
License
Project details
Release history Release notifications | RSS feed
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 securevector_sdk_langgraph-1.0.0.tar.gz.
File metadata
- Download URL: securevector_sdk_langgraph-1.0.0.tar.gz
- Upload date:
- Size: 23.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7294b307c48eb31c10fb74f796559ec93210a2d62561b09478498dba3d11d3f
|
|
| MD5 |
dc09986e3b0518a6d8574a95d3f68924
|
|
| BLAKE2b-256 |
e393e41fd3751c184ae0859b22a8d5725b042b783f0fef6e7c963365f6f329a6
|
Provenance
The following attestation bundles were made for securevector_sdk_langgraph-1.0.0.tar.gz:
Publisher:
release.yml on Secure-Vector/securevector-sdk-langgraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
securevector_sdk_langgraph-1.0.0.tar.gz -
Subject digest:
b7294b307c48eb31c10fb74f796559ec93210a2d62561b09478498dba3d11d3f - Sigstore transparency entry: 1905233800
- Sigstore integration time:
-
Permalink:
Secure-Vector/securevector-sdk-langgraph@48036d898f6516491456f510f0491194e2969865 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Secure-Vector
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@48036d898f6516491456f510f0491194e2969865 -
Trigger Event:
release
-
Statement type:
File details
Details for the file securevector_sdk_langgraph-1.0.0-py3-none-any.whl.
File metadata
- Download URL: securevector_sdk_langgraph-1.0.0-py3-none-any.whl
- Upload date:
- Size: 23.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7517714b25058c560faae756c8fdc4db1c6f4c461bc2d375679240feec40168
|
|
| MD5 |
3a28261df011615a4b1f145e200bf0b0
|
|
| BLAKE2b-256 |
7861ca5b138baaf1c77602db23ac05e97a3730d6e083c3ef636b8cb3d3fb59fe
|
Provenance
The following attestation bundles were made for securevector_sdk_langgraph-1.0.0-py3-none-any.whl:
Publisher:
release.yml on Secure-Vector/securevector-sdk-langgraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
securevector_sdk_langgraph-1.0.0-py3-none-any.whl -
Subject digest:
a7517714b25058c560faae756c8fdc4db1c6f4c461bc2d375679240feec40168 - Sigstore transparency entry: 1905233850
- Sigstore integration time:
-
Permalink:
Secure-Vector/securevector-sdk-langgraph@48036d898f6516491456f510f0491194e2969865 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Secure-Vector
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@48036d898f6516491456f510f0491194e2969865 -
Trigger Event:
release
-
Statement type: