@letterblack/lbe-core 1.3.3 → 1.3.4
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/LICENSE +1 -1
- package/README.md +130 -442
- package/assets/runtime-boundary.svg +36 -36
- package/dist/cli.js +141 -0
- package/dist/index.js +52 -0
- package/{release-exec/dist → dist}/wasm.lock.json +5 -4
- package/package.json +23 -54
- package/types.d.ts +2 -175
- package/.githooks/pre-commit +0 -2
- package/.githooks/pre-push +0 -2
- package/CHANGELOG.md +0 -75
- package/Release-README.md +0 -65
- package/WORKSPACE.md +0 -422
- package/_proof.mjs +0 -246
- package/bin/lbe.js +0 -12
- package/config/identity.config.json +0 -3
- package/config/policy.default.json +0 -24
- package/dist/cli/lbe.js +0 -4274
- package/dist/hooks/register.cjs +0 -505
- package/dist/state/appendCentral.cjs +0 -87
- package/dist/state/index.cjs +0 -101
- package/exec/cli.js +0 -472
- package/exec/index.js +0 -2
- package/index.js +0 -24
- package/lbe.audit.jsonl +0 -46
- package/release/README.md +0 -216
- package/release/TRUST.md +0 -90
- package/release/exec-README.md +0 -215
- package/release/exec-types.d.ts +0 -50
- package/release-exec/LICENSE +0 -1
- package/release-exec/README.md +0 -215
- package/release-exec/assets/lbe-gates.jpg +0 -0
- package/release-exec/assets/lbe-gates.png +0 -0
- package/release-exec/assets/runtime-boundary.svg +0 -36
- package/release-exec/assets/story-allow.jpg +0 -0
- package/release-exec/assets/story-allow.png +0 -0
- package/release-exec/assets/story-deny.jpg +0 -0
- package/release-exec/assets/story-deny.png +0 -0
- package/release-exec/dist/cli.js +0 -2841
- package/release-exec/dist/index.js +0 -1835
- package/release-exec/hooks/register.cjs +0 -473
- package/release-exec/package.json +0 -35
- package/release-exec/types.d.ts +0 -50
- package/runtime/engine.js +0 -322
- package/runtime/lbe_engine.wasm +0 -0
- package/src/cli/commands/auditVerify.js +0 -36
- package/src/cli/commands/dryrun.js +0 -175
- package/src/cli/commands/health.js +0 -153
- package/src/cli/commands/init.js +0 -306
- package/src/cli/commands/integrityCheck.js +0 -57
- package/src/cli/commands/logs.js +0 -53
- package/src/cli/commands/openState.js +0 -44
- package/src/cli/commands/policyAdd.js +0 -8
- package/src/cli/commands/policyMode.js +0 -7
- package/src/cli/commands/policySign.js +0 -72
- package/src/cli/commands/proof.js +0 -122
- package/src/cli/commands/run.js +0 -342
- package/src/cli/commands/status.js +0 -73
- package/src/cli/commands/verify.js +0 -144
- package/src/cli/main.js +0 -176
- package/src/cli/parseArgs.js +0 -114
- package/src/exec/localExecutor.js +0 -289
- package/src/hooks/register.cjs +0 -505
- package/src/state/appendCentral.cjs +0 -87
- package/src/state/fileIndex.js +0 -140
- package/src/state/index.cjs +0 -101
- package/src/state/index.js +0 -65
- package/src/state/intentRegistry.js +0 -83
- package/src/state/migration.js +0 -112
- package/src/state/proofRunner.js +0 -246
- package/src/state/stateRoot.js +0 -40
- package/src/state/targetRegistry.js +0 -108
- package/src/state/workspaceId.js +0 -40
- package/src/state/workspaceRegistry.js +0 -65
- /package/{release-exec/dist → dist}/lbe_engine.wasm +0 -0
package/lbe.audit.jsonl
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
{"kind":"local_policy","timestamp":"2026-06-19T23:35:11.147Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"GENESIS","hash":"4fa59031cd7aefdda2eaa673582431436e61b29cc52b1df44dcec64ff9500156"}
|
|
2
|
-
{"kind":"local_policy","timestamp":"2026-06-19T23:35:11.287Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"4fa59031cd7aefdda2eaa673582431436e61b29cc52b1df44dcec64ff9500156","hash":"ebe9a6effd202c1bfc7c744e34b9a4594fb87fbb9fcf9008fcb879d07b9e2e83"}
|
|
3
|
-
{"kind":"local_policy","timestamp":"2026-06-19T23:37:07.027Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"ebe9a6effd202c1bfc7c744e34b9a4594fb87fbb9fcf9008fcb879d07b9e2e83","hash":"09837b4ecbfea59315450838934da8dacff3e4606be177a9f2374ea3a7a17b7b"}
|
|
4
|
-
{"kind":"local_policy","timestamp":"2026-06-19T23:37:07.162Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"09837b4ecbfea59315450838934da8dacff3e4606be177a9f2374ea3a7a17b7b","hash":"55b48900a3fe9129aa3c5d6ca56b987b13b9519567ccdcf87111ee8fcf9d0c65"}
|
|
5
|
-
{"kind":"local_policy","timestamp":"2026-06-20T00:00:57.479Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"55b48900a3fe9129aa3c5d6ca56b987b13b9519567ccdcf87111ee8fcf9d0c65","hash":"43b7db12e0fb2a5c78b0cde6219e1899d0c153b06332304f5ffb588184f9a546"}
|
|
6
|
-
{"kind":"local_policy","timestamp":"2026-06-20T00:00:57.597Z","action":"write_file","actor":"agent:gpt","target":"Y:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"43b7db12e0fb2a5c78b0cde6219e1899d0c153b06332304f5ffb588184f9a546","hash":"ad3bff0b0d87f8d7cdd89c81d4feccf5ecb2b1ba6c6c87f4e1941b9f7602682a"}
|
|
7
|
-
{"kind":"local_policy","timestamp":"2026-06-20T00:01:37.683Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"ad3bff0b0d87f8d7cdd89c81d4feccf5ecb2b1ba6c6c87f4e1941b9f7602682a","hash":"0cd624477f29707d50fb51ed129cfcc4b1492fff6f764851818d85007de9d8a2"}
|
|
8
|
-
{"kind":"local_policy","timestamp":"2026-06-20T00:01:37.800Z","action":"write_file","actor":"agent:gpt","target":"Y:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"0cd624477f29707d50fb51ed129cfcc4b1492fff6f764851818d85007de9d8a2","hash":"60849f57f26cb478d16dfacbd890285c86039b353dd32b610781f2bd1ead37e2"}
|
|
9
|
-
{"kind":"local_policy","timestamp":"2026-06-20T07:38:16.456Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"60849f57f26cb478d16dfacbd890285c86039b353dd32b610781f2bd1ead37e2","hash":"14893cfb196d22710a42277d90e2f25210965842732cc9f945bb96ce8f9f4fcb"}
|
|
10
|
-
{"kind":"local_policy","timestamp":"2026-06-20T07:38:16.579Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"14893cfb196d22710a42277d90e2f25210965842732cc9f945bb96ce8f9f4fcb","hash":"882079452527f032349a2e7a60dd12d135198e22497d3f4b68b60f800f468e9e"}
|
|
11
|
-
{"kind":"local_policy","timestamp":"2026-06-20T08:26:18.715Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"882079452527f032349a2e7a60dd12d135198e22497d3f4b68b60f800f468e9e","hash":"5ebd63b1800100e757fd313bc9533e317595e3f387246403e583d7e47ae182dd"}
|
|
12
|
-
{"kind":"local_policy","timestamp":"2026-06-20T08:26:18.895Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"5ebd63b1800100e757fd313bc9533e317595e3f387246403e583d7e47ae182dd","hash":"2d8c2e634df7bea55d1086da89b9b2cba39385b8f8f4c93fe5f00e2861af4ebb"}
|
|
13
|
-
{"kind":"local_policy","timestamp":"2026-06-20T08:47:49.677Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"2d8c2e634df7bea55d1086da89b9b2cba39385b8f8f4c93fe5f00e2861af4ebb","hash":"58705eea240aca0a89a23848d8e217bfc66a20754d26d4d5e1c873a5d7f26243"}
|
|
14
|
-
{"kind":"local_policy","timestamp":"2026-06-20T08:47:49.835Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"58705eea240aca0a89a23848d8e217bfc66a20754d26d4d5e1c873a5d7f26243","hash":"f7e59903f44ed0ef649dd51d1ac0f9c65928f7ac9e1d05d3ed647ccfd439043e"}
|
|
15
|
-
{"kind":"local_policy","timestamp":"2026-06-20T09:16:18.272Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"f7e59903f44ed0ef649dd51d1ac0f9c65928f7ac9e1d05d3ed647ccfd439043e","hash":"9b46fff5248d53c6e6a3d0292306e72f72107717d720bbb8110f1c9bbe4aba98"}
|
|
16
|
-
{"kind":"local_policy","timestamp":"2026-06-20T09:16:18.415Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"9b46fff5248d53c6e6a3d0292306e72f72107717d720bbb8110f1c9bbe4aba98","hash":"3ce47f5511666be6bcd556a20b3f67fe98e30835036a7f8da0c98af0d2bb6eed"}
|
|
17
|
-
{"kind":"local_policy","timestamp":"2026-06-20T09:47:26.292Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"3ce47f5511666be6bcd556a20b3f67fe98e30835036a7f8da0c98af0d2bb6eed","hash":"6bec570ee7f1ccfb93ab08d3668e50f787318fece9461dc06c9a2b1a62c53727"}
|
|
18
|
-
{"kind":"local_policy","timestamp":"2026-06-20T09:47:26.439Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"6bec570ee7f1ccfb93ab08d3668e50f787318fece9461dc06c9a2b1a62c53727","hash":"d25f758c9d834280d62aecdd50bee074a910bb5a16876c834f3df3ef7dd90a9f"}
|
|
19
|
-
{"kind":"local_policy","timestamp":"2026-06-20T10:02:37.628Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"d25f758c9d834280d62aecdd50bee074a910bb5a16876c834f3df3ef7dd90a9f","hash":"b076f0c558e069a876135b52f197fe4eb265dd44efd9b74b68cf74eaf199c8ae"}
|
|
20
|
-
{"kind":"local_policy","timestamp":"2026-06-20T10:02:37.771Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"b076f0c558e069a876135b52f197fe4eb265dd44efd9b74b68cf74eaf199c8ae","hash":"b915c35fe9d842f42399bc83e5ed8bbf4c9ac0cf1d592fe72f51ec4d539b7fdb"}
|
|
21
|
-
{"kind":"local_policy","timestamp":"2026-06-20T11:47:47.851Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"b915c35fe9d842f42399bc83e5ed8bbf4c9ac0cf1d592fe72f51ec4d539b7fdb","hash":"817368eab148ac1bc57ecfa22f06124164b1e6176c4051b050b5e3b23f9152a1"}
|
|
22
|
-
{"kind":"local_policy","timestamp":"2026-06-20T11:47:48.023Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"817368eab148ac1bc57ecfa22f06124164b1e6176c4051b050b5e3b23f9152a1","hash":"060d71f2c54bb153628220eb1258231940a06ff16a6d7024201052d84176606d"}
|
|
23
|
-
{"kind":"local_policy","timestamp":"2026-06-20T11:56:56.022Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"060d71f2c54bb153628220eb1258231940a06ff16a6d7024201052d84176606d","hash":"6aed9fdcb3a3bec3530a0d89c06f7ac3fc1f3119ca91da4f1b056d813710a30a"}
|
|
24
|
-
{"kind":"local_policy","timestamp":"2026-06-20T11:56:56.171Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"6aed9fdcb3a3bec3530a0d89c06f7ac3fc1f3119ca91da4f1b056d813710a30a","hash":"91f2c57d924a21815ad3ef0abf0a4e8c05060380fe2c36ae104c4a8a67cebdbe"}
|
|
25
|
-
{"kind":"local_policy","timestamp":"2026-06-20T12:03:02.759Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"91f2c57d924a21815ad3ef0abf0a4e8c05060380fe2c36ae104c4a8a67cebdbe","hash":"d889e17676f042abfa4200d7834aa2a53bfabde2d339b81b8e6db8c365e83e28"}
|
|
26
|
-
{"kind":"local_policy","timestamp":"2026-06-20T12:03:02.916Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"d889e17676f042abfa4200d7834aa2a53bfabde2d339b81b8e6db8c365e83e28","hash":"f76eb13e259464f177968a80df07c737ad414ea324a2eeadc1f22afef29cf3ea"}
|
|
27
|
-
{"kind":"local_policy","timestamp":"2026-06-20T12:06:17.815Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"f76eb13e259464f177968a80df07c737ad414ea324a2eeadc1f22afef29cf3ea","hash":"b2710860f37999d3365ef9c3702e0d619e80138d45d086054fad169d98f9e212"}
|
|
28
|
-
{"kind":"local_policy","timestamp":"2026-06-20T12:06:17.957Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"b2710860f37999d3365ef9c3702e0d619e80138d45d086054fad169d98f9e212","hash":"4346d148ce5d4f090f2f1f574eeb6d748e641b30aadfdac27e41aae59d48ba35"}
|
|
29
|
-
{"kind":"local_policy","timestamp":"2026-06-20T12:07:08.214Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"4346d148ce5d4f090f2f1f574eeb6d748e641b30aadfdac27e41aae59d48ba35","hash":"a30c9b09a33473fc27fa0fb7b0d8900ad662be4a07486ffdb15a9a2f715e9a7e"}
|
|
30
|
-
{"kind":"local_policy","timestamp":"2026-06-20T12:07:08.344Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"a30c9b09a33473fc27fa0fb7b0d8900ad662be4a07486ffdb15a9a2f715e9a7e","hash":"83f2c7d56d26415e6d4b6fdc4111e5e979e32485f6d994cb433622a96dd70aca"}
|
|
31
|
-
{"kind":"local_policy","timestamp":"2026-06-20T12:08:25.892Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"83f2c7d56d26415e6d4b6fdc4111e5e979e32485f6d994cb433622a96dd70aca","hash":"1f649193b5fb02d0c83f36b7ff7648342da42d10b2b0589a884f2979a4518940"}
|
|
32
|
-
{"kind":"local_policy","timestamp":"2026-06-20T12:08:26.076Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"1f649193b5fb02d0c83f36b7ff7648342da42d10b2b0589a884f2979a4518940","hash":"939f5ceaa938d0a6e7dc520b607375cbd8bda9e6bce672db2adddc08ebe5167e"}
|
|
33
|
-
{"kind":"local_policy","timestamp":"2026-06-20T12:14:43.895Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"939f5ceaa938d0a6e7dc520b607375cbd8bda9e6bce672db2adddc08ebe5167e","hash":"88409073a33f89a8e29b5c9188816d8de460f23bfe92647f89cefba5029ccaa4"}
|
|
34
|
-
{"kind":"local_policy","timestamp":"2026-06-20T12:14:44.042Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"88409073a33f89a8e29b5c9188816d8de460f23bfe92647f89cefba5029ccaa4","hash":"cf477d692f3888269d9243b450d9c000e630c4bba5be1f223b4baba16b70db8d"}
|
|
35
|
-
{"kind":"local_policy","timestamp":"2026-06-20T13:23:45.701Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"cf477d692f3888269d9243b450d9c000e630c4bba5be1f223b4baba16b70db8d","hash":"baa3e917baa568c84ee8172d913a5744356dda663db1a6b6403f1e7380ccba3d"}
|
|
36
|
-
{"kind":"local_policy","timestamp":"2026-06-20T13:23:46.038Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"baa3e917baa568c84ee8172d913a5744356dda663db1a6b6403f1e7380ccba3d","hash":"8a347b48752b01af461624d9b62a0d626a7d0c16c61930ac5765a41c5146f41c"}
|
|
37
|
-
{"kind":"local_policy","timestamp":"2026-06-20T13:53:06.494Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"8a347b48752b01af461624d9b62a0d626a7d0c16c61930ac5765a41c5146f41c","hash":"0f40141f3d9d3f865a01aa684e5e6e36bcf04b037c0fa566b6ab78650f68c8c3"}
|
|
38
|
-
{"kind":"local_policy","timestamp":"2026-06-20T13:53:06.939Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"0f40141f3d9d3f865a01aa684e5e6e36bcf04b037c0fa566b6ab78650f68c8c3","hash":"af45bc8c55e6682f81a14869d1b3ba0acc40107bf4e007e6b7b89786dc4cf226"}
|
|
39
|
-
{"kind":"local_policy","timestamp":"2026-06-20T14:58:33.144Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"af45bc8c55e6682f81a14869d1b3ba0acc40107bf4e007e6b7b89786dc4cf226","hash":"c4984421fa1863224c6fc12af043894aba767eb351b7934f0e351f594888825e"}
|
|
40
|
-
{"kind":"local_policy","timestamp":"2026-06-20T14:58:33.291Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"c4984421fa1863224c6fc12af043894aba767eb351b7934f0e351f594888825e","hash":"cfccb5a4c4877491f8e3d06e84f43af20eeea5ab447fcb57412e71e9ff4691be"}
|
|
41
|
-
{"kind":"local_policy","timestamp":"2026-06-20T14:59:22.384Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"cfccb5a4c4877491f8e3d06e84f43af20eeea5ab447fcb57412e71e9ff4691be","hash":"fc67b954900c2b704ac3b33c17837de0bd021d64f5607f4add942815e8463008"}
|
|
42
|
-
{"kind":"local_policy","timestamp":"2026-06-20T14:59:22.517Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"fc67b954900c2b704ac3b33c17837de0bd021d64f5607f4add942815e8463008","hash":"f93630b6208fe6b3e135f63e935343fb633a20d9a4a129cc11ae88bdadec1794"}
|
|
43
|
-
{"kind":"local_policy","timestamp":"2026-06-20T15:00:10.434Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"f93630b6208fe6b3e135f63e935343fb633a20d9a4a129cc11ae88bdadec1794","hash":"84640c42c4213b5a6e5f995ff36c12e036faabaecb2bb6bd1675e69206425e15"}
|
|
44
|
-
{"kind":"local_policy","timestamp":"2026-06-20T15:00:10.578Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"84640c42c4213b5a6e5f995ff36c12e036faabaecb2bb6bd1675e69206425e15","hash":"b3669fa5f3bb23eb8964ce1b414efb1cad3e9879708e6186c1ebf15f33685362"}
|
|
45
|
-
{"kind":"local_policy","timestamp":"2026-06-20T15:00:59.854Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"b3669fa5f3bb23eb8964ce1b414efb1cad3e9879708e6186c1ebf15f33685362","hash":"70ca3430dc4b2e0af375aa4bbe864f362f9f05e67d59e1ba4d2d8941b11c7a01"}
|
|
46
|
-
{"kind":"local_policy","timestamp":"2026-06-20T15:00:59.974Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"70ca3430dc4b2e0af375aa4bbe864f362f9f05e67d59e1ba4d2d8941b11c7a01","hash":"5aa409b72bc1b26cef4e2ecefa7441805006096bb5b8e11d0e80c56b18b949a9"}
|
package/release/README.md
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
# {{PACKAGE_NAME}}
|
|
2
|
-
|
|
3
|
-
LBE is local execution control for AI agents. It evaluates file and shell
|
|
4
|
-
actions routed through its execution boundary and records local evidence.
|
|
5
|
-
It is not an AI model, IDE, full OS sandbox, or cloud monitor.
|
|
6
|
-
|
|
7
|
-
## Setup
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install {{PACKAGE_NAME}}
|
|
11
|
-
npx lbe init
|
|
12
|
-
npx lbe status
|
|
13
|
-
npx lbe logs
|
|
14
|
-
npx lbe proof --public
|
|
15
|
-
npx lbe open-state
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
State is stored locally in a central per-user folder, keyed by workspace ID.
|
|
19
|
-
In v1.3, `.lbe/events.jsonl` remains local fallback truth and is imported once
|
|
20
|
-
without changing the original file. Proof uses intent, target, file index, LBE
|
|
21
|
-
events, and `proof/latest.json`; `--public` redacts sensitive proof details.
|
|
22
|
-
|
|
23
|
-
LBE controls only actions routed through its execution boundary. Central writes
|
|
24
|
-
are best-effort, logs remain local, and non-inspectable targets may produce
|
|
25
|
-
`WEAK_PROOF`.
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
LBE puts a local policy gate between what an AI agent proposes and what the system actually executes. Every action — file write, shell command, anything — is validated locally before it runs. No cloud service. No daemon.
|
|
30
|
-
|
|
31
|
-
> **Used in production:** LBE is the safety engine inside [Letterblack for After Effects](https://letterblack.net) — every AI-generated script and automation command passes through it before touching a live project.
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## Which package do you need?
|
|
36
|
-
|
|
37
|
-
| I want… | Package |
|
|
38
|
-
|---|---|
|
|
39
|
-
| LBE to handle file writes and shell commands for me (full controller) | `@letterblack/lbe-exec` |
|
|
40
|
-
| Just the allow/deny decision — I'll execute it myself | `@letterblack/lbe-sdk` ← you are here |
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Install
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
npm install {{PACKAGE_NAME}}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Requires Node.js ≥ 20.9.0.
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## Quick start
|
|
55
|
-
|
|
56
|
-
```js
|
|
57
|
-
import { execute } from '{{PACKAGE_NAME}}';
|
|
58
|
-
|
|
59
|
-
const request = {
|
|
60
|
-
version: '1.0',
|
|
61
|
-
request_id: 'req-001',
|
|
62
|
-
timestamp: Math.floor(Date.now() / 1000),
|
|
63
|
-
actor: { id: 'agent:local', role: 'agent' },
|
|
64
|
-
intent: { type: 'command', name: 'write_file', payload: { target: 'out.txt' } },
|
|
65
|
-
context: { workspace: process.cwd(), env: {}, history: [] },
|
|
66
|
-
constraints: { policy_mode: 'strict', timeout_ms: 5000 },
|
|
67
|
-
auth: { signature: '<host-signed>', nonce: '<unique-per-request>' }
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const result = JSON.parse(execute(JSON.stringify(request)));
|
|
71
|
-
// Approved: { ok: true, decision: 'allow', ... }
|
|
72
|
-
// Blocked: { ok: false, decision: 'deny', error: { stage, message } }
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
`execute(input: string): string` — accepts JSON, returns JSON. The runtime validates and returns a decision. The host acts on the decision.
|
|
76
|
-
|
|
77
|
-
### Request fields
|
|
78
|
-
|
|
79
|
-
| Field | Required | Description |
|
|
80
|
-
|---|---:|---|
|
|
81
|
-
| `version` | Yes | `"1.0"` |
|
|
82
|
-
| `request_id` | Yes | Caller-supplied unique identifier |
|
|
83
|
-
| `timestamp` | Yes | Unix timestamp in seconds |
|
|
84
|
-
| `actor` | Yes | `{ id, role }` — identity of the requesting agent |
|
|
85
|
-
| `intent` | Yes | `{ type, name, payload }` — what the agent wants to do |
|
|
86
|
-
| `context` | Yes | Workspace path and caller context |
|
|
87
|
-
| `constraints` | Yes | `policy_mode` and `timeout_ms` |
|
|
88
|
-
| `auth` | Yes | Host-supplied `signature` and `nonce` |
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## Observer mode — start here
|
|
93
|
-
|
|
94
|
-
Not ready to block? Start in observer mode. Every request is fully validated and logged exactly as it would be in enforcement — but nothing is blocked. Watch what the agent is doing before you decide what to deny.
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
npx lbe init # create lbe.policy.json in observer mode
|
|
98
|
-
npx lbe enforce # switch to blocking
|
|
99
|
-
npx lbe observe # switch back to advisory
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## CLI reference
|
|
105
|
-
|
|
106
|
-
| Command | Purpose |
|
|
107
|
-
|---|---|
|
|
108
|
-
| `npx lbe init` | Create project-local policy and key state in observer mode |
|
|
109
|
-
| `npx lbe policy-add` | Add a rule to the active policy |
|
|
110
|
-
| `npx lbe observe` | Set advisory (log-only) mode |
|
|
111
|
-
| `npx lbe enforce` | Set blocking mode |
|
|
112
|
-
| `npx lbe run` | Validate and execute a proposal from `--in <file>` |
|
|
113
|
-
| `npx lbe verify` | Validate a proposal without executing |
|
|
114
|
-
| `npx lbe dryrun` | Validate and simulate without executing |
|
|
115
|
-
| `npx lbe health` | Check all required files are present and readable |
|
|
116
|
-
| `npx lbe audit-verify` | Verify the audit log hash chain |
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
## How the gate pipeline works
|
|
121
|
-
|
|
122
|
-

|
|
123
|
-
|
|
124
|
-
Every request enters a 7-gate pipeline. A failure at any gate returns a structured denial — the remaining gates are not evaluated.
|
|
125
|
-
|
|
126
|
-
```
|
|
127
|
-
[1] Schema required fields and structural validity
|
|
128
|
-
↓
|
|
129
|
-
[2] Timestamp permitted clock-skew window (±10 minutes)
|
|
130
|
-
↓
|
|
131
|
-
[3] Key lifecycle trusted key, active, not expired
|
|
132
|
-
↓
|
|
133
|
-
[4] Signature Ed25519 request authenticity
|
|
134
|
-
↓
|
|
135
|
-
[5] Rate limit per-requester sliding-window limit
|
|
136
|
-
↓
|
|
137
|
-
[6] Nonce single-use replay protection
|
|
138
|
-
↓
|
|
139
|
-
[7] Policy configured authorization (deny-wins)
|
|
140
|
-
↓
|
|
141
|
-
allow / deny / error — structured result returned to host
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
The WASM runtime owns all gate decisions. Your host receives the decision and acts on it. Nothing executes inside the runtime.
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## When a request is approved
|
|
149
|
-
|
|
150
|
-

|
|
151
|
-
|
|
152
|
-
1. The agent produces a signed action proposal.
|
|
153
|
-
2. Identity is confirmed against a locally held key — no network call required.
|
|
154
|
-
3. The project policy is evaluated. The action is approved.
|
|
155
|
-
4. The host executes the write or command inside the allowed workspace.
|
|
156
|
-
5. The audit chain is extended — every approved action appends a hash-linked entry to the local log, permanently verifiable, impossible to silently remove.
|
|
157
|
-
6. A structured result returns: whether it succeeded, which rules matched, and the audit entry identifier.
|
|
158
|
-
|
|
159
|
-
The application stays in control. {{PACKAGE_NAME}} decides whether the action was permitted and hands the answer back. It does not execute for you.
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
## When a request is blocked
|
|
164
|
-
|
|
165
|
-

|
|
166
|
-
|
|
167
|
-
1. The agent proposes an action that is outside the permitted policy.
|
|
168
|
-
2. The policy gate closes immediately. The WASM runtime stamps the request denied before any adapter is reached.
|
|
169
|
-
3. The shell is untouched. The filesystem is unchanged.
|
|
170
|
-
4. The denial is written to the immutable audit log — chain sealed, evidence preserved.
|
|
171
|
-
|
|
172
|
-
No partial execution. No silent failures. Denial is a first-class outcome, not an error.
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## What this covers
|
|
177
|
-
|
|
178
|
-
| Threat | Gate |
|
|
179
|
-
|---|---|
|
|
180
|
-
| Malformed or incomplete request | Schema |
|
|
181
|
-
| Stale or replayed request | Timestamp + Nonce |
|
|
182
|
-
| Tampered or expired key | Key lifecycle + Signature |
|
|
183
|
-
| Excessive requests from one actor | Rate limit |
|
|
184
|
-
| Action not permitted by project policy | Policy — deny-wins |
|
|
185
|
-
| Agent writing outside project root | Scope check in host after decision |
|
|
186
|
-
|
|
187
|
-
---
|
|
188
|
-
|
|
189
|
-
## What ships
|
|
190
|
-
|
|
191
|
-
```
|
|
192
|
-
dist/index.js WebAssembly runtime loader and execute()
|
|
193
|
-
dist/cli.js Local CLI (npx lbe)
|
|
194
|
-
dist/lbe_engine.wasm Verified runtime binary
|
|
195
|
-
dist/wasm.lock.json Runtime integrity lock (SHA-256 of wasm binary)
|
|
196
|
-
assets/lbe-gates.jpg Gate sequence diagram
|
|
197
|
-
assets/story-allow.jpg Approved-request storyboard
|
|
198
|
-
assets/story-deny.jpg Blocked-request storyboard
|
|
199
|
-
assets/runtime-boundary.svg Runtime boundary diagram
|
|
200
|
-
assets/lbe-gates.png Gate sequence diagram (full resolution)
|
|
201
|
-
assets/story-allow.png Approved-request storyboard (full resolution)
|
|
202
|
-
assets/story-deny.png Blocked-request storyboard (full resolution)
|
|
203
|
-
types.d.ts TypeScript declarations
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
At load time the runtime verifies `lbe_engine.wasm` against `wasm.lock.json`. A missing, modified, or swapped binary fails before any request is processed.
|
|
207
|
-
|
|
208
|
-
Source code, controller implementation, adapters, tests, keys, and runtime state are not included.
|
|
209
|
-
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
## Limits
|
|
213
|
-
|
|
214
|
-
This package validates requests routed through its runtime. It does not provide kernel-level process isolation, network-egress control, multi-tenant separation, or a hosted control plane.
|
|
215
|
-
|
|
216
|
-
For an in-process controller with file operations, shell, and policy management built in, see `@letterblack/lbe-exec`.
|
package/release/TRUST.md
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
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 outside `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 controls every Node.js action | 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.
|
package/release/exec-README.md
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
# @letterblack/lbe-exec
|
|
2
|
-
|
|
3
|
-
LBE puts a local policy gate between what an AI agent proposes and what the system actually executes. Every action — file write, shell command, anything — is validated locally before it runs. No cloud service. No daemon.
|
|
4
|
-
|
|
5
|
-
`lbe-exec` is the full in-process controller. It handles signing, execution, and auditing for you — your agent code just calls `lbe.writeFile()` or `lbe.runShell()`.
|
|
6
|
-
|
|
7
|
-
> **Used in production:** LBE is the safety engine inside [Letterblack for After Effects](https://letterblack.net) — every AI-generated script and automation command passes through it before touching a live project.
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Which package do you need?
|
|
12
|
-
|
|
13
|
-
| I want… | Package |
|
|
14
|
-
|---|---|
|
|
15
|
-
| LBE to handle file writes and shell commands for me (full controller) | `@letterblack/lbe-exec` ← you are here |
|
|
16
|
-
| Just the allow/deny decision — I'll execute it myself | `@letterblack/lbe-sdk` |
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Install
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npm install @letterblack/lbe-exec
|
|
24
|
-
npx lbe-exec init
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
`npx lbe-exec init` creates `lbe.policy.json` in observer mode, generates `CLAUDE.md` and `.github/copilot-instructions.md` so AI agents automatically discover and follow governance, and writes `.lbe/AGENT_CONTRACT.md` as a machine-readable contract.
|
|
28
|
-
|
|
29
|
-
Requires Node.js ≥ 20.9.0.
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## Quick start
|
|
34
|
-
|
|
35
|
-
```js
|
|
36
|
-
import { createLocalExecutor } from '@letterblack/lbe-exec';
|
|
37
|
-
|
|
38
|
-
const lbe = createLocalExecutor({ rootDir: process.cwd() });
|
|
39
|
-
|
|
40
|
-
// Every call routes through the full 7-gate pipeline automatically
|
|
41
|
-
await lbe.writeFile('output/report.md', content);
|
|
42
|
-
await lbe.readFile('src/config.json');
|
|
43
|
-
await lbe.patchFile('src/index.js', patch);
|
|
44
|
-
await lbe.deleteFile('tmp/scratch.txt');
|
|
45
|
-
await lbe.runShell('node', ['scripts/build.js']);
|
|
46
|
-
|
|
47
|
-
// Result shape — same for every method
|
|
48
|
-
// { ok: true, decision: 'allow', executed: true, auditId: '...' }
|
|
49
|
-
// { ok: false, decision: 'deny', executed: false, error: { code, message } }
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
No knowledge of the pipeline, request format, or policy internals required. All signing, validation, and auditing happens automatically.
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
## Options
|
|
57
|
-
|
|
58
|
-
```js
|
|
59
|
-
const lbe = createLocalExecutor({
|
|
60
|
-
rootDir: process.cwd(), // sandbox root — no writes escape this path
|
|
61
|
-
mode: 'observe', // 'observe' (log only) or 'enforce' (block)
|
|
62
|
-
shell: {
|
|
63
|
-
allowCommands: ['node', 'npm'], // only these commands may run
|
|
64
|
-
denyCommands: ['rm', 'curl'], // always blocked regardless of policy
|
|
65
|
-
maxRequests: 20 // per-minute shell rate limit
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Policy management
|
|
73
|
-
|
|
74
|
-
Only the host application writes policy. Agents may propose a rule — the proposal is returned as a plain object for the host to review. Until the host explicitly accepts and writes it, the proposal has no effect.
|
|
75
|
-
|
|
76
|
-
```js
|
|
77
|
-
// Propose a rule — returns an object for the host to review, writes nothing
|
|
78
|
-
const proposal = lbe.policy.proposeRule({
|
|
79
|
-
effect: 'deny',
|
|
80
|
-
type: 'path',
|
|
81
|
-
pattern: 'secrets/**',
|
|
82
|
-
from: 'agent: these files should not be modified'
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
// Host accepts and writes the rule
|
|
86
|
-
lbe.policy.addRule(proposal);
|
|
87
|
-
|
|
88
|
-
// Read current policy
|
|
89
|
-
const policy = lbe.policy.read();
|
|
90
|
-
|
|
91
|
-
// Verify the audit chain has not been tampered with
|
|
92
|
-
lbe.audit.verify();
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## Observer mode — start here
|
|
98
|
-
|
|
99
|
-
Not ready to block? Start in observer mode. Every request is fully validated and logged exactly as it would be in enforcement — but nothing is blocked. Watch what the agent is doing before you decide what to deny.
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
npx lbe-exec init # create lbe.policy.json in observer mode
|
|
103
|
-
npx lbe-exec enforce # switch to blocking
|
|
104
|
-
npx lbe-exec observe # switch back to advisory
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## CLI reference
|
|
110
|
-
|
|
111
|
-
| Command | Purpose |
|
|
112
|
-
|---|---|
|
|
113
|
-
| `npx lbe-exec init` | Bootstrap governance — policy, keys, agent files |
|
|
114
|
-
| `npx lbe-exec status` | Show mode, rule count, audit entry count |
|
|
115
|
-
| `npx lbe-exec policy` | List active rules |
|
|
116
|
-
| `npx lbe-exec observe` | Set advisory (log-only) mode |
|
|
117
|
-
| `npx lbe-exec enforce` | Set blocking mode |
|
|
118
|
-
| `npx lbe-exec execute` | Pipe a JSON request from stdin or `--input <file>` |
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
## How the gate pipeline works
|
|
123
|
-
|
|
124
|
-

|
|
125
|
-
|
|
126
|
-
Every request enters a 7-gate pipeline. A failure at any gate returns a structured denial — the remaining gates are not evaluated.
|
|
127
|
-
|
|
128
|
-
```
|
|
129
|
-
[1] Schema required fields and structural validity
|
|
130
|
-
↓
|
|
131
|
-
[2] Timestamp permitted clock-skew window (±10 minutes)
|
|
132
|
-
↓
|
|
133
|
-
[3] Key lifecycle trusted key, active, not expired
|
|
134
|
-
↓
|
|
135
|
-
[4] Signature Ed25519 request authenticity (signed locally, no network)
|
|
136
|
-
↓
|
|
137
|
-
[5] Rate limit per-requester sliding-window limit
|
|
138
|
-
↓
|
|
139
|
-
[6] Nonce single-use replay protection
|
|
140
|
-
↓
|
|
141
|
-
[7] Policy configured authorization (deny-wins)
|
|
142
|
-
↓
|
|
143
|
-
allow / deny / error — structured result returned to host
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
The executor signs every request with a host-held key before validation. No key material leaves the process.
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
## When a request is approved
|
|
151
|
-
|
|
152
|
-

|
|
153
|
-
|
|
154
|
-
1. The agent calls a convenience method — `lbe.writeFile()`, `lbe.runShell()`, etc.
|
|
155
|
-
2. The executor constructs and signs the request locally with a host-held Ed25519 key.
|
|
156
|
-
3. All seven gates pass. The project policy approves the action.
|
|
157
|
-
4. The write or command executes inside the configured project root.
|
|
158
|
-
5. The audit chain is extended — every approved action appends a hash-linked entry to `.lbe/audit.jsonl`, permanently verifiable, impossible to silently remove.
|
|
159
|
-
6. A structured result returns: whether it succeeded, which rules matched, and the audit entry identifier.
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
## When a request is blocked
|
|
164
|
-
|
|
165
|
-

|
|
166
|
-
|
|
167
|
-
1. The agent proposes an action that is outside the permitted policy.
|
|
168
|
-
2. The policy gate closes immediately. The request is denied before any adapter is reached.
|
|
169
|
-
3. The shell is untouched. The filesystem is unchanged.
|
|
170
|
-
4. The denial is written to the immutable audit log — chain sealed, evidence preserved.
|
|
171
|
-
|
|
172
|
-
No partial execution. No silent failures. Denial is a first-class outcome, not an error.
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## What this covers
|
|
177
|
-
|
|
178
|
-
| Threat | Gate |
|
|
179
|
-
|---|---|
|
|
180
|
-
| Agent writes outside the project root | Scope — sandbox path check |
|
|
181
|
-
| Replayed or stale request | Identity — nonce and timestamp |
|
|
182
|
-
| Tampered or expired key | Identity — key lifecycle |
|
|
183
|
-
| Excessive requests | Identity — rate limit |
|
|
184
|
-
| Action not permitted by project policy | Policy — deny-wins evaluation |
|
|
185
|
-
| Unauthorized shell command | Scope — explicit command allowlist |
|
|
186
|
-
| Injected payload (eval, exec, __proto__) | Content scan before pipeline |
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
## What ships
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
dist/index.js In-process executor — createLocalExecutor()
|
|
194
|
-
dist/cli.js Local CLI (npx lbe-exec)
|
|
195
|
-
dist/lbe_engine.wasm Verified WASM runtime binary
|
|
196
|
-
dist/wasm.lock.json Runtime integrity lock (SHA-256 of wasm binary)
|
|
197
|
-
assets/lbe-gates.jpg Gate sequence diagram
|
|
198
|
-
assets/story-allow.jpg Approved-request storyboard
|
|
199
|
-
assets/story-deny.jpg Blocked-request storyboard
|
|
200
|
-
assets/runtime-boundary.svg Runtime boundary diagram
|
|
201
|
-
assets/lbe-gates.png Gate sequence diagram (full resolution)
|
|
202
|
-
assets/story-allow.png Approved-request storyboard (full resolution)
|
|
203
|
-
assets/story-deny.png Blocked-request storyboard (full resolution)
|
|
204
|
-
types.d.ts TypeScript declarations
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
Source code, tests, keys, and runtime state are not included.
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
|
|
211
|
-
## Limits
|
|
212
|
-
|
|
213
|
-
This package governs actions routed through its executor. It does not provide kernel-level process isolation, network-egress control, multi-tenant separation, or a hosted control plane.
|
|
214
|
-
|
|
215
|
-
For the raw WASM runtime without a controller, see `@letterblack/lbe-sdk`.
|
package/release/exec-types.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export interface LBEResult {
|
|
2
|
-
ok: boolean;
|
|
3
|
-
decision: 'allow' | 'deny' | 'observe';
|
|
4
|
-
executed: boolean;
|
|
5
|
-
dryRun: boolean;
|
|
6
|
-
error?: { code: string; message: string; recoverable: boolean };
|
|
7
|
-
matchedRules?: string[];
|
|
8
|
-
auditId?: string;
|
|
9
|
-
rollback?: { available: boolean; performed: boolean; backupId?: string };
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface LBEPolicyRule {
|
|
13
|
-
effect: 'allow' | 'deny';
|
|
14
|
-
type: 'path' | 'command';
|
|
15
|
-
pattern: string;
|
|
16
|
-
from: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface LocalExecutor {
|
|
20
|
-
rootDir: string;
|
|
21
|
-
|
|
22
|
-
// High-level API — use these in agent code
|
|
23
|
-
writeFile(target: string, content: string): Promise<LBEResult>;
|
|
24
|
-
readFile(target: string): Promise<LBEResult>;
|
|
25
|
-
patchFile(target: string, content: string): Promise<LBEResult>;
|
|
26
|
-
deleteFile(target: string): Promise<LBEResult>;
|
|
27
|
-
runShell(cmd: string, args?: string[], opts?: { cwd?: string; timeoutMs?: number; maxOutputBytes?: number }): Promise<LBEResult>;
|
|
28
|
-
|
|
29
|
-
// Policy management
|
|
30
|
-
policy: {
|
|
31
|
-
read(): unknown;
|
|
32
|
-
proposeRule(rule: LBEPolicyRule): unknown;
|
|
33
|
-
addRule(rule: LBEPolicyRule): unknown;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// Audit
|
|
37
|
-
audit: { verify(): unknown };
|
|
38
|
-
|
|
39
|
-
// Low-level — for advanced / non-standard use only
|
|
40
|
-
validate(request: unknown): Promise<LBEResult>;
|
|
41
|
-
dryRun(request: unknown): Promise<LBEResult>;
|
|
42
|
-
execute(request: unknown): Promise<LBEResult>;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function createLocalExecutor(options?: {
|
|
46
|
-
rootDir?: string;
|
|
47
|
-
keyId?: string;
|
|
48
|
-
mode?: 'observe' | 'enforce';
|
|
49
|
-
shell?: { allowCommands?: string[]; denyCommands?: string[]; maxRequests?: number };
|
|
50
|
-
}): LocalExecutor;
|
package/release-exec/LICENSE
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
SEE LICENSE IN LICENSE
|