Home / Companies / Merge / Blog / Post Details
Content Deep Dive

7 best practices for authentication in AI agents

Blog post from Merge

Post Details
Company
Date Published
Author
Tim Bourcier
Word Count
1,763
Company Posts That Month
2
Language
English
Hacker News Points
-
Post removed?
No
Summary

AI agents that act on users’ behalf should use delegated, per-user OAuth 2.0 credentials with authorization code flow and PKCE whenever possible, ensuring that agents inherit only the permissions of the individual they represent and preserve clear audit attribution. Credentials should remain outside model prompts, tool inputs, and responses, with infrastructure attaching tokens only at execution time to prevent exposure through prompt injection, logging, or model providers. Security boundaries should be enforced through narrowly scoped grants rather than system prompts, while credentials should be encrypted, isolated by user, connector, and tenant, and never stored in process-wide environment variables. The guidance also recommends short-lived access tokens, server-side refresh handling with rotation and concurrency safeguards, and distinct handling for expiration versus revoked access, including pausing work and alerting users when permissions are removed. Teams should test failure scenarios such as expired tokens, revoked grants, missing scopes, and cross-user credential requests to ensure agents fail visibly and safely, while shared service accounts should be reserved for limited, low-sensitivity team use cases.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
AI Agents 14 5,590 1,409 270 -6%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.