Skip to main content

Get started with Clerk and eve

Built by Vercel, eve is a filesystem-first framework for durable AI agents. Identity, channels, instructions, tools, and subagents all live in conventional files you can read, diff, and version like any other code.

Clerk and eve fit together through four common patterns:

  • Custom channel auth — accept any Clerk token type at the channel boundary and map it to an eve principal.
  • API keys & M2M — API key callers and machine-to-machine calls between agents.
  • Authorize tool calls — permission checks inside execute, plus brokered OAuth for tools that need provider tokens.
  • Enrich instructions — rebuild the system prompt per session from the authenticated caller.

Each guide starts with a shadcn-installable helper, then builds the pattern from scratch if you'd rather wire it up yourself.

Install the helpers via shadcn

The clerk/eve-agents repo doubles as a shadcn GitHub registry that exposes clerkAuth(), clerkInstructions(), clerkM2MToken(), clerkConnect(), and clerkOAuthToken() as a single drop-in.

terminal
bunx --bun shadcn@latest add clerk/eve-agents/auth

The helpers land at lib/clerk-auth/:

lib/clerk-auth/
├── index.ts        # clerkAuth and related types
├── instructions.ts # clerkInstructions
├── m2m.ts          # clerkM2MToken
└── connect.ts      # clerkConnect, clerkOAuthToken

Try the demo

Clone clerk/eve-agents for a working monorepo that exercises every pattern in one place:

terminal
git clone https://github.com/clerk/eve-agents.git
WorkspaceWhat it shows
apps/dashboardChat UI with a colocated main agent.
apps/project-agentRemote subagent reachable only via M2M.
packages/clerk-eve-authClerk helpers shipped through the shadcn registry.

Boot the dashboard, sign in, and switch between Session, API key, and Unauthenticated flows in the UI to watch each path behave differently. Ask the agent to list your GitHub repositories to trigger the OAuth connect flow; ask it to archive a project to watch M2M delegation in action.

Detailed walkthroughs

Start with Custom channel auth — it produces the eve principal every other pattern reads. From there, layer on API keys & M2M for programmatic and agent-to-agent callers, Authorize tool calls to gate tools and broker provider OAuth, and Enrich instructions to personalize the system prompt per caller.

Feedback

What did you think of this content?

Last updated on