@@ -4,9 +4,9 @@ This directory is the starting point for new Lattice extensions.
44
55Plugin categories:
66
7- - ` system-go/ ` - trusted system plugin process template for host operations.
7+ - ` system-go/ ` - trusted first-party system plugin process template for host operations.
88- ` worker/ ` - capability-limited dashboard/server Worker template.
9- - ` wasm/ ` - future Wasm plugin template notes.
9+ - ` wasm/ ` - future sandboxed third-party Wasm plugin template notes.
1010
1111## Manifest
1212
@@ -17,13 +17,108 @@ Every plugin must declare an explicit capability list:
1717 "id" : " example.nft-guard" ,
1818 "name" : " Example nft Guard" ,
1919 "type" : " system" ,
20+ "version" : " 0.1.0" ,
21+ "publisher" : " latticenet" ,
22+ "entrypoint" : " system-go/lattice-plugin-example" ,
23+ "digest_sha256" : " <artifact sha256 hex>" ,
24+ "signature_ed25519" : " <base64 ed25519 signature>" ,
2025 "capabilities" : [" network:plan" ]
2126}
2227```
2328
2429Unknown capabilities are rejected by the server. Dangerous capabilities such as
2530` network:apply ` should never be granted to third-party plugins by default.
2631
32+ Manifest identity is intentionally strict:
33+
34+ - ` id ` is a stable lowercase identifier using only ` a-z ` , ` 0-9 ` , ` . ` , and ` - ` ;
35+ it must not contain whitespace, slashes, path traversal, or uppercase letters.
36+ - ` name ` must be printable and at most 80 characters.
37+ - ` capabilities ` must be non-empty and must not contain duplicates.
38+ - ` version ` and ` entrypoint ` are part of the public plugin contract even when a
39+ current template does not need generated code yet.
40+ - ` publisher ` identifies the signer/trust root. Production loaders should
41+ accept high-risk system plugins only from trusted publishers.
42+ - ` digest_sha256 ` is the lowercase hex SHA-256 of the plugin artifact/package.
43+ - ` signature_ed25519 ` signs the canonical Lattice plugin payload for
44+ ` id ` , ` name ` , ` type ` , ` version ` , ` entrypoint ` , ` publisher ` , ` digest_sha256 ` , and
45+ capabilities. It prevents replacing the artifact or reusing a signature for a
46+ different plugin id.
47+
48+ ## Capability Guide
49+
50+ Low-risk read capabilities:
51+
52+ - ` node:read `
53+ - ` monitor:read `
54+ - ` audit:read `
55+ - ` kv:read `
56+ - ` static:read `
57+ - ` task:read `
58+
59+ Operator-write capabilities:
60+
61+ - ` kv:write `
62+ - ` worker:route `
63+ - ` notify:send `
64+
65+ High-risk host capabilities:
66+
67+ - ` node:admin `
68+ - ` monitor:admin `
69+ - ` ddns:admin `
70+ - ` tunnel:admin `
71+ - ` static:write `
72+ - ` task:run `
73+ - ` network:plan `
74+ - ` network:apply `
75+
76+ Type restrictions:
77+
78+ - ` system ` plugins may request high-risk capabilities, but should be reserved
79+ for first-party or operator-audited plugins.
80+ - ` worker ` plugins may request only ` worker:route ` , ` kv:read ` , and
81+ ` static:read ` .
82+ - ` wasm ` plugins may request read and operator-write capabilities, but may not
83+ request high-risk host capabilities.
84+
85+ Third-party plugins should start with read-only capabilities. First-party system
86+ plugins may request high-risk capabilities only when their actions produce an
87+ auditable dry-run plan and go through the Lattice approval flow.
88+
89+ ` task:read ` is intentionally separate from ` task:run ` : reading task metadata and
90+ results must not imply the ability to queue remote execution.
91+
92+ ## Signing Model
93+
94+ Development manifests may omit ` digest_sha256 ` and ` signature_ed25519 ` , but a
95+ production Lattice loader should verify them for any host-risk capability such as
96+ ` network:plan ` , ` network:apply ` , ` task:run ` , ` ddns:admin ` , or ` tunnel:admin ` .
97+
98+ The server-side verifier expects:
99+
100+ - ` publisher ` to match a trusted Ed25519 public key configured by the operator.
101+ - ` digest_sha256 ` to match the exact plugin artifact bytes.
102+ - ` signature_ed25519 ` to verify against the canonical Lattice signing payload.
103+
104+ Trust policy JSON:
105+
106+ ``` json
107+ {
108+ "allow_unsigned_host_risk" : false ,
109+ "trusted_publishers" : {
110+ "latticenet" : " base64-raw-ed25519-public-key"
111+ }
112+ }
113+ ```
114+
115+ > Fail-closed by default: omitting ` allow_unsigned_host_risk ` (or setting it
116+ > ` false ` ) requires a trusted-publisher Ed25519 signature for ** every** host-risk
117+ > plugin. Set it ` true ` only for local development on a host you fully control.
118+
119+ Do not sign unpacked source directories casually. Build a deterministic artifact
120+ first, hash that artifact, then sign the manifest payload for that digest.
121+
27122## System Plugin Contract
28123
29124The bootstrap template uses newline-delimited JSON over stdio:
@@ -42,4 +137,3 @@ Output:
42137
43138Future Lattice releases can replace stdio with gRPC/hashicorp-go-plugin while
44139keeping the same capability and approval semantics.
45-
0 commit comments