Appearance
Tell N agents to "stay in your lane" and under pressure they won't — but give the runtime a {path, read, write, delete} tuple per agent and the violation becomes an error, not a rationalization.
Principle
Domain Locking Scales Multi-Agent Safety
The core asymmetry
Prompt-level rules are advisory. Runtime permissions are enforced.
Prompt-level "please don't"
"Frontend dev: please do not
touch apps/backend/**."
1.task gets hard
2.agent rationalizes
3."fastest way to fix it"
4.writes to backend anyway
5.commit lands
violation visible only in git diff — after the damage
Per-path permission tuple
runtime: write(apps/backend/x.py)
by frontend-dev → denied
1.task gets hard
2.agent tries the shortcut
3.tool call returns error
4.no rationalization possible
5.agent finds another way
violation blocked pre-emptively — at the syscall
Under pressure, advice gets ignored and rules get obeyed — the difference is whether the runtime returns an error.
The mechanism
Per-path, per-operation, per-agent — a lookup, not a negotiation.
// backend-dev's domain declaration
{
path: "apps/backend/**",
read: true, // can see
write: true, // can edit
delete: false // cannot remove
}
// frontend-dev attempts: write("apps/backend/auth.ts")
// lookup → no matching rule → ERROR, tool call failsREAD
Broad — workers read everything in scope. Context needs it.
WRITE
Narrow — scoped to the agent's domain. This is the guard.
DELETE
Narrowest — separate from write. Irrecoverable ops deserve their own bit.
Permissions are per-path, not per-agent-name — "can agent X write path Y?" answers in constant time, no coordination.
What the locks say about the hierarchy
Leads read; workers write their domain; nobody owns shared paths.
Lead
everything
plan file only
never
Worker (scoped)
in-scope
own domain
own domain
Lead with write
everything
everywhere
everywhere
Give a lead write permissions and the hierarchy inverts — leads execute, workers wait, throughput collapses. The permission tuple is the delegation discipline.
Shared files (package.json, schemas) are explicit — if two agents want to write the same path, that's the signal to refactor until only one does.
Why this matters at N>1
No locks? Works at one agent. Breaks at two. Catastrophic at five.
N=1
WORKS
no one to collide with
N=2
SHAKY
first mid-task clobber
N=3
DEGRADED
contention is constant
N=5
CATASTROPHIC
partial progress irrecoverable
Coarse-grained write access collapses to single-writer chaos. Multi-agent scaling is gated on per-path enforcement — there is no other mechanism that survives concurrency.
The system that works great with one agent is not the system that works with five — and you discover this the expensive way.
Both halves are needed
The lock is the mechanism. Leads-don't-execute is the policy.
Mechanism
Domain locking
Runtime per-path enforcement. Without it, policy is advisory.
Policy
Who gets which lock
Leads delegate, workers execute. Without it, locks just block random writes.
Mechanism without policy is arbitrary. Policy without mechanism is optimistic.
Together they are the only configuration that scales.
The discipline
"Stay in your lane" is a wish. A permission tuple is a fence.
Multi-agent safety is not something you ask the agents to uphold. It's a property of the runtime that denies the syscall before rationalization has a chance to speak.