Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

OAuth connections

OAuth 2.0 is available for REST connections and for MCP connections over http or sse. Stdio MCP servers and external connection drivers do not support it. The runtime acquires and refreshes bearer tokens during requests. Tokens and client secrets stay in encrypted credential storage and never become environment variables.

By default, a connection has a company account binding shared across deployments and cloud-backed local development. Hosted agents can also use an administrator-approved MCP catalog with separate employee-owned account bindings. Other connections and employees never inherit a personal account.

Declare OAuth in the connection

Set auth in spec.json:

{
  "baseUrl": "https://gitlab.com/api/v4",
  "auth": { "type": "oauth2" },
  "test": { "path": "user" }
}

auth.token is rejected with oauth2. The application configuration comes from the first of:

  1. auth.provider, the id of a managed provider. The CLI cannot use managed providers with --local.
  2. oauth.json next to spec.json, for a custom application.
  3. Discovery from the server URL, for an MCP connection whose server publishes OAuth resource metadata (RFC 9728) and registers public clients (RFC 7591).

A REST OAuth connection with none of these is listed as needing configuration. An existing approved binding takes precedence over the authentication declared in the files, so editing spec.json alone does not remove it.

oauth.json

oauth.json holds the application settings. It never holds the client secret: a clientSecret key, or any unknown key, fails validation.

FieldRequiredDescription
labelnoAccount label, 1 to 100 characters. Defaults to the connection name.
grantTypeyesauthorization_code or client_credentials.
issueryesIssuer URL.
discoveryUrlunless endpoints are setOpenID or OAuth discovery document.
authorizationUrl, tokenUrlwithout discoveryUrlExplicit endpoints. authorizationUrl is needed only for authorization_code.
revocationUrlnoRevocation endpoint used by disconnect.
clientIdsee belowRegistered client ID.
tokenAuthMethodyesclient_secret_post, client_secret_basic, or none. client_credentials cannot use none.
scopesyesArray of scope strings. May be empty.
resourceOriginsnoExact origins (scheme, host, port) the token may be sent to. Defaults to the origin of baseUrl or url. Not URL prefixes.
authorizationParameters, tokenParametersnoExtra parameters. Only access_type, prompt, audience, resource, login_hint, and include_granted_scopes are accepted.
accountUrl, accountIdPathnoIdentify the account on reconnect. accountIdPath is a dotted path into the accountUrl response, or into the token response when accountUrl is absent. accountUrl requires accountIdPath, and its origin must be in resourceOrigins.
accountNamePathnoDisplay name of the account, shown on the connection's account card. A dotted path into the same response as accountIdPath. A missing name does not fail authorization.
scopeSeparatorno"," for a provider that separates scopes with commas. Defaults to a space.
bearerTokenTypesnotoken_type values the provider uses for a bearer token, such as Slack's bot.
unreportedScopesnoRequested OpenID Connect scopes (offline_access, openid, profile, email) that the provider grants without listing them in the token response, such as Microsoft's offline_access. Each one must also be in scopes, and it is still requested. When the token response lists scopes, every other requested scope must appear in it.
entraAppOnlynotrue for Microsoft Entra organization-wide access, with "grantType": "authorization_code". The sign-in pins the tenant of a Global or Privileged Role Administrator. Tokens use client credentials at <issuer>/<tenant>/oauth2/v2.0/token. See Microsoft 365 organization.

Omit clientId only for a public authorization-code client: the file then needs discoveryUrl, "grantType": "authorization_code", and "tokenAuthMethod": "none", and the broker registers a client bound to the callback URL.

Hosted OAuth requires public HTTPS destinations. Local development also permits explicit loopback URLs. Resource redirects are rejected, so configure the final API origin. The broker generates protected fields such as state and the redirect URI.

Changing scopes, resource origins, or other compared settings in oauth.json moves a connected connection to reconnect required. Discovery-derived endpoints and an omitted client ID are not compared. Reconnecting approves the edited file and requires authorizing an account again.

Add a connection in Amodal

Add connection on the Connections page writes the connection files through the connected source. See Where changes are saved.

