@f4bioo/berry-shield 2026.3.3-2 → 2026.3.17

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.
@@ -34,6 +34,16 @@ Practical rule:
34
34
  For official OpenClaw plugin installation behavior, see:
35
35
  - https://docs.openclaw.ai/tools/plugin
36
36
 
37
+ ## Host hook note
38
+
39
+ OpenClaw host behavior can influence prompt-level guidance hooks used by Berry Shield.
40
+
41
+ Operational note:
42
+ - if the host explicitly disables plugin prompt-injection style prepend behavior for hooks, `Berry.Root` and Vine reminder guidance from `before_agent_start` can be partially degraded.
43
+
44
+ See more:
45
+ - [Technical limitations and host behavior](../../../README.md#-technical-limitations--sdk-diary)
46
+
37
47
 
38
48
  ### Quick navigation
39
49
 
@@ -98,6 +98,8 @@ Root is useful for:
98
98
  ## Limits and caveats
99
99
 
100
100
  - Root is instruction-level control, not hard execution enforcement.
101
+ - If the host disables prompt-injection style prepend behavior for plugin hooks, Root guidance can be partially degraded because `before_agent_start` context may no longer be injected.
102
+ - This is a host/runtime constraint, not a full Berry Shield plugin failure.
101
103
  - If runtime context identity is missing, global safety fallback can increase policy verbosity.
102
104
  - Excessive full injections increase token cost.
103
105
  - Too little reinjection can reduce model adherence in long sessions.
@@ -24,6 +24,7 @@ The tool evaluates operation intent (exec, read, write) against destructive-comm
24
24
  - sensitive file access in read/write requests
25
25
  - Emits structured audit events in both audit and enforce paths.
26
26
  - Returns allow/deny response payloads to the agent.
27
+ - Returns the standard `CONFIRM_REQUIRED` challenge when Vine risk is active, even if host/runtime identity is degraded.
27
28
  - Triggers adaptive escalation signaling on enforce denies.
28
29
 
29
30
  ## What Stem does not do
@@ -40,10 +41,11 @@ flowchart TD
40
41
  A[Agent requests gate check] --> B[Berry.Stem]
41
42
  B --> C{Input valid?}
42
43
  C -->|No| E[Reject request]
43
- C -->|Yes| D{Risk match?}
44
+ C -->|Yes| D{Policy or Vine risk?}
44
45
  D -->|No| ALLOW[Return ALLOWED]
45
- D -->|Yes + audit| WB[Emit would_block event]
46
- D -->|Yes + enforce| DENY[Return DENIED + blocked event]
46
+ D -->|Yes + audit| WB[Emit would_block or would_confirm_required]
47
+ D -->|Yes + confirm| CONFIRM[Return CONFIRM_REQUIRED]
48
+ D -->|Yes + deny| DENY[Return DENIED + blocked event]
47
49
  WB --> ALLOW
48
50
  DENY --> ESC[Adaptive escalation signal]
49
51
  ```
@@ -13,6 +13,18 @@ Berry.Vine is the **external-content trust guard layer**.
13
13
 
14
14
  It reduces prompt-injection risk by treating external content as untrusted by default and enforcing trust-aware checks before sensitive operations.
15
15
 
16
+ ## Philosophy
17
+
18
+ Vine is designed to act as a **pause layer**, not as a hard isolation barrier.
19
+
20
+ Its job is to slow down risky external-content-driven flows long enough to require visible human intent before the agent continues with a sensitive action.
21
+
22
+ Operationally, this means:
23
+ - prefer an explicit confirmation pause over a silent allow when external risk is active;
24
+ - avoid turning degraded binding or imperfect session identity into a hard product lockout by default;
25
+ - use confirmation as the pragmatic fallback when the host/runtime context is incomplete but the channel can still support a human pause;
26
+ - keep the focus on interrupting unsafe momentum, not on pretending Vine is a complete antivirus-style boundary.
27
+
16
28
  ## What Vine does
17
29
 
18
30
  - Tracks external-risk signals per session.
@@ -29,6 +41,32 @@ It reduces prompt-injection risk by treating external content as untrusted by de
29
41
  - It does not rely on semantic AI classification.
30
42
  - It does not auto-remediate without explicit operator action.
31
43
 
44
+ ## Confirmation strategies
45
+
46
+ Vine supports two confirmation strategies for sensitive actions under active external risk:
47
+
48
+ - `one_to_one` (`1:1`): one human confirmation code is consumed by one sensitive action.
49
+ - `one_to_many` (`1:N`): one human confirmation code can unlock multiple sensitive actions within a short bounded window.
50
+
51
+ Operational default:
52
+ - `one_to_many` is the default strategy.
53
+
54
+ Important fields:
55
+ - code TTL: how long a challenge code remains valid.
56
+ - confirmation window: how long the `1:N` execution window stays open after approval.
57
+ - max actions per window: how many sensitive actions the `1:N` approval can unlock inside that window.
58
+ - max attempts: how many invalid confirmation attempts are tolerated before the challenge is exhausted.
59
+
60
+ High-level confirmation flow:
61
+ - Berry detects active external-risk state.
62
+ - A sensitive action is evaluated through `berry_check` or `before_tool_call`.
63
+ - Vine emits a confirmation challenge when human intent must be made explicit.
64
+ - Human approval unlocks the real action according to the configured strategy.
65
+
66
+ Degraded path:
67
+ - if native binding or session identity is degraded, Berry still uses the normal `CONFIRM_REQUIRED` code-based challenge instead of silently allowing the action;
68
+ - degraded identity may reduce correlation precision, but it does not change the public confirmation protocol.
69
+
32
70
  ## Runtime flow
33
71
 
34
72
  ```mermaid
@@ -61,6 +99,7 @@ Key operational rule:
61
99
  ### Enforce
62
100
  - Sensitive actions under active external risk can be blocked.
63
101
  - In strict profile, unknown-origin sensitive attempts can also block.
102
+ - When native confirmation binding is degraded, Berry still uses the same explicit code-based confirmation flow instead of silently allowing the action.
64
103
 
65
104
  ### Audit
66
105
  - No hard block.
@@ -129,6 +168,7 @@ Important scope:
129
168
  ## Limits and caveats
130
169
 
131
170
  - Hook timing and availability still depend on host runtime behavior.
171
+ - If the host disables prompt-injection style context prepend for plugin hooks, Vine reminder text from `before_agent_start` can be neutralized even though risk tracking and action guarding still exist.
132
172
  - Unknown-origin classification can create false positives if over-tuned.
133
173
  - Risk decay should not depend only on elapsed time.
134
174
 
@@ -96,6 +96,13 @@ openclaw bshield vine set mode strict
96
96
  ```
97
97
  Expected: CLI confirms strict Vine mode for external-content guard behavior.
98
98
 
99
+ ### 9) Inspect or change Vine confirmation strategy
100
+ Use this when you need to verify or switch between `1:1` and `1:N` confirmation behavior.
101
+ ```bash
102
+ openclaw bshield vine confirmation
103
+ ```
104
+ Expected: CLI opens the interactive selector for Vine confirmation strategy.
105
+
99
106
  ## Documentation structure
100
107
 
101
108
  Each command page follows the same structure:
@@ -16,6 +16,7 @@ Show the effective Berry Shield runtime state resolved from OpenClaw plugin conf
16
16
  - Prints current plugin state (`Status`, `Mode`, and rule counters).
17
17
  - Prints policy state (`Profile`, adaptive values, and global escalation toggle).
18
18
  - Prints Vine state (`Mode`, thresholds, retention, and allowlist size).
19
+ - Prints Vine confirmation state (`Confirmation Strategy`, active strategy marker, TTL, attempts, and window values).
19
20
  - Prints each security layer status as `ACTIVE` or `OFF`.
20
21
 
21
22
  ## When to use
@@ -63,6 +64,17 @@ Result expected:
63
64
  - Thresholds and retention values match expected operational tuning.
64
65
  - `Allowlist` shows the number of exempt tools.
65
66
 
67
+ ### Vine Confirmation section
68
+ Command for this check: `openclaw bshield status`.
69
+ Result expected:
70
+ - `Confirmation Strategy` shows the configured runtime contract (`1:1` or `1:N`).
71
+ - `1:1` and `1:N` show which strategy is currently `ACTIVE`.
72
+ - `Code TTL (sec)` shows how long the challenge code remains valid.
73
+ - `Max Attempts` shows how many invalid confirmation tries are tolerated.
74
+ - `Window (sec)` and `Max Actions/Window` matter primarily for `1:N`.
75
+ - `Window (sec)` is the active multi-action approval window after a successful confirmation.
76
+ - `Max Actions/Window` is the maximum number of sensitive actions that one `1:N` approval can unlock inside that window.
77
+
66
78
  ### Security layers section
67
79
  Command for this check: `openclaw bshield status`.
68
80
  Result expected:
@@ -16,6 +16,7 @@ Manage Berry.Vine configuration and tool allowlist from CLI.
16
16
  - Writes deterministic Vine paths (set).
17
17
  - Adds one tool to Vine allowlist (allow).
18
18
  - Removes one tool from Vine allowlist (deny).
19
+ - Opens the interactive confirmation-strategy selector (confirmation).
19
20
 
20
21
  ## When to use
21
22
  - Before smoke tests that need strict/balanced Vine behavior.
@@ -80,6 +81,21 @@ Supported `set` paths:
80
81
  - `thresholds.forcedGuardTurns` (integer `>= 1`)
81
82
  - `retention.maxEntries` (integer `>= 1`)
82
83
  - `retention.ttlSeconds` (integer `>= 1`)
84
+ - `confirmation.strategy` (`one_to_one | one_to_many`)
85
+ - `confirmation.codeTtlSeconds` (integer `>= 1`)
86
+ - `confirmation.maxAttempts` (integer `>= 1`)
87
+ - `confirmation.windowSeconds` (integer `>= 1`)
88
+ - `confirmation.maxActionsPerWindow` (integer `>= 1`)
89
+
90
+ Confirmation strategy meanings:
91
+ - `one_to_one` (`1:1`): one code unlocks one sensitive action.
92
+ - `one_to_many` (`1:N`): one code can unlock multiple sensitive actions inside the active confirmation window.
93
+
94
+ Default:
95
+ - `one_to_many` is the default confirmation strategy.
96
+
97
+ Operational note:
98
+ - if host/runtime binding is degraded, Vine still uses the same visible code-based confirmation flow without changing the configured confirmation strategy itself.
83
99
 
84
100
  ## Tuning guide
85
101
 
@@ -139,6 +155,20 @@ openclaw bshield vine set thresholds.forcedGuardTurns 2
139
155
  ```
140
156
  Result: CLI confirms forced guard turns updated.
141
157
 
158
+ ### Switch confirmation strategy to one-to-one
159
+ Use this when every sensitive action must consume its own confirmation.
160
+ ```bash
161
+ openclaw bshield vine set confirmation.strategy one_to_one
162
+ ```
163
+ Result: CLI confirms `confirmation.strategy = one_to_one`.
164
+
165
+ ### Open interactive confirmation strategy selector
166
+ Use this when you prefer the TTY selector with `1:1` and `1:N` labels.
167
+ ```bash
168
+ openclaw bshield vine confirmation
169
+ ```
170
+ Result: CLI opens the interactive selector and updates strategy after confirmation.
171
+
142
172
  ### Allowlist one tool
143
173
  Use this when one trusted tool should not trigger Vine escalation.
144
174
  ```bash
@@ -180,6 +210,13 @@ openclaw bshield vine set thresholds.forcedGuardTurns zero
180
210
  ```
181
211
  Expected: CLI fails with integer validation message.
182
212
 
213
+ ### Invalid confirmation strategy value
214
+ Use this check when a direct confirmation strategy write uses an unsupported value.
215
+ ```bash
216
+ openclaw bshield vine set confirmation.strategy invalid
217
+ ```
218
+ Expected: CLI fails and prints the allowed confirmation strategies.
219
+
183
220
  ## Related commands
184
221
  - [index](README.md)
185
222
  - [status](status.md)
@@ -16,6 +16,7 @@ Use these pages when you want guided execution rather than command reference.
16
16
 
17
17
  - [secure session](secure-session.md): end-to-end first session with verification checkpoints
18
18
  - [choose your profile](choose-profile.md): decide strict/balanced/minimal with practical checks
19
+ - [choose your Vine confirmation strategy](choose-vine-confirmation.md): decide when to use `1:1` or `1:N`
19
20
  - [tune policy](tune-policy.md): configure adaptive and retention values safely
20
21
  - [build custom rules](build-custom-rules.md): add, test, list, and remove organization-specific rules
21
22
  - [audit-to-enforce rollout](audit-to-enforce-rollout.md): move from observation to active mitigation
@@ -0,0 +1,94 @@
1
+ ---
2
+ summary: "Choose the right Vine confirmation strategy for external-risk workflows"
3
+ read_when:
4
+ - You are deciding between one-to-one and one-to-many confirmation
5
+ - You want a practical Vine baseline before smoke tests or rollout
6
+ - You need to verify confirmation behavior from CLI and status output
7
+ title: "Choose Your Vine Confirmation Strategy"
8
+ ---
9
+
10
+ # `Choose Your Vine Confirmation Strategy`
11
+
12
+ This tutorial helps you choose and validate the Vine confirmation strategy without editing low-level config files.
13
+ Use it when you need a predictable human pause after external-content risk becomes active.
14
+
15
+ ## Prerequisites
16
+
17
+ - Berry Shield installed and enabled
18
+ - Access to run `openclaw bshield` commands
19
+ - Vine layer enabled in the active runtime
20
+
21
+ ## Step 1: Inspect current confirmation state
22
+
23
+ Use this command to inspect the active Vine confirmation strategy before changing anything.
24
+ ```bash
25
+ openclaw bshield status
26
+ ```
27
+ Expected:
28
+ - `Vine Confirmation` section is visible
29
+ - `Confirmation Strategy` is shown as `ONE_TO_ONE` or `ONE_TO_MANY`
30
+
31
+ ## Step 2: Start with the default strategy
32
+
33
+ Use this command when you want the recommended general-purpose confirmation baseline.
34
+ ```bash
35
+ openclaw bshield vine set confirmation.strategy one_to_many
36
+ ```
37
+ Expected:
38
+ - CLI confirms `confirmation.strategy = one_to_many`
39
+
40
+ ## Step 3: Verify the runtime state
41
+
42
+ Use this command to confirm the strategy is visible in status output.
43
+ ```bash
44
+ openclaw bshield status
45
+ ```
46
+ Expected:
47
+ - `Confirmation Strategy` is `ONE_TO_MANY`
48
+ - `ONE_TO_MANY` is marked `ACTIVE`
49
+
50
+ ## Step 4: Try the interactive selector
51
+
52
+ Use this command when you want the TTY selector with `1:1` and `1:N` labels.
53
+ ```bash
54
+ openclaw bshield vine confirmation
55
+ ```
56
+ Expected:
57
+ - CLI opens the confirmation strategy selector
58
+
59
+ ## Step 5: Switch to one-to-one when every action must pause
60
+
61
+ Use this command when each sensitive action should require its own human confirmation.
62
+ ```bash
63
+ openclaw bshield vine set confirmation.strategy one_to_one
64
+ ```
65
+ Expected:
66
+ - CLI confirms `confirmation.strategy = one_to_one`
67
+
68
+ ## Step 6: Return to one-to-many for smoother operator flow
69
+
70
+ Use this command when you want one confirmation to unlock a short bounded sequence of sensitive actions.
71
+ ```bash
72
+ openclaw bshield vine set confirmation.strategy one_to_many
73
+ ```
74
+ Expected:
75
+ - CLI confirms `confirmation.strategy = one_to_many`
76
+
77
+ ## Decision guide
78
+
79
+ - Choose `one_to_one` (`1:1`) when every sensitive action should stop and wait for a new human confirmation.
80
+ - Choose `one_to_many` (`1:N`) when the goal is to insert one visible human pause and then allow a short bounded sequence of related sensitive actions.
81
+ - Keep `one_to_many` as the default when operator experience matters and the bounded window is acceptable.
82
+ - Use `one_to_one` for higher-friction validation sessions or when you want the clearest action-by-action audit trail.
83
+
84
+ ## Related pages
85
+ - [tutorial index](README.md)
86
+ - [Vine layer reference](../layers/vine.md)
87
+ - [vine command reference](../operation/cli/vine.md)
88
+ - [status command reference](../operation/cli/status.md)
89
+
90
+ ---
91
+
92
+ ## Navigation
93
+ - [Back to Tutorials Index](README.md)
94
+ - [Back to Wiki Index](../README.md)
@@ -2,7 +2,7 @@
2
2
  "id": "berry-shield",
3
3
  "name": "Berry Shield",
4
4
  "description": "Security plugin that helps to block destructive commands, redact secrets and PII",
5
- "version": "2026.3.3-2",
5
+ "version": "2026.3.17",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "additionalProperties": false,
@@ -173,6 +173,46 @@
173
173
  },
