@letterblack/lbe-core 1.3.28 → 1.3.29

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.29 — 2026-06-25
4
+
5
+ ### Changed
6
+ - Expanded public mirror README with problem statement, target audience, use cases, why-local-first rationale, and scope boundaries. Previously documented only the technical surface.
7
+
3
8
  ## 1.3.28 — 2026-06-25
4
9
 
5
10
  ### Fixed
package/Release-README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @letterblack/lbe-core
2
2
 
3
- **Release 1.3.28**
3
+ **Release 1.3.29**
4
4
 
5
5
  LBE is local execution control for AI agents. It evaluates file and shell
6
6
  actions routed through its execution boundary, records local evidence, and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterblack/lbe-core",
3
- "version": "1.3.28",
3
+ "version": "1.3.29",
4
4
  "description": "Local-first execution governance SDK for AI agents. Agents propose → Controller validates → Adapters execute.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -74,5 +74,5 @@
74
74
  "directories": {
75
75
  "doc": "docs"
76
76
  },
77
- "gitHead": "3ab9a74084e1e4f067d65223d4a3d632b3a8a3e7"
77
+ "gitHead": "d1d8fededb1326ecc1490e0be1edbe606a16e0fb"
78
78
  }
package/release/README.md CHANGED
@@ -1,8 +1,77 @@
1
1
  # {{PACKAGE_NAME}}
2
2
 
3
- **Local execution control for AI agents.**
3
+ **A local policy gate between what an AI agent proposes and what your system executes.**
4
4
 
5
- LBE sits between what an AI agent proposes and what your system executes. Every action is validated against a local policy before it runs. No cloud service. No daemon. Evidence stays on your machine.
5
+ ---
6
+
7
+ ## The problem
8
+
9
+ AI agents write files, run shell commands, call APIs, and modify state. Most of the time they do the right thing. But they have no built-in execution boundary. When a model hallucinates a path, over-reaches its scope, or gets manipulated by injected instructions, there is nothing between the agent's decision and your filesystem.
10
+
11
+ You can prompt the agent to be careful. You can review outputs manually. But neither of those is enforcement.
12
+
13
+ LBE is enforcement. Every action the agent proposes is validated against a local policy before it runs. If the policy says no, the action does not execute — regardless of what the model decided.
14
+
15
+ ---
16
+
17
+ ## Who this is for
18
+
19
+ - **Developers building AI coding assistants** that write, move, or delete files on behalf of users
20
+ - **Developers building automation tools** where an AI generates shell commands or file operations
21
+ - **Teams integrating LLMs into existing applications** that need an audit trail and a hard execution boundary
22
+ - **Anyone who wants to know exactly what an AI agent did** and be able to prove it, not just trust it
23
+
24
+ You do not need to be building a safety product. If your application lets an AI agent touch the filesystem or run commands, you need an execution boundary. LBE is that boundary.
25
+
26
+ ---
27
+
28
+ ## Why local-first
29
+
30
+ No cloud service. No daemon. No API key. The runtime is a verified WASM binary that runs in your process. Policy is a local JSON file. Evidence stays on your machine.
31
+
32
+ This matters because:
33
+ - It works offline and in airgapped environments
34
+ - No external service can go down and break your enforcement
35
+ - Sensitive file paths and workspace context never leave the machine
36
+ - Latency is microseconds, not network round-trips
37
+ - You own the policy — no vendor decides what is allowed
38
+
39
+ ---
40
+
41
+ ## What it does
42
+
43
+ ```
44
+ Agent proposes an action
45
+
46
+ LBE validates it through a 7-gate pipeline
47
+
48
+ allow / deny — structured result returned to your host
49
+
50
+ Host executes only if LBE approved
51
+
52
+ Audit entry written to a local hash-linked log
53
+ ```
54
+
55
+ Your code stays in control. LBE makes the allow/deny decision and hands it back. It does not execute on your behalf.
56
+
57
+ ---
58
+
59
+ ## Use cases
60
+
61
+ **AI coding assistant**
62
+ The agent wants to write `src/auth.js`. LBE checks: is this path inside the allowed workspace? Is the operation type permitted? Does the policy allow file writes for this actor? Only if all gates pass does your host write the file.
63
+
64
+ **Shell command gating**
65
+ The agent proposes `rm -rf ./build`. Your policy allows `rm` inside `./build` but denies recursive deletes outside it. LBE returns deny before the command reaches the shell.
66
+
67
+ **Scope enforcement**
68
+ You want the agent to only touch files in `./generated/`. Write one policy rule. LBE denies every write outside that path, automatically, on every request, without you reviewing each one.
69
+
70
+ **Audit and proof**
71
+ Every allowed and denied action is written to a local hash-linked audit log. The chain is tamper-evident — removing or modifying an entry breaks the chain and is detectable. You can prove what the agent did, in order, with cryptographic evidence.
72
+
73
+ **Observer mode for new projects**
74
+ Not sure what your agent is doing? Start in observer mode. Every request is validated and logged exactly as it would be in enforcement — but nothing is blocked. Watch the patterns. Write policy rules. Switch to enforce when you are confident.
6
75
 
