Authdog

API keys and M2M for Claude Agent SDK

Last updated Oct 22, 2026
View as Markdown

The hook reads a token the host stored for the run. The client secret stays in the process that minted the token. Do not put the bearer in tool input. The model can see tool input.

The exchange is in Agent frameworks.

Which credential

Credential Use it when
Agent identity A named agent inside a project that already has users. Agents is sales-gated until access is approved.
M2M application The caller is a job, or Agents access is not approved yet. Same client_credentials grant.
Personal access token One person's script. Keep it off an unattended caller.
Service account Authdog REST automation. Not the bearer this hook checks.

To act for a person, keep this hook and present an RFC 8693 token. sub stays the user. act names the agent. The planned sample uses a token whose subject is the agent.

Read To learn how to
Custom channel auth for Claude Agent SDK Refuse a missing bearer
Machine identity Choose the credential
Claude Agent SDK See the hook

Learn more