Using In-chat authentication
In-chat authentication lets your agent prompt users to connect accounts during chat. When a tool requires authentication, the agent returns a Connect Link URL. The user authenticates, confirms in chat, and the agent retries.
How it works
- Agent searches for tools via the
COMPOSIO_SEARCH_TOOLSmeta-tool - The
COMPOSIO_MANAGE_CONNECTIONSmeta-tool checks connection status, returns Connect Link URL if needed - User authenticates, confirms in chat, agent continues
Configuration
By just creating a session with default configs, you are enabling in-chat auth. The manage_connections parameter defaults to True, which includes the COMPOSIO_MANAGE_CONNECTIONS meta-tool automatically:
Custom callback URL
Redirect users back to your chat page after they complete authentication:
Examples
What this looks like when you run the code:
To manage authentication outside of chat, see Manually authenticating users.