[PR #7998] [CLOSED] PoC: Hire your Agent #7676

Closed
opened 2026-03-13 13:45:18 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7998
Author: @Paola3stefania
Created: 2/16/2026
Status: Closed

Base: canaryHead: agent-auth


📝 Commits (10+)

📊 Changes

44 files changed (+7003 additions, -24 deletions)

View changed files

📝 docs/components/sidebar-content.tsx (+7 -0)
docs/content/docs/plugins/agent-auth.mdx (+913 -0)
📝 packages/better-auth/package.json (+72 -0)
📝 packages/better-auth/src/client/plugins/index.ts (+1 -0)
packages/better-auth/src/plugins/agent-auth/agent-auth-e2e.test.ts (+444 -0)
packages/better-auth/src/plugins/agent-auth/agent-auth.test.ts (+478 -0)
packages/better-auth/src/plugins/agent-auth/agent-client.ts (+351 -0)
packages/better-auth/src/plugins/agent-auth/client.ts (+23 -0)
packages/better-auth/src/plugins/agent-auth/crypto.ts (+108 -0)
packages/better-auth/src/plugins/agent-auth/error-codes.ts (+13 -0)
packages/better-auth/src/plugins/agent-auth/gateway/create-gateway-server.ts (+470 -0)
packages/better-auth/src/plugins/agent-auth/gateway/index.ts (+11 -0)
packages/better-auth/src/plugins/agent-auth/gateway/provider-manager.ts (+243 -0)
packages/better-auth/src/plugins/agent-auth/gateway/providers.ts (+118 -0)
packages/better-auth/src/plugins/agent-auth/gateway/scope-utils.ts (+69 -0)
packages/better-auth/src/plugins/agent-auth/index.ts (+278 -0)
packages/better-auth/src/plugins/agent-auth/mcp-server.ts (+116 -0)
packages/better-auth/src/plugins/agent-auth/mcp-storage-fs.test.ts (+109 -0)
packages/better-auth/src/plugins/agent-auth/mcp-storage-fs.ts (+242 -0)
packages/better-auth/src/plugins/agent-auth/mcp-storage-memory.ts (+59 -0)

...and 24 more files

📄 Description

Summary by cubic

Adds Agent Auth with per‑agent identity, Ed25519 keypair JWTs, scoped roles, and audit logs, plus an MCP Gateway you can run via npx for namespaced tools with strict scope checks. Extends device authorization, adds docs, and introduces CLI + tools to list local agent connections.

  • New Features

    • Agent identity: create/list/update/revoke; Ed25519 keypair auth (simple/AAP JWTs); before‑hook session resolution; key rotation and expiry.
    • Activity + SDK: list and log activity (including MCP gateway tool calls); cleanup expired sessions; Agent SDK for connect flow and JWTs; verifyAgentRequest helper; client plugin export.
    • MCP Gateway/Tools: run with npx better-auth-gateway; provider registry/manager with auto‑config from /agent/gateway-config; namespaced tool discovery; scope checks (provider.tool, provider.*, *); in‑memory or file storage; session via cookie or bearer; list_connections tool and storage APIs; CLI to manage keys and connections.
    • Device auth: adds client_name and authorization_details (RAR). Admin routes to register/list/delete MCP providers; docs page and sidebar entry.
  • Migration

    • Run DB migrations for agent, agentActivity, and mcpProvider tables.
    • Configure Agent Auth options (roles/defaultRole, jwtFormat, session TTL, mcpProviders). Set app URL and secrets for the gateway; choose storage (memory/file) and auth (session cookie or bearer).

Written for commit 56aa723551. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7998 **Author:** [@Paola3stefania](https://github.com/Paola3stefania) **Created:** 2/16/2026 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `agent-auth` --- ### 📝 Commits (10+) - [`62e1a5d`](https://github.com/better-auth/better-auth/commit/62e1a5dd9c075d28a32a76e7497aaaac375616b9) schema and types - [`696ea7d`](https://github.com/better-auth/better-auth/commit/696ea7d55c7648a522ce4ef9af03b756ff911675) just key pair - [`d5032a6`](https://github.com/better-auth/better-auth/commit/d5032a661e434a74104337d33a3ada2aac7a98d2) before hooks - [`eaf69f8`](https://github.com/better-auth/better-auth/commit/eaf69f8f3cda724a4275b92a627089474d3d9130) get auth and fix id - [`75add9b`](https://github.com/better-auth/better-auth/commit/75add9b160d6a5b5f9ba48cff304192a82953484) exports and clients - [`f9d0546`](https://github.com/better-auth/better-auth/commit/f9d0546b1b8c13e039855a07790d950291cdb72f) tests - [`d1ee342`](https://github.com/better-auth/better-auth/commit/d1ee342fed9925ac0a466b0b179b200e5fe1eed0) Merge branch 'canary' into agent-auth - [`eabec78`](https://github.com/better-auth/better-auth/commit/eabec788f949a4eb4ecf7b4e206fedec95d6a7fa) docs abd bug - [`76b6ce9`](https://github.com/better-auth/better-auth/commit/76b6ce95e9d906ea4b725852ed1ac67123d7c5b6) add test - [`28218fb`](https://github.com/better-auth/better-auth/commit/28218fb3e9f4bcd3d4c27e29ce5df8edc53d61d5) local mcp ### 📊 Changes **44 files changed** (+7003 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `docs/components/sidebar-content.tsx` (+7 -0) ➕ `docs/content/docs/plugins/agent-auth.mdx` (+913 -0) 📝 `packages/better-auth/package.json` (+72 -0) 📝 `packages/better-auth/src/client/plugins/index.ts` (+1 -0) ➕ `packages/better-auth/src/plugins/agent-auth/agent-auth-e2e.test.ts` (+444 -0) ➕ `packages/better-auth/src/plugins/agent-auth/agent-auth.test.ts` (+478 -0) ➕ `packages/better-auth/src/plugins/agent-auth/agent-client.ts` (+351 -0) ➕ `packages/better-auth/src/plugins/agent-auth/client.ts` (+23 -0) ➕ `packages/better-auth/src/plugins/agent-auth/crypto.ts` (+108 -0) ➕ `packages/better-auth/src/plugins/agent-auth/error-codes.ts` (+13 -0) ➕ `packages/better-auth/src/plugins/agent-auth/gateway/create-gateway-server.ts` (+470 -0) ➕ `packages/better-auth/src/plugins/agent-auth/gateway/index.ts` (+11 -0) ➕ `packages/better-auth/src/plugins/agent-auth/gateway/provider-manager.ts` (+243 -0) ➕ `packages/better-auth/src/plugins/agent-auth/gateway/providers.ts` (+118 -0) ➕ `packages/better-auth/src/plugins/agent-auth/gateway/scope-utils.ts` (+69 -0) ➕ `packages/better-auth/src/plugins/agent-auth/index.ts` (+278 -0) ➕ `packages/better-auth/src/plugins/agent-auth/mcp-server.ts` (+116 -0) ➕ `packages/better-auth/src/plugins/agent-auth/mcp-storage-fs.test.ts` (+109 -0) ➕ `packages/better-auth/src/plugins/agent-auth/mcp-storage-fs.ts` (+242 -0) ➕ `packages/better-auth/src/plugins/agent-auth/mcp-storage-memory.ts` (+59 -0) _...and 24 more files_ </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Adds Agent Auth with per‑agent identity, Ed25519 keypair JWTs, scoped roles, and audit logs, plus an MCP Gateway you can run via npx for namespaced tools with strict scope checks. Extends device authorization, adds docs, and introduces CLI + tools to list local agent connections. - **New Features** - Agent identity: create/list/update/revoke; Ed25519 keypair auth (simple/AAP JWTs); before‑hook session resolution; key rotation and expiry. - Activity + SDK: list and log activity (including MCP gateway tool calls); cleanup expired sessions; Agent SDK for connect flow and JWTs; verifyAgentRequest helper; client plugin export. - MCP Gateway/Tools: run with npx better-auth-gateway; provider registry/manager with auto‑config from /agent/gateway-config; namespaced tool discovery; scope checks (provider.tool, provider.*, *); in‑memory or file storage; session via cookie or bearer; list_connections tool and storage APIs; CLI to manage keys and connections. - Device auth: adds client_name and authorization_details (RAR). Admin routes to register/list/delete MCP providers; docs page and sidebar entry. - **Migration** - Run DB migrations for agent, agentActivity, and mcpProvider tables. - Configure Agent Auth options (roles/defaultRole, jwtFormat, session TTL, mcpProviders). Set app URL and secrets for the gateway; choose storage (memory/file) and auth (session cookie or bearer). <sup>Written for commit 56aa7235518e912fd642fab917747dc0eeca9379. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 13:45:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#7676