Covendocs

Safety Model

How Coven handles safety and guardrails.

Coven Safety Model

Coven is local-first, but local does not mean harmless. It can launch agent harnesses in real repositories, forward input to live processes, and preserve logs. This document states the safety boundaries that docs, clients, and code should preserve.

Trust Boundary

The Rust daemon is the authority boundary.

Every client is untrusted for enforcement purposes.

Untrusted client surfaces
SurfaceStatusTrust posture
CLI/TUICurrentPresentation layer; daemon still enforces sensitive decisions.
CastCodesCurrentWorkspace layer; cannot widen project or session policy.
Cast AgentCurrent backendSubstrate and session backend; still submits to daemon enforcement.
External OpenClaw pluginExternal bridgeBridge layer; must use daemon validation.
ScriptsCurrentAutomation callers; treated like any other untrusted client.
Future desktop clientsFutureLocal UI surfaces; policy remains behind Coven.

Clients may improve UX, but they must not be the only place where a sensitive decision is enforced.

Rendering diagram…

Anything in UntrustedZone can lie, drift, or be replaced. Anything in TrustedZone is the Rust daemon's job and must fail closed on unknowns. The arrow direction is the only direction a sensitive decision is allowed to flow: from untrusted into the boundary, where it is revalidated.

Cast Codes are part of the untrusted intent surface. They can make routing clear, but they do not authorize launches, live input, kill requests, external actions, or destructive session operations.

Authentication and Local Access

Coven's current auth solution is a same-user local access model, not a network authentication protocol.

Authentication and local access posture
RuleGroupImplication
Daemon API runs over <covenHome>/coven.sock, not TCP.TransportThe API is same-user local by default.
No daemon OAuth, JWT, bearer token, API key, browser cookie, RBAC, or hosted account session in v0.Auth modelDo not treat v0 as a remote service auth scheme.
Provider credentials stay in the harness/provider local auth flow.CredentialsCodex or Claude Code own provider login.
Clients are untrusted for enforcement.AuthorityThe Rust daemon must revalidate every sensitive request.
External OpenClaw plugin performs socket trust-anchor validation.Defense in depthClient checks help, but Rust-side private COVEN_HOME checks remain a hardening priority.
Do not expose the raw socket API through localhost TCP, browser, remote bridge, or mobile pairing without explicit auth design.TransportRemote access needs a separate design.

The detailed contract lives in Authentication and local access.

Core Rules

Core safety rules
RuleRisk areaReason
Launch only with an explicit project root.Filesystem policyEvery session needs a clear boundary.
Canonicalize projectRoot and cwd before comparing paths.Filesystem policyString paths are not enough for enforcement.
Reject working directories outside the project root.Filesystem policyClients cannot widen the launch boundary.
Keep harness ids allowlisted until a real policy layer exists.Harness policyUnknown adapters should not run by default.
Build harness commands with argv APIs.Command executionPrompt text should remain data.
Do not execute prompts through sh -c.Command executionAvoid shell interpolation hazards.
Keep provider credentials in provider or harness authentication flow.CredentialsCoven should not become a credential holder.
Treat the socket API as a local product contract.CompatibilityClients should use documented behavior, not internals.
Fail closed on unknown API versions, unknown action ids, unsupported harnesses, and invalid session ids.Unknown behaviorAmbiguous requests should not be guessed.

Data and Secrets

Coven should not require repository-stored secrets.

Do not commit runtime state:

Runtime state that must stay out of source control
PatternCategoryRisk
.coven/Coven stateLocal runtime records and sockets do not belong in repos.
*.sqliteDatabaseMay contain local session history.
*.sqlite3DatabaseMay contain local session history.
*.dbDatabaseMay contain local or application state.
*.sockSocketSocket paths are machine-local runtime artifacts.
.env*SecretsEnvironment files often contain credentials.
Private keysSecretsPrivate key material must never be published.
CertificatesSecretsCertificates may expose signing or identity material.
Token-bearing logsSecretsLogs can accidentally contain live credentials.

Docs and examples must use placeholders such as /path/to/project, /Users/example, session-1, and intent-1.

Event Log Caution

The event log records harness output. A harness may print sensitive data if the user asks it to inspect a sensitive repository or command output includes secrets.

Recommended user guidance:

Event log safety guidance
GuidanceRisk areaReason
Do not run untrusted prompts in sensitive repositories.Prompt riskHarness output may preserve inspected data.
Do not ask a harness to dump environment variables.SecretsEnvironment output can include tokens.
Do not paste secrets into prompts.SecretsPrompt text can be echoed or stored.
Use throwaway projects for demos and smoke tests.Demo safetyDemo logs should be safe to publish.
Run python scripts/check-secrets.py before publishing docs, fixtures, or release artifacts.PublishingCatch accidental secret material before release.

Local Socket Posture

The daemon API runs over a local Unix socket. It is intended for same-user local clients.

Hardening priorities:

Local socket hardening priorities
PriorityGroupPurpose
Private COVEN_HOME ownership and permissionsFilesystem trustKeep daemon state same-user local.
Safe socket creation and cleanupSocket lifecycleAvoid symlink and replacement hazards.
Request size limitsAPI hardeningConstrain malformed or oversized requests.
Read timeoutsAPI hardeningAvoid stalled local clients holding resources indefinitely.
Structured error codesCompatibilityLet clients handle failures consistently.
Event paginationScalabilityKeep large event logs usable.
Compatibility tests for external clientsCompatibilityPrevent drift between daemon behavior and clients.

Live Session Control

Live input and kill requests require a valid live session id.

Expected behavior:

Live session control behavior
ConditionResponse
Unknown session idReturn not found.
Non-live session input/killReturn conflict.
Destructive session deletion of a running sessionRefuse deletion.
Interactive deletionRequire explicit confirmation.

Desktop Automation and Local UI Control

Future desktop automation adapters should be treated as privileged local capabilities.

Required posture:

Desktop automation adapter posture
RequirementGroupReason
Discover capabilities before showing actionsCapability discoveryClients should not invent unavailable controls.
Label risky actions clearlyApproval UXUsers need to understand sensitive effects.
Require explicit approval for clicks, typing, deleting, sending, buying, posting, or modifying external stateApproval UXVisibility is not consent.
Log action requests and outcomes without recording secretsObservabilityAudits need traces, not credential leakage.
Keep adapters behind the Coven control planeArchitectureClients should not bind directly to brittle OS automation APIs.

The split should remain:

client intent -> Coven policy/control plane -> adapter -> desktop/app

External Actions

Coven should ask or require host-level policy before actions that leave the machine or affect external services.

External action approval examples
ActionCategoryApproval reason
Sending messagesCommunicationLeaves the local machine and speaks to another person.
Sending emailCommunicationCreates durable external communication.
Posting publiclyPublishingPublishes content under an identity or project.
PurchasingCommerceCan spend money or create obligations.
Deleting remote dataRemote stateCan destroy data outside the local ledger.
Pushing to git remotesRemote stateChanges shared source history or branches.
Modifying cloud resourcesRemote infrastructureCan affect live services or billing.

The local runtime can make these actions visible, but visibility is not consent.

Last updated on

On this page