A LangChain agent that takes its instructions from the documents it retrieves is not governed. It is exposed. The LangChain Sovereign Runtime, released June 19, 2026, closes the three gaps where that exposure turns into action: tool outputs entering the context window unchecked, an agent loop with no hard ceiling, and memory that accepts any write. It does this as a drop-in package, not a rewrite, and it reports 15 of 15 adversarial tests passing.
The problem: the chain reads its own instructions
LangChain is the framework most teams reach for first when they build an agent in Python. The release describes it as the most widely deployed Python AI framework, and whether or not that ranking holds, the deployment pattern is familiar: a chain pulls in tool outputs, feeds them to the model, and acts on what comes back. The problem is that nothing in that loop distinguishes data from instruction.
That is the first gap, and it is the one that matters most. Every web scrape, document retrieval, and API call is a potential indirect prompt injection surface. An attacker plants an instruction in a document the agent retrieves, and the agent executes it, because the retrieved text arrives in the context window with the same standing as the operator's own directions. The release puts the enforcement point at on_tool_end, the moment a tool returns, so output is checked before the agent ever sees it. Without that check, the chain has no boundary between what it was told to do and what it happened to read.
The second gap is the loop itself. An AgentExecutor loop with only a soft max_iterations limit is not bounded in any way the agent cannot talk its way around. A limit written in the system prompt is a hint, and the agent can reason around a hint. The runtime enforces a hard ceiling at the callback layer, a layer the agent cannot influence, under control F3.2. The difference between a hint and a ceiling is the difference between asking the agent to stop and making it stop.
The third gap is memory. ConversationBufferMemory accepts any write, so a poisoned memory write lands without a challenge and then corrupts future sessions. The runtime adds an authorization gate to every save_context() call under control S1.5, so a poisoned write is blocked before it becomes part of what the agent remembers. Memory is the longest-lived of the three gaps. A bad retrieval affects one run. A bad memory write affects every run after it.
Taken together, the three gaps form one path. Retrieval feeds the loop, the loop feeds memory, and memory feeds the next run. An organization that deploys LangChain without closing them has not adopted a governed agent. It has adopted LangChain's default authority model, in which retrieved text, the agent's own reasoning, and stored memory all carry the same weight.
What the release changes
The runtime is a drop-in AI SAFE2 v3.0 defense package for any LangChain chain, agent, or LCEL expression. The integration is one line:
chain.invoke(input, config={"callbacks": [SovereignCallbackHandler(act_tier=ACTTier.ACT3)]})
That callback is where the three enforcements live. Tool outputs are screened at on_tool_end. The loop ceiling is enforced at the callback layer. Memory writes pass through the authorization gate. The package covers 15 controls from AI SAFE2 v3.0, and the release reports 15 of 15 adversarial tests passing, with every control ID mapped to the verified framework and no fabricated IDs.
The runtime also plugs into the NEXUS mesh. The AISAFE2Engine kernel is shared across the runtimes in the program, so one engine instance gives one unified compliance score, one audit chain, and one HEAR gate across the whole agentic stack, according to the release. The point of the mesh is that governance is not per chain. It is per organization, and the same engine watches every runtime the organization runs.
What to do with it
Get the package from examples/langchain-sovereign-runtime in the ai-safe2-framework repository and add the callback to the chains that touch untrusted content. Start with the chains that retrieve from the web, read documents, or call outside APIs, because those are the ones where the first gap is live. Then test the three gaps yourself: a retrieved document carrying an instruction, a run that tries to exceed its iteration ceiling, and a memory write carrying poisoned content. A passing test is evidence for the case tested. It is not a general safety claim, and it should not be recorded as one.
Where it sits in the program
This release opened the June sequence. The sovereign runtime program began with the Hermes runtime in May 2026, followed by Anti-Gravity v2 on June 9. LangChain came next on June 19, then LangGraph on June 22, Langflow on June 24, AutoGen on June 26, CrewAI and Make.com on June 30, Grok on July 2 with a v3.1 update on July 8, Cursor on July 8, and Lovable on July 19. LangChain matters as the first of the June releases because it set the pattern the rest of the program followed: one framework, three named gaps, one callback, and a shared NEXUS kernel underneath.
The controls, in one place
The runtime enforces 15 controls from AI SAFE2 v3.0: P1.T1.2, P1.T1.5, P1.T1.10, P1.T2.3, S1.3, S1.5, F3.2, F3.5, A2.5, M4.5, P2.T3.6, CP.3, CP.4, CP.8, and CP.10. Every ID maps to the verified AI SAFE2 v3.0 framework. The release states there are no fabricated IDs and no documentation theater, and the control list is the evidence for that claim. If an ID in a future version does not map, that is the first thing to check.
What this does not establish
The 15 of 15 test result is the release's own testing, and the release body does not describe the test cases, the test environment, or any independent validation. Treat the number as the release's claim about its own tests, not as outside proof. The release also claims enforcement at the callback layer. It does not claim the model itself is trustworthy, and no test result in the body supports such a claim. The callback governs what reaches the agent and what the agent is allowed to remember. It does not govern what the model does with clean input, and that distinction is worth keeping in the record.
Sources
- LangChain Sovereign Runtime release, ai-safe2-framework, tag 2026-06-19_Langchain-Sovereign-Runtime, published 2026-06-19: https://github.com/CyberStrategyInstitute/ai-safe2-framework/releases/tag/2026-06-19_Langchain-Sovereign-Runtime
- LangChain Sovereign Runtime package: https://github.com/CyberStrategyInstitute/ai-safe2-framework/tree/main/examples/langchain-sovereign-runtime
- AI SAFE2 framework repository: https://github.com/CyberStrategyInstitute/ai-safe2-framework
- Release-notes audit, 2026-11-17: ~/workspace/seo-review/release-notes-audit-2026-11-17.md