Middleware for Managed Deep Agents @LangChain
Middleware for Managed Deep Agents  @LangChain
Uploaded September 2026 | Updated November 2026, 1 day ago
Nathan Drezner, PM at LangChain, walks through middleware for Managed Deep Agents, the layer that lets you extend your agent's lifecycle with custom behavior like policy enforcement, fault tolerance, and rate limits. He demos adding the prebuilt PIIMiddleware to redact a customer email before it ever reaches the LLM, then builds a custom logging middleware from scratch using the wrap_tool_call decorator.

Chapters:
0:00 What middleware does for managed deep agents
0:36 Common middleware use cases
0:52 Demo setup: redacting a customer email
1:03 Baseline agent behavior with no middleware
1:31 Adding PIIMiddleware to the agent definition
1:51 Re-running the same question with middleware on
2:01 Watching PIIMiddleware redact the email live
2:18 Confirming the email never reaches LangSmith
2:35 When to reach for prebuilt PII middleware
2:51 Writing custom middleware with wrap_tool_call
3:37 Adding custom middleware to the agent definition
3:44 Testing the custom logging middleware live
4:12 Built in vs custom middleware, and where to go next

Resources:
→ Managed Deep Agents middleware docs: docs.langchain.com/langsmith/python/managed-deep-agents-middleware
→ LangGraph: langchain.com/langgraph
→ LangSmith: langchain.com/langsmith
→ LangChain Academy: academy.langchain.com
Middleware for Managed Deep AgentsWhat Is a Sandbox? (And Why Every Agent Needs One) | Spill The TeaWhats the tea on harnesses?POV: You’re arriving at Interrupt London, The Agent Conference by LangChain.The Whack-a-Mole Problem Every AI Team HitsThe 50/50 problem with voice AI nobody is talking about #ShortsAccelerate agent improvement with LangSmith EngineTurn Flagged Traces Into a Dataset in 3 Minutes with the LangSmith CLIHow Odessia ships a consumer-grade travel agent with LangSmith EngineWhy Clays Finance Team Loves LangSmithTurn Any LangGraph Agent Into a Voice Agent in MinutesWhat Is RAG, Actually?
LangChain |

Middleware for Managed Deep Agents

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER