|
| 1 | +# Sensitive Write Boundary |
| 2 | + |
| 3 | +## Purpose |
| 4 | + |
| 5 | +Sensitive Write Boundary defines the project-control surfaces an AI coding |
| 6 | +agent must not create, edit, move, or delete without explicit user confirmation |
| 7 | +in the current task. |
| 8 | + |
| 9 | +It is a pre-write approval gate, not a diff-review checklist: |
| 10 | + |
| 11 | +```text |
| 12 | +planned write -> protected-surface match -> explicit confirmation -> scoped write -> evidence |
| 13 | +``` |
| 14 | + |
| 15 | +`sensitive-code.md` classifies risky content after a diff exists. This boundary |
| 16 | +acts earlier: it stops an unconfirmed write to a project-control surface before |
| 17 | +the diff is created. |
| 18 | + |
| 19 | +## Protected Surfaces |
| 20 | + |
| 21 | +Trigger before any write whose target path matches one of these surfaces: |
| 22 | + |
| 23 | +| Surface | Typical paths | Why it is protected | |
| 24 | +| --- | --- | --- | |
| 25 | +| Repository root files | `README.md`, `AGENTS.md`, `LICENSE`, `package.json`, lockfiles, dotfiles such as `.gitignore` or `.editorconfig` | They define project identity, agent behavior, and dependency contracts for every consumer. | |
| 26 | +| Configuration | `config/`, linter and compiler configs, environment templates | One edit silently changes behavior for all builds, tools, and agents. | |
| 27 | +| Documentation contracts | `docs/`, ADRs, specs, published architecture | They are the reviewed source of truth other work is validated against. | |
| 28 | +| Shared automation | `tools/`, `scripts/` | Other workflows, hooks, and CI jobs execute these paths. | |
| 29 | +| Hook lifecycle | `hooks/`, Git hook wiring, agent hook definitions | Hooks run automatically and can block or bypass safeguards. | |
| 30 | +| CI/CD and release | `.github/workflows/`, pipelines, release and install scripts | Supply-chain and release paths execute with elevated trust. | |
| 31 | +| Migration and schema | database migrations, schema definitions, seed data | Effects persist in data and are hard or impossible to roll back. | |
| 32 | + |
| 33 | +Projects may extend this table with their own control surfaces. Keep the |
| 34 | +project-specific path list in project policy or analyzer config; this document |
| 35 | +owns the boundary rule, not the path inventory. |
| 36 | + |
| 37 | +## Confirmation Rules |
| 38 | + |
| 39 | +1. Match the target path against the protected surfaces before writing, not |
| 40 | + after the diff exists. |
| 41 | +2. Confirmation must be explicit, current, and scoped: the user names the |
| 42 | + surface or file, the intended change, and the expected effect. Silence, |
| 43 | + topic similarity, or a generic "go ahead" from an earlier task does not |
| 44 | + qualify. |
| 45 | +3. Approval does not carry over. One confirmation covers one described write |
| 46 | + set; a new task, session, or additional surface needs fresh confirmation. |
| 47 | +4. A task instruction authorizes a protected write only when it names the |
| 48 | + surface. "Fix the failing tests" does not authorize editing a CI workflow; |
| 49 | + "update `.github/workflows/ci.yml` to fix the failing job" does. |
| 50 | +5. Without confirmation, the agent proposes instead of writing: target paths, |
| 51 | + a change summary, the reason, and the expected effect, then waits. If the |
| 52 | + change can live outside a protected surface, route it there instead. |
| 53 | +6. Never batch a protected write silently inside a broader change. Surface it |
| 54 | + as its own confirmation item even when the rest of the change is approved. |
| 55 | + |
| 56 | +## Required Evidence |
| 57 | + |
| 58 | +For every write to a protected surface, record: |
| 59 | + |
| 60 | +- target path and matched surface category |
| 61 | +- confirmation source: the user message or instruction that named the surface |
| 62 | +- change summary and expected effect |
| 63 | +- validation command or test run after the write |
| 64 | +- rollback route if the write must be undone |
| 65 | + |
| 66 | +## Escalation |
| 67 | + |
| 68 | +If a protected write already happened without confirmation: |
| 69 | + |
| 70 | +1. Report it immediately; do not fold it into an unrelated summary. |
| 71 | +2. Show the diff and offer to revert. |
| 72 | +3. Route the diff through `review-trigger.md` and `sensitive-code.md` for |
| 73 | + review classification before any further work builds on it. |
| 74 | + |
| 75 | +## Non-Goals |
| 76 | + |
| 77 | +This file does not: |
| 78 | + |
| 79 | +- implement permission enforcement, sandboxing, or filesystem ACLs |
| 80 | +- replace code review or the diff classification in `sensitive-code.md` |
| 81 | +- restrict reads, analysis, or drafting proposals about protected surfaces |
| 82 | +- own Git or agent hook mechanics; use `git-hooks.md` for hook lifecycle |
| 83 | + placement |
| 84 | + |
| 85 | +It defines when a write needs explicit user confirmation and what evidence the |
| 86 | +confirmation and the write must leave behind. |
0 commit comments