Integrations/langchain

Harden LangChain agents with Vijil

Install the SDK, wrap one function, evaluate in CI. Your LangChain agent gets runtime guards and a trust score without changing how you build.

01 · INSTALL
terminal
$ pip install vijil-sdk                  # CLI + SDK
$ pip install vijil-dome[langchain]      # chain-native guards
02 · GUARD — TWO LINES OF CODE
python
from vijil_dome import Dome, control
from vijil_dome.integrations.langchain.runnable import GuardrailRunnable

# Chain-native: guardrails as LCEL runnables
guard_in, guard_out = Dome("policy.yaml").get_guardrails()
chain = GuardrailRunnable(guard_in) | prompt | model | parser \
      | GuardrailRunnable(guard_out)

# Or wrap any entry point in two lines
@control(policy="policy.yaml")   # guards in + out
def ask(prompt: str) -> str:
    return chain.invoke({"input": prompt})
Guards compose as LCEL runnables — use RunnableBranch to route flagged inputs to a refusal path — or wrap the chain’s entry point with the decorator. Works with chains, agents, and tools. Enforce or shadow mode; sync or async.
03 · EVALUATE
terminal
$ vijil evaluate my-agent --baseline
$ vijil evaluate my-agent      # gate your pipeline
Diamond generates probes specific to your agent’s tools and data sources and returns a trust score with findings that drill down to evidence. Run it as a build step so every change is scored before it ships.
04 · ADAPT
terminal
$ vijil adapt my-agent      # learn from production
Darwin watches Dome’s runtime telemetry, attributes failures to root causes, and proposes hardening changes as a pull request — re-verified by Diamond before merge. Nothing ships without your approval.
Full reference, policies, and examples in the Vijil docs. The commands above are illustrative — check the docs for current syntax.
CrewAI guide Google ADK guide   Vijil Dome   Vijil Diamond   Vijil Darwin

Get your LangChain agent’s trust score

Start for free