mailwarden CLAUDE.md

Project instructions for Mailwarden, a TypeScript Gmail MCP server that provides email tools without sending, replying to, or forwarding messages. They also describe its design rules and development workflow.

In plain words
What is it for?
Guiding work on Mailwarden’s architecture, Gmail permissions, no-send guarantee, tests, and session-bridge behavior.
Why use it?
They give the coding agent the project’s safety constraints and technical context before it changes the code.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/csitte/mailwarden/claude-md
Clone the repo
git clone --depth 1 https://github.com/csitte/mailwarden
Per session 4,026 This file is loaded in full into every session.
When invoked 4,026 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.04026 $0.04026
Opus 5 $0.02013 $0.02013
Sonnet 5 $0.00805 $0.00805
Haiku 4.5 $0.00403 $0.00403

Measured 2d ago against content hash f00123811420, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mailwarden CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 175 lines

How it starts

The opening of the file, as written. The whole thing — 175 lines — stays where its author put it; the contents beside it link to each section on GitHub.

mailwarden — Projektinstruktionen

Native Gmail-MCP-Server (TypeScript, Node ≥20). Veröffentlicht als npm-Paket mailwarden und in der MCP-Registry als io.github.csitte/mailwarden.

Harte Design-Regeln (nicht ohne Rücksprache ändern)

  • Kein Senden — by design. Es gibt keine compose/reply/forward/send-Tools. Das ist die zentrale Sicherheitszusage gegen Prompt-Injection-Exfiltration und der wichtigste Differenzierer — siehe SECURITY.md. Auch create_filter erzeugt nie eine Forwarding-Regel. Präzise formulieren: von Google erzwungen ist das nur im read-Tier (gmail.readonly); gmail.modify ist bei Google für messages.send zulässig (13.08.2026 live bestätigt), dort trägt die Tool-Oberfläche die Zusage. Nie wieder „die Scopes können nicht senden" schreiben. Das prüft seit 26.08. ein Test (test/send-claims.test.ts + scripts/lib/send-claims.mjs): jede scope-verankerte No-Send-Aussage muss in einer Allowlist stehen — dieselbe Mechanik wie beim Egress-Guard. Eine neue Formulierung bricht npm test, bis jemand sie einträgt. Anlass: die Regel stand hier schon und wurde trotzdem zweimal verletzt (13.08. in sechs Dateien, 26.08. in 0.15.0 ausgeliefert). Seit 20.08. zusätzlich src/egress.ts: ein Checkpoint um request() des Auth-Clients, Allowlist der 15 tatsächlich genutzten Endpunkte — das sind 13 Einträge in ALLOWED, weil einer modify|trash|untrash in einem Ausdruck zusammenfasst; wer die Datei zählt, kommt auf 13, wer Endpunkte zählt, auf 15 (csitte kam bei der Verifikation auf 14, und das kam aus genau dieser Doppeldeutigkeit) — plus vorgeschaltete Denylist (send/drafts/import/insert/Hard-Delete/settings außer filters). Damit ist die Zusage im Server erzwungen — aber weiter nicht am Token: ein gestohlenes gmail.modify-Refresh-Token sendet von woanders. Wer einen Endpunkt neu benutzt, muss ihn dort eintragen, sonst fliegt der Aufruf. Die beiden Listen sind bewusst asymmetrisch (23.08.): die Denylist matcht einen normalisierten Pfad (Upload-Präfixe gestrippt, Mehrfach-Slashes gefaltet), weil googleapis bei media auf /upload/gmail/v1/... zielt — ein realer Sendeweg, den auf /gmail/v1 verankerte Regeln nie sahen. Die Allowlist matcht weiter roh und darf das nie ändern: sonst bekäme jeder erlaubte Endpunkt eine zweite, ungeprüfte Schreibweise. Merksatz: Denylist so breit wie die API wirklich ist, Allowlist so eng wie mailwarden wirklich ist.
  • Kein Hard-Delete. Nur trash/untrash (wiederherstellbar).
  • Live-API, kein Cache. Kein Mailbox-Spiegel, kein Suchindex. Einziger lokaler Zustand: ~/.mailwarden/ (credentials.json, token.json, ggf. token.<account>.json).
  • Suchtreffer werden re-verifiziert. threads.list (nicht „der Suchindex") kann Read-State-Operatoren aus einem veralteten **Thread-**Read-State beantworten (gemessen 15.08.2026: 131 Treffer für category:updates is:unread, davon 114 ohne eine einzige ungelesene Nachricht = 87 %; in der Nacht darauf über beide Endpunkte nachgemessen 132/114 — eine Mail kam dazwischen, beide Zahlen stehen, und welche Zahl aus welcher Messung stammt, steht in docs/measurements.json (ein Test prüft, dass keine Zahl ohne Beleg im Repo steht) — im selben Durchgang ein zweites Postfach mit 0 Drift, und dieselbe Query über messages.list im selben Postfach in derselben Minute: 19 Treffer, 0 veraltet). search() geht über threads.list und prüft deshalb jeden Treffer gegen die echten Labels; der Message-Pfad (bulk_modify) ist ein anderer Fall. Drei Formulierungen sind verbrannt und nicht wiederzubeleben: der Index „verwerfe is:unread" (falsch — dieselbe Query ohne das Prädikat liefert 800+, es wirkt also), es liege an bestimmten Operator-Kombinationen (falsch — auch die simpelste Query zeigt den Effekt; „größter Effekt" nur absolut, 136 Threads, in Prozent ist sie mit 58 % die schwächste), und es betreffe is:unread allgemein (unbelegt — das zweite Postfach widerspricht). Belegt ist: postfachabhängig, und ein Server kann vorher nicht wissen, in welchem er steckt. Demo gegen eine Fake-API: node scripts/demo-reverify.mjs; Messung im eigenen Postfach: node scripts/probe-reverify.mjs.

Read the full file on GitHub · 175 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 175 lines · 4,026 tokens per session scan A f00123811420

Subscribe to this mod's changes

mailwarden CLAUDE.md is an instructions file published in the GitHub repository csitte/mailwarden (0 stars, last pushed 2d ago), licensed MIT. It adds 4,026 tokens to every session, about $0.0201 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.