Introduction
Securely connect your AI agents to user accounts on external apps
AI agents often need to perform actions on behalf of users like;
- sending an email from their Gmail
- creating an issue in their Jira
- or posting to their Slack
Doing this securely requires handling complex authentication flows like OAuth 2.0, managing API keys, storing sensitive tokens, and refreshing credentials. This distracts from building the core agent logic.
Let’s see how Composio Auth works in a basic example where we connect a user to their GitHub account.
Quickstart with Composio Auth
1. Identify the User (Entity) & App
Composio lets you specify a unique entity_id
for each user in your application. This is the user’s identifier in your application.
2. Initiate the Connection
You’ll need the integration_id
for the app (which you typically set up once - see Integrations) and the entity_id
you specified for your user.
3. Wait for Connection Activation (OAuth)
For OAuth flows, the user needs to visit the redirectUrl
and authorize the connection. Your application can wait for the connection to become active.
4. Execute Actions Using the Connection
Once the connection is active, you (or realistically, an agent) can execute actions for that app on behalf of that specific user by providing their entity_id
Alternatively, you can execute actions directly using the connection ID if you have it:
This flow demonstrates how Composio uses Integrations (app config), Entities (your users), and Connections (the secure link between them) to simplify authenticated interactions for your AI agents.