@noppu-labs/opencode-permission-reviewer 2.4.2 → 3.0.0

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 (46) hide show
  1. package/CHANGELOG.md +44 -1
  2. package/LICENSE +21 -201
  3. package/LICENSE-APACHE +201 -0
  4. package/NOTICE +14 -6
  5. package/README.md +100 -787
  6. package/SECURITY.md +41 -22
  7. package/dist/explain.js +4932 -3522
  8. package/dist/index.d.ts +508 -547
  9. package/dist/index.js +12454 -9030
  10. package/dist/rpc.js +4 -1
  11. package/dist/tui/config/jsonc.ts +71 -63
  12. package/dist/tui/config/layer-read.ts +120 -0
  13. package/dist/tui/config/loader.ts +61 -513
  14. package/dist/tui/config/risk-policy-clamp.ts +80 -0
  15. package/dist/tui/config/trust-boundary-keys.ts +100 -0
  16. package/dist/tui/config/trust-boundary.ts +135 -0
  17. package/dist/tui/config/trusted-degradation.ts +97 -0
  18. package/dist/tui/config-fields.ts +55 -0
  19. package/dist/tui/config-knobs.ts +119 -0
  20. package/dist/tui/config-policy-rules.ts +86 -0
  21. package/dist/tui/config-risk-policy.ts +59 -0
  22. package/dist/tui/config-rule-condition.ts +150 -0
  23. package/dist/tui/config.ts +61 -430
  24. package/dist/tui/descriptor-io.ts +42 -0
  25. package/dist/tui/is-record.ts +13 -0
  26. package/dist/tui/opencode/event-normalizer.ts +41 -31
  27. package/dist/tui/reviewer-model.ts +87 -0
  28. package/dist/tui/tui.tsx +87 -99
  29. package/dist/tui/types.ts +170 -597
  30. package/dist/tui/ui/components.tsx +32 -136
  31. package/dist/tui/ui/review-connection.ts +32 -0
  32. package/dist/tui/ui/review-feed.ts +131 -0
  33. package/dist/tui/ui/review-overlay.tsx +83 -0
  34. package/dist/tui/ui/review-result.tsx +56 -0
  35. package/dist/tui/ui/review-store.ts +88 -0
  36. package/dist/tui/ui/review-theme.ts +63 -0
  37. package/dist/tui/ui/rpc.ts +5 -2
  38. package/dist/tui/ui/v1-host.ts +39 -0
  39. package/dist/tui/ui/v2.tsx +66 -220
  40. package/dist/tui/ui-protocol.ts +63 -118
  41. package/dist/tui/ui-state.ts +71 -64
  42. package/dist/tui/ui-status-parse.ts +74 -0
  43. package/package.json +16 -15
  44. package/rpc.js +2 -1
  45. package/server.js +2 -2
  46. package/tui.tsx +2 -1
package/SECURITY.md CHANGED
@@ -1,31 +1,50 @@
1
- # Reporting a vulnerability
1
+ # Security policy
2
2
 
3
- This plugin makes automated safety decisions about AI-agent permissions, so
4
- we take security bugs seriously.
3
+ ## Reporting a vulnerability
5
4
 
6
- Please **do not** file a public issue for a security vulnerability. Instead,
7
- use GitHub's private vulnerability reporting:
5
+ Report suspected vulnerabilities privately through
6
+ [GitHub private vulnerability reporting](https://github.com/noppu-labs/opencode-permission-reviewer/security/advisories/new);
7
+ please don't open a public issue. Include as much of this as you can:
8
8
 
9
- - go to **Report a vulnerability** at
10
- https://github.com/Warc0s/opencode-permission-reviewer/security/advisories/new
9
+ - a minimal reproduction: the command and the permission policy that trigger it
10
+ - the plugin version (`version` in `package.json`) and the OpenCode version you run
11
+ - the safety outcome you expected and the one you got
11
12
 
12
- or email the maintainer directly if the report contains sensitive details.
13
+ We acknowledge reports within a few days and coordinate the fix and disclosure with you.
13
14
 
14
- Include, when possible:
15
+ ## Scope
15
16
 
16
- - a minimal reproduction (command + permission policy that triggers it),
17
- - the affected version (`package.json` → `version`),
18
- - the OpenCode version you run,
19
- - the expected vs. actual safety outcome.
17
+ The plugin approves or denies AI-agent actions on your behalf, so most security bugs are cases
18
+ where it approves something it should not. In scope:
20
19
 
21
- We will acknowledge within a few days and coordinate a fix and disclosure.
20
+ - An automatic approval that breaks one of the deterministic invariants in
21
+ [docs/SAFETY.md](docs/SAFETY.md), such as approving an action the reviewer classified as
22
+ critical, or approving after a reviewer failure.
23
+ - Project or inline configuration that weakens trusted global settings (see the trust rules in
24
+ [docs/CONFIGURATION.md](docs/CONFIGURATION.md)).
25
+ - The reviewer session gaining tools, MCP servers, or repository instructions.
26
+ - Credentials leaking into reviewer evidence, the audit log, or the TUI.
27
+ - The release pipeline: npm publishing, provenance, checksums, and the SBOM.
22
28
 
23
- ## Threat model notes
29
+ A reviewer model that misjudges an action's risk is a known limit of the design, not a
30
+ vulnerability on its own. The plugin checks a decision's consistency, not its semantic
31
+ correctness. Other plugins loaded into the same OpenCode host can also override its decisions.
32
+ [docs/SAFETY.md](docs/SAFETY.md) covers the threat model.
24
33
 
25
- This plugin is a **defense-in-depth aid**, not a complete sandbox. It reviews
26
- `ask`-classified actions with a second model call and fails safe to manual
27
- review when anything is uncertain. It does not replace OpenCode's own
28
- permission system, your model provider's safety layers, or good OS-level
29
- hygiene. A determinedly adversarial agent may still attempt to mislead the
30
- reviewer; the deterministic emergency brake and the untrusted-evidence prompt
31
- mitigate but cannot fully eliminate that risk.
34
+ This project is a fork of
35
+ [warc0s/opencode-permission-reviewer](https://github.com/warc0s/opencode-permission-reviewer).
36
+ If an issue also affects the upstream project, report it there as well.
37
+
38
+ ## Verifying releases
39
+
40
+ Each release is published to npm with [provenance](https://docs.npmjs.com/generating-provenance-statements),
41
+ and its GitHub Release carries the package tarball, SHA-256 checksums, and a CycloneDX SBOM. To
42
+ check the registry signatures and provenance attestations of a copy installed with `npm install`
43
+ or `npm ci` (npm 8.15.0 or later), run this in the installing project:
44
+
45
+ ```sh
46
+ npm audit signatures
47
+ ```
48
+
49
+ [docs/SUPPLY-CHAIN.md](docs/SUPPLY-CHAIN.md) describes what the package ships and the known
50
+ residual exposure in its dependency tree.