---
title: "Authentication"
description: "Machine-to-machine and delegated authorization for agents"
url: "https://agentsurface.dev/docs/authentication"
lastVerified: 2026-09-24
lastModified: 2026-09-25T09:21:34.000Z
---



## Summary [#summary]

Authentication covers how agents receive credentials, prove identity, narrow authority, and call protected APIs or MCP servers without borrowing a human browser session.

* **Owns:** API keys, OAuth for agents, token exchange, DPoP, agent identity, MCP auth metadata, `auth.md`, and replay protection.
* **Does not own:** tool safety semantics; see [Tool Design](/docs/tool-design). Public discovery broadly; see [Discovery](/docs/discovery).
* **Agent-ready means:** credentials are scoped, short-lived where possible, machine-usable at runtime, validated on every request, and auditable by agent/user/delegation chain.

Registration can still involve human consent or an OTP claim ceremony. The runtime request path should stay programmatic: no CAPTCHA, login page, or ambient session cookie dependency.

## Choose A Path [#choose-a-path]

* [API Keys](/docs/authentication/api-keys) - Only when keys are scoped, rotatable, and not exposed to models.
* [OAuth 2.1 for Agents](/docs/authentication/oauth-for-agents) - Default for standalone agent services and machine-to-machine access.
* [Agent Identity](/docs/authentication/agent-identity) - Model agents as first-class principals for audit trails.
* [Token Exchange](/docs/authentication/token-exchange) - Narrow authority for delegation and sub-agents.
* [DPoP](/docs/authentication/dpop) - Bind tokens to client keys to reduce replay risk.
* [Protected Resource Metadata](/docs/authentication/protected-resource-metadata) - Publish OAuth metadata for protected APIs.
* [MCP Authorization](/docs/authentication/mcp-auth-model) - Apply OAuth discovery and client identity to MCP.
* [auth.md](/docs/authentication/auth-md) - Describe agentic registration and credential-claim flows.
* [Idempotency and Replay Protection](/docs/authentication/idempotency-and-replay) - Defend write operations from duplicated or replayed requests.
* [Auth Anti-Patterns](/docs/authentication/anti-patterns) - Avoid browser sessions, unscoped tokens, and hidden delegation.

## Related [#related]

* [API Surface](/docs/api-surface) - Contracts that declare which authenticated operations exist.
* [MCP Servers: Authentication](/docs/mcp-servers/authentication) - Implementing auth inside MCP servers.
* [Discovery: Well-Known Endpoints](/docs/discovery/well-known-endpoints) - Publish metadata endpoints agents can discover.
* [Error Handling](/docs/error-handling) - Return structured auth failures agents can interpret.
