Quickstart: Guard a Support Response
Walk through the full consensus lifecycle: a support AI drafts a dangerous response, guards catch it, and the board blocks it before it sends.
The scenario
Your customer support AI just drafted a response to Meridian Partners, an enterprise client on a $47K/year SaaS contract. The customer is furious about a billing error and demanding a full refund.
The AI's draft:
"We sincerely apologize for the inconvenience. We'll process a full refund of $47,000 immediately and terminate your contract effective today. No further charges will apply."
Two problems the AI doesn't know about:
- The refund exceeds the auto-approve limit. Company policy caps automated refunds at $5K. Anything above requires VP approval.
- The contract has a 12-month lock-in. Terminating it early triggers a $14K early termination fee that the company would be waiving without authorization.
Without a guard, that response sends. The company eats $47K + $14K in unauthorized commitments. With consensus.tools, specialist guards catch both issues before the customer ever sees the draft.
No account needed
This entire quickstart runs locally. One TypeScript file, no server, no API keys.
Let's build it
Create a project and install packages
Create the guard script
Create support-guard.ts:
Run the guard
You will see each guard evaluate the draft, then the board's decision:
What just happened
Each step in the script maps to a stage in the consensus lifecycle:
board.init()created a local board with anAPPROVAL_VOTEpolicy requiring 3 participants and 60% agreement.board.engine.postJob()registered a guard job. The draft is now under review -- it cannot send until the board resolves.board.engine.claimJob()-- each guard locked 3 credits as stake. If their judgment turns out to be wrong over time, they lose those credits.board.engine.submitJob()-- each guard submitted a verdict (BLOCK,BLOCK,REWRITE) with confidence scores and structured evidence.board.engine.resolveJob()-- the consensus engine applied theAPPROVAL_VOTEpolicy across all three submissions and produced an auditable resolution.
The entire decision trail -- every vote, every confidence score, every reason string -- is stored in board-state.json. Six months from now, when Meridian Partners asks why the refund took a week, you can show exactly which guards flagged what and why.
What would have gone wrong without the guard
| Without guard | With guard |
|---|---|
| $47K refund processes immediately | Refund flagged: exceeds $5K auto-approve by 840% |
| 12-month contract terminated at month 4 | Termination flagged: $14.1K ETF waiver requires authorization |
| Company absorbs $61.1K in unauthorized commitments | Draft blocked, escalated to VP and Account Manager |
| No audit trail of who approved what | Full decision log with verdicts, confidence scores, and reasons |
Next steps
- Understand the core primitives -- Concepts
- Build a multi-step guard pipeline -- Zero to Hero
- Use the CLI for team workflows -- Install CLI
- Explore all 9 consensus policies -- Consensus Policies