Delegated agent access and the Connected apps page
When an end user lets an AI assistant act for them in your product, the platform records one agent connection: one user, one workspace (tenant), one agent client. The connection is what the user sees on their Security page under Connected apps, what your organization admins can review and shut off, and what your resource server or MCP gateway checks on every call.
What an agent can do
An agent can only do what the user can do right now, and only in the workspace it was connected to:
effective scopes = scopes granted at consent ∩ the user's current role permissions in that workspace- A token is bound to one workspace. A call that targets any other workspace is refused (
tenant_mismatch), even if the same user belongs to several. - The intersection is recomputed on every check, never cached. Remove a permission from the user's role and the agent loses it on its next call. Remove the user from the workspace and every call is refused (
membership_removed). - Permissions can only shrink after consent. A role that gains permissions does not widen an existing grant.
Checking a call
The MCP gateway and your resource server call AgentConnectionService.ResolveAsync(authorizationId, tenantId) with the token's authorization id (oi_au_id) and the workspace the call targets. It returns the effective scopes or a deny reason: unknown_connection, connection_revoked, tenant_mismatch, tenant_inactive, membership_removed, no_effective_scopes. An allowed call updates the connection's last-used time and call counter.
Who can revoke, and how fast
| Who | Where | Scope |
|---|---|---|
| The user | Security > Connected apps, DELETE /api/v1/account/security/connected-apps/{id} | their own connections |
| Organization admin / ISV | DELETE /api/v1/console/organizations/{orgId}/agent-connections/{id}, or POST .../revoke-client to cut one agent client everywhere | connections in your organization's applications |
Latency: revoking takes effect on the agent's next ResolveAsync call and the refresh token stops working at once; the underlying OAuth authorization and its tokens are revoked in the same step, so introspection also sees it immediately. A self-contained access token that a resource server checks only by signature stays usable until its own lifetime ends (minutes; 10 minutes for metadata-document clients, one hour by default elsewhere). Resource servers that need instant cut-off must check every request with ResolveAsync or, from outside the platform, the introspection route below.
Discovery documents and delegated token claims
/.well-known/oauth-authorization-server (RFC 8414) is the conservative document written for MCP clients and resource servers: PKCE S256 only, authorization_code, refresh_token and client_credentials grants, authorization_response_iss_parameter_supported: true. The OpenIddict-generated /.well-known/openid-configuration on the same host lists the full set the server implements (including the platform's own sign-in grants and private_key_jwt), so its grant_types_supported, token_endpoint_auth_methods_supported and scopes_supported are a superset by design. Both agree that iss is returned on every authorization response (RFC 9207): a client must compare it with the issuer it started from.
A delegated agent token is a signed JWT with: iss, sub (the user), aud (exactly the requested resource), client_id, scope, and oi_au_id (the authorization id used for per-call checks). It carries no act, agent_id or actor claim: the agent is identified by client_id, and the acting user is sub. Do not assume RFC 8693 actor semantics; resolve the tenant and permissions with ResolveAsync or the introspection route below.
Checking a token over HTTP
A resource server outside the platform cannot call ResolveAsync. It asks the platform instead:
POST /api/v1/runtime/oauth/introspect
X-TenancyEngine-Api-Key: te_...
Content-Type: application/x-www-form-urlencoded
token=<the access token>- Credential. An organization API key created from the application (application-level, one application, no allowlist, no tenant binding) that carries the exact scope
oauth.introspect. A workload (environment-bound) key answers only for tokens whose resource is that exact environment.adminandmcp.fulldo not satisfy it. The application is read from the key; the request names none. Give each resource server its own key with only this scope. - Input. The token, and nothing else: any other field (including
tenant_id) is ignored, and the token's own workspace is the only one considered. There is no way to look up an authorization by id. Body at most 16 KiB, token at most 8192 characters, form-encoded only. - What the platform checks, in order: the token's signature, issuer, type (
at+jwt), algorithm (RS256) and expiry with the platform's own keys; then that the token's singleaudis exactly your application's registered resource, before it reads anything else. A token for any other resource, and every malformed, forged, expired, revoked or unknown token, gets the identical answer{"active":false}. For your own tokens it then checks the token and its authorization are valid, the client still exists, is active and belongs to your application, the user is not locked, the workspace is active and in your application, and the membership is current. A token issued to an agent connection is judged byResolveAsync(granted scopes intersected with the user's current role permissions). A token issued to a client identified by a metadata document is judged byAgentConsentService.ResolveAsync, the same call a refresh makes: an unrevoked consent for that user, client, resource and workspace, the user still in an active workspace, the client allowed (strict allowlist) and not blocked by the owning organization; it is also inactive while the metadata-document feature is switched off. - Active answer, exactly these members and nothing else:
{ "active": true, "sub": "<user id>", "client_id": "<client>", "scope": "<space-delimited>", "aud": "<your resource>",
"tenant_id": "<workspace id>", "exp": 1790000000, "roles": ["tenant_admin"] }roles is the user's current role in the workspace (not the one frozen in the token). For an ordinary user token scope is the token's scope; scope narrowing by role exists only for agent connections. There is no email, name, agent_id or act, and no reason for an inactive answer.
- Optional impersonation fields (#1472, contract fixture
current-authority-introspection.fixture.json). When the token was minted by a support impersonation session (a platform operator acting as the member), the answer isactive: truefor as long as that session is active and unexpired, and carries two more members, present only in that case and omitted otherwise:
{ "active": true, "sub": "<the member's user id>", "client_id": "...", "scope": "...", "aud": "...", "tenant_id": "...", "exp": 1790000000,
"roles": ["tenant_admin"], "impersonation": true, "impersonation_session_id": "<session id>" }sub is always the member, never the operator, and the operator's identity (act) is never returned. A session that has ended, expired, is missing or belongs to another member, workspace or application makes the token introspect as inactive. An app that ignores these two fields treats the operator exactly as the member (the SDKs ignore them and do not surface them, so a checker built on them behaves this way). To refuse such tokens outright set OAuthIntrospection:RefuseImpersonationTokens=true on the platform: they then introspect as {"active":false}. It is off by default so support staff can reproduce a customer's problem; an app that must never act on an operator's behalf (for example one that shows a child's records) should ask for it to be on.
- Status codes.
200the answer (active or inactive);400missing, duplicated or oversizedtoken, or a body that is not form-encoded;401no, invalid or expired key;403one generic{"error":"forbidden"}for every credential problem (missing or insufficient scope, wrong key shape, application not active, environment mismatch; no scope name is returned);429rate limited (Retry-After);503the platform could not decide (store or signing-key failure). A failure never answersactive: true. Treat anything but a well-formed200with"active": trueas "do not serve". - No caching on the platform. Every call reads the current state, so a revocation is visible on the next call. Responses carry
Cache-Control: no-store. If you cache a result, keep it to a few seconds. - Limits. Per verified API key (default 600 a minute; a forged or unknown key is counted against its client address instead and never gets a bucket of its own), per client IP (default 1200) and per token (default 60). Calls are audited without the token:
oauth.introspect.deniedfor a revocation or removal,oauth.introspect.foreign_audiencewhen a key presents a token for another resource.
API
User, bearer auth:
GET /api/v1/account/security/connected-appslists the caller's connections with last used and call count.POST /api/v1/account/security/connected-appswith{ "authorizationId", "tenantId" }records the consent for an authorization the user just completed. The authorization must belong to the caller and be valid, the caller must be a member of the workspace, and the client name and scopes come from the registered client and the authorization.DELETE /api/v1/account/security/connected-apps/{id}disconnects.
Organization admin (uniform 403 for anything else):
GET /api/v1/console/organizations/{orgId}/agent-connections?applicationId=DELETE /api/v1/console/organizations/{orgId}/agent-connections/{id}POST /api/v1/console/organizations/{orgId}/agent-connections/revoke-clientwith{ "clientId" }
Audit events: agent_connection.granted, agent_connection.revoked, agent_connection.denied_cross_tenant.