Docs menu
Security & privacy
How your mail, knowledge and keys are protected - encryption at rest, workspace isolation with row-level security, human approval, prompt-injection safeguards, retention, export and deletion, and where your data goes.
Nearlysent handles customer email, so it is built to keep data separated, encrypted where it matters, and never to act without a person. This page explains how, in plain terms. The legal details are in the privacy policy.
Where your data goes
Your mailbox (IMAP/SMTP or Microsoft Graph) ⇄ Nearlysent server (EU) → your AI provider, with your key
Optional: Nearlysent server (EU) ⇄ Claude connector → Anthropic, on your own Claude account
-
Your mailbox: new mail is fetched over an encrypted IMAP connection and replies are sent over SMTP from your own mailbox; an Outlook or Microsoft 365 mailbox uses Microsoft’s own mail API (Microsoft Graph) over HTTPS instead, after you sign in with Microsoft. Mails are read without marking them as read.
-
The Nearlysent server (hosted in the EU) stores the imported mail, your knowledge, settings and drafts in one database.
-
Your AI provider (Anthropic, OpenAI or the OpenAI-compatible service you chose) receives, per AI call, only what that call needs: the email thread, the matching passages from your knowledge (not whole documents) and your AI behaviour settings. It is called with your own key, under your own contract with that provider. We do not use a provider account of our own, and we do not train any model on your data.
-
Search runs on our server. The index of your knowledge (the “embeddings”) is computed by a model running on the Nearlysent server, so your documents are not sent to anyone to be indexed.
-
Claude, if you connect it (optional, your choice): with the Claude connector, Claude fetches what it asks for (email threads, knowledge passages, drafts of the one workspace you approved) and that goes to Anthropic under the terms of your own Claude account. Nearlysent stores only the connection and hashed access tokens, and logs each call without content.
Nothing else receives your mail or knowledge. System emails (verification, password reset, invites) go through an email delivery service and contain no mailbox content.
Encryption
- In transit: the app and the site are served over HTTPS only. Connections to mail servers use SSL/TLS or STARTTLS; a mailbox without encryption cannot be saved on the public service.
- Secrets at rest: AI keys, mailbox passwords and Microsoft sign-in tokens are encrypted with AES-256-GCM before they are stored, with a key that is not in the database and can be rotated. They are never written to logs and never sent back to your browser; the app only shows the last four characters of a key.
- Passwords of Nearlysent accounts are stored as Argon2id hashes, never in readable form.
Workspaces are isolated
Every piece of data belongs to one workspace, and a workspace can never see another one’s data. This is enforced twice:
- In the application: every request checks that you are a member of the workspace, with the right role (Owner, Admin or Member).
- In the database: row-level security in PostgreSQL filters every query to the current workspace, even if the application had a bug. The application connects with a database role that cannot switch this off.
An automated test tries to reach other workspaces’ data through every API endpoint on every change.
The operator’s admin area shows counts and the health of the system. It cannot show email bodies, knowledge content or drafts.
A human approves every email
Nearlysent never sends anything on its own. The AI (or Claude, through the connector) writes a draft; a person reads it, edits it if needed, clicks Send and confirms with Send now. The confirmation shows the recipient, and warns when a reply would go somewhere unexpected (for example to a Reply-To address that differs from the sender).
Prompt injection
An email can contain text that tries to instruct the AI (“ignore your instructions and…”). Our stance:
- Email content and documents are always passed to the AI as data, clearly marked as untrusted, never as instructions.
- The AI has no tools or actions it could be tricked into using. The only thing its output can become is a draft (or a chat answer) that a person reviews.
- Through the Claude connector, Claude can only read threads and knowledge and save drafts. There is no tool to send, delete or change settings, and email content reaches Claude marked as untrusted with a note not to follow instructions in it.
- Every factual claim in a draft must cite a passage from your knowledge. A citation of a passage the AI was not given is rejected, and the draft is then marked as low confidence.
- Sending is always a human click.
So the worst a malicious email can do is make a bad draft, which you will see before anything happens.
Mail in the app
- Email HTML is cleaned (sanitized) before it is stored and shown in a sandboxed frame without scripts. Remote images are blocked until you click Show images, so senders cannot track when you open a mail.
- Uploaded files are checked for their real type, read in a separate background process with a time limit, and never stored under their original file name.
- Newsletters, automatic replies, no-reply senders and mail loops are recognised and set aside as Ignored, without any AI call.
Accounts and sessions
- Log-in uses a session cookie that scripts cannot read (
HttpOnly,Secure,SameSite=Lax) and a CSRF token on every change. Those are the only cookies; there are no tracking or advertising cookies, in the app or on this site. - Sessions expire after 30 days. Log out everywhere in the account menu ends all your sessions; changing your password logs out your other devices and also ends every Claude connection’s access.
- Claude connections are approved per workspace on a consent page and can be revoked at any time under Settings → Claude connector. Their access tokens are random, stored only as hashes, valid for one hour and renewed for at most 30 days without use.
- Sign-up, log-in and password reset are rate limited.
Retention
Imported mail is kept until you delete it: remove a mailbox (its threads are deleted in Nearlysent, nothing changes in the mailbox itself), or delete the workspace. A workspace can also have a retention period after which the text of old emails is removed automatically; it is off by default, and a workspace admin sets it under Members -> Workspace -> Delete email bodies after (days). Every night the text of older emails is removed; sender, subject and dates stay. Deleted workspaces are purged from the database and file storage in the background right away; backups age out on their normal schedule.
Export and deletion
- Export a workspace: Settings → General → Data export → Download export (Admin or Owner): a ZIP with settings, members, knowledge documents with the original files, mailboxes (without passwords), emails, drafts, usage and the audit log.
- Export your account: Account settings → Download my data: your profile, memberships and account activity as JSON.
- Delete a workspace: Members page → Delete workspace (Owner). Everything in it is deleted for all members.
- Delete your account: Account settings → Delete account. Workspaces where you are the only member are deleted with it.
Error reports and logs
When something crashes, the server can send an error report to an error-tracking service. These reports are scrubbed before they leave the server: no request bodies, cookies, authorization headers, keys or email content. Server logs never contain keys or passwords. There is no analytics or tracking script in the app or on this site.
Questions or a security issue
Contact us through the contact page. Please report security issues privately, and give us time to fix them before you publish.
Something unclear or missing in the docs?Tell us.