Skip to content

Installation ​

Install Patchwork globally from npm:

bash
npm install -g patchwork-audit

Verify the installation:

bash
patchwork --version

From Source ​

Clone the repository and build:

bash
git clone https://github.com/JonoGitty/patchwork-audit.git
cd patchwork-audit
pnpm install && pnpm build

# Link the CLI globally
cd packages/cli && npm link && cd ../..

System Requirements ​

  • Node.js 20 or later
  • Operating system: macOS, Linux, or Windows
  • AI agent: Claude Code (more agents coming soon)

System-Level Install (Tamper-Evident) ​

For managed machines where non-admin users should not be able to disable auditing:

bash
sudo bash scripts/system-install.sh
bash
sudo bash scripts/system-install.sh --all-users
bash
sudo bash scripts/system-install.sh --users alice,bob,charlie
powershell
powershell -ExecutionPolicy Bypass -File scripts/system-install.ps1

The system install deploys:

  • A root-owned relay daemon that receives audit events via Unix socket
  • A watchdog that ensures hooks can't be silently removed
  • Immutable policy files that non-admin users cannot modify

See Tamper-Evident Layers for details on what each layer protects.

Editing a system-level policy later

The system install flags /Library/Patchwork/policy.yml immutable (chflags schg on macOS, chattr +i on Linux, attrib +R on Windows). That is deliberate, but it means even root cannot edit the policy until the flag is cleared, and a write attempt fails with Operation not permitted rather than a permissions message. Clear the flag, edit, then set it again — and verify with ls -lO that it is back, because leaving it cleared silently downgrades the install.

Next Steps ​

Once installed, follow the Quickstart to set up your first audited session.

Released under the BUSL-1.1 License.