174
174
  "default": [],
175
175
  "description": "Tool names exempt from Vine escalation"
176
+ },
177
+ "confirmation": {
178
+ "type": "object",
179
+ "additionalProperties": false,
180
+ "description": "Confirmation flow tuning for sensitive actions under Vine risk",
181
+ "properties": {
182
+ "strategy": {
183
+ "type": "string",
184
+ "enum": [
185
+ "one_to_one",
186
+ "one_to_many"
187
+ ],
188
+ "default": "one_to_many",
189
+ "description": "Confirmation strategy: 1:1 = one code per action, 1:N = one code for multiple actions within a short window"
190
+ },
191
+ "codeTtlSeconds": {
192
+ "type": "integer",
193
+ "minimum": 1,
194
+ "default": 180,
195
+ "description": "Confirmation code time-to-live in seconds"
196
+ },
197
+ "maxAttempts": {
198
+ "type": "integer",
199
+ "minimum": 1,
200
+ "default": 3,
201
+ "description": "Maximum invalid code attempts per challenge"
202
+ },
203
+ "windowSeconds": {
204
+ "type": "integer",
205
+ "minimum": 1,
206
+ "default": 120,
207
+ "description": "Window lifetime in seconds when strategy is 1:N"
208
+ },
209
+ "maxActionsPerWindow": {
210
+ "type": "integer",
211
+ "minimum": 1,
212
+ "default": 3,
213
+ "description": "Maximum sensitive actions allowed during 1:N confirmation window"
214
+ }
215
+ }
176
216
  }
