# How to let AI agents act on behalf of users without handing them access tokens

DevFeed: [How to let AI agents act on behalf of users without handing them access tokens](<https://devfeed.tech/articles/how-to-let-ai-agents-act-on-behalf-of-users-without-handing-them-access-tokens-16013.md>)

Original publisher: [Read original article](<https://workos.com/blog/delegated-access-for-ai-agents>)

Author: WorkOS

Published: 2026-08-10T00:00:00Z

Content type: tutorial

Language: en

Sources: [WorkOS Blog](<https://devfeed.tech/sources/workos-blog.md>)

Topics: [OAuth](<https://devfeed.tech/topics/oauth.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Application Security](<https://devfeed.tech/topics/application-security.md>), [Security](<https://devfeed.tech/topics/security.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [application-security](<https://devfeed.tech/tags/application-security.md>), [logging](<https://devfeed.tech/tags/logging.md>), [oauth](<https://devfeed.tech/tags/oauth.md>), [observability](<https://devfeed.tech/tags/observability.md>), [security](<https://devfeed.tech/tags/security.md>)

## AI overview

This article explains why giving AI agents long-lived OAuth access tokens creates security risks. It describes how untrusted content can influence agent behavior and cause tokens to appear in context windows, tool-call logs, model-provider logs, and other unintended locations.

## Source excerpt

Agents that call third-party APIs on behalf of users normally hold the OAuth access token. Here is where that token leaks, and how to get delegated access without it.