harnessie.com  /  docs  /  File ownership

Harnessie's Golden Rule for agent work

Read together. Write only what you own.

Shared context makes a group of agents useful. Shared write authority makes their work fragile. Two agents can read the same artifact, form different plans, and contribute complementary results. If both can silently replace the same file, however, the last writer wins and neither agent can prove which work survived.

Harnessie calls its answer the Golden Rule for agent work. The memorable phrase is communications shorthand. The technical mechanism is ownership lanes, enforced below the prompt.

What the rule means

An agent may use shared workspace context, but it may change only paths where the ownership ledger gives it write authority.

The operator remains the root owner. The operator can reassign a path or deliberately declare a collaborative lane. The rule constrains agents, not the human accountable for the run.

The harness enforces it twice

A prompt can ask an agent to respect ownership. Harnessie makes refusal independent of whether the model cooperates.

  1. Direct tool writes are checked against OWNERSHIP.yaml. A cross-lane write is refused with the owner's identity and the request_change remedy.
  2. Child commands receive agent-specific read-only overlays for operator lanes, other-agent lanes, and other agents' first-writer claims. This covers shell calls, deterministic checks, and verifier execution. If the host cannot prove the required nested read-only confinement, the child process does not run.

Parallel workflow members execute in isolated phase workspaces. When a parallel group opts into declared writes:, every member must declare its intended paths and overlapping declarations refuse before workspace creation or model dispatch. Ownership lanes still apply inside each isolated phase workspace.

How this differs from adjacent patterns

PatternWrite modelWhere a collision appears
Prompt-only cooperationAgents are asked not to interfereA model can ignore or misunderstand the rule
Worktree isolationEach parallel agent writes a separate checkoutConflicts appear when results are integrated
Shared-state conflict detectionMultiple writers are allowed; stale or competing writes are rejectedAt the attempted shared-state update
Harnessie ownership lanesWrite authority is declared or acquired by first write; cross-lane writes are deniedBefore a direct write, inside child-process confinement, or before a declared parallel group dispatches

Harnessie does not claim that cross-agent overwrite prevention is a unique problem or that ownership is the only valid coordination design. Its specific claim is falsifiable: within the shipped boundary, an agent cannot write across an ownership lane through a built-in direct write or a confined child process, and declared overlapping parallel writes refuse before dispatch.

This is why Harnessie treats cooperation prompts as guidance, not as a control. Anthropic's August 2026 multiagent experiments report coordination failures, collusion, and sabotage in agent swarms. Ownership lanes are a structural response to that class of failure: write authority is checked at dispatch and carried into child-process confinement even when a model does not cooperate.

Boundaries and exceptions

Verify the claim

The enforcing paths are harness/ownership.py, harness/sandbox.py, and the operator-owned OWNERSHIP.yaml. The threat-model claim and proof references are collected in Threat model.

From a source checkout after installing the development dependencies:

Literal

python3 -m pytest -q tests/test_ownership.py::test_cross_agent_write_denied_at_dispatch tests/test_ownership.py::test_run_shell_receives_agent_specific_readonly_roots tests/test_runner.py::test_parallel_declared_write_conflict_refuses_before_dispatch tests/test_sandbox.py::test_readonly_lane_backend_failure_blocks_child

These deterministic tests prove direct denial, compilation of agent-specific read-only roots, pre-dispatch parallel conflict refusal, and fail-closed behavior when lane confinement is unavailable. Platform-backed sandbox tests add a live interpreter probe when the required backend is present.

Run the collision proof

The executable repository example performs an actual built-in write_file collision in a temporary workspace. Alice writes first. Bob attempts to replace the same artifact. The script exits 0 only when Bob receives ownership_denied, Alice's bytes survive unchanged, and the ledger still names Alice as owner. It makes no model or network call and does not modify the checkout.

Literal

python3 examples/ownership-collision/demo.py

The final line must be Golden Rule proof: PASS.

Inspect a policy before a run

Shipped in Harnessie 1.1.0, harnessie ownership evaluates the same ledger decision used by write_file without claiming or changing the path.

Replace: PROJECT_ROOT -> the Harnessie project directory containing OWNERSHIP.yaml

Replace: WORKSPACE_PATH -> the path to inspect, relative to that project's workspace/

Replace: AGENT_NAME -> the agent identity to evaluate

Customize

python3 -m harness.cli --root PROJECT_ROOT ownership WORKSPACE_PATH --agent AGENT_NAME

The human-readable result names ALLOWED or DENIED, the governing source, owner and pattern when present, the reason, and any remedy. Add --json for a schema-versioned machine result. Schema version 1 fixes the fields and the source vocabulary (operator_lane, agent_lane, collaborative_lane, first_writer, or unowned); remedies are request_change, operator_reassignment, or null. A valid explanation exits 0 regardless of allow or deny; malformed input exits 2.

The short version

Harnessie's Golden Rule for agent work is simple enough to remember and strict enough to test:

Read together. Write only what you own.

The rule is the explanation. Ownership lanes are the enforcement.