# Security

> How Cozy signs people in, keeps workspaces apart, limits what agents can do, and revokes access.

## Signing in [#signing-in]

- Email sign-in uses a six-digit code. Codes are stored hashed, expire in
  10 minutes and allow three wrong guesses, and requests are rate limited by
  address and IP.
- Google and Apple sign-in require a verified email address.
- Cozy has no passwords, password resets or email changes.
- Sessions are secure, HttpOnly cookies that last 60 days. Signing out
  revokes the session.

## Workspaces are isolated [#workspaces-are-isolated]

Cozy is single-player. Each workspace belongs to one person and has its own
storage, credentials, connectors, files and activity history. Only that
person and the agents they authorize can access it. Every request checks
that the workspace is yours, and a credential from one workspace can't
authenticate against another. Being signed in never grants access to
someone else's wiki.

Workspace changes run one at a time, and credentials are checked again
inside each change. A revocation that lands first also stops writes already
queued.

File contents are stored in private storage, never at a public URL.

## Agents [#agents]

Agents connect with OAuth on `https://cozy.cloud/mcp`, or with a workspace
credential. Either way:

- They never get more access than the person who authorized them, and their
  scopes are checked on every request.
- Workspace credentials are random, shown once, stored as SHA-256 digests,
  expire within 90 days and can be limited to folders.
- OAuth access tokens are opaque, last a day, and refresh tokens are single
  use. See [MCP server](/docs/mcp#oauth).
- Every edit is checked against the revision it read, so concurrent writes
  conflict instead of overwriting.

### What agents can't do [#what-agents-cant-do]

Whatever their scopes, agents can't:

- See connector credentials.
- Create or manage credentials or grants.
- Erase a file's history for good. Deletes leave a tombstone, and the last
  50 revisions stay restorable.

Permanent erasure of a deleted file is available only to the workspace's owner
signed in to Cozy, never to agents or over MCP. A minimal tombstone remains,
so an erased source isn't imported again.

### Untrusted sources [#untrusted-sources]

Imported material is evidence, not instructions. Cozy keeps it in `sources/`,
marks it untrusted to agents, escapes HTML in the app, and tells agents to
ignore instructions inside it. Skills are ordinary files and grant nothing.

Cozy runs no model, so it can't stop an agent from following injected text.
Limit the damage: give ingest jobs `sources:write` only, use folder prefixes,
and review `cozy_changes` after a new agent's first runs.

## Connector credentials [#connector-credentials]

Tokens for connected apps are encrypted with AES-256-GCM, bound to their
workspace and connection, and never returned by the server. Connectors only
read from apps. Disconnecting deletes the stored credential and keeps the
sources already imported.

## Revoke access [#revoke-access]

| To stop | Do this |
| --- | --- |
| An agent connected with OAuth | **Connectors → Agents**, then **Disconnect** |
| A workspace credential or workspace grant | **Agents**, then **Revoke** |
| A connected app | The app's page in **Connectors**, then **Disconnect** |

Revocation takes effect at once. It doesn't wait for tokens to expire.

## Contact [#contact]

Cozy is operated by Coral Sourcing LLC. Report security issues to
[hello@cozy.cloud](mailto:hello@cozy.cloud). See the
[privacy page](https://cozy.cloud/privacy).

