Shared Token or Per-User OAuth for AI Agents? Use This Gate
A support agent needs to read tickets and occasionally apply a label. One team can give the application a service credential. Another can delegate the signed-in operatorβs permissions. Removing a departing operator expos
A support agent needs to read tickets and occasionally apply a label. One team can give the application a service credential. Another can delegate the signed-in operatorβs permissions. Removing a departing operator exposes the practical difference: which actions can still run, and under whose authority?
Start with one row per action, even if the same integration implements several. βSearch ticketsβ might expose confidential records. βWrite labelβ might trigger an external workflow. Read/write alone does not establish the impact.
| Question | What to put in the decision record |
|---|---|
| Who is allowed to request the action? | A user, a scheduled workload, or both, and who verifies that fact |
| What identity does the target enforce? | End user, workload instance, or a service shared by all callers |
| How much can that identity reach? | Resources and operations, including tenant boundaries |
| How is access removed? | Owner, grant or key to revoke, and how outstanding work behaves |
| What evidence survives? | A request identifier linking the initiating principal and downstream outcome |
For a nightly export, a narrowly scoped workload identity may be a better fit than borrowing one employeeβs grant. For a user-triggered label change that must obey the userβs ticket permissions, delegated access is a natural choice if the target enforces those permissions. A shared credential can still be appropriate when the service itself is the authorized principal and an upstream service independently authenticates and authorizes every request. It cannot, by itself, tell the target who clicked a button.
Test revocation where the action happens
In a test tenant, revoke a test grant using the supported control. Record when the control acknowledges it and when the target first refuses a previously permitted harmless request. Include a queued request that was accepted by the application before revocation. Test refresh and access tokens independently where applicable. An audit-log subject proves attribution only if you can tie it to the actual authorization decision.
OAuth token revocation permits propagation delay, and the treatment of related tokens depends on token type and server policy. Document the observed behavior of the specific provider. Repeat the check when scopes, caching, job duration or offboarding change. RFC 7009.
This article was created with AI assistance.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.