The dialog stages are Choose service, Set up, Save, and Connect. Services with nothing to fill in skip Set up.

  1. Choose service lists the managed providers the platform enables, Slack (your own app), and the remote MCP presets, such as Linear, Jira and Confluence, Notion, GitLab, Sentry, and Stripe. A preset writes an ordinary OAuth MCP spec.json and needs no application registration. Custom connection offers an API key, your own OAuth app, or an MCP server.
  2. Set up takes the name and the service's values. The name must match [A-Za-z0-9_-]{1,100} and be unique. A managed provider writes auth: {"type": "oauth2", "provider": "<id>"} with no oauth.json. A custom OAuth app shows the redirect URL to register, writes oauth.json, and stores the client secret encrypted outside the repository. An API key is stored as an agent secret after the files are saved.
  3. Save shows the summary and the generated files under Configuration files, then commits with Save connection.
  4. Connect lists the remaining steps: add the credential for each env: reference with Save secret, then Deploy and connect and Continue to sign in. Custom applications wait for the deployment to become active, because their settings come from its bundle. With manual production promotion, the dialog offers Make production. Connect later leaves Finish setup on the row.

An MCP server without published resource metadata, or one that requires a pre-registered client ID, needs oauth.json. Register the exact callback URL shown in Amodal.

Manage connections in Amodal

  • Each row on the Connections page shows one state and the action that completes setup, such as Finish setup, Configure OAuth, Add credential, Connect, Reconnect, or Restart agent. A connection that declares no authentication reads No credentials.
  • Test connection runs the test operation declared in spec.json, or lists an MCP server's tools. A REST connection without a test operation offers Open instead.
  • The connection page's Account and access card shows the authorized account's name and ID, the member who connected it and when, the latest token refresh, the last passed test with its request and HTTP status, the granted scopes, and Disconnect account. Disconnecting affects every connection bound to the same account.
  • The Settings card of a custom OAuth connection edits oauth.json through the connected source. Deploy the saved source, then connect.
  • When the saved account cannot be verified on reconnect, Authorize a new account and Replace account and authorize create a fresh binding. Other connections keep the replaced account.
  • Remove deletes the directory and its OAuth binding. It stops when code or configuration still references the connection. It does not deploy, so a deployed connection stays as Pending removal until the next deploy. Removing a binding does not disable the account.

Credential changes do not restart a hosted runtime. New sessions resolve them immediately. Restart agent restarts the deployment so open sessions, channels, and MCP sessions pick them up.

Use the CLI

Commands address the connection name, such as analytics, not its npm package name.

add writes the connection files into the working tree without committing, and refuses an existing name. It takes one of --rest <baseUrl>, --mcp <url>, or --provider <id> (with an optional --rest <baseUrl>). Manage Connections lists every option.

amodal connections add crm --rest https://api.example.com
amodal connections add shop --rest https://shop.example.com --auth header --header X-Shop-Token --secret-name SHOP_TOKEN
amodal connections add analytics --rest https://analyticsdata.googleapis.com --auth oauth2 --oauth ./oauth.json
amodal connections add drive --provider google-drive --rest https://www.googleapis.com/drive/v3
amodal connections add linear --mcp https://mcp.linear.app/mcp
amodal connections add notion --mcp https://mcp.notion.example --auth bearer

The other actions are configure, connect, status, test, list, disconnect, and remove:

amodal connections configure analytics --agent AGENT_ID --config oauth.json --secret-stdin
amodal connections connect analytics --agent AGENT_ID
amodal connections status analytics --agent AGENT_ID --json
amodal connections test analytics --agent AGENT_ID --path ./agent
amodal connections list --agent AGENT_ID --json
  • configure does not read the connection's oauth.json. Pass --config <file>, --grant GRANT_ID to bind an existing account, or --managed PROVIDER_ID. For a provider whose host depends on the connection, such as Egnyte, also pass --rest with the connection's base URL.
  • --secret-stdin reads a confidential client's secret from standard input until it ends. Do not pass secrets as arguments.
  • connect prints and opens the authorization link (--no-open skips the browser) and polls until completion or denial. The authorization expires after ten minutes. For cloud authorization, sign into the same Amodal account in the browser.
  • disconnect disables the account, attempts revocation when the provider has a revocation endpoint, and blocks every binding of that account. It does not delete files.
  • remove deletes the connection directory only when every file in it is a source file. With --local it also deletes the local binding. Without --local, cloud bindings and accounts are unchanged.

