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. The supported integration mode is the sidecar:Documentation Index
Fetch the complete documentation index at: https://authsome.agentr.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
authsome run -- python agent.py spawns the agent as a subprocess of authsome with an HTTP proxy injecting credentials at request time. No auth code in the agent.
The same layered architecture is also exposed as a Python library (from authsome.server.dependencies import create_auth_service) for embedding inside a larger orchestrator. The two modes share the same layers below.
Sidecar-mode call graph. Identity and policy gate the vault; the auth layer refreshes when needed; the sidecar writes back, injects the Authorization header, and audits at every step.
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.
AuthService: the orchestrator
AuthService owns OAuth flows, token refresh, and the login/logout/revoke lifecycle. It receives a Vault, a ProviderRegistry, and an AppStore as dependencies. The daemon assembles one per profile; library callers build one with create_auth_service().
AuthLayer is a thinner facade exposing the building blocks (vault(), registry(), identity(), app_store()) for callers that need them directly. See Python library.
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
State lives under~/.authsome/. See Filesystem layout for the full tree and per-file reference.
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 |