Quick installation
@lyhna/bind is a project dependency. Install it inside your Node project with npm install @lyhna/bind. Do not install it globally.
Quick start
Direct SDK — bind() without the loop (advanced)
@lyhna/bind is the underlying primitive: one authorization, one signed receipt. Use it when you are integrating the gate into your own runtime rather than wrapping an MCP server. This path ends at a receipt, not the capsule trio — for the loop-and-trio path, start from the quickstart.
- Inside your Node project:
npm install @lyhna/bind(project dependency, not global). - The SDK is ESM-only. If your project was initialized as CommonJS, run
npm pkg set type=modulefirst. - Set
LYHNA_API_KEY, callbind()before execution, obey the outcome. - Verify any single receipt offline:
npx -y lyhna-verify --receipt receipt.json.
How bind() works
-
1Action declared — Your agent declares what it intends to do, under what intent.
-
2Tier resolved — The enforcement engine looks up the action in your authority rules table. Deterministic — no inference.
-
3Policy evaluated — Tier policy determines outcome: auto-approve, standard review, or authorize-all.
-
4Receipt signed — Ed25519 signed receipt produced. Append-only. Verifiable offline. Contains action hash, tier, outcome, timestamp.
-
5License returned — APPROVED, REFUSED, or ESCALATED. No APPROVED receipt, no execution. Fail-closed.
Six Invariants
Fail-closedNo APPROVED receipt = no execution
DeterministicNo probabilistic decisions
Append-onlyNo mutation of receipts
SovereignTenant-isolated
VerifiableOffline verification always possible
Pre-executionAuthorization happens before execution