Skip to main content
Actions connect your agents to external systems. Simple provides encrypted configuration variables for credentials and managed OAuth connections for service-to-service APIs, so you can keep authentication separate from conversation inputs and Action source code.

Choose an Authentication Method

Managed OAuth Connections

An OAuth connection is a reusable configuration owned by your organization. In your Code Action, you explicitly choose the connection to use on each fetch that needs authentication. Saving a connection or making it available to an Action does not add credentials to requests automatically. A fetch without an explicit connection selection receives no managed OAuth credential, even when its URL matches a saved connection’s allowed origins. Simple does not infer the credential from the destination or reuse the selection from a previous fetch. When you choose a connection for a request, Simple manages its token exchange and renewal. Your code selects the connection without copying its client secret or access token into source code. The supported grant is OAuth 2.0 client credentials (client_credentials): your agent acts on behalf of a service account or application. This does not implement a user’s browser sign-in, authorization-code callback, or refresh-token grant.

Create a Connection

  1. Open Configuration → OAuth Connections and add a connection.
  2. Enter a descriptive name and the provider settings below.
  3. Save the connection and use its test control to verify that the provider issues a token.
Extra token parameters and other connection settings are readable configuration. Put the client secret in its dedicated field; do not store additional secrets in descriptions, URLs, or extra token parameters.

Choose Authentication on Each Fetch

For every fetch in your Code Action, decide whether it needs managed authentication and explicitly choose the saved connection if it does. Selection applies only to that request. For example, a Code Action that calls the same CRM API twice can:
  • Fetch a public endpoint without choosing authentication. No managed OAuth token is added.
  • Fetch a protected account endpoint and explicitly choose the Production CRM connection for that request.
A second authenticated fetch must choose its connection again. Allowed origins constrain where the selected credential may be sent; they do not select or enable authentication. Simple continues to handle the selected connection’s token lifecycle and keeps managed secrets out of Action code.

Example: Choose an OAuth Connection in Code

With a saved OAuth connection named production-crm that allows https://api.example.com, explicitly choose it for the request:
Each auth.fetch explicitly names the saved OAuth connection. Simple handles token acquisition, renewal, and secure attachment for that request. Another authenticated request must select its connection again. Ordinary fetch(...) receives no managed OAuth credentials.

How Tokens Are Obtained and Renewed

  1. Your code explicitly selects a connection for the fetch. Simple verifies that the selected connection exists, belongs to the organization executing the Action, and permits the destination origin.
  2. Simple reuses a cached token when it is sufficiently far from expiry. Otherwise, it exchanges the stored client credentials at the provider’s token endpoint.
  3. The access token is encrypted before it is cached. Concurrent requests coordinate token renewal to reduce duplicate exchanges.
  4. Simple attaches the selected connection’s token only to that explicitly authenticated request. Other fetches receive no managed OAuth credential unless they also select a connection.
Simple stops reusing a cached token within 60 seconds of its expiry and obtains a replacement when needed. Renewal is another client-credentials exchange; it does not use a refresh token or run as a continuous background refresh. If the provider omits an expiry, Simple uses a five-minute lifetime for cache decisions. Cache lifetime is capped at six hours. Editing a connection invalidates its cached token, including when you change its secret, scopes, or token endpoint. Deleting a connection invalidates its cache too. A request selecting a missing connection must fail rather than silently continue without the requested authentication.

Restrict Where Tokens Are Sent

Allowed origins match the exact HTTPS scheme, hostname, and port. For https://api.example.com:
  • Requests to https://api.example.com/orders and /customers may use the connection when the fetch explicitly selects it.
  • Requests to a different subdomain, lookalike hostname, non-default port, or an HTTP URL do not qualify.
  • Paths are not an access boundary: entering a URL with a path stores its origin. Each fetch must still explicitly choose the connection.
Only allow API origins you trust to receive the credential. An allowed origin is a destination restriction, not an instruction to include credentials. Token attachment requires an explicit connection selection on that fetch. Limit the token’s actual permissions with the provider’s scopes and service-account permissions.

How Credentials Are Stored and Protected

Managed OAuth Credentials

  • Encryption at rest: client secrets and cached access tokens use AES-256-GCM authenticated encryption.
  • Write-only secrets: the client secret is accepted when creating or updating a connection, but is excluded from connection read responses. Those responses also exclude access tokens.
  • Organization isolation: connection lookup and execution check organization ownership. Configuration read and write permissions control connection management.
  • Runtime separation: Simple performs token exchange and header attachment outside the Code Action execution environment. The managed client secret and token are not supplied to the Action as inputs or configuration values.
  • Safe test results: connection tests report success, token type, and expiry information rather than returning the access token. Provider response bodies and free-form OAuth error descriptions are omitted from token-exchange errors.
These protections cover Simple’s credential handling. The destination API receives the access token, so use trusted destinations and avoid endpoints that reflect request credentials in their responses.

API Keys and Other Configuration Secrets

For credentials you use directly, open Configuration Variables, add a named value, mark it sensitive with the lock control, and save it. Use names such as CRM_API_KEY or BASIC_AUTH so Actions can reference them without embedding values in source code. All configuration-variable values are encrypted at rest with AES-256-GCM. Marking a variable sensitive additionally omits its saved plaintext from configuration read responses. Variable names and descriptions remain visible, so keep secrets in the value field. Configuration edits record which variable names and fields changed without recording their values in the configuration audit event. An HTTP Action references a variable with {{ config.CRM_API_KEY }}. A Code Action reads it as config.CRM_API_KEY. Unlike managed OAuth credentials, these values are available to the Action at runtime. Do not print them, return them as outputs, or interpolate them into conversation prompts. Marking a value sensitive does not make arbitrary Action code safe to log it.

Rotate or Revoke Credentials

To rotate an OAuth client secret, edit the connection and enter the replacement secret. Leaving that field empty preserves the stored secret. Saving the replacement invalidates the cached token so a subsequent execution exchanges the new credentials. For an API key, replace the sensitive configuration variable’s value. Keep the same name to preserve Action references. Remove unused connections and variables, and revoke old credentials with the provider. Deleting a connection in Simple does not revoke a token that the provider has already issued.

Test Authentication

First test the OAuth connection to confirm the credentials can obtain a token. Then run the Action’s test panel to confirm that the selected connection, allowed origin, provider permissions, and API request work together. A successful token test alone does not prove access to a particular API endpoint.

API Keys and Bearer Tokens

Use the header name and format required by the destination API. Common HTTP Action configurations are: Choose the matching header for your provider; you do not need to send all three. A Code Action can set the same headers with fetch:
If the provider requires a key in a query parameter or request body, use that location instead. Prefer headers when the provider supports them, and use HTTPS.

Mutual TLS (mTLS)

mTLS authenticates the client with a certificate and its corresponding private key during the TLS connection. It can also be used with OAuth, as described in OAuth mutual TLS. Actions currently do not expose customer-provided client certificates or private keys for outbound requests. Adding a certificate to an HTTP header or configuration variable does not enable mTLS. To reach an API that requires mTLS, have the Action call an HTTPS endpoint in your own middleware. Authenticate that request with a supported method, such as an API key, and configure your middleware to present the client certificate when it calls the destination API. Certificate provisioning, renewal, and private-key storage belong in that middleware.

Other Authentication Methods

For calls to Simple AI itself, use the handler’s client: it is already authenticated for your organization. External services still require their own credentials.
Last modified on September 28, 2026