Production AI Institute — vendor-neutral certification for AI practitioners
Verify a credentialFor organisationsContact

Insights / Ecosystem Assessments / LangChain & LangGraph

Production AI Institute — Ecosystem Assessment v1.0
Published: 2026-04-30 · License: CC BY 4.0
Cite as: Production AI Institute. (2026). LangChain and LangGraph in Production: A PSF Domain Assessment.
Independence disclosure: The Production AI Institute has no commercial relationship with LangChain, Inc. This assessment is conducted solely against the PSF framework. LangChain was not consulted in the preparation of this assessment.

LangChain and LangGraph in Production: A PSF Domain Assessment

LangChain is the most widely adopted framework for building AI agents and LLM-powered applications. LangGraph, built on top of LangChain, extends it with a graph-based execution model that supports multi-step agents, stateful workflows, and human-in-the-loop patterns. Together they form the most common foundation for production agent deployments.

This assessment evaluates both libraries against the eight domains of the Production Safety Framework. The aim is not a recommendation for or against LangChain, but an honest map of where it provides production safety properties and where the practitioner must supplement it.

Assessment Summary

DomainLangChain+LangGraph
D1Input GovernancePartialsame
D2Output ValidationPartialsame
D3Data ProtectionGapsame
D4ObservabilityStrongStrong
D5Deployment SafetyPartialStrong
D6Human OversightStrongsame
D7SecurityPartialsame
D8Vendor ResilienceStrongsame

LangGraph ratings reflect what becomes achievable when using LangGraph atop LangChain — some domains improve meaningfully with the graph-based execution model.

D1

PSF Domain 1: Input Governance

Partial

LangChain: Prompt templates provide structural input governance but no semantic validation or sanitisation.

LangChain's prompt templates enforce a consistent structure for inputs, and LCEL chains allow developers to insert pre-processing steps before the LLM call. However, LangChain does not provide native prompt injection detection, PII identification in incoming requests, or semantic classification of user inputs against a permitted-use policy. A user can send adversarial instructions through the standard input pathway without any built-in interception. For PSF Domain 1 compliance, practitioners must explicitly add an input governance step — either a classification LLM call, a guardrails library, or a rule-based filter — before the primary inference step. Many production incidents with LangChain deployments trace back to the absence of this step: the chain processes inputs it was never designed to handle.

Recommended companion toolingGuardrails AI, NeMo Guardrails, or LlamaGuard as an input classification step before the primary chain. Configure rejection behaviour for out-of-scope inputs rather than defaulting to processing everything.
D2

PSF Domain 2: Output Validation

Partial

LangChain: Output parsers (Pydantic, JSON, XML) provide structural validation for structured outputs. Free-text outputs have no native semantic validation.

LangChain's output parser ecosystem is genuinely useful for structured tasks. If you need a chain to return a specific JSON schema, a Pydantic model parser enforces that structure and retries on format failure. This is real output validation for deterministic-format workflows. The gap is significant for free-text outputs and for any workflow where the semantic correctness of the output matters — not just its structure. A chain that summarises a legal document, answers a customer support question, or classifies a transaction can return a structurally valid response that is factually wrong, inappropriately confident, or harmful. LangChain provides no mechanism to detect this. PSF Domain 2 requires output contracts that specify not just format but permitted content, confidence expression, and handling of uncertain cases. The practitioner must build this.

Recommended companion toolingDefine an OutputContract per PSF Domain 2 guidance for each chain. For high-stakes outputs, add a validation LLM step that evaluates the primary response against the contract before returning it. Tools like Langfuse Prompt Experiments can help evaluate output quality systematically.
D3

PSF Domain 3: Data Protection

Gap

LangChain: No native PII detection, data classification, or output scrubbing. LangSmith tracing will log PII unless explicitly configured not to.

