agent.pw is a robust credential vault and authentication framework specifically designed for AI agents. It provides secure storage for encrypted credentials, including OAuth tokens and API keys, utilizing AES-GCM for data at rest. The library manages the entire OAuth lifecycle, supporting PKCE, token refresh, revocation, and RFC 9728 discovery. Currently at version 0.8.2, the project exhibits a rapid release cadence with frequent patch and minor updates (multiple in April 2026 alone), indicating active development and continuous improvement. Key differentiators include its agent-centric design, comprehensive OAuth handling, support for admin-configurable credential profiles, path-based organization (`ltree` paths like `acme.connections.github`), and scoped access control. It is designed to be embeddable, working seamlessly with any PostgreSQL-compatible database without requiring a separate server component.
Verified import paths — ran on the pinned version, not inferred.
agent.pw is primarily an ESM module, though CJS usage might be possible via transpilation or specific Node.js settings, ESM is recommended.
OAuth-related utilities are located in the 'agent.pw/oauth' subpath. Ensure correct subpath import for specific features.
Database connection utilities are located in the 'agent.pw/sql' subpath. This is a common mistake to import from the root.
The `unwrap` utility is an external dependency from the `okay-error` package, not an internal export of `agent.pw`.
This quickstart demonstrates how to initialize `agent.pw` with a PostgreSQL database, an encryption key, and an in-memory OAuth flow store, then resolves headers for a resource.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.