Skip to content

v0.1.7 — a claim holds against the shell

Choose a tag to compare

@maksymenkoml maksymenkoml released this 26 Aug 19:09
· 2121 commits to main since this release

Install or upgrade:

npm install -g agents-can-communicate@0.1.7
acc install

The one that matters

A guarded claim stopped a file edit and nothing else. The shell went straight through it — on all four clients, in a workspace ACC reported as protected.

Found by asking a live Codex session to append a line to a file another agent held:

printf '%s\n' '// via shell' >> src/parser.mjs
→ Appended. Verified the final line and Git diff.

sed -i, mv, rm and git restore behaved the same way. That was a deliberate decision, and its reasoning was sound — a path guessed out of a command blocks work at random and still misses real writes. What it did not account for is that agents in these harnesses are told to prefer the shell for file edits, so the uncovered path was not the exotic one. It was the default one.

The fix does not guess

A command is read for the positions where a write is unambiguous, and for nothing else:

seen not seen
> file, >> file, 2> file < file, 2>&1, /dev/null
tee, touch, truncate, dd of=, rm, mv, cp, ln cat, grep, wc
sed -i, perl -i sed without -i
git restore, git checkout -- git diff, git log -- path

Quoted text is text, a heredoc body is content, every command in a chain is read, and anything unparseable yields nothing rather than a guess. A read is never reported — that is what makes partial coverage safe.

The injected context now says where the guard ends, where an agent reads it:

- file edits are blocked; edits made through a shell are not
+ file edits and recognised shell writes are blocked; a runtime can still get past

The old line was honest about the gap and, read by an agent under instructions to use the shell, amounted to directions around the guard. A language runtime opening the file is still unseen.

Also

  • acc release --resource — a claim is given back the way it was taken, instead of via a round trip through acc status --json for an id the caller never chose
  • acc uninstall clears the trust record Codex keeps about ACC's hooks — five tables per install, naming a plugin that no longer existed. Verified inert before touching them: a hook whose recorded hash no longer matches still runs

Verified on the published artifact, against the real client

1. claimed, live Codex, shell write:
     Command blocked by PreToolUse hook: file:src/parser.mjs is claimed by alice
     Command: printf 'y' >> src/parser.mjs        on disk: 0 changes

2. claimed, live Codex, reads through the shell:
     cat / grep -c parse → exit 0, not blocked

3. acc release --resource file:src/parser.mjs → released, 0 claim(s)

4. the identical shell command, now → file changed

Step 2 matters as much as step 1: a guard that blocked reading would be a worse regression than the hole it closes. Step 4 separates a guard from a breakage — a hook that denied everything would pass step 1 alone.

Record

Built from d61967d
Tarball agents-can-communicate-0.1.7.tgz, 142 KB, 110 entries
sha256 16bbddfe242df6da5bf48aeec30a6f0c70cd7491cfbb71320fa4d60ef408c642

Digest verified by downloading the tarball back from the registry. 906 tests passing, 0 failing.