Local and hosted execution

Add --local --path ./agent to configure, connect, status, test, list, and disconnect to store credentials on this machine. The local authorization-code callback is http://127.0.0.1:8788/callback; --callback-port selects another port. Register both this URL and the platform callback shown in Amodal when one provider application serves both.

Local credentials are encrypted under ~/.amodal/oauth/ with an owner-only key file. They are not copied into the repository or the deployment bundle. A missing key requires reauthorization.

amodal dev uses the local bindings. amodal dev --oauth-cloud uses the selected cloud agent's bindings through the platform broker; select the agent with amodal login or amodal agent first.

Hosted runtimes resolve the named connection for their agent, so the connection's files must be in the active deployment. REST requests read the current binding at request time. HTTP MCP sessions bind at initialization: create a fresh session after changing an MCP application's scopes, resource origins, or account.

The request tool keeps its permission and confirmation checks. Custom code using ctx.request() must enforce its own operation authorization. Both paths enforce the approved resource origin. A failed resource request is not replayed.

Managed providers

Managed providers are OAuth applications hosted by the platform: the Google APIs below, Slack, Microsoft Outlook, Microsoft 365 organization, and Egnyte. Select one with auth.provider. A provider appears in the picker only when the platform has its client ID and client secret configured. When a managed provider adds scopes, existing connections stay connected and keep the scopes they were authorized with. Their Account and access card lists the added scopes the account lacks, and its Reconnect button approves the provider's current scopes. The connection has no access from that click until the sign-in completes. Removing, replacing, or reordering a provider's scopes disables its connections until they reconnect.

auth.providerScopes beyond openidSelection
google-analyticsanalytics.readonlyProperty ID
google-sheetsspreadsheetsSpreadsheet ID
google-docsdocumentsDocument ID
google-drivedrive.filenone
google-calendarcalendar.readonly, calendar.eventsCalendar ID
google-search-consolewebmasters.readonlySite URL
google-bigquerybigqueryProject ID
egnyteEgnyte.filesystem, Egnyte.auditEgnyte domain

All managed Google providers share one Google OAuth client. Drive's drive.file scope grants access to files created by, opened with, or shared with that Google app, per Google account. Connections that authorize the same Google account therefore see the same files, including files created through another connection. Amodal has no Google Picker integration, so it cannot authorize arbitrary existing files.

Slack

slack is a managed provider whose authorized account is the workspace, so reconnect requires the same workspace. The connection's spec.json gets the Web API base URL and auth.test as its test operation. The bot token has the app_mentions:read, assistant:write, chat:write, im:history, channels:read, groups:read, channels:history, groups:history, users:read, and users:read.email scopes: the agent reads the channels the app is invited to, reads members' profiles including their email addresses, and posts as the app.

To answer direct messages and @mentions, the agent lists @amodalai/channel-slack-assistant among the packages in amodal.json. The package ships the slack-assistant channel, so the agent needs no channels/slack-assistant/channel.json of its own. Adding a managed Slack connection from the Studio connections page commits that packages entry in the same commit as the connection files, unless the package is already listed. Studio leaves amodal.json unchanged when the repository has none or it is not valid JSON; list the package by hand in that case.

In a channel the app is invited to, an @mention gets a reply in a thread under it. A follow-up in that thread needs another @mention, and everyone in the thread shares one conversation. Nothing else is configured per agent. The platform's Slack app receives every workspace's events at one request URL and relays each one, with the workspace's bot token, to the agent whose Slack connection is bound to that workspace. An event is not delivered when two agents are bound to the same workspace, when the grant needs reconnection, or when the agent has no active production deployment. A channel that declares its own signingSecret still receives relayed events, and it also accepts requests that Slack signs with that secret.

While the agent works on a message, in a direct message or a channel thread, Slack shows its working indicator with a Stop button, and the reply streams into the thread as the agent writes it. The indicator ends when the turn ends: after the reply, when the agent writes no text, when the turn fails, and when someone presses Stop. Stop ends the turn, the text already streamed stays in the thread, and the agent replies "Stopped." to confirm. Slack shows Stop only when the app subscribes to the agent_session_stopped bot event, which the generated manifest includes.

