Hacker News new | ask | show | jobs
by kaicianflone 91 days ago
Sure the core primitive is a runtime wrapper that turns any function into a governed decision point:

  import { consensus } from "@consensus-tools/wrapper";

  const safeSend = consensus(sendEmail, {
    reviewers: [humanReviewer, aiSafetyReviewer],
    strategy: { mode: "unanimous" },
    hooks: { onBlock: (ctx) => audit.log("blocked", ctx) },
  });

  await safeSend({ to: "user@example.com", body: "Hello" });
The call to sendEmail doesn't execute until every reviewer votes. Strategy modes handle the consensus logic (unanimous, majority, weighted, etc.), and guards can ALLOW, BLOCK, REWRITE, or escalate to REQUIRE_HUMAN before anything fires.

The monorepo has 9 built-in policy types and 7 guard types designed so you can drop governance into an existing agent system without rewriting your orchestration.

Repo's at github.com/consensus-tools if you want to poke around.