Clearbox AI Inbox Cleanup for Gmail and Outlook
A self-hosted Gmail and Outlook assistant: Microsoft-Decision-1 scores email, code adds guardrails and reasons, and the owner approves every move to Trash or Archive.
Key results
1,589
Automated tests passing
179
Commits by Kurniadi in two days
40
Synthetic labeled emails in the model evaluation
- Solo builder: product design, implementation, infrastructure and tests (open source, MIT)
- Oct 2026
- Featured
- L3:clearbox
Results
1,589
Automated tests passing
179
Commits by Kurniadi in two days
40
Synthetic labeled emails in the model evaluation
Problem
Cleaning a busy inbox means reading email by email. Simple filter rules either miss bulk mail or trash something that mattered, and hosted cleanup services need broad access to the mailbox.
Contribution
- I built a per-email pipeline: Microsoft-Decision-1 on Microsoft Foundry returns trash, archive, keep and unsure probabilities; code derives reasons from headers and history, applies guardrails and sender priors, then fuses the scores. Trash suggestions must clear a threshold, calibrated only with enough labels. Moves need owner approval, with Undo for 24 hours and no permanent deletion.
- Review groups email by sender with a confidence band and up to three reasons from real signals; one Clean up moves only approved mail to Trash or Archive, with Undo for 24 hours and no permanent delete path.
- Once enough labels are available, a nightly job targets at least 98% agreement with the owner's trash decisions, using the newest 500 labels: at least 50 eligible labels and 20 supporting labels per candidate threshold. It searches 0.80 to 0.99 and falls back to 0.99 if none qualifies. Approvals and overrides update sender priors.
- It runs on Cloudflare Workers and D1 (EU jurisdiction) behind Cloudflare Access, with least-privilege OAuth, AES-256-GCM encrypted tokens, metadata and snippets only, and a Bicep deployment for the model in Sweden Central.
Gallery
Code and research
Repositories on GitHub
Tech stack
TypeScript
ReactVite
Tailwind CSS
Hono
Cloudflare Workers
Cloudflare D1
Microsoft Foundry
Bicep
Vitest