Authsome is layered. Each layer has one bounded responsibility. Layers do not reach sideways into other layers — explicit orchestrators compose them. This makes every layer independently testable and independently swappable. Two deployment modes share the same layered architecture:Documentation Index
Fetch the complete documentation index at: https://authsome.mbajaj.me/llms.txt
Use this file to discover all available pages before exploring further.
- Sidecar mode —
authsome run -- python agent.py. Transparent credential injection through an HTTP proxy. No auth code in the agent. - Library mode —
from authsome.context import AuthsomeContext. A direct programmatic API.
The five layers
| Layer | Owns | Does not own |
|---|---|---|
| Identity | Agent identity, principal chain token | Credentials, access decisions, token expiry |
| Policy | Access control, allow/deny decisions | Credentials, token refresh, encryption |
| Vault | Minimal encrypted KV interface (get/put/delete/list) | OAuth, providers, expiry, refresh, policy |
| Auth | Token refresh, OAuth acquisition flows | Persistent storage, access decisions |
| Audit | Append-only event log | Decisions, credentials, request flow |
Identity, Policy, and Audit are part of the long-term architecture. The current alpha implementation focuses on Vault and Auth. The CLI emits audit events to
~/.authsome/audit.log today; identity and policy enforcement are planned.Vault: minimal storage
The Vault is intentionally small. It exposes a generic encrypted key-value interface and nothing else.~/.authsome/profiles/<name>/store.db. Field-level encryption uses AES-256-GCM with a 256-bit data key and a 96-bit nonce per encryption. The data key is wrapped by either a local file (~/.authsome/master.key, mode 0600) or the OS keyring.
See Credential storage for the storage model and key namespace.
Auth: two levels
The Auth layer has two intentionally separate surfaces. Low level (auth.flows). A pure function. Receives expired credentials and refresh material. Calls the external token endpoint. Returns fresh credentials and updated expiry. No vault access. No side effects. Independently testable.
High level (AuthLayer). A stateful orchestrator with a vault dependency. Reads the credential from the vault, calls the stateless refresh if expired, writes the result back, returns a usable token. This is what library users call.
AuthsomeContext: the orchestrator
AuthsomeContext is the runtime wiring container assembled once per CLI invocation. It holds Vault, AuthLayer, and ProxyRunner as attributes. No business logic of its own.
AuthsomeContext directly. The CLI creates one context per invocation.
Proxy: sidecar orchestrator
In sidecar mode, the proxy runner is the orchestrator.- Starts the HTTP proxy on a random local port.
- Spawns the agent as a subprocess with
HTTP_PROXYset to the local proxy address. - Intercepts outbound HTTP requests from the agent.
- Looks up the matching provider by
host_url, asks the AuthLayer for fresh credentials, and injects them into theAuthorizationheader. - Writes refreshed credentials back to the vault.
- Tears down cleanly when the agent exits.
Storage layout
default, work, or a profile per agent.
Standards
| Concern | v1 |
|---|---|
| Token refresh | OAuth 2.0 (RFC 6749) |
| Browser-less OAuth | Device Authorization Grant (RFC 8628) |
| PKCE | RFC 7636 |
| Encryption at rest | AES-256-GCM, 256-bit key, 96-bit nonce |
| Agent identity (planned) | Ed25519, agent://local/<name> URIs |
| Principal chain (planned) | Local signed JWT, RFC 8693 later |
| Policy (planned) | Cedar |