| 1 | # Prompt-injection defences |
| 2 | |
| 3 | The [Fable follow-up](2026-11-19-injection-defences-follow-up.md) supersedes |
| 4 | the diagnostic, browser-preview and scanner details below. |
| 5 | |
| 6 | Paul approved this work on 2026-11-19 after Fable's review of |
| 7 | oficina/equipo main 449e9c14. Implementation starts from main abed8933. |
| 8 | Authority comes from a person's tap or a standing project setting they chose, |
| 9 | combined with deterministic checks. Model text cannot grant authority. |
| 10 | |
| 11 | ## Merge (H1) |
| 12 | |
| 13 | The checks executor takes gate definitions from BaseSHA and runs them against |
| 14 | candidate source. Pin .amadan/ci, .amadan/ci.d, Makefiles and a base-declared |
| 15 | list of supporting gate files. Candidate changes cannot select the gate. |
| 16 | Missing or unreadable base evidence fails closed. Hosted CI that executes |
| 17 | candidate definitions cannot substitute for base-run checks. |
| 18 | |
| 19 | The base must contain `.equipo/gates.json` version 1 with an explicit `files` |
| 20 | list of gate dependencies. Missing contracts or declared files report |
| 21 | `base_gate_unavailable`; a contract added by the candidate cannot certify that |
| 22 | candidate. Existing projects need an owner-approved bootstrap commit before |
| 23 | base-run checks can certify later work. Mac worker results remain diagnostic |
| 24 | until their executor can enforce immutable base gates, and cannot grant |
| 25 | standing auto-merge authority. |
| 26 | |
| 27 | Both checked and unchecked decisions evaluate change criteria. For checked |
| 28 | work, the additional human decision is limited to edits to gate files or a |
| 29 | truncated Review diff. Existing execution, review, sandbox, hold and project |
| 30 | policy checks still apply. The owner can enable “Auto-merge even when CI files |
| 31 | change” for the project to allow those cases with passing base-run checks. |
| 32 | The setting starts off. Review receives the diff as quoted data that cannot |
| 33 | close its own framing. Older runners cannot certify the new guarantees. |
| 34 | |
| 35 | ## Previews (H2) |
| 36 | |
| 37 | Use the paired private devbox preview host by default, without a tap. Public |
| 38 | Carloku temporary previews require the owner's “Publish previews publicly” |
| 39 | project setting, initially off. Recheck current authority at publish time. |
| 40 | Every export receives a fixed _headers Content-Security-Policy restricting |
| 41 | connections, scripts, images, forms and frames to the required local surface. |
| 42 | Scan exports for secrets using trusted scanner definitions before any publish. |
| 43 | A finding or unavailable scanner refuses publication with a clear status card. |
| 44 | |
| 45 | CARLOS must accept Content-Security-Policy through its static-header parser. |
| 46 | The inspected platform main (0acb2767) and installed CLI v0.35.5 reject these |
| 47 | headers during archive packing, before publication. Equipo reports that the host |
| 48 | needs an update. A separate tested platform patch is required; this task deploys |
| 49 | nothing. Restart reconciliation only advertises previews with the new runner-owned |
| 50 | security stamp, which is written after policy installation and the secret scan. |
| 51 | |
| 52 | ## Person text and prompts (M5, M4) |
| 53 | |
| 54 | Research pre-approval uses composer-origin messages only. Notebook person |
| 55 | entries must preserve a whole composer sentence, including any negation. |
| 56 | A tapped generated choice is never treated as the person's prose. Historical |
| 57 | notebook entries have no original composer reference. Their text, IDs and times |
| 58 | are preserved, but their source becomes an agent note on upgrade. Old runner |
| 59 | reports cannot restore their person attribution. |
| 60 | CI tails, Review findings and coordinator brief material enter Engineering |
| 61 | prompts as quoted data with source labels. Person words remain separate. |
| 62 | Correct the stale claim that every merge needs a fresh tap. |
| 63 | |
| 64 | ## Settings and verification |
| 65 | |
| 66 | Add the two settings to the existing Settings shell and project roster style |
| 67 | under “What Equipo can do on its own”. Owners edit them with current-roster |
| 68 | checks inside the transaction, revision conflicts and an audit event. Keep the |
| 69 | storage extensible, but expose only these two actions. Revoked owners confer |
| 70 | no continuing authority. Add migration and protocol numbers after main only |
| 71 | where the contract changes require them. |
| 72 | |
| 73 | Write failing tests before fixes, then break each guard and observe its test |
| 74 | fail before restoring it. Run targeted tests and the requested budget, dead |
| 75 | reference, lane and copy release gates. Record mutations and CI in ../report.md. |
| 76 | New UI copy receives the delegated Astra pass authorised by Paul; no copy |
| 77 | review server. Push both branches without merging or deploying. |
| 78 | |
| 79 | The hosted-runner spec receives H3 offline sandbox and mirror boundaries, |
| 80 | M4 quoting, M8 checkpoint provenance and controller-bound certification, and |
| 81 | the five authority rules on design-hosted-runners in a separate commit. |
| 82 | |