# Threat model

> What could go wrong with Sypnia AI, and how each threat is answered.

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

For agents: Threats → answers: leaked secret key (scopes, per-key caps, refused from browsers, revoke within 60 s, alerts on unusual spend); stolen browser token (10 min, one person, browser routes, per-person caps, origins); one person abusing a public feature (end_user limits required, moderation); prompt injection making the model leak or act (locked instructions, tool allowlist, your server confirms actions, minimal context); provider keeping data (zero-retention only in Cloud); Sypnia staff reading prompts (not stored by default; kept bodies encrypted per project, reads audited and shown); runaway agent spending (MCP cannot change limits/keys/routes; Sypnia-Budget per step); price/usage tampering (server-side counting, idempotent records); SSRF via image URLs (https only, no private addresses, 10 s); denial of service (CloudFront, per-minute limits, reservations).

| Threat                                                 | Answer                                                                                                                                                                                                                                               |
| ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| A secret key leaks and someone spends your credits     | keys have scopes and their own caps; a secret key from a browser is refused; a revoked key stops within a minute; unusual spending sends a notice to owners and admins                                                                               |
| A browser token is stolen                              | it lasts 10 minutes, serves one person, only tasks marked for browsers, within that person's limit, from your sites only                                                                                                                             |
| One person of your app asks a thousand questions       | browser routes must have a per-person limit; moderation stops abusive content                                                                                                                                                                        |
| A message talks the model into leaking or doing things | instructions are locked in the route, tools are allowed by name, your server confirms every action that changes something, and the model only gets what this person may see ([Prompt injection](https://ai.docs.sypnia.com/safety/prompt-injection)) |
| A provider keeps or trains on what you send            | Sypnia Cloud uses only providers that commit to neither                                                                                                                                                                                              |
| Someone at Sypnia reads what your customers wrote      | it is not kept unless a route keeps it; then it is encrypted per project, and every read is recorded and shown to the project                                                                                                                        |
| An agent spends without limit                          | agents cannot change routes, limits or keys; each step of an agent task carries its remaining budget                                                                                                                                                 |
| Usage is counted wrong                                 | tokens are counted by the gateway itself; each record carries its call id, so it is never counted twice                                                                                                                                              |
| An image address points inside a private network       | the gateway fetches only `https://` addresses, never private ones, for at most 10 seconds                                                                                                                                                            |
| A flood of calls                                       | CloudFront, per-minute limits, and reservations that refuse calls the balance cannot cover                                                                                                                                                           |
