sharness.ai / the code · this page as markdown

The code: where it is and what it does

Status: experiments, as of 25 Oct 2026. The site publishes the design; the code lives in one repository, SHarness-AI/SHarness-AI__CLI, and today it carries experiments, not a component. This page is the map: the package, its modules, the commands, and where each thing on this site has code behind it.

Where everything is

WhatWhereStatus
the sharness-ai packagesharness_ai/ on the dev branch; v0.1.0 on PyPI carries only --versionrunnable from the repository; unreleased
the experiments, numberedexperiments/README.mdE01 to E04, E09 and E10 runnable; E05 to E08 planned
the example policies: two minimal, five profiles P0 to P4experiments/policies/runnable; run natively 25 Oct 2026
E09, the harness under a second kernel: the guest build, the Node and browser runners, the chroot formexperiments/browser/: build_guest.py (standard library), init.sh, page.html, boot_node.mjs, boot_browser.mjs, chroot_native.sh; v86 pinned in its own package.jsonrunnable; measured 25 Oct 2026 (Linux in the browser)
the skill for a Claude Code session.claude/skills/sharness-hello/SKILL.mdrunnable
the teststests/unit/, 53 tests; Landlock tests skip where it is absentgreen on 25 Oct 2026
the ground rules for agents working in the repositoryCLAUDE.md
the release pipeline.github/workflows/workflow.yml: tests, version bump, tag, PyPI by Trusted Publishingruns on a push to main
the browser mockupsthis site, explain/mockups/: hand-written HTML, no buildpublished
the storyboards' datathis site, content/storyboards/published
this site's build toolstools/: the generators and the gate, Python standard library and Node

The package, module by module

Standard library only. Each module is meant to be read in one sitting; the design's size targets are launcher ≤ 400 lines, each component ≤ 300, a shared library ≤ 400.

ModuleLinesDoesExperiment
cli.py98the argument parser and the dispatch: probe, policy hash, policy check, run, hello
probe.py138the grant: reads /proc/self/status, the Landlock ABI, memfd_secret, the namespaces, cgroups, the kernel config, the tools present, the names of proxy variablesE01
policy.py126a v0 policy: load, check the shape (including the caps), canonicalise (sorted keys, no whitespace, integers only), hashE02
translate.py176the policy as bubblewrap, docker run, a Claude Code sandbox settings.json, a Kubernetes Pod and NetworkPolicy; each with what it does not enforceE10
landlock.py157Landlock through ctypes: the ABI, a ruleset, path rules, port rules, restrict_selfE03
run.py133fork, apply the policy in the child (network namespace, caps, no_new_privs, Landlock), exec; --expect-hashE03
limits.py95the caps: RLIMIT_AS and RLIMIT_NPROC, and a memory and pids cgroup (v1 or v2) where /sys/fs/cgroup is writableE03
hello.py124the acceptance test: a deny-all policy for the running interpreter with a 128 MiB cap, six probes, the caveatE04
_version.py17the version, read from the file CI maintains

Counts from wc -l on 25 Oct 2026. How a command moves through these modules is on Flows.

The commands

sharness-ai probe [--json]                                E01  the grant
sharness-ai policy hash|check FILE                        E02  the one value the person supplies
sharness-ai policy translate FILE --to T [-- CMD…]        E10  the policy in another enforcer's form, and the gap
sharness-ai run --policy FILE [--expect-hash H] -- CMD…   E03  one command under a policy
sharness-ai hello [--json]                                E04  the acceptance test, one child process
cd experiments/browser && npm run node|browser|native     E09  the same, under a second kernel (v86) or through chroot

Install and use: The CLI. Each command's output and caveats: Examples. What each shows and does not show: Mockups and experiments.

What has code behind it, and what does not

On this siteCodeWhere
the v0 Process Behaviour Policy and its hashyespolicy.py; the browser mockup reproduces it
Landlock file, exec and port rules; network: "none"yeslandlock.py, run.py
the grant and the deltayesprobe.py
the memo's acceptance testyes, for one child processhello.py; also under a second kernel in Node and in a tab, E09
the launcher, sharness.kms, .net, .fs, .bash, .llmnodesigned on Components; E05 to E08 are the next pieces
mutual TLS with a session CA; the edge matrixmeasured by hand, not yet a commandE05
memory and process-count caps (rlimits and cgroups)yeslimits.py, measured 25 Oct 2026
seccomp, the cpu cgroup, scoping, the execute allowlistnoContainment says which rows are designed

Next in the code, in order

The research note sets the order: E06 (the process tree), E05 (the edges as a script), E08 (sharness.kms v0) before E07 (sharness.llm v0), then the launcher as a script above the agent on a laptop. The languages for each are on Languages.