Skip to content

v0.0.8

Choose a tag to compare

@github-actions github-actions released this 12 Nov 02:11
· 42 commits to main since this release
3e52d66

Install on macOS or Linux:

curl -fsSL https://github.com/pedroknigge/pregate/releases/download/v0.0.8/install.sh | sh

Install on Windows PowerShell:

irm https://github.com/pedroknigge/pregate/releases/download/v0.0.8/install.ps1 | iex

Each archive and SHA256SUMS has a Sigstore bundle (.bundle) from cosign sign-blob (GitHub OIDC) and a GitHub artifact attestation. Verification steps are in docs/guides/installation.md.

Release 0.0.8

Pregate v0.0.8, core 0.0.1. macOS ARM64 stays the stable platform. Linux and Windows archives stay experimental until native validation is recorded.

Install 0.0.8, then review the project update it prepares (pregate update --project --preview) and approve that exact digest. A global update prepares that review for each enabled project whose lock still pins an older engine.

This release teaches Pregate the harnesses people actually use, and it lets a project carry its own hooks. OpenCode joins as the sixth harness. Cursor, Codex, Claude Code and Antigravity can register hooks inside the repository, so a cloud agent or a teammate does not depend on a file in someone's home directory. A Claude Code subagent hears the project's briefing when it starts. The shell guard stops blocking a project's own test and syntax commands, and it lets the agent read the skill file Pregate installed.

A project can carry its own hooks

pregate project setup merges Claude Code hooks into the project's .claude/settings.json. They run the reviewed project launcher and the engine the lock pins. They do not fall back to a launcher on PATH, and they do not write the home directory or grant consent. pregate doctor reports that project scope, and it reports workspace trust separately from policy consent.

The same idea, one command per harness:

  • Claude Code. pregate project hooks --harness claude-code registers PreToolUse, Stop, SubagentStop and SessionStart through $CLAUDE_PROJECT_DIR.
  • Codex. pregate project hooks --harness codex registers the Codex hooks in .codex/hooks.json, including SubagentStart and SubagentStop. Codex still needs the human to trust the project and review the hooks with /hooks. A later change to the definition removes the gate until that review is done again.
  • Cursor. pregate project hooks --harness cursor registers preToolUse, stop and sessionStart in .cursor/hooks.json. Cursor's cloud agents load that file from the repository. An MCP tool is judged by the paths it names: a protected file is denied, a file in scope is sent back to the file tool, and a call that names no local path is left alone.
  • Antigravity. pregate project hooks --harness agy registers PreToolUse, PostInvocation, Stop and SessionStart in .agents/hooks.json.

Each command keeps every hook it does not own, and a second run changes no byte. They all go through the same review and approval as a contract change.

OpenCode

OpenCode has no hook process of its own. pregate setup installs a small plugin and lists it in OpenCode's plugins array. The plugin does not decide anything. It asks the same engine the other harnesses use, and it throws the engine's deny so that one call fails.

On Windows the plugin starts pregate.cmd, which is the launcher the rest of Pregate installs there. An earlier build looked for the Unix launcher and then reported that Pregate could not evaluate.

A project with no .pregate/preset.json stays inert. The plugin ignores read-only tools. OpenCode's code-mode tool, whose nested calls no hook can see, is denied in an enabled project.

Subagents hear the contract

A Claude Code subagent used to start with only the task its parent wrote. It learned of a rule when a write was denied. The registration now answers SubagentStart with the same briefing the session received. The briefing grants nothing: every write is still checked. Run pregate update to add the event to an existing registration.

A Codex child gets bounded contract context, keeps the parent's baseline, and is checked when it finishes. The parent's Stop remains the backstop.

A Grok subagent stop is that child's own session. The payload names the child session and no agent id, so the gate judges the files of that session. A shutdown stop stays ignored.

Antigravity, after the tool returns

Antigravity can now deliver a warning or a halt after a tool call, and a session start message. A task's send_input is treated as a write. Reading or killing a task is not. Settings under ~/.gemini/antigravity, ~/.gemini/antigravity-cli and the global plugin stay protected, including when the path is spelled with Windows backslashes.

The shell guard and the project's own programs

Since 0.0.5, a script that node, bun or deno ran was scanned for write sinks, and the list included import and require. Every real file matched, so node tests/index.js, bun src/main.ts and node --check were denied in an enabled project. In the first session trial this stopped the test or the syntax check.

Two limits now apply. A script that still has the text it had when the session began is the project's program and is not read for write sinks. A script the session changed is read by the rules for a file: an import is a sink only when it names a module that writes files or starts programs. Control commands stay denied.

The same trial showed a second stop. Codex loads the Pregate skill with cat of the installed SKILL.md, and that read was denied as a protected path. One session then abandoned its task. A literal cat of that one skill file is now allowed. A write to the skill folder, a read of any other file there, and a skill folder that links into Pregate's own state stay denied.

A trial with real sessions

The first run of the session trial is published: 48 sessions, Claude Code and Codex, twelve tasks on three public repositories, with and without the gate. Neither arm left a new finding, so the run shows no prevented defect. It shows the cost: seventeen denials in the gated arm, seven of them true, eight false and two unclear. Seven of the false ones were the script scan above, fixed after the run. The page is session-trial.md.

The precision measurement was run again after the rule fixes: 5,508 findings, where 0.0.7 recorded 8,951. Labels written by an agent are counted apart from labels written by the maintainer.

What this release does not establish

  • No OpenCode session was captured with a model. The plugin's deny, advice, briefing and Stop were tested without one. Whether a thrown message reaches the model is not yet shown.
  • The interactive trust prompt, cloud agents, and a real Windows session were not run for every harness that gained project hooks. What was run, and on which version, is in the changelog.
  • Codex project hooks gate a session only after the human trusts the project and reviews the hooks. A later edit of the hook definition turns the gate off until that review is repeated.
  • Grok still does not honor a Stop block, on the 1.0.80 measurement. The child session is judged; the CLI may not stop.
  • The macOS latency gate is unchanged. It still fails by runner noise at times. The Windows latency job on this release passed.
  • The full suite does not run on macOS in CI. macOS runs the latency and release-build jobs there, and the suite on the maintainer's machine.

The changelog lists every change. Guarantees and limits records the shell-guard limits this release adds.