# Threat model

> What could go wrong in Sypnia Mail, and how each threat is answered.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://mail.docs.sypnia.com/security/threat-model/

For agents: Mail threat model: leaked key (scopes, from/template limits, volume guardrails pause, revoke); spoofed domain (verified domains only via DNS control); shared reputation abuse (warm-up, limits, suppression, thresholds, review); template injection (HTML-escaped variables, raw {{{ }}} flagged); webhook spoofing (HMAC + timestamp); reading others mail (project scope, encrypted bodies, deleted at retention); inbound malware (SES verdict, dropped); agent sending (approval every time).

| Threat                                                      | Answer                                                                                                                                                            |
| ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| A leaked key sends spam or phishing from your domain        | keys have scopes; `send` keys can be limited to some `from` addresses and templates; sudden volume trips the guardrails and pauses sending; revoke in one command |
| Someone sends from a domain they do not own                 | sending needs a verified domain; verification needs DNS control                                                                                                   |
| One customer's spam hurts everyone's delivery               | warm-up, rate limits, automatic suppression, bounce and complaint thresholds, acceptable-use review                                                               |
| Template injection: user data breaks the HTML or adds links | variables are HTML-escaped by default; raw output needs `{{{triple}}}` and is flagged in review                                                                   |
| Webhook spoofing                                            | HMAC signatures with timestamps; `verifyWebhook` rejects old or unsigned requests                                                                                 |
| Reading other people's e-mails                              | event logs and bodies are scoped to the project; bodies are encrypted and deleted at the end of retention                                                         |
| An inbound attachment carries malware                       | SES virus verdict; infected messages are dropped                                                                                                                  |
| An agent e-mails customers on its own                       | `send_email` over MCP needs approval every time                                                                                                                   |