LangChain does not perform any classification or handling of sensitive data. If a user submits a request containing a social security number, a medical diagnosis, or payment card information, LangChain passes it through — to the LLM, to any tool calls, and (by default) to LangSmith traces. For teams subject to GDPR, HIPAA, CCPA, or PCI DSS, this creates a significant compliance risk that is invisible until an audit or breach. The most common data protection failure mode in LangChain deployments is the LangSmith tracing configuration: developers enable tracing for debugging, forget to exclude PII, and end up with months of sensitive data in a third-party logging system. PSF Domain 3 requires data classification at ingestion, PII handling procedures, and output scrubbing before data leaves the system. All of this must be implemented explicitly.

Recommended companion toolingAdd a PII detection step at chain ingestion using a library like Presidio (Microsoft, open source) or a commercial data classification API. Configure LangSmith's metadata fields to exclude sensitive data from traces. Implement output scrubbing for any chain that may surface user-submitted data in its responses.
D4

PSF Domain 4: Observability

Strong

LangChain: LangSmith provides excellent trace-level observability — one of LangChain's strongest production properties.

LangGraph: LangGraph's checkpointing adds state-level observability across multi-step agent runs.

Observability is LangChain's strongest PSF domain. LangSmith captures full execution traces — every prompt, every model response, every tool call, latency at each step, token usage, and cost. This is the kind of visibility that most AI teams building without LangChain have to construct from scratch. For production incidents, LangSmith traces provide the evidence needed for root-cause analysis: you can reconstruct exactly what the chain was processing when a failure occurred. LangGraph adds another layer: its checkpointing mechanism persists the agent's state at each node in the graph, which means multi-step agent runs can be replayed, inspected, and (where configured) resumed after interruption. For PSF Domain 4, a LangChain + LangSmith deployment satisfies the observability requirement more completely than almost any alternative stack. The main caveat is the PII risk noted in Domain 3 — tracing must be configured thoughtfully in sensitive data environments.

Recommended companion toolingPair LangSmith with an alert configuration on error rates and latency degradation. For teams with data residency requirements that prevent using LangSmith, Langfuse (self-hostable) provides equivalent trace-level observability.
D5

PSF Domain 5: Deployment Safety

Partial

LangChain: LCEL provides structured chain composition. LangServe enables deployment. Neither provides native blast-radius controls or circuit breakers.

LangGraph: LangGraph's interrupt/resume and conditional edge patterns support deployment-safety architectures, but require explicit implementation.

LangChain Expression Language (LCEL) encourages developers to think in terms of explicit pipelines rather than ad-hoc prompt chains — this is a deployment safety benefit, because the execution path is defined and inspectable rather than emergent. LangServe makes deploying chains as REST APIs straightforward. These are useful but narrow deployment safety properties. PSF Domain 5 requires controls on autonomous action scope: blast-radius limits (the maximum consequence a single run can have), rate limits (preventing runaway loops from escalating costs or external API consumption), and circuit-breaker patterns (halting execution when anomalous behaviour is detected). None of these are provided out of the box. A misconfigured LangGraph agent in an infinite loop will continue executing — making LLM calls, invoking tools, incurring costs — until an external system stops it or the budget is exhausted.

Recommended companion toolingImplement rate limiting at the deployment layer (LangServe supports middleware). Define explicit step budgets in LangGraph graphs — maximum node invocations per run. Add a cost circuit breaker: track token consumption per run and abort if it exceeds a defined threshold. For customer-facing deployments, implement concurrency limits to prevent a single user session from consuming disproportionate resources.
D6

PSF Domain 6: Human Oversight

Strong

LangChain: LangGraph provides first-class human-in-the-loop primitives — interrupt/resume, approval nodes, and state persistence across sessions.

LangGraph is one of the few agent frameworks that treats human oversight as a first-class architectural concern rather than an afterthought. Its interrupt mechanism allows a graph to pause execution at a defined node, serialise state, and wait for human input before resuming. This enables approval workflows that are stateful across sessions — a human can review a pending action hours after the agent proposed it, and the agent resumes with the decision context intact. Conditional edges allow routing based on human input (approve/reject/modify), creating genuinely branching workflows rather than binary halt-or-continue patterns. For PSF Domain 6, a LangGraph deployment can fully satisfy the oversight requirement if the practitioner designs the interrupt points appropriately. The key design discipline is identifying which decisions in the workflow require human judgment and building interrupt nodes at those points before deployment — not adding them reactively after an incident.

