# Where the data is stored

What draften stores, where it lies and who sees it.

## In draften's database

| What | Note |
|---|---|
| organisations, people, roles, access | members' e-mails and names |
| mailboxes and assistants | addresses, settings, instructions with all their versions |
| knowledge sources and attachments | uploaded documents including their extracted text, attachment files |
| messages | sender, subject, time, how the assistant sorted them and why, hidden texts found |
| drafts | the draft text, versions after revision, the difference against the sent version, the evaluation |
| learning | lessons and knowledge corrections with "before and after" examples |
| trial set | saved messages with their text and thread |
| records | mail checks, events, requests, change history |

So the database also holds customers' names and mail content. For the draften
service the operator runs it; in an installation on your own server it is with
you and reachable on the network only inside the installation.

## What is encrypted

Secrets are encrypted in the database (AES-256-GCM) with `MASTER_KEY`, which
is not in the database:

- model API keys,
- mailbox access (registration secrets, service account keys, tokens of
  connected accounts, IMAP passwords),
- access details for connected systems (CRMs),
- clients for signing in with Microsoft and Google,
- the password or API key of the mail sender.

A secret is never shown in the interface once stored, and it is not in the
change history either. Users' passwords are stored only as a hash (argon2id).

## What is not stored

- **The new-assistant wizard** stores only ids and dates of its mail sample; it
  reads the message texts while running and does not store them.
- **Data from connected systems** is not stored — the assistant reads it while
  writing a draft; the log holds only the tool's name, not whom it asked about.
- Sent mail is not stored whole, only the text of the sent reply, for comparison
  with the draft.

## What goes out

To the **language model provider** (Anthropic by default) go, during triage and
writing, the content of the message and the thread, the instructions, the
knowledge sources and data from connected systems. With OpenAI `store: false`
is sent; still, with sensitive data check the provider's retention terms. With
a **local model** on your own server, mail never leaves the server.

draften sends nothing else anywhere; e-mails go out only as invitations and
notices through the configured [mail sender](/en/admin/outgoing-mail).

## Who sees what

- An organisation member sees only the mailboxes they have access to.
- The operator (superadmin) cannot see inside organisations — only their name,
  bindings, owners and size.
- The change record (who changed what) is read by the organisation's owners and
  managers.

## Deletion

An organisation is deleted by the operator, and only a suspended one: it goes
with everything in it (mailboxes, assistants, messages, drafts, keys, settings,
change history). User accounts stay.
