sharness.ai / mockups and experiments / policy hash

Policy hash: the one value the person supplies

A mockup of experiment E02, in your browser. Paste a v0 Process Behaviour Policy; it is canonicalised (keys sorted, no whitespace, UTF-8, integers only) and hashed with SHA-256 by your browser's WebCrypto. The result must equal what sharness-ai policy hash prints for the same file. Nothing leaves the page.

Why this matters: the hash is what the person gives the launcher from outside the agent, so a prompt-injected agent cannot widen a policy without the hash changing. For that to work, two unrelated implementations must agree on the bytes they hash. This page and the CLI are those two. Status: a mockup of a computation, as of 24 Oct 2026; it enforces nothing. The design is on Policies §6.
…

Check it against the CLI

$ pip install git+https://github.com/SHarness-AI/SHarness-AI__CLI@dev
$ sharness-ai policy hash experiments/policies/deny-all-example.json
sha256:ab1d3e4e779313274f7a1d3ef3e46f6eacef038d8cfaa6198151a45cd82dcc76

Load the deny-all example above: the hash must be the same. Change one character in the policy and it is not. The CLI's test suite pins this vector, so a change to either side fails a build.

The canonical form

The v0 shape

Six keys: pbp (1), id, an optional layer and notes, files with read, write and exec lists of absolute paths, network as "none" or {"connect_tcp_ports": […]}, and process with no_new_privs: true. It is what sharness-ai run enforces with Landlock. The full schema it grows towards is on Policies §4.