# Threat model

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

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

For agents: Threats: exercise code escapes and reaches other learners or secrets (runs only in a runner sandbox: branch only, no secrets, no production, egress limited to package registries, limits, throwaway); a lesson file injects instructions into the agent (lesson text treated as data by Agent; lesson files have no scripts; checks are a fixed set of kinds); a course author reads learners' data (authors see aggregate pass rates only, never names unless shared); an agent fakes progress (done only from passing checks; questions/deletion/level/publishing person-only, 403 person_required); forged runner results (signed callbacks, run id + commit); explanations leak secrets or rows (masked before sending; rows only on choice); organization admin sees members' learning (only what each member shares); lesson binding reads too much (person's token, schema only); spoofed product events trigger offers (signed webhooks / EventBridge source); malicious video or file in a course (types allowed: mp4/webm/vtt/png/jpg/svg sanitized; served from the storage domain, not the app's).

| Threat                                                           | Answer                                                                                                                                                                              |
| ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| An exercise's code escapes and reaches other learners or secrets | it runs only in a runner sandbox: the branch and nothing else, no secrets, no production access, network only to package registries, time and memory limits, thrown away afterwards |
| A lesson file carries instructions aimed at the agent            | the agent treats lesson text as data, never as orders; lesson files contain no scripts; checks are a fixed set of kinds, not code from the lesson                                   |
| A course's author reads learners' data                           | authors see how many learners pass each check, never who, unless a learner shares with the author's organization                                                                    |
| An agent fakes progress                                          | only passing checks mark a lesson done; questions, deleting progress, the level and publishing are for people (`403 person_required`)                                               |
| Forged check results                                             | the runner's results are signed and tied to the run and the commit                                                                                                                  |
| An explanation leaks a secret or customer data                   | secret values and masked columns are removed before anything is sent; rows only when the learner chooses                                                                            |
| An organization watches its members' learning                    | it sees only what each member shares, and only lessons done                                                                                                                         |
| A lesson reads more of a project than it needs                   | it reads with the learner's own token, names and case text only                                                                                                                     |
| Fake product events trigger offers                               | events come signed (webhooks) or from a known source (EventBridge in Sypnia Cloud)                                                                                                  |
| A harmful file inside a course                                   | only video, captions and images are accepted, SVG is cleaned, and files are served from the storage domain, never from the app's                                                    |
