← Back to library

Run a self-hosted chat assistant with read-only email

vidarh on Hacker News asked Kimi to install Matrix on his own hardware and write a tiny agent loop modeled on Claw designs. Each tool is wrapped in bubblewrap, persona and notes live in separate files, and the mailbox can be searched read-only.

  • OutcomeBuild a small private assistant that you message through your own Matrix server, with sandboxed tools, file-based memory and mailbox access that can only read.
  • SetupAn afternoon+
  • LevelAdvanced
  • Creditvidarh on Hacker News
View original
Works with
Custom agentOpenClaw

Published Oct 23, 2026Updated Oct 23, 2026AI dry run on sample input: passed Oct 23, 2026Source verified Oct 24, 2026

When should you use it?

  • You want an assistant that is small enough to audit
  • You already run a home server or VPN
  • You want mail help without giving send rights

Not for: Anyone not comfortable running servers; Heavy exposure to untrusted content without a VM

What do you need, and what do you get?

You need

  • Home server
  • Matrix server with federation off
  • Read-only mail tools

You get

  • A private chat assistant on your phone
  • Memory files you can inspect

How does it work, step by step?

  1. Host the chatRun a Matrix server with federation disabled on your private network.
  2. Sandbox the toolsWrap each tool in a sandbox; move to a VM before exposing it to untrusted content.
  3. Grant read-only mailGive tools that can search and read but never hold your credentials or send.
  4. Add a heartbeatSchedule a periodic prompt to consolidate memory and move tasks along.
  5. Reach it privatelyConnect from your phone over your VPN.

The prompt

Our own prompt, inspired by vidarh on Hacker News and written to work in Custom agent and OpenClaw. Values in lime are placeholders.

Prompt0 variables
You are my private assistant on Matrix.
Tools: read_mail (search and read only), send_matrix, notes_read, notes_write.
On each heartbeat: consolidate anything worth remembering into notes, move open tasks forward, and send me at most one message with reminders due today. Never ask for or store credentials.

Inspired by vidarh on Hacker News: Hacker News comment on a small self-built assistant over Matrix. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.

What can go wrong?

  • A light sandbox is not enough for lots of untrusted input; the author plans a VM.
  • Web access is still a leak path; watch what it fetches.

Our take

The design is the attraction: small, auditable pieces chosen for isolation. Read-only mail through tools, rather than a password, is a pattern every personal agent should copy, because it limits damage from a prompt injection. vidarh's build is for people comfortable running servers, but the choices transfer. A Matrix server with federation disabled on a private network keeps the chat in your hands. Each tool runs in its own sandbox, and the mailbox is reachable only through tools that can search and read but never hold your credentials or send. That limits what a prompt injection hidden in an email could do. He notes a light sandbox is not enough for lots of untrusted input and plans to move to a VM, which is the right instinct. Web access remains a leak path, so watch what it fetches. A scheduled heartbeat to tidy memory and tasks keeps it useful. Reach it over your VPN, never from the open internet.

Where the time goes back: You get a personal assistant on your phone without handing your mail or chats to a third-party agent service.

FAQ

Why Matrix?
Running it privately with federation disabled keeps the agents isolated.
How is email kept read-only?
The agent never sees credentials, only tools that perform read operations.

Source and credit

Inspired by vidarh on Hacker News. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.

Inspired by
Hacker News comment on a small self-built assistant over Matrix
Creator
vidarh on Hacker News
Published on
Hacker News
Original date
Oct 8, 2026
License
Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
Originally for
Custom agent
AI dry run
Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Oct 24, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in Privacy & Security

All 22 Privacy & Security playbooks →

Related playbooks

Privacy & SecurityRoutine✓ AI dry run

Approve a daily memory diff from your personal agent

Keep a personal agent's long-term memory accurate by reviewing a short daily list of proposed additions and edits before they are saved.

Credit: PrincessEe on Hacker News

An afternoon+
Privacy & SecurityRoutine✓ AI dry run

Forward vendor spam to an agent that unsubscribes

Clear trade-show and vendor mailing lists without opening each email, and without giving an agent your personal mailbox.

Credit: Vivek V.

Under an hour
Privacy & SecurityPrompt✓ AI dry run

Check your family's cars for open safety recalls

With your relatives' permission, have an assistant work out which cars the family drives from routine emails, check each one against official recall records, explain any open recall in plain words and keep watching, while it flags scam emails on the side.

Credit: Albus (@0xAlbus)

Minutes
Privacy & SecurityWorkflow✓ AI dry run

Keep brainstorming and life admin apart in one agent

Use the same agent for exploring ideas and for private chores without personal details leaking into drafts or tone mixing between jobs.

Credit: Nathan Petralia

Minutes
Privacy & SecurityWorkflow✓ AI dry run

Require hardware-wallet approval for agent crypto moves

If a coding agent can read or move crypto, connect it through a hardware wallet so every value-moving step needs a physical button press and keys never leave the device.

Credit: u/pzarevich on r/AI_Agents

Under an hour