Security
Inhouse holds a copy of your mail and a key to your mailbox. This page says how
to report a problem, what the app does to protect that data, and what it does
not protect against.
Reporting a problem
Please do not open a public issue for a security problem.
Report it privately through GitHub:
Report a vulnerability
(the repository’s Security tab → Report a vulnerability).
A useful report says:
- what an attacker could do (read mail, obtain the sign-in tokens, run code)
- what they need to start with (send you an email, have a file on your
computer, be on your network)
- the steps to reproduce it, the commit you tested, and your system
Do not include real mail or real tokens. A made-up message that triggers the
problem is enough.
This is a project in early development, maintained in spare time. Expect a
first answer within a week. Fixes land on main; only the latest main and the
latest published build are supported.
What counts
Things worth reporting privately:
- An email that, when downloaded, analyzed or opened, can run code, reach the
network, read files, or get at the app’s bridge to the main process.
- Any way to get the stored sign-in tokens out of the app.
- Any path by which mail content leaves the computer.
- A way to make the app use a wider Gmail permission than it states, or to
change the mailbox.
- A flaw in the sign-in flow (the local redirect, the
state check, PKCE).
- A model download that is accepted without matching its checksum.
Things that are known and are not vulnerabilities by themselves are listed
under What is not protected.
What the app can reach
At Google, with your consent, and nothing more:
| Scope |
Meaning |
https://www.googleapis.com/auth/gmail.messages.readonly |
Read messages. No sending, changing or deleting. |
openid, email |
The address of the account that signed in |
On the network, the app connects only to:
| Host |
Why |
accounts.google.com |
Sign-in, in your own browser |
oauth2.googleapis.com |
Exchanging and renewing tokens; revoking them on disconnect |
gmail.googleapis.com |
Downloading mail |
huggingface.co (and the hosts it redirects downloads to) |
Downloading the model file |
There is no telemetry, no crash reporting, no update check and no server run by
this project. Mail text is never sent to an AI service; the model runs locally.
How your data is protected
Sign-in
- Sign-in happens in your system browser, never inside the app, so the app
never sees your Google password.
- It uses the OAuth flow for installed apps with PKCE (S256) and a random
state. The answer comes back to a listener on 127.0.0.1, on a random
port, that exists only while sign-in is in progress and gives up after five
minutes.
- Disconnecting a mailbox (Settings → Mailboxes) revokes the token at Google
and deletes that mailbox’s mail and answers from the computer.
- “Delete all downloaded mail” in the same place deletes the mail and answers
of every mailbox and keeps the sign-ins. The database file is rebuilt
afterwards, so the deleted mail is not left in unused parts of the file.
Disconnecting a single mailbox does not rebuild the file: its rows are
deleted, and the space they took is reused or cleared later.
Stored tokens
- The refresh and access tokens are encrypted with the operating system’s
keychain (Electron
safeStorage) before they are written, and the file is
readable by your user only.
- A Google client you enter yourself is kept the same way: the secret
encrypted, the file readable by your user only.
- If the system has no secure storage, the app refuses to save credentials
rather than writing them in the clear.
Mail from strangers
Mail is untrusted input, and the app treats it that way.
- HTML mail is shown in a sandboxed frame: no scripts, no forms, no access to
the app. A content policy inside the frame blocks everything remote, so
opening a message loads no images or fonts from the sender and does not tell
them you opened it.
- Links open in your browser, and only
http, https and mailto links.
Nothing navigates the app’s own window.
- Attachments are never downloaded or opened.
- The window runs sandboxed, with context isolation and without Node
integration. It talks to the main process through a small fixed set of calls,
and the arguments of those calls are checked on the other side.
- Database queries are parameterized.
The model
- The model runs in a process of its own, with no tools: it cannot send
anything, open anything or change anything. It produces text.
- A message can contain text written to mislead the model (“mark this as
important”). The worst outcome is a wrong answer about that message, or a
misleading answer in the conversation. Answers are constrained to a fixed
format, generated from your questions, and checked before they are stored.
- The questions and instructions you write in Settings are text for the model
and nothing else. Names go into the answer format as escaped literals, and
colours are picked from a fixed list, so nothing you type reaches a query,
a style or the page as code.
- A questions file you import is someone else’s text. It is read only when you
choose it, must be under 1 MB, and is checked against the same rules as what
you type; anything that does not fit is refused. It is loaded into the
editor and changes nothing until you save. It can still be badly worded or
written to make the model answer misleadingly, so read an imported file’s
questions as you would read a prompt from a stranger.
- Model files are fetched from a pinned revision and are used only after their
SHA-256 matches the one recorded in the source.
- The native library is the prebuilt one that ships with
node-llama-cpp.
Nothing is compiled on your computer.
What is not protected
Be aware of these before trusting the app with your mail.
- The mail database is not encrypted.
mail.sqlite holds your mail as
readable data. Anyone, or any program, that can read your user’s files can
read it. Full-disk encryption (FileVault, BitLocker, LUKS) is the protection
against a lost or stolen computer.
- Other programs running as you can read the database, and can ask the
keychain for the tokens in the same way the app does. The app does not defend
against malware on your own account.
- Backups and sync folders copy the database like any other file. If your
home folder is backed up to a cloud service, so is your mail.
- The OAuth client secret is not a secret in an app of this kind, as Google
itself documents for installed apps; PKCE is what protects the sign-in. A
build carries the client it was built with, and anyone who has the build can
read it out. With it, another program could show Google’s consent page under
this app’s name; it still gets nothing unless the person signs in and agrees.
If you would rather not rely on a shared client, enter your own on the
connect screen.
- The model’s answers can be wrong, and can be steered by the content of a
message. Do not rely on them alone for anything that matters.
- Saving changed questions deletes the stored answers, after a warning.
That is by design, and there is no undo. Your mail is not touched.
- Builds are only as trustworthy as where you got them. A build from this
repository’s Releases page is signed with the maintainer’s Apple Developer ID
and notarized by Apple. A build from anywhere else may carry a different
Google client or different code. Building from source is always possible.
- No automatic updates, so a fix reaches you only when you download a newer
build or pull the source.
Removing your data
- In the app, open Settings → Mailboxes and disconnect each mailbox. This
revokes the app’s access at Google and deletes the downloaded mail. To
remove only the mail and stay connected, use “Delete all downloaded mail”
there instead.
- Delete the data folder (on macOS,
~/Library/Application Support/inhouse/)
to remove the model and everything else.
- If you want to be sure, check
your Google Account’s third-party access
and remove the app there.