7
76
  ---
8
77
 
@@ -19,16 +88,16 @@ Requires Node.js >= 20.9.0.
19
88
  ## Quick start
20
89
 
21
90
  ```bash
22
- npx lbe init # create policy file in observer mode
91
+ npx lbe init # create lbe.policy.json in observer mode
23
92
  npx lbe status # show current policy and workspace state
24
93
  npx lbe enforce # switch to blocking mode when ready
25
94
  ```
26
95
 
27
96
  ---
28
97
 
29
- ## How it works
98
+ ## How the gate pipeline works
30
99
 
31
- Every request passes through a 7-gate validation pipeline inside a local WASM runtime. If any gate fails, the request is denied before anything executes.
100
+ Every request passes through 7 gates inside the WASM runtime. If any gate fails, the request is denied and the remaining gates are not evaluated.
32
101
 
33
102
  ```
34
103
  [1] Schema required fields and structure
@@ -42,7 +111,7 @@ Every request passes through a 7-gate validation pipeline inside a local WASM ru
42
111
  allow / deny — structured result returned to your host
43
112
  ```
44
113
 
45
- Your host receives the decision and acts on it. Nothing executes inside the runtime.
114
+ A failure at gate 2 never reaches gate 7. A denied request never reaches your execution layer.
46
115
 
47
116
  ---
48
117
 
@@ -58,58 +127,43 @@ Your host receives the decision and acts on it. Nothing executes inside the runt
58
127
  | `npx lbe execute` | Validate a JSON proposal from stdin |
59
128
  | `npx lbe execute --input <file>` | Validate a JSON proposal from a file |
60
129
 
61
- Start in observer mode. Watch what your agent proposes. Add deny rules. Switch to enforce when you are confident in the policy.
62
-
63
- ---
64
-
65
- ## Observer mode
66
-
67
- Not ready to block? `init` creates the policy in observer mode. LBE validates every request and writes audit entries — but nothing is blocked. You see exactly what the agent is doing before you decide what to deny.
68
-
69
- ```bash
70
- npx lbe init # observer mode on by default
71
- npx lbe status # confirm mode: observe
72
- npx lbe enforce # block when ready
73
- npx lbe observe # back to advisory if needed
74
- ```
75
-
76
130
  ---
77
131
 
