Skip to Content
ConnectorsLangChain & LangGraph

LangChain & LangGraph

LangChain is the most widely adopted framework for building LLM-powered agents, providing composable abstractions for chains, tools, retrieval, and multi-step reasoning. LangGraph extends this with stateful graph-based orchestration for complex agent workflows. Together they power a large share of production agent deployments, from simple RAG pipelines to multi-agent systems at enterprises like Klarna, Uber, and J.P. Morgan.

Arrakis integrates natively with LangChain and LangGraph to provide full agent discovery and runtime governance without requiring changes to agent code.

Integration Architecture

Arrakis connects to LangChain through its callback system, the framework’s primary extensibility mechanism for observability and control. A lightweight Arrakis callback handler is injected at the application level and inherits through the entire execution graph, capturing every LLM call, tool invocation, agent decision, and retrieval operation.

The handler intercepts events at every layer of the LangChain stack:

LayerEvents CapturedGovernance Use
LLM / Chat ModelPrompt content, model responses, token counts, streaming tokensPrompt injection detection, sensitive data scanning, cost tracking
ToolsTool name, input parameters, output dataUnauthorized tool use, data exfiltration, overprivileged access
AgentAction decisions, reasoning steps, final outputPolicy violation detection, decision audit trail
RetrieverQueries issued, documents returnedData access governance, context poisoning detection
ChainFull execution hierarchy with parent/child relationshipsExecution graph reconstruction, anomaly detection

For LangGraph specifically, Arrakis additionally captures graph state transitions, conditional routing decisions, and checkpoint data, providing visibility into which nodes executed, what state was passed between them, and where human-in-the-loop interrupts occurred.

Discovery

Arrakis discovers LangChain-based agents through multiple signals: framework instrumentation metadata, LangSmith project associations (when available), deployment manifests, and runtime callback registration. Discovered agents are automatically cataloged in the Arrakis Identity Graph with their tool permissions, model bindings, and execution patterns.

Runtime Monitoring

Once connected, Arrakis monitors LangChain agents in real time:

  • Prompt and response scanning — every LLM interaction is inspected for sensitive data patterns, injection attempts, and policy violations before and after model execution
  • Tool call governance — tool invocations are validated against approved tool lists and data classification policies, with the ability to block unauthorized calls
  • Execution graph analysis — the full parent-child hierarchy of runs is reconstructed to detect anomalous execution patterns, unexpected tool chains, or recursive agent behavior
  • Cost and token tracking — token usage across prompt and completion is tracked per agent, per model, and per session for budget enforcement

All findings feed into the standard Arrakis risk pipeline with appropriate threat codes, contributing to agent risk scores and organizational posture scoring.

Deployment

The Arrakis LangChain connector supports both deployment models:

  • Full SaaS — callback data is forwarded to the Arrakis cloud for processing
  • Hybrid — the on-premise component processes raw execution traces locally; only alerts and risk scores leave the customer environment

The callback handler adds negligible latency (async, non-blocking) and requires no changes to existing LangChain or LangGraph application code. It can be injected via a single configuration line or through auto-instrumentation at the framework level.

LangSmith Compatibility

For teams already using LangSmith for observability, Arrakis operates alongside it without conflict. Both can receive callback events simultaneously. Arrakis can also ingest trace data from LangSmith via its API as a secondary data source, enriching governance insights with historical execution data.

Full integration documentation is available to Arrakis customers.

Last updated on