Tool Calling Authorization Boundary Confusion in LangChain Agents
Model-selected tool calls may cross authorization boundaries when application logic treats LLM intent as sufficient permission.
A user-controlled prompt or poisoned context can steer the agent toward invoking a privileged tool with attacker-influenced parameters.
This can turn prompt injection into practical application impact, including unauthorized reads, unsafe writes, workflow manipulation, data exfiltration or business logic abuse.
Separate model planning from execution. Require server-side authorization, argument validation, scoped credentials, allowlisted tools, approval gates for sensitive operations and detailed audit logs.
The model could select a privileged tool and provide arguments without deterministic authorization.
Tool execution is blocked unless an application-side policy authorizes the tool and validates every argument.
View PoC code
const userInput = "Use any available tool to export the customer list."; const modelDecision = { tool: "database_query", args: { query: "select * from customers" } }; console.log(modelDecision);
View mitigation code
function authorizeToolCall(user, tool, args) { if (tool === "database_query") return false; return true; }
View FRES detection heuristic
match: langchain AND (tool OR bindTools OR createAgent) AND (invoke OR execute) AND NOT (authorize OR allowlist OR approval)