Platform operators create the shared Slack app from a generated manifest. Run node scripts/slack-app-manifest.mjs https://platform.example.com with the platform's base URL (add --name "My App" to change the app name from Amodal). In Slack, choose Create New App, From an app manifest, and paste the output. The manifest carries the redirect URL, the Events API request URL, the event subscriptions, the Agents & AI Apps feature, and the bot scopes from the managed Slack provider. After creating the app, set SLACK_CLIENT_ID, SLACK_CLIENT_SECRET, and SLACK_SIGNING_SECRET on the platform from the app's Basic Information page. When SLACK_CLIENT_ID is set without SLACK_SIGNING_SECRET, the platform logs slack_signing_secret_missing once per process and answers every Slack event with a 503. Set SLACK_APP_ID to the App ID from the same page so that a Slack connection's Settings card in Studio shows the App ID with a link to the app's settings at https://api.slack.com/apps/<App ID>. The card shows the client ID the connection's account was authorized against; when that differs from SLACK_CLIENT_ID, it hides the App ID and notes that the account was authorized through a different app.

Slack with your own app

Slack (your own app) sits next to Slack in Choose service and connects through a Slack app the organization creates in its own workspace. The app needs no Slack Marketplace approval. The organization decides which channels it reads by inviting the app. Studio offers it to members who can manage OAuth connections, whether or not the platform enables the managed slack provider.

  1. Set up shows a Slack app manifest with a copy button. In Slack, choose Create New App, From an app manifest, pick the workspace, and paste the manifest. Then copy the client ID and client secret from the app's Basic Information page into Client ID and Client secret.
  2. Save writes spec.json with the Web API base URL, auth.test as its test operation, and auth: {"type": "oauth2"}. It writes an oauth.json with the client ID, the Slack endpoints, "scopeSeparator": ",", "bearerTokenTypes": ["bot"], "accountIdPath": "team.id", and "accountNamePath": "team.name", plus the managed provider's policy.json, surface.md, and rules.md. The client secret is stored encrypted outside the repository. amodal.json is not changed.
  3. Connect deploys the files and signs in, which installs the app in the workspace.

The manifest registers the platform's redirect URL and the bot scopes chat:write, im:history, channels:read, groups:read, channels:history, groups:history, users:read, and users:read.email, which are the scopes oauth.json requests. It has no event subscriptions and no Agents & AI Apps feature, and the app's Messages tab is read only. The platform relays only its shared app's events and verifies them with SLACK_SIGNING_SECRET, so an organization's own app does not answer direct messages or @mentions. The agent reads and posts through the connection.

Microsoft Outlook

microsoft-outlook is a managed provider for Outlook mail and the default calendar through Microsoft Graph. Its authorized account is the Microsoft user, identified by the Graph id that /me returns, so reconnect requires the same user. The connection's spec.json gets the base URL https://graph.microsoft.com/v1.0 and GET me as its test operation. The provider requests the delegated permissions User.Read, Mail.Read, Mail.Send, and Calendars.ReadWrite, plus offline_access for the refresh token. The agent reads mail, sends mail and replies, manages events on the default calendar, and reads free/busy.

Platform operators register the shared application in the Microsoft Entra admin center, under App registrations, New registration:

  1. Under Supported account types, choose "Accounts in any organizational directory and personal Microsoft accounts" to admit both work or school accounts and personal accounts, or "Accounts in any organizational directory" to admit work and school accounts only. A single-tenant registration fails, because the provider signs in through the common endpoint.
  2. Add a redirect URI on the Web platform: <platform API URL>/api/oauth/callback.
  3. Under API permissions, add the Microsoft Graph delegated permissions offline_access, User.Read, Mail.Read, Mail.Send, and Calendars.ReadWrite.
  4. Under Certificates & secrets, create a client secret.
  5. Set MICROSOFT_CLIENT_ID on the platform to the Application (client) ID, and MICROSOFT_CLIENT_SECRET to the secret's Value, not its Secret ID.

An organization that restricts user consent needs an administrator to grant consent for the tenant; until then, sign-in stops at an approval request. Publisher verification lets users consent in tenants that allow consent only for apps from verified publishers.

Client secrets expire after at most 24 months. Add a fresh secret and update MICROSOFT_CLIENT_SECRET before the expiry. The secret is not part of the compared configuration, so connections stay connected. Changing MICROSOFT_CLIENT_ID disables every Microsoft connection until it is reconnected. Microsoft ends a refresh token that goes unused for 90 days, and the connection then asks to reconnect.

