# Threat model

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

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

For agents: Run threat model: malicious builds (fresh container, per-project role, no SSM/control plane), malicious apps (per-app roles, per-project KMS, CloudFront-only prefixes, no inter-app network), bypassing the edge (CloudFront-signed function URLs, ALB-only security groups), cookie theft (sypnia.app on PSL), post-install exfiltration (no secrets in builds unless marked, masked), leaked deploy token (scoped, revocable, OIDC), agent mistakes (approval for production), subdomain takeover (names reserved 30 days, detach before DNS removal), DoS (per-project limits, Shield Standard), compromised control plane (no clear secrets, tag-scoped roles, audit). security@sypnia.com.

| Threat                                                            | Answer                                                                                                                                   |
| ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| A malicious build reads another customer's code or secrets        | fresh container per build; per-project build role limited to its own prefixes; no Parameter Store or control-plane access                |
| A malicious app reads another app's data or files                 | per-app execution roles, per-project KMS keys, prefixes readable only by CloudFront, no network path between apps                        |
| An app calls another app's server directly, skipping the edge     | Lambda function URLs accept only CloudFront-signed requests; Fargate security groups accept only the load balancer                       |
| Deployed code steals Sypnia session cookies                       | apps are served on `sypnia.app` (Public Suffix List), never on `sypnia.com`                                                              |
| A dependency with a post-install script exfiltrates build secrets | secrets are not in builds unless marked; marked ones are masked; builds have no access to runtime secrets                                |
| A leaked deploy token is used                                     | scoped to one app and listed environments, revocable, `last_used_at` visible; GitHub OIDC avoids stored tokens                           |
| An agent deploys or rolls back production by mistake              | production actions from MCP need a person's approval                                                                                     |
| A subdomain takeover after an app is deleted                      | `<app>.sypnia.app` names are reserved for 30 days after deletion; custom domains are detached from CloudFront before records are removed |
| Denial of service on one app exhausts a cell                      | per-project concurrency and task limits; CloudFront and AWS Shield Standard in front                                                     |
| A compromised control plane                                       | the control plane holds no app secrets in clear; its roles can manage only tagged resources; actions are audited                         |

Report a security problem to `security@sypnia.com`.
