Metadata-Version: 2.4
Name: verificate-langchain
Version: 0.1.0
Summary: A veto gate for AI-written code in LangChain / LangGraph — 17 reality gates + frontier review, with veto power. Free to try, no signup.
Author-email: Verificate <info@verificate.ai>
License: MIT
Project-URL: Homepage, https://verificate.ai/mcp
Project-URL: Documentation, https://github.com/Verificate-Dev/verificate-langchain#readme
Project-URL: Source, https://github.com/Verificate-Dev/verificate-langchain
Keywords: langchain,langgraph,mcp,code-review,hallucination,guardrails,ai-safety,agents
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: langchain-mcp-adapters>=0.1.0
Dynamic: license-file

# verificate-langchain

**A veto gate for AI-written code in LangChain / LangGraph.** Your agent writes code; Verificate runs it through 17 deterministic reality gates (mock/placeholder veto, invented-API checks, false-completion detection) plus a frontier-model review, and can **veto**. An agent that ships confident-but-wrong code loses its user's trust — this is the safety net that keeps it shipping.

```bash
pip install verificate-langchain
```

**25 free validations per machine — no signup, no token.** After that, pass a token (30-day trial, no card: https://verificate.ai/auth/signup).

## One-shot check

```python
from verificate_langchain import validate

v = await validate("def refund(order_id, amount):\n    pass  # TODO real refund")
print(v.approved)     # False — the mock refund path is vetoed
print(v.findings)     # ['[code_reality_gate] Placeholder detected ...', ...]
```

`Verdict` is truthy iff approved, so `if await validate(code): ship(code)` reads naturally.

## As a LangGraph guardrail node

```python
from verificate_langchain import VerificateGuardrail
from langgraph.graph import StateGraph, START, END

gate = VerificateGuardrail(max_attempts=3)           # optional token=...

g = StateGraph(dict)
g.add_node("write", write_code)                       # your codegen node, sets state["code"]
g.add_node("gate", gate.node)                         # sets state["verdict"] / ["findings"]
g.add_edge(START, "write")
g.add_edge("write", "gate")
g.add_conditional_edges("gate", gate.route, {"fix": "write", "done": END, "give_up": END})
app = g.compile()
```

The output must *pass through* the gate node — the veto is structural, not an optional tool call the agent can skip under pressure.

## Load the raw tools

```python
from verificate_langchain import load_verificate_tools

tools = await load_verificate_tools()   # validate_ai_output, validate_plan, analyze_code, generate_code
agent = create_react_agent(model, tools + your_other_tools)
```

## What it catches (real, verbatim)

> *"N+1 synchronous API calls … 100 sequential HTTP roundtrips … will trigger Stripe rate limiting"* · *"`stripe.Inventory` is not a valid Stripe SDK resource"* · *"Stripe API requires integer cents"*

Read-only: code is analyzed, never executed, never trained on. https://verificate.ai/privacy

Uses the official [`langchain-mcp-adapters`](https://github.com/langchain-ai/langchain-mcp-adapters) against the hosted [Verificate MCP server](https://mcp.verificate.ai/mcp). All clients + one-click installs: https://github.com/Verificate-Dev/verificate-mcp-quickstart
