| new file mode 100644 |
| index 00000000..9686781d |
| --- /dev/null |
| +++ b/docs/superpowers/specs/2026-11-19-injection-defences.md |
| @@ -0,0 +1,60 @@ |
| +# Prompt-injection defences |
| + |
| +Paul approved this work on 2026-11-19 after Fable's review of |
| +oficina/equipo main 449e9c14. Implementation starts from main abed8933. |
| +Authority comes from a person's tap or a standing project setting they chose, |
| +combined with deterministic checks. Model text cannot grant authority. |
| + |
| +## Merge (H1) |
| + |
| +The checks executor takes gate definitions from BaseSHA and runs them against |
| +candidate source. Pin .amadan/ci, .amadan/ci.d, Makefiles and a base-declared |
| +list of supporting gate files. Candidate changes cannot select the gate. |
| +Missing or unreadable base evidence fails closed. Hosted CI that executes |
| +candidate definitions cannot substitute for base-run checks. |
| + |
| +Both checked and unchecked decisions evaluate change criteria. For checked |
| +work, the additional human decision is limited to edits to gate files or a |
| +truncated Review diff. Existing execution, review, sandbox, hold and project |
| +policy checks still apply. The owner can enable “Auto-merge even when CI files |
| +change” for the project to allow those cases with passing base-run checks. |
| +The setting starts off. Review receives the diff as quoted data that cannot |
| +close its own framing. Older runners cannot certify the new guarantees. |
| + |
| +## Previews (H2) |
| + |
| +Use the paired private devbox preview host by default, without a tap. Public |
| +Carloku temporary previews require the owner's “Publish previews publicly” |
| +project setting, initially off. Recheck current authority at publish time. |
| +Every export receives a fixed _headers Content-Security-Policy restricting |
| +connections, scripts, images, forms and frames to the required local surface. |
| +Scan exports for secrets using trusted scanner definitions before any publish. |
| +A finding or unavailable scanner refuses publication with a clear status card. |
| + |
| +## Person text and prompts (M5, M4) |
| + |
| +Research pre-approval uses composer-origin messages only. Notebook person |
| +entries must preserve a whole composer sentence, including any negation. |
| +A tapped generated choice is never treated as the person's prose. |
| +CI tails, Review findings and coordinator brief material enter Engineering |
| +prompts as quoted data with source labels. Person words remain separate. |
| +Correct the stale claim that every merge needs a fresh tap. |
| + |
| +## Settings and verification |
| + |
| +Add the two settings to the existing Settings shell and project roster style |
| +under “What Equipo can do on its own”. Owners edit them with current-roster |
| +checks inside the transaction, revision conflicts and an audit event. Keep the |
| +storage extensible, but expose only these two actions. Revoked owners confer |
| +no continuing authority. Add migration and protocol numbers after main only |
| +where the contract changes require them. |
| + |
| +Write failing tests before fixes, then break each guard and observe its test |
| +fail before restoring it. Run targeted tests and the requested budget, dead |
| +reference, lane and copy release gates. Record mutations and CI in ../report.md. |
| +New UI copy receives the delegated Astra pass authorised by Paul; no copy |
| +review server. Push both branches without merging or deploying. |
| + |
| +The hosted-runner spec receives H3 offline sandbox and mirror boundaries, |
| +M4 quoting, M8 checkpoint provenance and controller-bound certification, and |
| +the five authority rules on design-hosted-runners in a separate commit. |