Free/busy through getSchedule works only for work and school accounts. Microsoft has no revocation endpoint: disconnect deletes the stored tokens, and the user removes the app's access from their Microsoft account settings.

A custom Microsoft application in oauth.json needs explicit authorizationUrl and tokenUrl instead of discoveryUrl, no openid scope, and "unreportedScopes": ["offline_access"]. Microsoft's multi-tenant discovery document and ID tokens carry a per-tenant issuer that no single issuer matches.

To read every mailbox and calendar in an organization without each person signing in, use Microsoft 365 organization.

Microsoft 365 organization

microsoft-365-organization is a managed provider that reads every user's mail and default calendar in one Microsoft 365 organization, reads the files in its SharePoint sites and in each person's OneDrive, and lists the people in its directory. It holds the Microsoft Graph application permissions Mail.Read, Calendars.Read, User.Read.All, and Sites.Read.All of the shared Microsoft application, so the agent reads as that application, not as a person. Access is read only. The connection's spec.json gets the base URL https://graph.microsoft.com/v1.0 and GET users as its test operation.

A Global Administrator or a Privileged Role Administrator of the organization connects it. A role assigned through Privileged Identity Management must be active during the sign-in. Cloud Application Administrators and Application Administrators cannot grant Microsoft Graph application permissions, and any account without one of the two roles gets OAUTH_ADMIN_REQUIRED. On the consent screen, the administrator accepts for the organization and ticks "Consent on behalf of your organization" when the screen shows it.

The organization is taken from the sign-in, so an Amodal organization can connect only its administrator's home Microsoft 365 organization. The authorized account is that Microsoft 365 organization, so reconnect requires an administrator of the same organization. Amodal keeps no token of the administrator: it acquires app-only tokens with client credentials, and the connection keeps working after the administrator's account changes or is removed.

A 403 on the test operation means the consent lacks the application permissions. An administrator grants them in the Microsoft Entra admin center under Enterprise applications, the Amodal application, Permissions, "Grant admin consent", or at https://login.microsoftonline.com/organizations/adminconsent?client_id=<client ID>, and then reconnects.

Consent covers the permissions the shared application held when the administrator gave it. An organization whose consent does not include Sites.Read.All stays connected, because the test operation passes without that permission. It reads mail and calendars, and gets a 403 on SharePoint and OneDrive paths only. An administrator of that organization reconnects: the sign-in sends prompt=consent, so the consent screen appears again and lists Sites.Read.All. Reconnecting leaves the connection's policy.json, surface.md, and rules.md as the repository holds them. The agent uses the SharePoint and OneDrive paths once those files describe them.

The connection lists sites, document libraries, and the files in a library or in a person's OneDrive, and reads each file's metadata. A file's content is downloaded from the item's @microsoft.graph.downloadUrl, a short-lived URL on a SharePoint host that takes no token. The connection reaches only graph.microsoft.com, so a custom tool fetches that URL.

The sign-in requests https://graph.microsoft.com/.default, so the consent screen lists every permission on the shared application, including the delegated permissions of microsoft-outlook. Granting them for the organization lets its users connect microsoft-outlook without a consent prompt of their own. Outlook still signs each user in and reaches only that user's mail and calendar. Conversely, granting tenant-wide consent for Outlook in the Microsoft Entra admin center also grants the application permissions. Amodal uses them only for an Amodal organization whose administrator connected this provider.

Disconnect deletes the stored token. The consent stays in the Microsoft 365 organization until an administrator removes the Amodal enterprise application, which also ends the organization's Outlook connections.

The organization can limit which mailboxes the application reaches with Exchange Online RBAC for Applications or application access policies.

