Langchain Middleware
INVOKE THIS SKILL when you need human-in-the-loop approval, custom middleware, or structured output. Covers HumanInTheLoopMiddleware for human approval of dangerous tool calls, creating custom middleware with hooks, Command resume patterns, and structured output with Pydantic/Zod.
- Type
- Skill
- Author
- langchain-ai
- Category
- AI Agents
- GitHub stars
- 1.3K
- Installs
- 16.3K
- Last updated
- October 29, 2026
Install
npx skills add https://github.com/langchain-ai/langchain-skills --skill langchain-middlewareUse cases
- Gate a dangerous tool call behind human approval with HumanInTheLoopMiddleware.
- Write custom middleware with hooks to intercept agent behavior.
- Return structured output from an agent using Pydantic or Zod schemas.
Frequently Asked Questions
What is HumanInTheLoopMiddleware for?
It pauses for human approval before dangerous tool calls are executed.
Can I resume an agent after approval?
Yes, the skill covers Command resume patterns.
Which schema libraries are supported for structured output?
Pydantic and Zod.
About this skill
Covers human-in-the-loop approval, custom middleware, and structured output in LangChain. It includes HumanInTheLoopMiddleware for approving dangerous tool calls, middleware hooks, Command resume patterns, and structured output with Pydantic or Zod. Invoke it when an agent needs a human gate or typed responses.
Summary written with AI assistance from the project's public description.
Categories
More from langchain-ai
Deep Agents Memory
INVOKE THIS SKILL when your Deep Agent needs memory, persistence, or filesystem access. Covers StateBackend (ephemeral), StoreBackend (persistent),...
by langchain-ai
Langgraph Fundamentals
INVOKE THIS SKILL when writing ANY LangGraph code. Covers StateGraph, state schemas, nodes, edges, Command, Send, invoke, streaming, and error hand...
by langchain-ai
Langgraph Persistence
INVOKE THIS SKILL when your LangGraph needs to persist state, remember conversations, travel through history, or configure subgraph checkpointer sc...
by langchain-ai
Langchain Rag
INVOKE THIS SKILL when building ANY retrieval-augmented generation (RAG) system. Covers document loaders, RecursiveCharacterTextSplitter, embedding...
by langchain-ai
Similar Skills
Find Skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", o...
by vercel-labs
Grill Me
A relentless interview to sharpen a plan or design.
by mattpocock
Ai Video Generation
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0,...
by inference-sh
Ai Image Generation
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FL...
by inference-sh