78
- ## Validating a request
79
-
80
- `execute` accepts a JSON proposal on stdin or via `--input <file>` and returns a structured decision.
81
-
82
- ```bash
83
- # from a file
84
- npx lbe execute --input proposal.json
132
+ ## Programmatic API
85
133
 
86
- # from stdin
87
- echo '{"version":"1.0",...}' | npx lbe execute
88
- ```
134
+ ```js
135
+ import { execute } from '{{PACKAGE_NAME}}';
89
136
 
90
- Exit code `0` = allowed. Exit code `1` = denied. Exit code `2` = bad input.
137
+ const proposal = {
138
+ version: '1.0',
139
+ request_id: 'req-001',
140
+ timestamp: Math.floor(Date.now() / 1000),
141
+ actor: { id: 'agent:local', role: 'agent' },
142
+ intent: {
143
+ type: 'command',
144
+ name: 'write_file',
145
+ payload: { target: 'src/output.js' }
146
+ },
147
+ context: { workspace: process.cwd(), env: {}, history: [] },
148
+ constraints: { policy_mode: 'strict', timeout_ms: 5000 },
149
+ auth: { signature: '<host-signed>', nonce: '<unique-per-request>' }
150
+ };
91
151
 
92
- ### Minimal request shape
152
+ const result = JSON.parse(execute(JSON.stringify(proposal)));
93
153
 
94
- ```json
95
- {
96
- "version": "1.0",
97
- "request_id": "req-001",
98
- "timestamp": 1700000000,
99
- "actor": { "id": "agent:local", "role": "agent" },
100
- "intent": {
101
- "type": "command",
102
- "name": "write_file",
103
- "payload": { "target": "out.txt" }
104
- },
105
- "context": { "workspace": "/your/project", "env": {}, "history": [] },
106
- "constraints": { "policy_mode": "strict", "timeout_ms": 5000 },
107
- "auth": { "signature": "<host-signed>", "nonce": "<unique-per-request>" }
154
+ if (result.decision === 'allow') {
155
+ // LBE approved — safe to execute
156
+ } else {
157
+ // LBE denied — result.error has the gate and reason
158
+ console.error(result.error.stage, result.error.message);
108
159
  }
109
160
  ```
110
161
 
111
- ### Decision response
162
+ `execute(input: string): string` — synchronous, accepts JSON, returns JSON. The WASM runtime owns all gate decisions.
163
+
164
+ ### Decision responses
112
165
 
166
+ Allowed:
113
167
  ```json
114
168
  {
115
169
  "ok": true,
@@ -119,6 +173,7 @@ Exit code `0` = allowed. Exit code `1` = denied. Exit code `2` = bad input.
119
173
  }
120
174
  ```
121
175
 
176
+ Denied:
122
177
  ```json
123
178
  {
124
179
  "ok": false,
@@ -130,36 +185,47 @@ Exit code `0` = allowed. Exit code `1` = denied. Exit code `2` = bad input.
130
185
 
131
186
  ---
132
187
 
133
- ## Programmatic API
188
+ ## Validating from the CLI
134
189
 
135
- ```js
136
- import { execute } from '{{PACKAGE_NAME}}';
137
-
138
- const result = JSON.parse(execute(JSON.stringify(proposal)));
190
+ ```bash
191
+ # from a file
192
+ npx lbe execute --input proposal.json
139
193
 
140
- if (result.decision === 'allow') {
141
- // safe to act
142
- } else {
143
- // blocked — result.error has the gate and reason
144
- }
194
+ # from stdin
195
+ cat proposal.json | npx lbe execute
145
196
  ```
146
197
 
147
- `execute(input: string): string` accepts JSON, returns JSON. Synchronous. The WASM runtime owns all gate decisions.
198
+ Exit code `0` = allowed. Exit code `1` = denied. Exit code `2` = bad input.
199
+
200
+ ---
201
+
202
+ ## Observer mode
203
+
204
+ Not ready to block? Start here.
205
+
206
+ `npx lbe init` creates the policy in observer mode. Every request is fully validated and logged — exactly as it would be in enforcement — but nothing is blocked. You see exactly what the agent is doing before you write your first deny rule.
207
+
208
+ ```bash
209
+ npx lbe init # observer mode on by default
210
+ npx lbe status # confirm mode: observe
211
+ npx lbe enforce # block when ready
212
+ npx lbe observe # back to advisory any time
213
+ ```
148
214
 
149
215
  ---
150
216
 
151
217
  ## What ships in this package
152
218
 
153
219
  ```
154
- dist/index.js WebAssembly runtime loader — exports execute()
155
- dist/cli.js CLI (npx lbe)
156
- dist/lbe_engine.wasm Verified runtime binary
157
- dist/wasm.lock.json Runtime integrity lock (SHA-256 of wasm binary)
220
+ dist/index.js WebAssembly runtime loader — exports execute()
221
+ dist/cli.js CLI (npx lbe)
222
+ dist/lbe_engine.wasm Verified runtime binary
223
+ dist/wasm.lock.json Runtime integrity lock (SHA-256 of wasm binary)
158
224
  assets/lbe-gates.jpg Gate sequence diagram
159
225
  assets/story-allow.jpg Approved-request flow
160
226
  assets/story-deny.jpg Blocked-request flow
161
227
  assets/runtime-boundary.svg Runtime boundary diagram
162
- types.d.ts TypeScript declarations
228
+ types.d.ts TypeScript declarations
163
229
  LICENSE
164
230
  ```
165
231
 
@@ -169,46 +235,26 @@ Source code, tests, keys, internal adapters, and workspace state are not include
169
235
 
170
236
  ---
171
237
 
172
- ## Gate pipeline — approved request
173
-
174
- ![LBE gate sequence — schema, timestamp, key, signature, rate limit, nonce, policy](./assets/lbe-gates.jpg)
175
-
176
- 1. Agent produces a signed action proposal.
177
- 2. Identity confirmed against a locally held key — no network call.
178
- 3. Policy evaluated. Request approved.
179
- 4. Host executes inside the allowed workspace.
180
- 5. Audit entry appended to local hash-linked log.
181
-
182
- ---
183
-
184
- ## Gate pipeline — denied request
185
-
186
- ![Blocked-request flow — policy gate closes, nothing reaches execution](./assets/story-deny.jpg)
187
-
188
- 1. Agent proposes an action outside the permitted policy.
189
- 2. Policy gate closes. WASM runtime returns denied before any adapter runs.
190
- 3. Shell untouched. Filesystem unchanged.
191
- 4. Denial written to audit log — chain sealed.
192
-
193
- No partial execution. Denial is a first-class outcome.
194
-
195
- ---
196
-
197
238
  ## What LBE does not do
198
239
 
199
- - Kernel-level process isolation
200
- - Network-egress control
201
- - Multi-tenant separation
202
- - Cloud monitoring or hosted control plane
203
- - Universal control over tools not routed through LBE
240
+ LBE is not a sandbox, container, or OS-level isolation layer. It controls only the actions that your host routes through it.
241
+
242
+ - Does not provide kernel-level process isolation
243
+ - Does not control network egress
244
+ - Does not prevent the agent from calling external APIs directly
245
+ - Does not provide multi-tenant separation
246
+ - Does not run a hosted control plane
204
247
 
205
- LBE controls only actions that pass through its execution boundary.
248
+ If the agent calls the filesystem directly without going through your host code, LBE does not see it. LBE governs actions that are explicitly routed through the `execute()` boundary.
206
249
 
207
250
  ---
208
251
 
209
252
  ## Limits
210
253
 
211
- Central writes are best-effort. Local logs remain local. Non-inspectable targets may produce `WEAK_PROOF`. Rate and nonce state is per-process unless you supply a shared database path.
254
+ - Central writes are best-effort
255
+ - Local logs remain local
256
+ - Non-inspectable targets may produce `WEAK_PROOF`
257
+ - Rate and nonce state is per-process unless you supply a shared database path
212
258
 
213
259
  ---
214
260