Hi everyone,
I am deploying an app using LangGraph Platform and have successfully implemented custom authentication following the official documentation.
Current Situation:
I can successfully access the authenticated user information inside my Tools using the runtime object.
However, I am struggling to access the same RunnableConfig (specifically langgraph_auth_user) inside my Middleware (or Nodes, e.g., in a @before_model hook).
Code Example:
-
In Tools (Works Fine)
-
@tool def my_tool(runtime: ToolRuntime): # This works perfectly user = runtime.config["configurable"].get("langgraph_auth_user") -
In Middleware/Nodes (The Issue)

-
@before_model def check_message_limit(state: AgentState, runtime: Runtime): # ERROR: 'Runtime' object has no attribute 'get' or 'config' # I cannot easily reach the 'configurable' dictionary here. user_config = runtime.config.get("configurable", {}).get("langgraph_auth_user")