Recommended companion toolingMap each consequential action in your LangGraph workflow to an autonomy level before writing code. Actions at autonomy level 0 or 1 require interrupt nodes. Use LangGraph's checkpointing to make interrupts resumable across sessions — avoid patterns where agent state is lost if the human doesn't respond immediately.
D7

PSF Domain 7: Security

Partial

LangChain: No native security controls. Prompt injection protection, credential management, and access control require explicit implementation.

LangChain provides no built-in protection against prompt injection — the most common and consequential attack vector against agentic systems. A user who can influence the prompt context can, in an unprotected LangChain deployment, instruct the agent to ignore its instructions, exfiltrate information from its context window, or invoke tools with attacker-controlled parameters. Credential management is the responsibility of the deployment team — LangChain passes whatever environment variables or secrets the developer provides to LLM calls and tool invocations. There is no architectural separation between the agent's operational context and its credentials. For PSF Domain 7, LangChain requires the practitioner to implement a complete security model: input sanitisation to resist injection, secrets management that keeps credentials out of agent context, output filtering to prevent data exfiltration, and access controls on the deployment endpoint.

Recommended companion toolingUse Composio or a secrets manager (AWS Secrets Manager, HashiCorp Vault) to keep credentials out of agent context. Add a prompt injection detection step using LlamaGuard or a custom classifier. Implement output filtering to prevent the chain from echoing back sensitive data from its context. Apply authentication and authorisation to LangServe endpoints.
D8

PSF Domain 8: Vendor Resilience

Strong

LangChain: LangChain's model-agnostic architecture is a genuine vendor resilience strength — switching LLM providers requires minimal code changes.

LangChain was designed from the start to be model-agnostic. Swapping from OpenAI GPT-4 to Anthropic Claude to Google Gemini to a locally hosted Llama model is an interface-level change, not an architectural one. This is a meaningful vendor resilience property: if an LLM provider experiences an outage, raises prices significantly, or degrades quality, the migration path is well-defined and low-risk. LangChain supports multi-provider fallback configurations natively — you can define a primary provider and one or more fallbacks, with automatic routing on failure. For PSF Domain 8, this makes LangChain-based deployments substantially more resilient than stacks that are tightly coupled to a single provider's API. The vendor resilience concern shifts from LLM dependency to LangChain itself — but given LangChain is open source and the core abstractions are stable, this is a much lower-risk dependency than a proprietary API.

Recommended companion toolingConfigure a fallback provider in production. Document the model substitution procedure in your runbook. If LangChain as a dependency is a concern, evaluate whether your use of LCEL can be encapsulated behind an interface layer, allowing substitution if necessary.

PSF-Compliant LangChain Stack

LangChain and LangGraph do not provide a PSF-compliant deployment out of the box. The following companion tools close the primary gaps. This is not a prescriptive stack — alternatives exist for each component — but represents a reasonable starting point for practitioners building toward PSF compliance.

RequirementToolNotes
Input governanceGuardrails AI or NeMo GuardrailsAdd before the primary LLM call
PII detectionMicrosoft Presidio (open source)At ingestion and before tracing
ObservabilityLangSmith or LangfuseLangSmith for LangChain-native; Langfuse if self-hosted required
Tool integrationsComposioManaged OAuth for 250+ services; see Composio PSF Assessment
Security / prompt injectionLlamaGuardOpen source classifier for unsafe content and injection patterns
Secrets managementAWS Secrets Manager or HashiCorp VaultKeep credentials out of agent context
Output validationCustom OutputContract + validation LLMPer PSF Domain 2 — no off-the-shelf solution fully addresses this

Related Assessments

Composio
PSF assessment of the managed tool integration layer for AI agents.
The Production AI Ecosystem
How major agent frameworks, tool layers, and observability tools relate to the PSF.
From reading to credential

You understand the gaps.
Get the credential that proves it.

The AIDA examination tests applied PSF knowledge across all eight domains — exactly the gaps and strengths covered in this assessment. 15 minutes. No charge. Ever.

Start AIDA — free →CPAP practitioner credential