cc-safety-net 2.2.1 → 2.2.2

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.
package/README.md CHANGED
@@ -28,20 +28,6 @@ CC Safety Net is short for Coding CLI Safety Net. It is a PreToolUse hook that b
28
28
 
29
29
  We built CC Safety Net after an agent [wiped hours of work](https://www.reddit.com/r/ClaudeAI/comments/1pgxckk/claude_cli_deleted_my_entire_home_directory_wiped/) with one `rm -rf ~/` or `git checkout --`. Instructions did not stop it. Rules in `CLAUDE.md` or `AGENTS.md` can guide an agent, but they cannot enforce a technical limit. CC Safety Net watches relevant tool calls and blocks destructive commands and secret access before they reach the shell. See [What is CC Safety Net](https://ccsafetynet.com/docs/introduction) for the full background.
30
30
 
31
- ## What's new in v2.0.0
32
-
33
- > [!TIP]
34
- > **Already running v1?** Run `npx -y cc-safety-net@latest update` to upgrade every installed integration to v2. If you defined custom rules under v1, also read [Upgrading from an older version](#upgrading-from-an-older-version).
35
-
36
- - **Evaluation engine.** A canonical command IR, policy snapshots that remain immutable at every nested level, and an ordered guard pipeline now support decision tracing through `explain`.
37
- - **Secret protection.** Built-in rules block content access to SSH keys, `.env` files, cloud credentials, and coding-CLI credential stores through shell commands and file tools.
38
- - **Always-on protections.** Every mode blocks recursive deletion of root or home, Git metadata changes to the `.git` control plane, hooks, worktrees, or submodules, and changes to the user policy file. Overrides do not disable these rules.
39
- - **Safety presets.** The `standard`, `strict`, and `paranoid` levels support per-rule overrides and trusted delete allow-paths. Safety-level and capability environment variables can only raise protection. `CC_SAFETY_NET_WORKTREE` is the one exception. It allows local Git discards in linked worktrees.
40
- - **Policy GUI.** `cc-safety-net gui` runs a local, token-authenticated editor with a live preset preview.
41
- - **Universal installer.** Interactive `install` and `uninstall` commands support all twelve coding CLIs. The `update` command updates installed integrations.
42
- - **Command-decision audit trail.** CC Safety Net records allowed and blocked decisions in local per-project JSONL. It redacts secrets, keeps records for 30 days by default, and shows them through `cc-safety-net logs`.
43
- - **Threat model.** [SECURITY.md](SECURITY.md) defines the mode contract and resource limits. Its residual-risk registry records decisions for bypass families.
44
-
45
31
  ## Quick start
46
32
 
47
33
  You need Node.js 18 or higher.
@@ -58,21 +44,7 @@ To update every installed integration:
58
44
  npx -y cc-safety-net@latest update
59
45
  ```
60
46
 
61
- Keep the `@latest` qualifier. A bare `cc-safety-net` spec can run an older cached
62
- copy from the npx cache instead of the current release.
63
-
64
- To remove integrations interactively:
65
-
66
- ```bash
67
- npx -y cc-safety-net uninstall
68
- ```
69
-
70
- If you use the CLI often, install it globally to get `ccsn`, a shorter alias for the same commands:
71
-
72
- ```bash
73
- npm install -g cc-safety-net
74
- ccsn doctor
75
- ```
47
+ Keep the `@latest` qualifier; a bare `cc-safety-net` spec can run an older cached copy from the npx cache. `npx -y cc-safety-net uninstall` removes integrations interactively, and `npm install -g cc-safety-net` gives you `ccsn`, a shorter alias for the same commands.
76
48
 
77
49
  ## Supported coding CLIs
78
50
 
@@ -91,9 +63,9 @@ CC Safety Net supports the coding agent CLIs below on Windows, macOS, and Linux.
91
63
  <td align="center"><a href="https://ccsafetynet.com/docs/installation#github-copilot-cli-installation"><picture><source media="(prefers-color-scheme: dark)" srcset="./.github/assets/copilot-cli-dark.svg"><img alt="GitHub Copilot CLI" src="./.github/assets/copilot-cli-light.svg" height="32"></picture><br>GitHub Copilot CLI</a></td>
92
64
  <td align="center"><a href="https://ccsafetynet.com/docs/installation#grok-build-installation"><picture><source media="(prefers-color-scheme: dark)" srcset="./.github/assets/grok-build-dark.svg"><img alt="Grok Build" src="./.github/assets/grok-build-light.svg" height="32"></picture><br>Grok Build</a></td>
93
65
  <td align="center"><a href="https://ccsafetynet.com/docs/installation#hermes-agent-installation"><img alt="Hermes Agent" src="./.github/assets/hermes.png" height="32"><br>Hermes Agent</a></td>
66
+ <td align="center"><a href="https://ccsafetynet.com/docs/installation#kimi-code-installation"><img alt="Kimi Code" src="./.github/assets/kimi-cli.png" height="32"><br>Kimi Code</a></td>
94
67
  </tr>
95
68
  <tr>
96
- <td align="center"><a href="https://ccsafetynet.com/docs/installation#kimi-code-installation"><img alt="Kimi Code" src="./.github/assets/kimi-cli.png" height="32"><br>Kimi Code</a></td>
97
69
  <td align="center"><a href="https://ccsafetynet.com/docs/installation#openclaw-installation"><img alt="OpenClaw" src="./.github/assets/openclaw.png" height="32"><br>OpenClaw</a></td>
98
70
  <td align="center"><a href="https://ccsafetynet.com/docs/installation#opencode-installation"><picture><source media="(prefers-color-scheme: dark)" srcset="./.github/assets/opencode-dark.svg"><img alt="OpenCode" src="./.github/assets/opencode-light.svg" height="32"></picture><br>OpenCode</a></td>
99
71
  <td align="center"><a href="https://ccsafetynet.com/docs/installation#pi-installation"><picture><source media="(prefers-color-scheme: dark)" srcset="./.github/assets/pi-dark.svg"><img alt="Pi" src="./.github/assets/pi-light.svg" height="32"></picture><br>Pi</a></td>
@@ -143,7 +115,7 @@ npx cc-safety-net logs
143
115
  npx cc-safety-net gui
144
116
  ```
145
117
 
146
- `doctor`, `explain`, and `logs` support `--json` for machine-readable output. The audit trail stays on your machine. It records command decisions, but it does not record command output or prompts. Invalid configuration never blocks your agent. CC Safety Net drops unverifiable rule sources and reports each degraded state in the next block message, `doctor`, the status line, and the GUI banner.
118
+ `doctor`, `explain`, and `logs` support `--json` for machine-readable output. The audit trail stays on your machine. It records command decisions, but it does not record command output or prompts.
147
119
 
148
120
  Details: [CLI Commands](https://ccsafetynet.com/docs/reference/cli-commands) · [Explain Trace](https://ccsafetynet.com/docs/reference/explain-trace) · [Audit Log](https://ccsafetynet.com/docs/reference/audit-log) · [Dashboard](https://ccsafetynet.com/docs/guides/dashboard) · [Configuration Recovery](https://ccsafetynet.com/docs/configuration/recovery).
149
121
 
@@ -178,18 +150,10 @@ if (commandIsAllowed('git status', process.cwd())) {
178
150
 
179
151
  Usage rules:
180
152
 
181
- - Requires Node.js 18 or later and ESM. There is no CommonJS build.
182
153
  - `cwd` is required and must be an absolute directory path. It anchors relative command
183
- targets and selects the project policy, so the API never defaults to hidden process state.
184
- - The function reads local policy files, filesystem facts, and `CC_SAFETY_NET_*` environment
185
- settings on each call. An invalid `CC_SAFETY_NET_LEVEL` is ignored and reported to stderr.
186
- It does not run the command, write audit logs, change configuration, or make network requests.
187
- - Commands are fully checked, including secret file access performed through commands. The
188
- host's own non-shell file tools (read, write, edit, search) are not checked by this function.
154
+ targets and selects the project policy.
189
155
  - A `deny` result means the host must not execute the command. **If `checkCommand` throws,
190
156
  do not execute the command either.**
191
- - `reason` is display text; do not parse or compare it. Use the `kind` field for the
192
- decision and treat the optional `ruleId` as diagnostic data only.
193
157
 
194
158
  ## Limitations
195
159
 
@@ -201,11 +165,7 @@ Codex has one integration-specific limit. Its unified exec path is the default o
201
165
 
202
166
  ## Upgrading from an older version
203
167
 
204
- Upgrade every installed integration to the current release with one command:
205
-
206
- ```bash
207
- npx -y cc-safety-net@latest update
208
- ```
168
+ Run the `update` command from [Quick start](#quick-start) to upgrade every installed integration to the current release.
209
169
 
210
170
  > [!WARNING]
211
171
  > If you defined custom rules in a legacy inline config such as `.safety-net.json` or `~/.cc-safety-net/config.json`, CC Safety Net no longer loads those files at runtime. Their rules enforce nothing. Normal use does not show this failure because the commands now run. Run `npx -y cc-safety-net rule migrate` to convert the rules to the rulebook layout. Then run `npx -y cc-safety-net doctor` and confirm that the runtime is `ready`. See the [migration guide](https://ccsafetynet.com/docs/configuration/custom-rules#migrate-legacy-configuration).
@@ -226,12 +186,6 @@ The **[ccsafetynet.com/docs](https://ccsafetynet.com/docs)** site contains the f
226
186
 
227
187
  See [CONTRIBUTING.md](CONTRIBUTING.md) to contribute to the project.
228
188
 
229
- The repository tracks all 14 generated files under `dist/`. They include the library
230
- bundle and its type declarations, the command-check API entry and its declaration, the CLI
231
- entrypoint, the shared chunks, the vendored Zod copy,
232
- and the Pi, Amp, and OpenClaw adapter files. Run `bun run verify:package` and
233
- `bun run verify:repository-plugin` when changing packaging, integrations, or release automation.
234
-
235
189
  ## License
236
190
 
237
191
  MIT