Share your middleware
Middleware enables context engineering, harness customization, and runtime safety controls. It is a useful extension point in LangChain and we love highlighting what the community builds with it:Add an official integration
Follow the contributing guide to build and publish a middleware package.
Share a community middleware
Open a PR to the docs repo to add your middleware to the table below.
Official integrations
| Provider | Middleware available | Source |
|---|---|---|
| Anthropic | Prompt caching, bash tool, text editor, memory, and file search | langchain-ai/langchain |
| AWS | Prompt caching | langchain-ai/langchain-aws |
| OpenAI | Content moderation | langchain-ai/langchain |
Community integrations
| Middleware | Description | Source |
|---|---|---|
| Cisco AI Defense | Runtime security inspection | cisco-ai-defense/ai-defense-langchain-middleware |
| compact-middleware | Claude Code’s compaction engine as LangChain middleware. Multi-level context compaction for long-running agents. | emanueleielo/compact-middleware |
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