Platform operators configure the provider on the registration behind MICROSOFT_CLIENT_ID:

  1. Under API permissions, choose Add a permission, Microsoft Graph, Application permissions, and add Mail.Read, Calendars.Read, User.Read.All, and Sites.Read.All. Do not grant admin consent there: that applies only to the platform's own tenant, and each customer's administrator consents at sign-in.
  2. Under Token configuration, choose Add groups claim, select Directory roles, and include it in the ID token. This sets groupMembershipClaims to DirectoryRole, so ID tokens carry the wids claim. Without it every administrator gets OAUTH_ADMIN_REQUIRED. Outlook requests no ID token, so the claim does not affect it.
  3. Keep the delegated permissions of microsoft-outlook on the list. The supported account types, the redirect URI, and the client secret are the ones Outlook uses, and the provider needs no other platform variables.
  4. Complete steps 1 and 2 before deploying a platform version that ships the provider. It appears wherever MICROSOFT_CLIENT_ID and MICROSOFT_CLIENT_SECRET are set.

Egnyte

egnyte is a managed provider for one Egnyte domain per connection. The domain is the name before .egnyte.com: for https://baypoint.egnyte.com, enter baypoint. Studio writes https://<domain>.egnyte.com/pubapi as the base URL in spec.json. The platform takes the OAuth host from that base URL and accepts only https://<label>.egnyte.com, where the label is lowercase letters, digits, and inner hyphens. The client secret and tokens therefore reach only that domain.

Changing the domain in spec.json and deploying marks the connection as changed. Reconnect then approves the new host and requires authorizing an account again.

The authorized account is the username that GET /v1/whoami returns, so reconnect requires the same Egnyte user. The test operation lists /Shared.

The connection requests two scopes:

  • Egnyte.filesystem lists, reads, searches, uploads, moves, and deletes the files and folders the signed-in user can reach, and reads file system events. Egnyte has no read-only file access. Moves, copies, new folders, and deletes ask for confirmation.
  • Egnyte.audit reads the audit stream, which records previews, downloads, and other file actions by user. It answers only for an Egnyte admin, or a power user with the "can run reports" role, on a plan with audit reporting. Other users get HTTP 403.

Access tokens last 30 days and refresh automatically. Disconnect deletes the stored tokens and does not revoke them at Egnyte; users revoke the application in their Egnyte settings. Downloads return text formats only, and uploads write the JSON request body, so the connection cannot upload text, spreadsheet, or Office files.

With the CLI, pass the base URL to both add and configure:

amodal connections add files --provider egnyte --rest https://baypoint.egnyte.com/pubapi
amodal connections configure files --managed egnyte --rest https://baypoint.egnyte.com/pubapi --agent AGENT_ID

The CLI writes only spec.json. Studio also writes the policy, surface, and rules.

Platform operators register an API key at developers.egnyte.com for an application that other Egnyte domains use. Set <platform API URL>/api/oauth/callback as its redirect URI and request the Egnyte.filesystem and Egnyte.audit scopes. Then set EGNYTE_CLIENT_ID to the API key and EGNYTE_CLIENT_SECRET to its secret on the platform. Until Egnyte approves the key for production, only the domain registered with it can connect. Editing the provider's config block for anything other than adding scopes disables every Egnyte connection until it reconnects.

Recipes

Google Analytics 4 with your own application

Register a Google OAuth web application and enable the Analytics Data API:

{
  "label": "Analytics account",
  "grantType": "authorization_code",
  "issuer": "https://accounts.google.com",
  "discoveryUrl": "https://accounts.google.com/.well-known/openid-configuration",
  "clientId": "YOUR_CLIENT_ID",
  "tokenAuthMethod": "client_secret_post",
  "scopes": ["openid", "https://www.googleapis.com/auth/analytics.readonly"],
  "resourceOrigins": ["https://analyticsdata.googleapis.com", "https://openidconnect.googleapis.com"],
  "authorizationParameters": { "access_type": "offline" },
  "accountUrl": "https://openidconnect.googleapis.com/v1/userinfo",
  "accountIdPath": "sub"
}

openid and the account lookup identify the account on reconnect; the broker does not use the ID token as the user's identity. access_type: offline obtains a refresh token. Add prompt: "consent" only when reconsent is needed.

Test against a real property. For property 123456789:

{
  "baseUrl": "https://analyticsdata.googleapis.com/v1beta",
  "auth": { "type": "oauth2" },
  "test": {
    "method": "POST",
    "path": "properties/123456789:runReport",
    "body": {
      "dateRanges": [{ "startDate": "yesterday", "endDate": "yesterday" }],
      "metrics": [{ "name": "eventCount" }],
      "limit": "1"
    }
  }
}

An empty successful report verifies access. An account without access to the property fails the test even when OAuth connects.

