@letterblack/lbe-exec 1.2.17 → 1.2.19
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/TRUST.md +90 -0
- package/dist/cli.js +41 -2845
- package/dist/index.js +14 -1835
- package/hooks/register.cjs +5 -476
- package/package.json +2 -1
package/TRUST.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Trust Model
|
|
2
|
+
|
|
3
|
+
This document states plainly what you can and cannot verify about `@letterblack/lbe-exec` and `@letterblack/lbe-sdk`. It is written for agents and developers who want to reason about the trust surface before depending on this package.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## What this package does
|
|
8
|
+
|
|
9
|
+
LBE intercepts Node.js file system and shell operations at the process level via a CJS preload hook (`--require`). Every intercepted action is evaluated against a local policy file and appended to an audit log. The governance engine runs inside a compiled WASM binary shipped with the package.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## What you can verify independently
|
|
14
|
+
|
|
15
|
+
### 1. Hook behavior (fully verifiable)
|
|
16
|
+
|
|
17
|
+
The preload hook (`hooks/register.cjs`) is client-side JavaScript. You can read it, run it in isolation, and confirm it patches the APIs it claims to patch. The minified form is smaller but not protected — it can be formatted and read.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Confirm hook patches fs and child_process
|
|
21
|
+
node --require ./node_modules/@letterblack/lbe-exec/hooks/register.cjs \
|
|
22
|
+
-e "require('fs').writeFileSync('test.txt','x')"
|
|
23
|
+
cat .lbe/events.jsonl
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 2. Audit log integrity (partially verifiable)
|
|
27
|
+
|
|
28
|
+
`audit.jsonl` is append-only JSONL in `.lbe/`. You can read every entry. The format is stable and human-readable. There is no cryptographic hash chain on the events.jsonl written by the hook — entries can be deleted without detection at the file level.
|
|
29
|
+
|
|
30
|
+
### 3. WASM hash lock (tamper-detection, not supply-chain proof)
|
|
31
|
+
|
|
32
|
+
`dist/wasm.lock.json` contains a SHA-256 hash of `dist/lbe_engine.wasm`. The CLI verifies this at runtime.
|
|
33
|
+
|
|
34
|
+
**What this protects against:** post-install tampering — if someone modifies the WASM binary on your machine after installation, the hash check fails and the CLI refuses to run.
|
|
35
|
+
|
|
36
|
+
**What this does not protect against:** the initial install. If the package on npm is compromised before you install it, the hash in `wasm.lock.json` will match the compromised binary. This is standard supply-chain trust, not an additional guarantee.
|
|
37
|
+
|
|
38
|
+
### 4. Commit signatures (verifiable from 2026-06-21 forward)
|
|
39
|
+
|
|
40
|
+
Commits to this repository are GPG-signed with key `B902B3111F7D01BA` (Ed25519, expires 2028-06-20). You can verify:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git log --show-signature
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This confirms that commits were made by the key holder. It does not make the code open source.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## What you cannot verify
|
|
51
|
+
|
|
52
|
+
### The WASM runtime is closed source
|
|
53
|
+
|
|
54
|
+
`dist/lbe_engine.wasm` is a compiled binary. Its source is not published. You cannot audit the governance engine logic — policy evaluation, signature verification, rate limiting, nonce replay protection — from the shipped artifact.
|
|
55
|
+
|
|
56
|
+
The trust chain for the runtime is: **you trust the binary or you don't.** There is no open-source alternative at this time.
|
|
57
|
+
|
|
58
|
+
### Minified JS is not hidden
|
|
59
|
+
|
|
60
|
+
`hooks/register.cjs` and `dist/cli.js` are minified. Minified means smaller and harder to read — not protected, not encrypted, not obfuscated beyond whitespace and name compression. A motivated reader can format and read the full implementation.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## What the hook does and does not govern
|
|
65
|
+
|
|
66
|
+
**Governed:** Node.js processes that load the hook via `--require` or `NODE_OPTIONS`.
|
|
67
|
+
|
|
68
|
+
**Not governed:** Python, Go, Rust, native binaries, PowerShell scripts, subprocess spawns that bypass `child_process`, or any process that runs outside the hooked Node.js environment.
|
|
69
|
+
|
|
70
|
+
The hook is a best-effort governance layer for Node.js agents, not a sandbox or kernel-level enforcement mechanism.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Verification surface summary
|
|
75
|
+
|
|
76
|
+
| Claim | Verifiable? | How |
|
|
77
|
+
|---|---|---|
|
|
78
|
+
| Hook patches fs and child_process | Yes | Run it, read the audit log |
|
|
79
|
+
| Audit log captures intercepted actions | Yes | Read `.lbe/events.jsonl` |
|
|
80
|
+
| WASM binary not tampered post-install | Yes | Hash in `wasm.lock.json` |
|
|
81
|
+
| WASM binary not tampered at publish time | No | Closed source, standard npm trust |
|
|
82
|
+
| Governance engine logic is correct | No | WASM is not open source |
|
|
83
|
+
| Commits are from the stated author | Yes | GPG signatures on git history |
|
|
84
|
+
| Hook cannot be bypassed by Node.js code | No | JS is not a sandbox |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Reporting
|
|
89
|
+
|
|
90
|
+
If you find behaviour that contradicts this document — the hook not logging, the hash check not failing on a modified binary, or audit entries missing — open an issue on the public repository.
|