@f4bioo/berry-shield 2026.3.3-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 (52) hide show
  1. package/CONTRIBUTING.md +32 -0
  2. package/LICENSE +201 -0
  3. package/README.md +251 -0
  4. package/SECURITY_AUDIT.md +96 -0
  5. package/docs/wiki/README.md +108 -0
  6. package/docs/wiki/decision/README.md +48 -0
  7. package/docs/wiki/decision/modes.md +176 -0
  8. package/docs/wiki/decision/patterns.md +137 -0
  9. package/docs/wiki/decision/posture.md +68 -0
  10. package/docs/wiki/deploy/README.md +51 -0
  11. package/docs/wiki/deploy/auditing.md +56 -0
  12. package/docs/wiki/deploy/build.md +92 -0
  13. package/docs/wiki/deploy/github-ci-cd.md +107 -0
  14. package/docs/wiki/deploy/installation.md +348 -0
  15. package/docs/wiki/engine/README.md +53 -0
  16. package/docs/wiki/engine/match-engine.md +91 -0
  17. package/docs/wiki/engine/performance.md +114 -0
  18. package/docs/wiki/engine/redaction.md +120 -0
  19. package/docs/wiki/layers/README.md +68 -0
  20. package/docs/wiki/layers/leaf.md +126 -0
  21. package/docs/wiki/layers/pulp.md +139 -0
  22. package/docs/wiki/layers/root.md +130 -0
  23. package/docs/wiki/layers/stem.md +139 -0
  24. package/docs/wiki/layers/thorn.md +139 -0
  25. package/docs/wiki/layers/vine.md +154 -0
  26. package/docs/wiki/operation/README.md +31 -0
  27. package/docs/wiki/operation/cli/README.md +122 -0
  28. package/docs/wiki/operation/cli/add.md +157 -0
  29. package/docs/wiki/operation/cli/help.md +83 -0
  30. package/docs/wiki/operation/cli/init.md +52 -0
  31. package/docs/wiki/operation/cli/list.md +78 -0
  32. package/docs/wiki/operation/cli/mode.md +93 -0
  33. package/docs/wiki/operation/cli/policy.md +202 -0
  34. package/docs/wiki/operation/cli/profile.md +98 -0
  35. package/docs/wiki/operation/cli/remove.md +96 -0
  36. package/docs/wiki/operation/cli/report.md +66 -0
  37. package/docs/wiki/operation/cli/reset.md +99 -0
  38. package/docs/wiki/operation/cli/rules.md +161 -0
  39. package/docs/wiki/operation/cli/status.md +103 -0
  40. package/docs/wiki/operation/cli/test.md +119 -0
  41. package/docs/wiki/operation/cli/toggle.md +90 -0
  42. package/docs/wiki/operation/cli/vine.md +193 -0
  43. package/docs/wiki/operation/web/README.md +27 -0
  44. package/docs/wiki/tutorials/README.md +40 -0
  45. package/docs/wiki/tutorials/audit-to-enforce-rollout.md +99 -0
  46. package/docs/wiki/tutorials/build-custom-rules.md +99 -0
  47. package/docs/wiki/tutorials/choose-profile.md +91 -0
  48. package/docs/wiki/tutorials/incident-triage-report.md +99 -0
  49. package/docs/wiki/tutorials/secure-session.md +115 -0
  50. package/docs/wiki/tutorials/tune-policy.md +111 -0
  51. package/openclaw.plugin.json +293 -0
  52. package/package.json +70 -0
