Verigent trust verification for LangChain agents, chains, and tools
Project description
langchain-verigent
Trust verification for LangChain agents, chains, and tools using Verigent keys.
The problem
Multi-agent LangChain pipelines delegate tasks to sub-agents and tools with no way to verify trust, capability, or identity. Any agent can claim any role. langchain-verigent adds cryptographic trust verification to your pipeline — every agent carries a VG key that declares what it is and what it can do.
Install
pip install langchain-verigent
Quick start
Callback handler (recommended)
Attach to any agent executor to automatically verify VG keys on tool calls:
from langchain_verigent import VerigentCallbackHandler
handler = VerigentCallbackHandler(
min_tier=2, # Require at least V2
threshold=0.5, # 50% composite trust minimum
block_untrusted=True # Raise TrustDeniedError on failure
)
# Attach to your agent
result = agent_executor.invoke(
{"input": "Research this topic"},
config={"callbacks": [handler]}
)
# Inspect trust decisions
for entry in handler.trust_log:
print(f"{entry['handle']}: {entry['composite']}% — {'PASS' if entry['passed'] else 'FAIL'}")
Tool wrapper
Wrap any tool to attach a VG key and verify trust before execution:
from langchain_verigent import VerigentToolWrapper
from langchain_community.tools import TavilySearchResults
search = TavilySearchResults()
trusted_search = VerigentToolWrapper(
search,
vg_key="VG:SEARCH-01:V3-SENT·Se4Op7An5Ar9Co2Ad6St8Sc3Sa5So1Br2Fo6",
threshold=0.4
)
result = trusted_search.invoke("latest AI papers")
print(f"Trust: {trusted_search.trust_score.percent}%")
Agent filter (multi-agent)
Filter and rank agents by trust score:
from langchain_verigent import VerigentAgentFilter
agents = [
{"name": "researcher", "vg_key": "VG:RES-01:V4-ANAL·Se4Op7An5Ar9Co2Ad6St8Sc3Sa5So1Br2Fo6"},
{"name": "writer", "vg_key": "VG:WRT-02:V2-SAGE·Se2Op3An4Ar2Co5Ad3St4Sc2Sa8So1Br3Fo2"},
{"name": "untrusted", "vg_key": "VG:BAD-99:V0-SENT·Se1Op1An1Ar1Co1Ad1St1Sc1Sa1So1Br1Fo1"},
]
filter = VerigentAgentFilter(min_tier=2, threshold=0.4)
# Only agents meeting threshold
trusted = filter.filter(agents) # [researcher, writer]
# Ranked by composite score
ranked = filter.rank(agents) # [researcher, writer, untrusted]
VG Key format
VG:{NAME}-{SUFFIX}:{TIER}-{PRIMARY}·{12×class_code+digit}
- Tier: V0 (unverified) through V6 (sovereign-grade)
- Primary: 4-letter class code (e.g. ARCH, SENT, ANAL)
- Scores: 12 class dimensions, each 0-9
Classes: Sentinel, Operative, Analyst, Architect, Conduit, Adaptor, Steward, Scout, Sage, Sovereign, Broker, Forge.
Configuration
| Parameter | Default | Description |
|---|---|---|
min_tier |
0 | Minimum tier to pass (0-6) |
threshold |
0.5 | Minimum composite score (0.0-1.0) |
required_classes |
None | Class codes to weight in scoring |
block_untrusted |
False | Raise error on trust failure |
Links
License
MIT
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 langchain_verigent-0.1.0.tar.gz.
File metadata
- Download URL: langchain_verigent-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b353da61c2665c630015d6544885d1b760aee1a3ea8fe486be524a94a80a54d8
|
|
| MD5 |
adb73821a5b050c43c98c6fc78419b8d
|
|
| BLAKE2b-256 |
f9353ebc50ce14ae581383a4da7932c2b31a6bfd181c0a10b86a41fb2992a964
|
File details
Details for the file langchain_verigent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_verigent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3d7e713835b744294b7de7c5ecba084ad344bbad2c68974a234159852b5444f
|
|
| MD5 |
27ae87c0a13316045648c2181093deab
|
|
| BLAKE2b-256 |
c40cb4b9e94a047718554f6ca5ec5919fbaf66fc27d945aa002b2ce2c3703369
|