@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 +5 -0
- package/Release-README.md +1 -1
- package/package.json +2 -2
- package/release/README.md +142 -96
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@letterblack/lbe-core",
|
|
3
|
-
"version": "1.3.
|
|
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": "
|
|
77
|
+
"gitHead": "d1d8fededb1326ecc1490e0be1edbe606a16e0fb"
|
|
78
78
|
}
|
package/release/README.md
CHANGED
|
@@ -1,8 +1,77 @@
|
|
|
1
1
|
# {{PACKAGE_NAME}}
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**A local policy gate between what an AI agent proposes and what your system executes.**
|
|
4
4
|
|
|
5
|
-
|
|
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
|
|
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
|
|
98
|
+
## How the gate pipeline works
|
|
30
99
|
|
|
31
|
-
Every request passes through
|
|
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
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
```
|
|
134
|
+
```js
|
|
135
|
+
import { execute } from '{{PACKAGE_NAME}}';
|
|
89
136
|
|
|
90
|
-
|
|
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
|
-
|
|
152
|
+
const result = JSON.parse(execute(JSON.stringify(proposal)));
|
|
93
153
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
188
|
+
## Validating from the CLI
|
|
134
189
|
|
|
135
|
-
```
|
|
136
|
-
|
|
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
|
-
|
|
141
|
-
|
|
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
|
-
|
|
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
|
|
155
|
-
dist/cli.js
|
|
156
|
-
dist/lbe_engine.wasm
|
|
157
|
-
dist/wasm.lock.json
|
|
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
|
|
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
|
-

|
|
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
|
-

|
|
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
|
-
|
|
200
|
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
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
|
|
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
|
|
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
|
|