@@ -0,0 +1,91 @@
1
+ ---
2
+ summary: "Choose the right Berry Shield profile for your workload"
3
+ read_when:
4
+ - You are deciding between strict, balanced, and minimal
5
+ - You want a safe baseline profile before broader rollout
6
+ - You need quick profile verification steps
7
+ title: "Choose Your Profile"
8
+ ---
9
+
10
+ # `Choose Your Profile`
11
+
12
+ This tutorial helps you choose and validate a policy profile without editing low-level paths first.
13
+ It is the fastest way to put teams on a predictable baseline.
14
+
15
+ ## Prerequisites
16
+
17
+ - Berry Shield installed and enabled
18
+ - Access to run `openclaw bshield` commands
19
+
20
+ ## Step 1: Inspect current profile
21
+
22
+ Use this command to view the current profile and adaptive values before changes.
23
+ ```bash
24
+ openclaw bshield status
25
+ ```
26
+ Expected:
27
+ - Policy section is visible
28
+ - Profile appears as STRICT, BALANCED, or MINIMAL
29
+
30
+ ## Step 2: Start with balanced baseline
31
+
32
+ Use this command to set a practical default for most environments.
33
+ ```bash
34
+ openclaw bshield profile balanced
35
+ ```
36
+ Expected:
37
+ - CLI confirms profile update
38
+
39
+ ## Step 3: Verify profile application
40
+
41
+ Use this command to confirm the profile was persisted and is visible in status output.
42
+ ```bash
43
+ openclaw bshield status
44
+ ```
45
+ Expected:
46
+ - Profile is shown as BALANCED
47
+
48
+ ## Step 4: Compare strict behavior
49
+
50
+ Use this command when you need maximum prompt-policy presence every turn.
51
+ ```bash
52
+ openclaw bshield profile strict
53
+ ```
54
+ Expected:
55
+ - CLI confirms strict profile
56
+
57
+ ## Step 5: Compare minimal behavior
58
+
59
+ Use this command when your priority is lower prompt noise and trigger-based behavior.
60
+ ```bash
61
+ openclaw bshield profile minimal
62
+ ```
63
+ Expected:
64
+ - CLI confirms minimal profile
65
+
66
+ ## Step 6: Return to team baseline
67
+
68
+ Use this command to restore the recommended daily-operation profile.
69
+ ```bash
70
+ openclaw bshield profile balanced
71
+ ```
72
+ Expected:
73
+ - Profile returns to balanced for normal operation
74
+
75
+ ## Decision guide
76
+
77
+ - Choose `strict` for high-control sessions where repeated policy injection is preferred.
78
+ - Choose `balanced` for default production posture with good safety-to-noise tradeoff.
79
+ - Choose `minimal` when low prompt overhead is required and risk triggers are tuned.
80
+
81
+ ## Related pages
82
+ - [tutorial index](README.md)
83
+ - [policy tuning](tune-policy.md)
84
+ - [profile command reference](../operation/cli/profile.md)
85
+ - [modes and profiles model](../decision/modes.md)
86
+
87
+ ---
88
+
89
+ ## Navigation
90
+ - [Back to Tutorials Index](README.md)
91
+ - [Back to Wiki Index](../README.md)
@@ -0,0 +1,99 @@
1
+ ---
2
+ summary: "Use report output for incident triage and policy follow-up"
3
+ read_when:
4
+ - You need to investigate suspicious activity patterns
5
+ - You want to separate rule gaps from expected denials
6
+ - You need a repeatable incident-response flow
7
+ title: "Incident Triage with Report"
8
+ ---
9
+
10
+ # `Incident Triage with Report`
11
+
12
+ This tutorial provides a practical incident triage flow using Berry Shield report output.
13
+ It helps teams turn raw event summaries into concrete policy actions.
14
+
15
+ ## Prerequisites
16
+
17
+ - Berry Shield running in your target environment
18
+ - Access to report output and policy/rule management commands
19
+
20
+ ## Step 1: Capture current evidence snapshot
21
+
22
+ Use this command to read the current event summary and detail samples.
23
+ ```bash
24
+ openclaw bshield report
25
+ ```
26
+ Expected:
27
+ - Output includes event count, period, summary rows, and details
28
+
29
+ ## Step 2: Confirm runtime posture
30
+
31
+ Use this command to validate mode and profile before drawing conclusions.
32
+ ```bash
33
+ openclaw bshield status
34
+ ```
35
+ Expected:
36
+ - Mode and profile are visible and match expected operating state
37
+
38
+ ## Step 3: Test suspected gap with dry-style check
39
+
40
+ Use this command to test a candidate path or token string against active rule coverage.
41
+ ```bash
42
+ openclaw bshield test "/home/team/.config/newservice/credentials.json"
43
+ ```
44
+ Expected:
45
+ - Output indicates whether active patterns already detect this input
46
+
47
+ ## Step 4: Add a temporary custom rule when gap is confirmed
48
+
49
+ Use this command to quickly patch detection coverage for a validated gap.
50
+ ```bash
51
+ openclaw bshield add file --name newservice-creds --pattern "/home/.*/.config/newservice/credentials.json"
52
+ ```
53
+ Expected:
54
+ - CLI confirms custom file rule persistence
55
+
56
+ ## Step 5: Verify rule presence
57
+
58
+ Use this command to ensure the new rule is visible in active rule inventory.
59
+ ```bash
60
+ openclaw bshield rules list
61
+ ```
62
+ Expected:
63
+ - Custom list includes `id: file:/home/.*/.config/newservice/credentials.json`
64
+
65
+ ## Step 6: Re-check detection behavior
66
+
67
+ Use this command to confirm the new pattern now matches the targeted input.
68
+ ```bash
69
+ openclaw bshield test "/home/team/.config/newservice/credentials.json"
70
+ ```
71
+ Expected:
72
+ - Output reports match for the newly added custom rule
73
+
74
+ ## Step 7: Document and normalize policy
75
+
76
+ Use this command to print all policy values and capture final triage state for handoff.
77
+ ```bash
78
+ openclaw bshield policy get
79
+ ```
80
+ Expected:
81
+ - Full policy values are printed for incident notes
82
+
83
+ ## Triage decision guide
84
+
85
+ - If repeated suspicious inputs are not detected, add a custom rule and track it.
86
+ - If detection is too broad, tighten regex before promoting rule to shared baseline.
87
+ - If behavior differs across sessions, verify mode/profile and session context first.
88
+
89
+ ## Related pages
90
+ - [tutorial index](README.md)
91
+ - [build custom rules](build-custom-rules.md)
92
+ - [report command reference](../operation/cli/report.md)
93
+ - [posture and limits](../decision/posture.md)
94
+
95
+ ---
96
+
97
+ ## Navigation
98
+ - [Back to Tutorials Index](README.md)
99
+ - [Back to Wiki Index](../README.md)
@@ -0,0 +1,115 @@
1
+ ---
2
+ summary: "Run your first end-to-end Berry Shield validation session"
3
+ read_when:
4
+ - You need a safe first-run checklist
5
+ - You want to validate enforce and audit behavior
6
+ - You want to verify report output after real checks
7
+ title: "Your First Secure Session"
8
+ ---
9
+
10
+ # `Your First Secure Session`
11
+
12
+ This tutorial walks through a minimal but complete validation cycle.
13
+ You will verify mode, generate controlled security events, and confirm reporting.
14
+
15
+ ## Prerequisites
16
+
17
+ - Berry Shield installed and enabled in OpenClaw
18
+ - Shell access to run `openclaw bshield ...`
19
+ - A running OpenClaw session where `berry_check` is available
20
+
21
+ ## Step 1: Confirm status
22
+
23
+ Check current mode and active layers.
24
+
25
+ ```bash
26
+ openclaw bshield status
27
+ ```
28
+
29
+ Expected:
30
+ - Status is `ENABLED`
31
+ - Security layers are `ACTIVE`
32
+
33
+ ## Step 2: Start from a clean report
34
+
35
+ Clear persisted audit events before testing.
36
+
37
+ ```bash
38
+ openclaw bshield report --clear
39
+ ```
40
+
41
+ Expected:
42
+ - Clear confirmation message with removed event count
43
+
44
+ ## Step 3: Validate enforce blocking
45
+
46
+ Set enforce mode explicitly so subsequent checks use active blocking behavior.
47
+
48
+ ```bash
49
+ openclaw bshield mode enforce
50
+ ```
51
+
52
+ Then, in your OpenClaw chat session, request a safe denial test:
53
+
54
+ Example prompt:
55
+ `Run berry_check with operation=read and target=/etc/shadow. Do not read file contents.`
56
+
57
+ Expected:
58
+ - `berry_check` returns `STATUS: DENIED`
59
+ - No sensitive content is read
60
+
61
+ ## Step 4: Confirm enforce report entries
62
+
63
+ Run the report immediately after the denied test to confirm event persistence.
64
+
65
+ ```bash
66
+ openclaw bshield report
67
+ ```
68
+
69
+ Expected:
70
+ - The enforce decision count increases in Summary
71
+ - Details include `stem | sensitive file access` for the tested target
72
+
73
+ ## Step 5: Validate audit shadow behavior
74
+
75
+ Switch to audit mode to observe shadow decisions without enforce-time blocking.
76
+
77
+ ```bash
78
+ openclaw bshield mode audit
79
+ ```
80
+
81
+ Repeat the same `berry_check` request in chat (`/etc/shadow`).
82
+
83
+ Expected:
84
+ - Tool result is not hard-blocked by audit posture
85
+ - Event is logged as `would_block`
86
+
87
+ ## Step 6: Confirm audit report entries
88
+
89
+ Run report again after the audit test to verify shadow logging behavior.
90
+
91
+ ```bash
92
+ openclaw bshield report
93
+ ```
94
+
95
+ Expected:
96
+ - `would_block` count increases
97
+ - Details show shadow decisions instead of enforce decisions
98
+
99
+ ## Troubleshooting
100
+
101
+ - If mode changes do not appear immediately, re-check with `openclaw bshield status`.
102
+ - If report looks empty right after activity, wait a moment and run report again.
103
+ - If an event is missing, verify you exercised a path covered by current rules.
104
+
105
+ ## Related pages
106
+ - [tutorial index](README.md)
107
+ - [decision modes](../decision/modes.md)
108
+ - [CLI mode command](../operation/cli/mode.md)
109
+ - [CLI report command](../operation/cli/report.md)
110
+
111
+ ---
112
+
113
+ ## Navigation
114
+ - [Back to Tutorials Index](README.md)
115
+ - [Back to Wiki Index](../README.md)
@@ -0,0 +1,111 @@
1
+ ---
2
+ summary: "Tune adaptive and retention policy values safely with CLI"
3
+ read_when:
4
+ - You need to configure adaptive policy behavior
5
+ - You want deterministic set/get commands for automation
6
+ - You need to validate retention values
7
+ title: "Tune Policy"
8
+ ---
9
+
10
+ # `Tune Policy`
11
+
12
+ This tutorial configures policy values using deterministic commands.
13
+ Use it when you want repeatable settings for teams, scripts, and CI runs.
14
+
15
+ ## Prerequisites
16
+
17
+ - Berry Shield enabled
18
+ - Profile strategy already chosen (or about to be set)
19
+
20
+ ## Step 1: Read full policy state
21
+
22
+ Use this command to print all policy values before making changes.
23
+ ```bash
24
+ openclaw bshield policy get
25
+ ```
26
+ Expected:
27
+ - Rows for profile, adaptive values, and retention values
28
+
29
+ ## Step 2: Set profile via policy path
30
+
31
+ Use this command to enforce an explicit profile through policy path semantics.
32
+ ```bash
33
+ openclaw bshield policy set profile balanced
34
+ ```
35
+ Expected:
36
+ - CLI confirms `profile = balanced`
37
+
38
+ ## Step 3: Set stale timeout
39
+
40
+ Use this command to define when sessions are considered stale for adaptive behavior.
41
+ ```bash
42
+ openclaw bshield policy set adaptive.staleAfterMinutes 30
43
+ ```
44
+ Expected:
45
+ - CLI confirms stale timeout update
46
+
47
+ ## Step 4: Set escalation turns
48
+
49
+ Use this command to control how many turns remain elevated after critical triggers.
50
+ ```bash
51
+ openclaw bshield policy set adaptive.escalationTurns 3
52
+ ```
53
+ Expected:
54
+ - CLI confirms escalation value update
55
+
56
+ ## Step 5: Set heartbeat interval
57
+
58
+ Use this command to tune optional periodic reinforcement cadence.
59
+ ```bash
60
+ openclaw bshield policy set adaptive.heartbeatEveryTurns 0
61
+ ```
62
+ Expected:
63
+ - CLI confirms heartbeat interval update
64
+
65
+ ## Step 6: Configure global escalation behavior
66
+
67
+ Use this command to keep global escalation disabled unless you explicitly need it.
68
+ ```bash
69
+ openclaw bshield policy set adaptive.allowGlobalEscalation false
70
+ ```
71
+ Expected:
72
+ - CLI confirms boolean update
73
+
74
+ ## Step 7: Tune retention limits
75
+
76
+ Use this command to cap how many persisted audit events are retained.
77
+ ```bash
78
+ openclaw bshield policy set retention.maxEntries 5000
79
+ ```
80
+ Expected:
81
+ - CLI confirms retention max entries update
82
+
83
+ ## Step 8: Tune retention TTL
84
+
85
+ Use this command to define event expiration window in seconds.
86
+ ```bash
87
+ openclaw bshield policy set retention.ttlSeconds 2592000
88
+ ```
89
+ Expected:
90
+ - CLI confirms retention TTL update
91
+
92
+ ## Step 9: Verify one critical field
93
+
94
+ Use this command to verify the exact value of global escalation after updates.
95
+ ```bash
96
+ openclaw bshield policy get adaptive.allowGlobalEscalation
97
+ ```
98
+ Expected:
99
+ - Output shows `false` for the selected path
100
+
101
+ ## Related pages
102
+ - [tutorial index](README.md)
103
+ - [choose profile](choose-profile.md)
104
+ - [policy command reference](../operation/cli/policy.md)
105
+ - [security posture](../decision/posture.md)
106
+
107
+ ---
108
+
109
+ ## Navigation
110
+ - [Back to Tutorials Index](README.md)
111
+ - [Back to Wiki Index](../README.md)