177
217
  }
178
218
  },
@@ -290,4 +330,4 @@
290
330
  "sensitive": false
291
331
  }
292
332
  }
293
- }
333
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@f4bioo/berry-shield",
3
- "version": "2026.3.3-2",
3
+ "version": "2026.3.17",
4
4
  "description": "OpenClaw plugin for policy checks, command/file blocking, and sensitive-data redaction.",
5
5
  "keywords": [
6
6
  "openclaw",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "homepage": "https://github.com/F4bioo/berry-shield#readme",
26
26
  "engines": {
27
- "node": ">=20.0.0"
27
+ "node": ">=22.16.0"
28
28
  },
29
29
  "type": "module",
30
30
  "files": [
@@ -44,27 +44,32 @@
44
44
  "scripts": {
45
45
  "test": "vitest run",
46
46
  "test:watch": "vitest",
47
+ "pretest": "npm run plugin:manifest:sync",
47
48
  "typecheck": "tsc --noEmit",
48
- "build": "esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/index.js --external:openclaw/plugin-sdk --target=node20",
49
+ "pretypecheck": "npm run plugin:manifest:sync",
50
+ "plugin:manifest:sync": "node scripts/sync-manifest.mjs",
51
+ "prebuild": "npm run plugin:manifest:sync",
52
+ "build": "esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/index.js --external:openclaw/plugin-sdk --target=node22",
49
53
  "build:types": "tsc -p tsconfig.build.json",
50
54
  "//release": "Preflight gates run before version bump",
51
- "release:preflight": "npm run build && npm run typecheck && npm test && npm run wiki:claim",
55
+ "prerelease:preflight": "npm run plugin:manifest:sync",
56
+ "release:preflight": "npm run typecheck && npm test && npm run build && npm run wiki:claim",
52
57
  "release": "npm run release:preflight && npm run version:update",
53
58
  "version:update": "npx ts-node --esm scripts/update-version.ts",
54
59
  "update-patterns": "npx ts-node --esm scripts/update-patterns.ts",
55
60
  "wiki:claim": "npx ts-node --esm scripts/doc-sanity.ts"
56
61
  },
57
62
  "peerDependencies": {
58
- "openclaw": "^2026.2.3-1"
63
+ "openclaw": "^2026.3.12"
59
64
  },
60
65
  "dependencies": {
61
- "@clack/prompts": "^0.7.0"
66
+ "@clack/prompts": "^1.0.1"
62
67
  },
63
68
  "devDependencies": {
64
69
  "@iarna/toml": "^2.2.5",
65
70
  "@types/node": "^25.2.2",
66
- "esbuild": "^0.27.3",
71
+ "esbuild": "^0.27.4",
67
72
  "typescript": "^5.3.0",
68
- "vitest": "^4.0.18"
73
+ "vitest": "^4.1.0"
69
74
  }
70
75
  }