Overview
RunTools provides built-in OAuth integration for 10 providers. Connect your accounts once, and tools automatically resolve fresh access tokens — no manual token management. Key features:- One-click connect — authorize via the Connected Apps tab
- Auto-refresh — background daemon refreshes tokens before they expire
- On-demand refresh — if a token is expired when needed, it’s refreshed instantly
- BYOA — bring your own OAuth app credentials for white-label consent screens
- AES-256-GCM encryption — tokens encrypted at rest, decrypted only when needed
Supported Providers
| Provider | ID | Token Type | Used By |
|---|---|---|---|
google | OAuth 2.0 | Gmail, Calendar, Sheets | |
| GitHub | github | OAuth 2.0 | GitHub tool |
| Slack | slack | OAuth 2.0 | Slack tool |
| Discord | discord | OAuth 2.0 | Discord tool |
| Microsoft | microsoft | OAuth 2.0 | Outlook tool |
| X (Twitter) | x | OAuth 2.0 (PKCE) | X/Twitter tool |
linkedin | OAuth 2.0 | LinkedIn tool | |
| Telegram | telegram | Login Widget (HMAC) | Telegram tool |
whatsapp | Meta OAuth 2.0 | WhatsApp tool |
Connecting an Account
Via Dashboard
- Go to Dashboard → Credentials → Connected Apps
- Find the provider you want to connect
- Click Connect — you’ll be redirected to the provider’s authorization page
- Authorize RunTools (or your BYOA app) to access your account
- You’ll be redirected back with a Connected status
Via CLI
How Auto-Resolution Works
When a tool executes, the tools service resolves credentials automatically:Token Refresh
OAuth tokens are kept fresh through two mechanisms:Background Daemon (Proactive)
A background task in the auth service runs every 5 minutes:- Queries for connections with tokens expiring within 10 minutes
- Decrypts refresh tokens
- Calls each provider’s token refresh endpoint
- Updates the DB with new access tokens and expiry times
- Tracks failures to avoid retrying revoked tokens
On-Demand (Reactive)
WhenGET /v1/oauth/token/:provider is called and the token is expired:
- The auth service refreshes the token immediately
- Stores the new token
- Returns the fresh token to the caller
BYOA (Bring Your Own App)
Organizations can register their own OAuth app credentials for any provider. When configured:- The consent screen shows your app name instead of “RunTools”
- You control the scopes requested
- Your customers see your brand throughout the OAuth flow
Dashboard
Go to Dashboard → Credentials → Connected Apps → BYOA Settings to configure per-provider OAuth apps.API
Declaring OAuth in Custom Tools
When building custom tools withdefineTool(), declare the OAuth provider in the credentials spec:
tools/my-google-tool.ts
credentialMapping maps your tool’s credential key names to OAuth token fields:
{ accessToken: 'access_token' }— mapscredentials.accessTokento the OAuth access token{ token: 'access_token' }— mapscredentials.tokento the OAuth access token
{ token: 'access_token' }.
Security
| Property | Detail |
|---|---|
| Encryption | AES-256-GCM at rest for all tokens and BYOA client secrets |
| Transport | HTTPS only, internal calls use X-Internal-Secret service auth |
| Sandbox isolation | OAuth tokens never enter sandbox VMs — resolved server-side |
| Refresh tracking | Failed refreshes are tracked to prevent retry storms |
| Scoping | Connections are scoped to org_id + user_id |
API Reference
| Method | Path | Description |
|---|---|---|
GET | /v1/oauth/providers | List available OAuth providers |
POST | /v1/oauth/start/:provider | Start OAuth authorization flow |
GET | /v1/oauth/callback/:provider | OAuth callback (handled automatically) |
GET | /v1/oauth/connections | List user’s OAuth connections |
DELETE | /v1/oauth/connections/:provider | Disconnect an OAuth provider |
GET | /v1/oauth/token/:provider | Get valid access token (internal only, auto-refreshes) |