oficina / equipo Public

Specify prompt-injection defences and authority rules

Paul Campbell pushed by paul@keymail.dev 48b041ade97ddfe57b144d1505850afde50c7711 parent abed893
2 files changed, +73 −0
  • AGENTS.md +13 −0
  • docs/superpowers/specs/2026-11-19-injection-defences.md +60 −0
diff --git a/AGENTS.md b/AGENTS.md
index a3a9a576..304199b7 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -5,6 +5,19 @@ Read `docs/superpowers/specs/2026-11-01-equipo-design.md` and the current
controller brief before changing behavior. Task dispatch instructions take
precedence over generic workflows.
+## Model text and authority
+
+1. Model-written text is never the person's words. A tapped option the model
+ wrote is a choice among model text, not a statement by the person.
+2. A change never authorises its own merge. Evidence the candidate can edit
+ (its own checks, its own diff) is never trusted.
+3. Untrusted text enters a prompt only quoted, under a label naming its source.
+4. Anything an agent writes that leaves the system, or opens in a browser
+ beyond the person's private tailnet, needs the person's tap or a standing
+ project setting they chose, plus deterministic checks.
+5. A sandbox that runs agent-chosen code has no network. Dependencies come
+ from a mirror.
+
## Data and authority
- Never use `scope.Owned` or `scope.OwnedBy` for shared team records.
diff --git a/docs/superpowers/specs/2026-11-19-injection-defences.md b/docs/superpowers/specs/2026-11-19-injection-defences.md
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.