Quickstart: TypeScript, plain functions
1. Install #
npm install signafaide # or: pnpm add / yarn add / bun add2. Wrap the tools that act #
import { note, record, wrapTools } from "signafaide";
const approvePayout = record(async (claimId: string, amount: number) => {
/* ... */
}, { name: "approve_payout" });
// or wrap existing functions (object key = recorded name):
const tools = wrapTools({ approve_payout: approvePayout, escalate });
// a decision that is not a tool call:
note("routing", { reason: "amount over limit" });Every call of a wrapped tool writes a signed decision record before it runs and an outcome record after it (the result, or the error, which is raised again unchanged). Records are signed and chained in .signafaide/ on your machine, and nothing is sent until you opt in (step 4).
3. Verify #
Run the agent once, then:
npx signafaide verifyOne line per check, then a result line that says how many of the 12 checks passed, are pending and were not checked, for example PASS: 4 of 12 checks passed, 8 not checked (nothing co-signed yet) before anything is sent, and what still needs a witness (co-signature, public timestamp). A check that was not run is never counted as passed. See Verify for what each check means.
4. Send hashes to a witness (when you choose) #
npx signafaide initcreates a free sandbox (no account, email or card), saves SIGNAFAIDE_API_KEY to .env (and adds .env to .gitignore) and prints a link to claim it. Only salted hashes are sent, never inputs or outputs; records written before ship with their original times, if they are at most 7 days old. To keep the evidence in your environment, self-host the witness and set SIGNAFAIDE_URL.
Other quickstarts: Python, plain functions · Python, LangChain · Python, OpenAI Agents SDK · TypeScript, LangChain · TypeScript, OpenAI Agents SDK · TypeScript, Vercel AI SDK.