config["configurable"]["langgraph_auth_user"]
object through a custom authentication handler. You can then access this object in your graph with the langgraph_auth_user
key to allow an agent to perform authenticated actions on behalf of the user.
@auth.authenticate
handler, LangGraph sees only the API-key owner (usually the developer), so requests aren’t scoped to individual end-users. To propagate custom tokens, you must implement your own handler.langgraph.json
, add the path to your auth file:config
) that is passed to LangGraph Platform deployment. This object contains information about the current user, including any custom fields you return from your @auth.authenticate
handler.
To allow an agent to perform authenticated actions on behalf of the user, access this object in your graph with the langgraph_auth_user
key:
is_studio_user
was added in version 0.1.73 of the langgraph-sdk. If you’re on an older version, you can still check whether isinstance(ctx.user, StudioUser)
.