@justfortytwo/gate 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +15 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -60,6 +60,7 @@ project root the agent runs in):
60
60
  | `GATE_MANIFEST` | `.claude/policy/capabilities.toml` | capability manifest TOML |
61
61
  | `GATE_BASH_ALLOWLIST` | `rules/bash-allowlist.jsonl` | bash allowlist JSONL |
62
62
  | `GATE_APPROVALS` | `.gate/approvals.jsonl` | durable one-shot approval store |
63
+ | `GATE_ACTOR` | `agent` | label recorded as the actor in the audit log |
63
64
 
64
65
  ## Use as a hook without the plugin
65
66
 
@@ -80,10 +81,20 @@ Add to `.claude/settings.json`:
80
81
  }
81
82
  ```
82
83
 
83
- The hook emits a standard Claude Code `permissionDecision` (`allow` | `deny` and a
84
- `defer`-style hold) with a human-readable reason. The gate is the safety
85
- authority; with `deny > defer > ask > allow`, a `defer`/`deny` from the gate still
86
- overrides a permissive `permissions.allow` list.
84
+ The hook reads the tool event on stdin and writes one JSON object on stdout:
85
+
86
+ ```json
87
+ { "hookSpecificOutput": { "hookEventName": "PreToolUse", "permissionDecision": "allow | deny | defer", "permissionDecisionReason": "<human-readable reason>" } }
88
+ ```
89
+
90
+ `permissionDecision` is exactly one of `allow`, `deny`, or `defer`. `allow` and
91
+ `deny` resolve the call immediately. `defer` is the gate asking the host to **hold
92
+ the call for a one-shot human approval** rather than run it: the gate stages a
93
+ pending one-shot and emits `defer`, and the defer → approval → re-fire loop only
94
+ completes if the host actually pauses on that decision (re-firing the same call
95
+ once the approval is recorded). The gate emits the decision; it cannot itself stop
96
+ a host that ignores `defer`. Approvals are cleared out of band via the bundled
97
+ `fortytwo-gate` CLI (see below).
87
98
 
88
99
  ### How an approval flows
89
100
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justfortytwo/gate",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Standalone, agent-agnostic PreToolUse safety gate for Claude Code: an autonomy-tier policy engine, a fail-closed bash allowlist, and a hook that turns dangerous tool calls into one-shot approvals.",
5
5
  "license": "MIT",
6
6
  "author": {