Skip to main content

Trust-gate your LangChain agents with Nerq. Preflight trust checks, agent discovery, and trust scoring for 204K+ AI agents.

Project description

nerq-langchain

Trust-gate your LangChain agents with Nerq. Preflight trust checks before every tool call.

Install

pip install nerq-langchain

Quick Start — trust_gate (3 lines)

from nerq_langchain import trust_gate

agent = initialize_agent(tools, llm)
agent = trust_gate(agent, min_trust=60)
# Every tool call now gets a preflight trust check

Before each tool call, trust_gate checks the tool's trust score via nerq.ai/v1/preflight:

  • PROCEED (trust >= 70): runs silently
  • CAUTION (trust 40-69): logs warning, proceeds
  • DENY (trust < 40): raises TrustError
  • UNKNOWN (not in index): proceeds with warning
  • Network failure: proceeds with warning (never blocks)

NerqPreflight — Check trust on any agent

from nerq_langchain import NerqPreflight

tool = NerqPreflight()
print(tool.run("SWE-agent"))
# Nerq Preflight: SWE-agent
# Recommendation: PROCEED
# Trust Score: 92.5/100
# Grade: A+
# Verified: Yes

NerqSearch — Find agents for a task

from nerq_langchain import NerqSearch

tool = NerqSearch()
print(tool.run("code review"))
# Nerq Search: 'code review' — 5 results
# 1. SWE-agent/SWE-agent — Trust: 92.5, Category: security
# ...

In a LangChain agent

from langchain_openai import ChatOpenAI
from langchain.agents import initialize_agent, AgentType
from nerq_langchain import NerqPreflight, NerqSearch, trust_gate

llm = ChatOpenAI(model="gpt-4")
tools = [NerqPreflight(), NerqSearch()]
agent = initialize_agent(tools, llm, agent=AgentType.OPENAI_FUNCTIONS)
agent = trust_gate(agent, min_trust=60)

result = agent.run("Is SWE-agent safe to use for code review?")

With LangGraph

from nerq_langchain import NerqPreflight, NerqSearch
from langgraph.prebuilt import create_react_agent

tools = [NerqPreflight(), NerqSearch()]
agent = create_react_agent(model, tools)

Error handling

from nerq_langchain import trust_gate, TrustError

agent = trust_gate(agent, min_trust=70)

try:
    result = agent.run("Use low-trust-tool to analyze data")
except TrustError as e:
    print(f"Blocked: {e.tool_name} (trust={e.trust_score})")

API

  • Endpoint: GET https://nerq.ai/v1/preflight?target={name}
  • Auth: None required
  • Rate limit: Generous (no hard cap during beta)
  • Coverage: 204K+ agents and tools
  • Latency: <50ms typical

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nerq_langchain-0.2.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nerq_langchain-0.2.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file nerq_langchain-0.2.0.tar.gz.

File metadata

  • Download URL: nerq_langchain-0.2.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for nerq_langchain-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8dc17909f80a5aa9c7faa2ffa9c7d1b0dd4ab07606934177a91f17ca9d8a4b52
MD5 6633419535b528ada9ad1e207695b228
BLAKE2b-256 301719bda2d6b1f40df6cbc4ca29a7749cafa7a6ebdd30c95bd19189c19f3ed3

See more details on using hashes here.

File details

Details for the file nerq_langchain-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: nerq_langchain-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for nerq_langchain-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 380e3ee0ee58b6416713860206518617f6432e6035e4d80d9e9f08c199e55012
MD5 f0348a5829d6366cfc3e0fcf70af8b87
BLAKE2b-256 f58aab0a147e40b572148344b322488a44d05f9bca5d0261e87e2c93b7863824

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page