Skip to content
Lubo Bali
All projects

AI agentsProductivity

Sentinel-AI

An AI agent that sorts your inbox, and can never send or delete a thing

4safety layers before the AI touches an email

See the code on GitHub (opens in a new tab)

Proof you can check:Code on GitHub

AI agents

4 safety layers before the AI acts

  1. Allowlistonly senders you trust get in
  2. Injection guardemails that try to trick the AI are blocked
  3. AI sorts ita second provider if the first fails, then a no-AI backup
  4. Answer checkbroken or unsure means "needs review", never an action
  • Meeting
  • Action
  • FYI
  • Needs review

Lubo Bali · lubobali.com

No. 03Never sends, never deletes

The problem

An AI agent on a real inbox can be tricked by one bad email, act twice on the same message, or act on a broken answer. Most demos skip this part.

What I built

Sentinel triages a Gmail inbox: it sorts each email into Meeting, Action or FYI, adds a label and puts meeting requests on the calendar as tentative. When it isn't sure, it marks the email for a person to check.

Tech & why

Two AI providers plus a keyword sorter with no AI as the last backup, so it keeps working when a provider is down. FastAPI and Postgres keep it simple and auditable.

  • Python
  • FastAPI
  • Gmail API
  • PostgreSQL
  • Docker

The result

Runs on a server with 181 tests at 93% coverage. It labels emails and holds meeting times, and it has no power to send or delete anything.

How this agent is built

Every AI agent has the same five parts. Here is what each one is in Sentinel-AI, so you can judge any agent the same way.

  1. ModelAn AI model from one provider, a second provider (NVIDIA) if it fails, and a keyword sorter with no AI as the last backup.
  2. HarnessA scheduled heartbeat: fetch, filter, sort, label, remember. Every email is handled once, even after a restart.
  3. GuardrailsSender allowlist, prompt-injection guard, fail-closed on bad AI output, and no send or delete ability at all.
  4. KnowledgeOnly emails from allowed senders, plus a Postgres record of every email already handled.
  5. ToolsGmail (read and label only) and Google Calendar (tentative events). Nothing else.

Safe by design

Only allowed senders reach the AI, tricks are blocked before it reads them, a bad answer means "needs review" instead of an action, and it has no power to send or delete.

Similar projects

Have a problem like this? Get your free AI blueprint in about a minute.

Tell me your problem. I'll find a way to build the solution.

Available now

Book a free 30-min call (opens Calendly in a new tab)

No obligation. Pick a time that suits you.

Prefer email?data@lubobali.com