externalUserId, and Runtools stores credentials scoped to:
Hosted Connect vs. Connected Apps
Connections are app-scoped by default. A Gmail connection for
atlas does not automatically become a Gmail connection for iris or any other product.
Create a product app
Configure one app per product. TheappId is your stable product identifier, such as atlas.
oauthAppPolicy controls which OAuth client is used:
Create a connect session
When a signed-in product user clicks “Connect integrations”, create a short-lived hosted connect session from your server.session.connectUrl in the browser. The hosted page shows the requested integrations, starts OAuth where needed, and collects API-key-style credentials for tools that use secrets instead of OAuth.
Run an agent with that user’s connections
When your product runs an agent, pass the same app and user scope.connect_required instead of falling back to builder or org credentials.
Agent-runtime tool calls are capability-scoped internally. The model, sandbox, and managed runtime can request a tool action, but they cannot choose credentialScope, endUser, raw credentials, or org secret overrides. Runtools derives that authority from the agent run and Hosted Connect app/user scope.
Use Hosted Connect from channels
For Telegram, WhatsApp, Slack, Discord, iMessage, or SMS products, the developer connects the channel once and end users only chat with it. The channel credential is the transport, not the customer data identity. Bind the channel to your product app, then link each provider sender id to the sameappId + externalUserId you use for Hosted Connect:
connect_required. The channel worker does not fall back to builder Connected Apps, org defaults, or another product user’s credentials.
Run tools directly
You can also execute Tool Hub actions with end-user scope.endUser is present, RunTools enforces credentialScope: 'end_user' even if you omit it. Passing it explicitly makes your intent clear.
If the user connected multiple accounts for the same tool, pass a connection selector.
List connections
Show connection status in your product’s settings page.API-key-backed tools
Some tools use API keys or secrets instead of OAuth. The hosted connect page can collect those values and store them through the tools service. If you build your own connect UI, post the values through the connect session instead of storing them in your product database.Usage and audit
Usage is attributed by app and end user so builders can report, rebill, and debug without exposing credentials.Custom OAuth apps
By default, Hosted Connect can use Runtools-managed OAuth. If you want the provider consent screen to show your own app name, configure a custom OAuth app.appId. Hosted Connect resolves app-specific config first, then org-level config, then Runtools-managed OAuth when the app policy allows it.
REST endpoints
The SDK uses the Auth and Tools service URLs internally. If you call REST directly, use these endpoints from your server:
Authenticated Auth service calls accept the same Runtools API key as a bearer token:
Production checklist
- Use a stable
externalUserIdfrom your product, not an email address that can change. - Create sessions server-side only.
- Keep
allowedRedirectUrlsstrict. - Keep
allowedToolSlugslimited to tools your product actually needs. - Never use builder credentials for customer-data tool calls.
- Treat missing end-user credentials as a connect-required state in your product UI.
- Show connection status and reconnect actions inside your product settings.