GitLab

{
  "label": "GitLab account",
  "grantType": "authorization_code",
  "issuer": "https://gitlab.com",
  "discoveryUrl": "https://gitlab.com/.well-known/openid-configuration",
  "clientId": "YOUR_CLIENT_ID",
  "tokenAuthMethod": "client_secret_post",
  "scopes": ["read_api", "read_user"],
  "resourceOrigins": ["https://gitlab.com"],
  "accountUrl": "https://gitlab.com/api/v4/user",
  "accountIdPath": "id"
}

With base URL https://gitlab.com/api/v4, use GET user as the test.

Auth0 client credentials

Create a machine-to-machine application authorized for the API, with token authentication set to Client Secret (Post):

{
  "label": "Reporting service",
  "grantType": "client_credentials",
  "issuer": "https://YOUR_TENANT.us.auth0.com/",
  "tokenUrl": "https://YOUR_TENANT.us.auth0.com/oauth/token",
  "clientId": "YOUR_CLIENT_ID",
  "tokenAuthMethod": "client_secret_post",
  "scopes": ["read:reports"],
  "resourceOrigins": ["https://YOUR_API_HOST"],
  "tokenParameters": { "audience": "YOUR_API_IDENTIFIER" }
}

The audience is the Auth0 API identifier, and the resource origin is the API host. This grant has no account lookup or browser consent; expired tokens are reacquired with client credentials.

Troubleshooting

  • Revoked credentials or reduced consent: reconnect the account.
  • Configuration revision errors: approve the intended oauth.json by reconnecting.
  • Resource permission failures: grant the account access to the selected resource.
  • An approved scope that returns 403: enable the matching API in the provider's project.

Error messages include safe codes and correlation IDs. Token values never appear in diagnostics.

Shared agents with personal MCP accounts

Use one agent definition for the company, with separate authenticated employee sessions. In the hosted Studio connection page, Approved employee tools defines which MCP endpoints and individual tools employees may use. These approvals apply only to an agent with MCP governance turned on.

AccessAccount usedEmployee setupAllowed operations
Company readsAdministrator-configured company accountSign in to the agentExplicitly approved read tools
Personal toolsThat employee’s OAuth grantConnect the approved integration in ConnectionsApproved reads and confirmed changes
Shared storesAgent-level store marked shared: trueSign in to the agentReads; end-user writes are refused
Private stores and memoryEmployee scopeSign in to the agentScope-specific access

For a CRM, use two named connections such as crm-reference and crm-personal, even if they use the same MCP server. Approve only company-safe queries on the former, and employee actions on the latter. Do not place restricted deals in a shared store or expose them through a company account with broader access than the allowed employees. Keep restricted records behind source-enforced permissions, using personal read connections where needed. The catalog controls tools and employee roles; it does not invent record-level permissions for the upstream service.

Administrator setup

  1. On the Connections page, turn on MCP governance. The confirmation lists the MCP connections that have no approved access policy and stop working. Access policies cannot be saved while governance is off.
  2. Configure the named MCP connection’s OAuth application in Studio. Authorize an admin discovery account so Studio can list the tool contracts without executing them.
  3. In Approved employee tools, choose Company account — reads only or Each employee’s personal account, and the approved HTTPS endpoint (Streamable HTTP; an SSE policy is refused when employees use it).
  4. Discover and review each tool’s description and inputs, then check only the tools you approve. Classify personal operations as reads or changes. Changes always require confirmation. Provider readOnlyHint annotations do not grant approval.
  5. Optionally restrict connection and tool access to roles: the organization roles admin, developer and viewer, and the agent collaborator roles owner, editor and viewer. Saving refuses any other role name. Blank roles permit every authenticated employee with access to the agent; tool restrictions further narrow connection access.
  6. Save access, then deploy the agent. A deployment keeps the governance mode it started with, so turning governance on or off takes effect on the next deploy. Until then, the MCP governance switch shows Redeploy needed and links to the deploys page. Approve every needed connection before employees depend on them. MCP connections without OAuth cannot be approved.

Use a company account whose upstream permissions are actually read-only and limited to company-shareable data. Labeling an arbitrary SQL or HTTP tool as read-only does not constrain what the remote implementation can do.

Employee setup

