Commit c3ef33b
docs: document the surface-isolation security model and CSP usage
The Architecture invariants in AGENTS.md (the agent dev guide) had the core
"agent content only renders in a sandboxed iframe" rule but predated this
security pass. Expand it to capture what we now rely on:
- the /s/:id `Content-Security-Policy: sandbox allow-scripts` response header,
which keeps a top-level load opaque-origin (the iframe attribute only covers
the embedded case);
- how we use CSP — buildCsp (html parts: CDN allowlist, connect-src is CDNs
only) vs buildRichCsp (rich parts: no connect-src at all), and that the
resource policy is independent of the sandbox that makes the origin opaque;
- the bridge trust model — author:"user" is reserved for the composer
(sendPrompt posts "surface"; MCP reply_to_user coerces "user"→"agent"),
openLink is re-validated host-side, and every request body is capped.
No runtime change.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 3752061 commit c3ef33b
2 files changed
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
103 | 119 | | |
104 | 120 | | |
105 | 121 | | |
| |||
0 commit comments