# Security

> The threat model, prompt injection, secrets, and the checklist.

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

For agents: Threats and defenses: prompt injection via files/web/issues/tool output (content marked as data, never instructions; the policy check is outside the model; no self-approval; egress allowlist limits exfiltration), secret leakage (secrets injected only into processes, redacted from logs and prompts, never in memory), runaway cost (held budgets, hard stops), destructive actions (always-ask tier, re-check before acting, branch-only writes), supply-chain (new dependencies need approval; registries via proxy), sandbox escape (microVM/container isolation, Rust supervisor, no credentials inside), cross-tenant (one sandbox per task, destroyed).

## Threat model

| Threat                                                                                     | Defense                                                                                                                                                                                              |
| ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Prompt injection**: a file, web page, issue or tool result says «ignore your rules and…» | that content is marked as data, never instructions; the permission check runs outside the model; the agent cannot approve its own requests; the egress allowlist limits where anything could be sent |
| **A secret leaks**                                                                         | secrets reach only the processes that need them; they are removed from logs and prompts; never stored in memory                                                                                      |
| **Runaway cost**                                                                           | budgets are held before a task starts; hard stop at 100 %                                                                                                                                            |
| **A destructive action**                                                                   | the always-ask tier; the agent checks again after approval; it writes only to its own branch                                                                                                         |
| **A malicious dependency**                                                                 | adding one needs approval; registries are reached through the proxy                                                                                                                                  |
| **Escaping the sandbox**                                                                   | isolated machines or containers, a Rust supervisor, and no credentials inside to steal                                                                                                               |
| **One customer reaching another**                                                          | one sandbox per task, destroyed at the end; nothing shared                                                                                                                                           |

## Checklist

- Keep `sypnia.toml` (its `[agent]` table holds the agent's rules) in the repository and review changes to it like code.
- Put production secrets only in your secrets store, never in the repository.
- Keep **always ask** for production data and messages to real people.
- Review the task log of anything that touched production.