Employees open Connections in the standard chat app. Company read connections need no personal consent. For a personal integration, select Connect, follow the authorization link, sign in as the same Amodal employee who began the flow, and consent at the provider. Refresh the list and start a new chat to load the newly available tools. Disconnect revokes that employee’s grant without changing other employees or the company account.

Custom apps can use usePersonalConnections() from @amodalai/react, inside AmodalProvider. It exposes data, isLoading, error, refetch(), connect(name), disconnect(name) and cancel(), and runs the authorization flow. connect resolves to { status: 'complete' } when no authorization is needed, or to { status: 'pending', authorizeUrl, expiresAt }. While an authorization is open, pending holds { name, authorizeUrl, expiresAt }; open that URL on a user click. The hook refetches every 5 seconds until the connection reports connected or expiresAt passes, an ISO 8601 time that defaults to ten minutes after the connect when the platform omits it. outcome holds { name, kind } for the last result, with kind set to connected, disconnected or expired. busy names the connection a connect or disconnect is running for. cancel() drops the open authorization and stops polling. The hook also refetches when the window regains focus. unsupported is true when the runtime serves no personal connections or answers that sign-in is required or the service is unavailable; hide the feature then. Pass { pollInterval } in milliseconds to refetch in the background as well. A failed refetch keeps the last data next to error, and error.status holds the HTTP status of a failed request. connect and disconnect reject with the server's message on failure. Requests go to the runtime’s /api/my-connections; the backend derives ownership from the authenticated caller. The hosted edge rejects cross-origin cookie authentication; cross-origin SDK apps must send an employee bearer token and use the runtime’s configured CORS policy. Employees cannot submit their own endpoint, tool approval, owner ID, or OAuth application.

Enforcement and rollout

  • The platform stores personal grants encrypted, keyed by organization, agent, connection and employee. The OAuth application can be shared; tokens and MCP sessions cannot cross employees.
  • Tool approvals pin the advertised name, description, input/output schemas and annotations. New or changed tools are unavailable until reviewed. The runtime reaches a governed connection only through the platform’s MCP endpoint for that connection and never receives its token. For every tool list and call, the platform checks membership, policy and account state, opens a new session to the MCP server with the employee’s token, compares each tool’s contract with its approval in that same session, and refuses or omits any that changed, then calls. Tool lists are read when a chat starts; a tool that changes mid-chat is refused and removed from that chat. An intent acting for an employee may call approved reads only.
  • Revocation blocks subsequent tool calls in existing chats; it cannot undo a request already sent to the provider. Newly enabled tools/accounts require a new chat. Failed writes are not automatically retried by the credential transport.
  • A chat continued by another caller, such as an organization API key, runs with that caller’s tools and keeps its history. Only the employee whose personal tools a running turn holds can approve its confirmations or add messages to it.
  • Company grants cannot back approved write tools. Personal writes use the runtime’s existing confirmation flow. The platform records policy changes, account actions and each tool call’s outcome once the MCP server answers, even after the chat stopped waiting, in mcp_access_events; tokens and arguments are not written there.
  • The platform MCP endpoints accept only a live deployment service credential. That credential identifies the agent, never the employee. The runtime exchanges the caller’s own sign-in token for a grant that expires after 15 minutes, and the platform names the employee only after it verifies that token for this agent. Each request also carries the employee’s grant. Browser runtime tokens cannot call these endpoints, and runtime client tokens minted for embedding never name an employee. Governed connection names are also blocked on the legacy runtime OAuth resolver.
  • MCP governance is a per-agent setting, off for new agents. While it is on, only connections with an enabled access policy and their approved tools run, and every MCP server in the agent's own configuration is ignored. While it is off, the agent uses its own MCP configuration and access policies cannot be saved. Each change of the setting is recorded in mcp_access_events as governance_enabled or governance_disabled.

Governed connections support hosted employees identified by an Amodal user ID or linked WorkOS subject, and remote OAuth MCP servers. Anonymous callers and shared SDK agent identities receive no governed connections. Automations and other background runs receive none either, because their tokens name no employee. Personal API-key/bearer entry, arbitrary external-IdP identity linking, service-principal policies and per-deal ACL management are not included. Company-wide Microsoft application grants and the managed Slack bot grant cannot be configured as personal accounts; use a user-delegated OAuth application instead.