// INSTALL
1) Install packages
npm install \
@trigguard/execution-sdk \
@trigguard/intent-sdk \
@trigguard/surface-registry \
@trigguard/express-middleware
// EXPRESS EXAMPLE
2) Run a minimal middleware gate
import express from "express";
import { trigguardMiddleware } from "@trigguard/express-middleware";
import { defineSurface } from "@trigguard/surface-registry";
const app = express();
app.use(express.json());
const spendCommit = defineSurface({
id: "payments.spendCommit",
description: "Commit outbound payment",
});
app.post(
"/payments/commit",
trigguardMiddleware({
surface: spendCommit,
onDecision: (decision) => {
if (decision === "PERMIT") return;
throw new Error(`Execution denied by TrigGuard: ${decision}`);
},
}),
(_req, res) => {
res.json({ ok: true, committed: true });
}
);
app.listen(3000, () => console.log("listening on :3000"));
// EXPECTED BEHAVIOR
3) Decision contract
- PERMIT -> execution proceeds
- DENY -> execution stops
- SILENCE -> no authorization, execution stops
Keep this mapping explicit in integration code. Do not model decisions with alternate terms.
// DEVELOPER DOCS
Navigate by protocol surface
PROTOCOL · ARCHITECTURE · QUICKSTART · VERIFY_RECEIPT · GOVERNANCE · REQUEST_ACCESS
