Integrations, Authentication and Authorization

As agents move closer to the user, they need access to the user’s data and services to perform tasks with agency. Connecting these agents and applications to third party services means having the manage the complexities of authentication yourself.

Integrations

As agents move closer to the user, they need access to the user’s data and services to perform tasks with agency. Connecting these agents and applications to third party services means having the manage the complexities of authentication yourself.

Integrations

An integration is a configuration object that defines how an application connects to external service for a user. It encapsulates the authentication credentials, permission scopes and API specification that determine how an AI agent interacts with the external service.

Using Composio’s client credentials (for prototyping)

It’s a development overhead and a burden to manage and create a developer app when making AI Agents for personal use or during prototyping.

To solve for that, you can use Composio’s client credentials.

Head over to the dashboard to setup a GitHub integration for your account following the steps in the video below.

When creating an integration we also attempt to create a connection to help you start prototyping early!

Creating and using your own developer app

You can add in your OAuth client credentials directly from the dashboard.

Custom Integration

Connections and entities

An entity represents a unique user in your application’s ecosystem. Think of it as a container that holds all the third-party service connections for a single user. Key points about entities:

For example, if you have a user “Alice” in your application, she would have a single entity ID that links to all her connected services (GitHub, Google Calendar, etc.).

Use entity IDs to track and sync a user’s connections with your application logic!

A connection represents an authenticated link between an entity (user) and a specific external service through an integration. When a user authorizes your application to access a service, Composio:

Creating a connection for a user
1user_id = "alice_id" # Retrieved through application logic / DB
2
3toolset.get_integration(id=integration.id)
4entity = toolset.get_entity(id=user_id)
5entity.initiate_connection(app_name=App.GITHUB, use_composio_auth=True)
6
7print(conn_req.redirectUrl) # Emit the redirect URL back to the user

During tool calling and execution, specifying the entity_id will execute the tool on behalf of the user specified.

Executing tool calls on behalf of the user
1toolset.handle_tool_calls(
2 response=response,
3 entity_id=entity.id,
4)

The entity ID can be any string that uniquely identifies a user in your system. If not specified, Composio uses “default” as the entity ID.

Built with