Privacy
Trilium sends nothing to an AI provider until you send a message. Enabling the integration, adding a provider or opening a chat transmits nothing on its own, the one exception is that listing a provider's models sends your API key to that provider, so the list can be fetched.
Once you send a message or run the In-editor AI assistant, what leaves your machine depends on the provider you chose and on which context options are enabled.
Where your notes go
| Provider type | Destination |
|---|---|
| Cloud providers | The provider's servers (Anthropic, OpenAI, Google, DeepSeek). OpenRouter passes each message on to the lab that runs the chosen model, according to the privacy settings of your OpenRouter account. |
| Subscription-based | The provider's servers, via Claude Code running locally |
| Local / self-hosted | Nothing leaves the machine running the model |
| Custom endpoint | Wherever it was pointed, which may be your own hardware or a hosted service |
This is the reason the provider list is grouped this way, and why Trilium pre-selects nothing: the choice of where your note content is sent is made explicitly by you, before anything is sent.
What is actually sent
- Always, with every message
- The conversation itself: your messages and the assistant's replies, including earlier turns
- Trilium's system prompt describing how to format answers and use tools.
- The current note, only when note context is enabled.
- In the sidebar chat this is the file icon at the bottom; the dedicated chat note type never sends a current note.
- What travels is a metadata block: the note's ID, title, type, creation and modification dates, its parent IDs, the titles of up to 20 children, up to 20 attributes, and a preview of the content.
- Notes above a size threshold send a size hint instead of the text, and the model must call a tool to read further.
- Any note the model asks for, when note access is enabled.
- Tools let the model search your tree and read notes, attributes and attachments beyond the current one.
- It decides what to fetch, and each call waits for you to allow it, unless the chat's permission mode lets reads or every call run on their own, or you allowed that tool for the chat. The reachable scope is your whole tree, except for notes you exclude (see Excluding notes below).
- Attachments and mentions, when you add them: images, PDFs and text files are sent to the provider, and an
@mention makes that note fetchable. - Your search query, when web search is enabled, the model's search terms reach the provider's own search infrastructure, or the search provider chosen in the Tools menu (Brave Search, Tavily, Exa, Serper, Perplexity or your SearXNG instance).
- The pages the model reads, when web search goes through a search provider or a DeepSeek model's built-in search: Trilium fetches each page the model asks for from the site itself, so the site sees a request from the machine running Trilium. The page's text is then sent to the model's provider.
The in-editor AI assistant
A run of the In-editor AI assistant sends a different set than a chat message. For quick actions, it sends it the moment you pick an action, there is no send button to reconsider at. For the free-form Ask AI, there is a dedicated send button and model selector.
- The passage you selected, or the paragraph the cursor is in when you pick a quick action without selecting anything. Opened from the menu of the drag handle, the assistant sends the whole blocks that the handle shades instead.
- Up to 1500 characters of the note on each side of that passage, as plain text. The assistant is told this is context only and must not be rewritten, but it is sent regardless of whether you selected it: a run on a single sentence still transmits the paragraphs around it.
- Where the note sits: its title and the titles of its parents, as a breadcrumb.
- Trilium's writing-assistant instructions, which describe the formatting it may produce.
- Earlier turns of the same exchange, once you follow up on a response.
No note metadata block is sent, web search is never enabled, and the assistant has no note tools so it can read nothing beyond the text listed above.
Protected notes
While your protected session is locked, protected notes send neither title nor content. While it is unlocked they are treated like any other note, a note the model reads through a tool is sent to the provider in full. If you keep sensitive material in protected notes, be aware that unlocking them removes that boundary for the duration of the session.
The same applies to the In-editor AI assistant: it works on whatever is open in the editor, so running it inside an unlocked protected note sends that note's text like any other.
Excluding notes
Add the #excludeFromLlm label to a note to hide it from the AI chat and the MCP server. The label covers only that note: the notes below it stay visible unless you make the label inheritable, and a child can opt back in with #excludeFromLlm=false.
A note created from a template inherits all of the template's labels (see Templates), so adding #excludeFromLlm to a template hides every note that uses it, not just the template.
For an excluded note:
- The note tools report it as not found: it is left out of search results, child lists and subtrees, and relations that point to it are not shown.
- The model cannot read, edit, move, clone or rename it, create notes under it, or remove the label. It also cannot delete a note that has an excluded note below it.
- Its metadata is not sent as the current note, even when note context is enabled.
- A visible child does not show it as a parent, and the model cannot move the child out of it.
Unlike a protected note, an excluded note stays hidden while your protected session is unlocked. The exclusion applies to the note tools only. It is not encryption, and it does not cover:
- Files you attach to a message yourself.
- The In-editor AI assistant when you run it inside the note.
- Text from the note that appears in other notes, such as a link with the note's title.
- What a search query can test. Search never returns an excluded note, but a query can still match a visible note through an excluded one: by its title in the note path, through a relation (
~link.title), a parent or child (note.parents.content), or a label the visible note inherits from it. A model that guesses can learn whether an excluded note contains a given word.
What you control
- Which provider: the single decision that determines whether anything leaves your machine at all.
- Note access: turn it off in the Tools menu at the bottom of the chat, and the model can read nothing beyond what you type.
- The current note: the file icon in the sidebar chat.
- Notes the AI cannot reach: the
#excludeFromLlmlabel, see Excluding notes above. - Web search: also in the Tools menu.
- Which tool calls ask first: the Permissions submenu of the Tools menu. Always ask has every call wait for you, reads included. A new chat starts in the mode you picked last, so a chat after one set to Don't ask asks about nothing either. Until you pick a mode, chats start in Ask before changes, where the AI reads and searches your notes without asking.
- The editor assistant: it has no per-run toggles. What you control is whether you run it, what you select before you do and which model answers.
With note access and note context both off, the provider receives only the words you typed.
Keeping everything local
Adding an Ollama or LM Studio provider keeps every message on the machine running the model, and Trilium marks their models as free because no metered API is involved. The trade-off is quality and hardware: a small local model may fail at tool calls that a cloud model handles, so a local setup that misbehaves is worth benchmarking against a cloud provider before reporting it as a bug.
Telemetry & security
Trilium itself collects no telemetry from the AI integration.
Your API key is stored in your database, sent only to the provider it belongs to, and is write-only through the options API so that a malevolent Scripting cannot access it. If you have backend or SQL console access enabled, a malevolent script could potentially exfiltrate your API keys.
The built-in MCP server is off by default. When enabled, every request must carry an ETAPI token, which grants the same full read and write access to your notes as the REST API; treat one like a password. On desktop it is reachable only from localhost unless you turn on Network Access.