# Threat model

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

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

For agents: Design threats: malicious SVG (script, foreignObject, external href) → sanitized, original quarantined, unsafe_svg; malformed font → parsed, WOFF2/TTF/OTF only, size limit; prompt injection in uploaded brand files or screenshots → treated as data, proposals still need a person; agent approving its own change → impossible (no approve tool, person session required, proposer ≠ approver); leaked token → scopes, no approval, revoke; generated code carrying something unexpected → plain source in a PR, check runs, reviewed; unreleased brand leaking → private gallery, signed expiring links, audit; copying another brand or unlicensed fonts → skills refuse, licence recorded, font_licence_missing; regenerated pieces overwriting your edits → three-way merge in a PR.

| Threat                                                              | Answer                                                                                                                                                                                                 |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| An uploaded SVG carries a script or loads something from outside    | SVGs are sanitized: scripts, event attributes, `foreignObject` and external links are removed; the original is kept aside and never served; a file that cannot be cleaned is refused with `unsafe_svg` |
| A malformed font file attacks the renderer or the browser           | only WOFF2, TTF and OTF, parsed and size-limited before use                                                                                                                                            |
| Text inside an uploaded file gives the agent instructions           | uploaded files are data; nothing in them is followed, and every proposal still needs a person                                                                                                          |
| An agent approves its own change                                    | there is no approve tool in MCP, tokens cannot approve, and the author of a proposal can never be its approver                                                                                         |
| A leaked token changes the guide                                    | tokens have scopes and cannot approve; every action is in the audit log; revoke in one command                                                                                                         |
| Generated code brings something unexpected into the app             | pieces are plain source in a pull request, checked and reviewed like any other code                                                                                                                    |
| An unreleased brand leaks                                           | galleries and pictures are private to the organization; share links are signed and expire; every view of a share link is logged                                                                        |
| A design copies another company's brand, or uses an unlicensed font | the skills refuse to imitate brands; fonts need a recorded licence (`font_licence_missing`)                                                                                                            |
| Regeneration overwrites your edits                                  | regenerated pieces are merged with your edits in a pull request, never written over them                                                                                                               |
