LangGraph subagents can bypass parent tool limits; middleware fix demonstrated
A developer testing LangChain 1.3.15 and Deep Agents 0.7.6 found that subagents do not inherit their parent agent's tool restrictions — each subagent receives a fresh, independent permissions grant. In the test, a supervisor agent holding only a write_brief tool spawned a writer subagent that successfully executed an unauthorized web search query, with no system check enforcing the parent's limits. LangChain's own documentation acknowledges this behavior, stating that a subagent spec replaces the parent's rules entirely rather than inheriting them. A GitHub issue (#33879) requesting subagent middleware was filed in November 2025 and remains unresolved, with one pull request closed unmerged and another still in draft. The developer demonstrated a working fix using a custom AgentMiddleware class that intercepts tool calls and blocks any tool not held by the parent agent, effectively enforcing least-privilege inheritance at the subagent level.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in