Skip to main content

langchain-kerq

LangChain integration for Kerq — trust scoring and telemetry for AI agent tool calls.

Why Kerq?

AI agents connect to dozens of tools. Kerq scores each one for trust, security, and reliability before your agent runs it — and tracks performance telemetry so you can see exactly what's happening.

Installation

pip install langchain-kerq

Quick Start
Get your API key at kerq.dev. Full API docs at kerq.dev/docs.

KerqTrustTool
Check a tool's trust score before connecting to it. Works as a standard LangChain tool that agents can invoke directly.
from langchain_kerq import KerqTrustTool

kerq = KerqTrustTool(api_key="your-api-key")

# Invoke directly
result = kerq.invoke("github-mcp-server")
print(result)
# {"trust_score": 87, "tier": "high", "score_breakdown": {...}}

# Or let your agent use it as a tool
from langchain_core.agents import AgentExecutor

agent = ...  # your LangChain agent
agent_executor = AgentExecutor(agent=agent, tools=[kerq])


KerqTelemetryHandler
Automatically intercept every tool call and report telemetry to Kerq. Telemetry is always fire-and-forget — it never blocks your agent.
from langchain_kerq import KerqTelemetryHandler

handler = KerqTelemetryHandler(api_key="your-api-key")

# Attach to any agent invocation
result = agent.invoke(
    {"input": "search the web for news"},
    config={"callbacks": [handler]},
)

Options:
Parameter
Type
Default
Description
api_key
str
required
Your Kerq API key
telemetry
bool
True
Enable/disable telemetry reporting


KerqGuard
The full package: trust gating + telemetry in one callback. Blocks tools that score below your threshold and reports all executions to Kerq.
from langchain_kerq import KerqGuard

guard = KerqGuard(
    api_key="your-api-key",
    min_score=70,   # block any tool scoring below 70
    telemetry=True, # report execution telemetry
)

result = agent.invoke(
    {"input": "run my workflow"},
    config={"callbacks": [guard]},
)

Options:
Parameter
Type
Default
Description
api_key
str
required
Your Kerq API key
min_score
int
70
Minimum trust score to allow a tool to run (0–100)
telemetry
bool
True
Enable/disable telemetry reporting

Trust score rules:
Score >= min_score -> tool runs
Score < min_score -> tool is blocked
Score missing, null, or unparseable -> treated as 0 -> blocked

Error Handling
All components handle API errors gracefully:
401 Invalid key -> warning logged, operation skipped
404 Not found -> clear error returned
429 Rate limited -> warning logged, operation skipped
500 Server error -> warning logged, operation skipped
Network errors -> warning logged, operation skipped
Errors never crash your agent.

License
MIT — see LICENSE.

Metadata

Release files for langchain-kerq 0.1.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 langchain-kerq 0.1.1
File Size Uploaded Provenance Actions
langchain_kerq-0.1.1.tar.gz 5.2 kB Without provenance Details for langchain_kerq-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-kerq 0.1.1
File Interpreter ABI Platform Actions
langchain_kerq-0.1.1-py3-none-any.whl Python 3 none any Details for langchain_kerq-0.1.1-py3-none-any.whl

Total release size: 12.3 kB

Release files / langchain_kerq-0.1.1.tar.gz

Download URL langchain_kerq-0.1.1.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5882a672a81afed20bf98f5f753bdc6ddfb0bf5a0a54290a134a8bc6b9dbfb20
BLAKE2b-256 checksum
How to use checksums
034b0e458721cd4d7d840b2862abaf592b87b73584065ae25e9931f9ab7ffdd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.4 CPython/3.11.15 Linux/6.17.0-1010-azure

Release files / langchain_kerq-0.1.1-py3-none-any.whl

Download URL langchain_kerq-0.1.1-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c78d671aabae7f7e6413ec4a7813c6123673661e1530cf8e07bba9eb1615c1e7
BLAKE2b-256 checksum
How to use checksums
1dd8e9010e00571ffd7e637b64c4612c79adbaabd67666ccd79103adc41aee01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.4 CPython/3.11.15 Linux/6.17.0-1010-azure

Security for langchain-kerq 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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