Skip to content

Commit 69846dd

Browse files
author
东夷
committed
docs(references): add sensitive write boundary for project-control surfaces
Add references/project-harness/sensitive-write-boundary.md, a pre-write approval gate requiring explicit, current, scoped user confirmation before an AI coding agent writes to project-control surfaces: repo root files, config/, docs/, tools/, scripts/, hooks/, CI/CD, and migration/schema paths. The boundary acts before a diff exists and complements sensitive-code.md, which classifies risky content after. Register the doc in the Project Harness domain README under Owns and Read Next. Docs-only change; no scripts, fixtures, or graph regeneration needed since the doc is outside the skill routing chain. Validated with node --test test/doc-link-graph.test.mjs (6/6 pass) and the docs-relevant suite subset (32/32 pass).
1 parent b2e621d commit 69846dd

2 files changed

Lines changed: 90 additions & 0 deletions

File tree

references/project-harness/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ acceptance, change safeguards, and recovery boundaries.
3131
applicability, and validation evidence.
3232
- `review-trigger.md`: recommendation and review-trigger policy.
3333
- `sensitive-code.md`: sensitive-code review and reporting boundaries.
34+
- `sensitive-write-boundary.md`: pre-write confirmation gate for
35+
project-control surfaces.
3436

3537
## Does Not Own
3638

@@ -52,4 +54,6 @@ acceptance, change safeguards, and recovery boundaries.
5254
- Use `friendly-cli.md` for command interface design.
5355
- Use `recovery-evidence.md` for rollback and recovery inspection.
5456
- Use `sensitive-code.md` for sensitive-code review boundaries.
57+
- Use `sensitive-write-boundary.md` for pre-write confirmation on
58+
project-control surfaces.
5559
- Use `git-hooks.md` for Git hook lifecycle placement and evidence.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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

Comments
 (0)