Covendocs

Authentication

Authentication, tokens, and access control.

Authentication and Local Access

Last updated: 2026-05-14

Coven does not currently have daemon-level user authentication in the OAuth, JWT, bearer-token, API-key, browser-cookie, or hosted-account sense.

The current solution is a same-user local access model.

Same-user local access model
PropertyGroupMeaning
Local Unix socket onlyTransportThe daemon exposes HTTP only over <covenHome>/coven.sock.
Default socket pathTransportThe default path is ~/.coven/coven.sock.
Client validation is UXAuthorityClients may validate requests for nicer errors, but Rust remains the enforcement boundary.
Harness-owned provider credentialsCredentialsCodex, Claude Code, and other harnesses keep using their normal local auth flow.
No credential proxyingCredentialsCoven should not read, proxy, persist, or mint provider or OpenClaw credentials.

This is intentionally a local-first MVP posture. It is suitable for same-user local clients such as the Coven CLI/TUI, CastCodes, Cast Agent, scripts, and the external OpenClaw plugin. It is not a remote API auth scheme.

Rendering diagram…

The boundary is filesystem permissions plus same-user process locality. Anything outside the dashed zone is rejected by design; introducing a remote, browser, or cross-user surface requires a separate auth design (not a tunnel of the existing socket).

What Protects the API Today

Unix Socket Locality

The API is not exposed as TCP by default. Clients connect to the local Unix socket owned by the user's Coven state directory.

New clients should treat the socket path as the trust anchor and should connect only to the versioned API under /api/v1/....

Rust Authority Checks

The daemon must revalidate sensitive request fields before acting, even when a client already validated them.

Rust authority checks
FieldRisk areaFailure behavior
API versionCompatibilityFail closed on unknown versions.
Project rootFilesystem policyReject invalid or widened roots.
Working directoryFilesystem policyReject cwd values outside the project root.
Harness idHarness policyReject unsupported harnesses.
Session idSession controlReturn not found for unknown records.
Live-session stateSession controlReturn conflict for non-live input or kill requests.
Input requestsSession controlForward only to verified live sessions.
Kill requestsSession controlTerminate only verified live processes.
Control-plane action idsAction routingFail closed on unknown action ids.

Unknown API versions, unknown action ids, unsupported harnesses, invalid session ids, and outside-root working directories must fail closed.

Harness-owned Provider Auth

Coven launches supported local harness CLIs. It does not implement provider login.

Examples:

Harness provider authentication owners
HarnessAuth flowOwner
Codexcodex login or Codex CLI local setupCodex CLI
Claude Codeclaude doctor or Claude Code CLI local setupClaude Code CLI

coven doctor may report setup hints for these tools, but Coven does not own their credentials.

External OpenClaw Plugin Guardrails

OpenClaw integration is externalized through @opencoven/coven. OpenClaw core is not a Coven trust root.

The plugin is disabled by default and must be explicitly selected as the ACP backend. It validates the local socket trust anchor before connecting.

External OpenClaw plugin socket guardrails
GuardrailRisk areaPurpose
covenHome absolute and non-symlinkPath trustAvoid ambiguous or replaceable state roots.
socketPath restricted to <covenHome>/coven.sockPath trustPrevent arbitrary socket targets.
Socket path is not a symlinkReplacement raceAvoid following a swapped socket target.
Resolved socket is a Unix socketTransportReject regular files or unexpected filesystem nodes.
Socket root, directory, and socket owned by current userOwnershipKeep access scoped to the same OS user.
Socket root and directory not group/world accessiblePermissionsReduce accidental cross-user access.
Socket path fingerprinted around connectionReplacement raceCatch socket replacement between validation and connect.

These client-side checks improve defense in depth. They do not replace Rust daemon enforcement.

What This is Not

The current auth solution is intentionally narrow.

What the current auth model is not
Excluded modelCategoryImplication
OAuthIdentity protocolThere is no delegated web login boundary.
OpenID ConnectIdentity protocolThere is no hosted identity-provider session.
JWT sessionsToken authThere are no daemon-issued session tokens.
Bearer-token authToken authThere is no reusable API bearer credential.
API-key authToken authThere are no daemon API keys.
Browser cookie authBrowser authThe daemon is not browser-origin safe.
RBACAuthorizationThere are no daemon roles or multi-user permissions.
Multi-user authorizationAuthorizationAccess is same-user local, not team-scoped.
CSRF/origin policyBrowser authDo not expose the raw socket through a browser-facing bridge.
Cloud account boundaryHosted serviceCoven v0 is not a hosted account API.
Permission to expose localhost TCP, remote network, or browser accessTransportRemote access needs a separate auth and pairing design.

If a future dashboard, mobile app, remote bridge, or browser-exposed service needs to talk to Coven, it needs an explicit additional auth and pairing design. Do not tunnel or proxy the raw daemon socket into a network service and call that authenticated.

Current Hardening Gap

The TypeScript OpenClaw plugin client already performs strict socket trust-anchor validation.

The Rust daemon currently owns request enforcement and socket API behavior, but Rust-side private COVEN_HOME ownership and permission checks before creating, binding, or removing daemon state are still a hardening priority. Until that is implemented, client-side socket validation should be treated as defense in depth for cooperating clients, not as a complete daemon-side auth boundary.

Before broad distribution, Rust should fail closed for the hardening cases below.

Rust-side hardening gaps
ConditionRisk areaExpected behavior
COVEN_HOME is not owned by the current userOwnershipFail before using the state directory.
COVEN_HOME is group or world accessiblePermissionsFail before binding or trusting daemon state.
COVEN_HOME resolves through a symlinkPath trustReject ambiguous state roots.
Socket path resolves outside COVEN_HOMEPath trustReject widened socket paths.
Existing socket path is a symlink or non-socket fileReplacement raceRefuse cleanup or connection assumptions.
Socket creation or cleanup would cross the trusted state directory boundaryState safetyRefuse the operation.

Requirements for New Clients

New Coven clients must preserve the local authority boundary.

New client requirements
RequirementGroupReason
Use /api/v1/... routesVersioningKeeps clients on the documented compatibility contract.
Call GET /api/v1/health before assuming compatibilityHandshakeConfirms daemon availability and API version first.
Treat the Rust daemon as the authority boundaryPolicyClient checks are UX, not enforcement.
Keep provider credentials in the provider or harness auth flowCredentialsPrevents Coven from becoming a credential proxy.
Avoid storing repository secrets, environment dumps, private URLs, or token-bearing logsPrivacySession artifacts should stay publishable and inspectable where possible.
Reject configurable socket paths that do not resolve to <covenHome>/coven.sockPath trustAvoid arbitrary local socket targets.
Fail closed on unknown harness ids or unsupported API versionsCompatibilityUnknown behavior should not be guessed.
Avoid network, browser, or remote transport without a separate auth designTransportSame-user local access is not remote authentication.

Last updated on

On this page