Prerequisites
- Use an authenticated board session. Agent API keys cannot start or complete
OAuth. In
local_trusted, the synthetic local operator is supported. - Set one stable
BETTER_AUTH_SECRETfor authenticated deployments.AOA_AGENT_JWT_SECRETis the supported fallback, but multi-instance systems must use the same stable value on every replica. Rotating the effective key invalidates outstanding flows and stored OAuth bundles; disable and reauthorize affected connectors. - Configure the public callback origin with
AOA_AUTH_PUBLIC_BASE_URL(or the documented auth base URL fallback). The provider-registered redirect URI must match<public-origin>/api/mcp-connectors/oauth/callbackexactly. - When AoA is behind a reverse proxy, configure
AOA_TRUST_PROXYto the known hop count or trusted CIDRs. Do not use unrestricted trust on a directly exposed server; OAuth rate limiting and request identity depend on correct client-IP resolution. - Keep
AOA_SECRETS_MASTER_KEY_FILEstable, backed up, and available to every replica that can read the same database. Losing or changing that key makes existing local-encrypted OAuth credentials undecryptable; restore the key or revoke and reauthorize the affected connectors. - Keep
AOA_MCP_CONNECTORS_ENABLED=true.AOA_MCP_CONNECTOR_DENYLISTcan block individual server names immediately during an incident.
Authorize and verify
- Open Marketplace → Connectors and install a verified OAuth connector.
- Select Connect. Complete provider sign-in in the provider window; never send the authorization URL or code to an agent.
- Return to AoA. A successful callback shows the connector as active. A denied or failed callback is terminal and offers a retry; it must not remain on “Checking…” indefinitely.
- In Settings → Agents, enable the connector for one test agent.
- Run a read-only tool-list/search smoke test against disposable provider data. Confirm the activity log contains authorization and tool-use entries without tokens, codes, cookies, or authorization query strings.
Test refresh safely
The force-expiry command is dry-run by default and targets one company, connector, and expected secret version. It resolves the active external or running embedded database automatically.--confirm-production when NODE_ENV=production. After apply, make one new
read-only agent request. Exactly one new credential version and one redacted
refresh activity should appear.
Incident rollback
Rollback is data-destructive and must precede starting an old binary that cannot understand OAuth v2 bundles.- Set
AOA_MCP_CONNECTOR_DENYLIST=notion,sentryfor the affected bundled providers, or setAOA_MCP_CONNECTORS_ENABLED=false, and restart/reload the deployment so delivery fails closed. - Take and verify a database backup.
- Run a company-scoped dry run. Review connector IDs and counts.
- Apply with the same fail-closed environment present, then run
--verify. - Revoke the provider grants before starting the old binary.
--all-companies --instance-id=<active-instance-id> and
uses that instance ID as the --confirm value. --maintenance-confirmed means
every running server was actually drained or restarted with the fail-closed
policy; the CLI environment alone is not proof. Production apply also requires
--confirm-production. The command archives only exact AoA-managed,
local-encrypted secrets whose company, connector binding, catalog identity,
policy version, purpose, owner, and name all match. It leaves collisions and
transplanted metadata untouched. Verification exits 0 when safe and 2 when
matching active data remains.
Troubleshooting
For evidence, record only connector/company IDs, version numbers, fixed reason
codes, counts, and timestamps. Scan logs and artifacts for access/refresh tokens,
authorization codes, cookies, signing keys, and authorization query strings before
sharing them.