One email service.
Separate access for every person.
Assistants and household apps use the same Rust service to find emails, read attachments and prepare drafts. Each request carries permission for a particular owner and set of mailboxes.
01 · How the email service works
The service sits between clients and Gmail
Architecture · Arrows show requests / dataKeycloak issues user login tokens. Separate hashed bearer grants support backend apps and local clients. Google consent connects a mailbox; Keycloak login decides who may use it.
Direct tools: give me the source
Live Gmail search, message and thread reads, attachment download, index queries and unsent drafts with files. A mailbox + message + MIME part identifies an attachment.
Ask mode: investigate and explain
The built-in agent searches bounded index results and provides evidence. It has no arbitrary SQL, web or mutation tools. Attachment text enters the index when read, rather than pre-extracting every file.
Draft tools do not send mail. Cleanup tools propose exact messages; Trash requires a separate authenticated human review. Morning briefings are implemented but currently disabled. Scanned PDF OCR and Office text extraction are not implemented.
02 · Casa and household apps
Casa turns selected emails into bill evidence
Bill integration deployedFind candidate invoices
Page through selected supplier mail. Partial searches never count as a completed scan.
Keep the original
Record the PDF’s content hash and source. Extracted text is separate from the file.
Check the bill
Supplier and account checks happen in Casa. Model-assisted extraction requires review.
Show approved evidence
A bill can be shared without granting access to other messages in its source mailbox.
| Integration | Current state | Access boundary |
|---|---|---|
| Casa bill importer | Deployed | One owner’s mailbox; read only. Supplier and account selection are enforced by Casa, not by the email token. |
| Casa private chat | Deployed | Person-specific credentials and chat memory; no partner fallback. Shared legacy email caches are inaccessible. |
| M&N Amazon worker | Deployed | A separate read grant drives the hourly worker. Only the existing household subscription summary is shared. |
| Tila (Mery app) chat | Deployed | Separate person-specific memory and credentials. Her mail remains unavailable until she connects it. |
Read grants currently authorize whole mailboxes, rather than particular suppliers. The app holding that token is trusted to implement its narrower purpose. Sharing selected evidence is a separate decision from granting inbox access.
03 · Permissions and connection management
A connection and a permission grant are different things
Illustrative scenarios · No live account dataA connection joins a provider mailbox to its owner. A grant allows named operations on selected mailboxes. Connecting both partners does not give either partner access to the other’s mail.
Identity verified by the app’s login gateway.
Selected by the backend for this person, never by a prompt or browser owner field.
The service checks owner, mailbox and read scope on every operation.
A partner’s mailbox stays outside this grant, even if its ID is guessed.
Manage connections today
Operator-managed configuration: the owner consents with Google, the verified account is bound to their Keycloak subject, and apps get separate credentials. Remove a grant and restart the service to revoke it. Disconnect at Google to revoke provider consent too.
Several mailboxes, one owner
Supported through configuration. A grant can name several mailboxes belonging to the same owner; the agent calls each explicitly. Automatic merged search, cross-owner roaming and a connection-management screen are not implemented.
| Capability | Today | Next design step |
|---|---|---|
| Delegated user access | Keycloak user tokens; app-side per-person read credentials. | Exchange a user’s token for short-lived, mailbox-limited access instead of keeping static per-user keys. |
| Background agents | Separate fixed-owner credentials with explicit scopes and mailbox IDs. | Named service identities, expiry, revocation and an audit trail for each grant. |
| Both partners / Outlook | Owner separation exists. Only Gmail is implemented; the partner’s accounts are not connected. | Microsoft Graph and per-account consent, keeping the same ownership and attachment references. |
| Agent across owners | Rejected by the current owner model. | Each owner authorizes a finite mailbox set. Track the acting agent separately from the data owner on every request. |
Encryption protects stored data, not against the running service or its root administrator. Apps receiving email content and any model provider used for a task remain part of the trust boundary. This public page contains documentation only: no mailbox inventory, email content or credentials.
Interfaces and technical references
MCP: https://email.borrowed.computer/mcp. Typed app access: POST /api/tools/{operation}. Original files: POST /api/attachment. Protected tools require a bearer token. The TypeScript and Rust clients share protocol version 1.
Provider references: Gmail scopes · Microsoft Graph mail permissions · Outlook attachment API.