I open-sourced the part of a proactive AI assistant that decides when not to speak
Description and use
Open-source suppression module for a proactive AI assistant, implementing 12 checks, atomic budget control, and policy simulation.
Problem
Proactive AI assistants often lack a robust mechanism to decide when not to speak, leading to unwanted or poorly timed messages.
Outcome
The open-source gate provides a single, ordered set of suppression checks, logs detailed reasons for rejections, enforces daily budgets atomically, and allows policy replay and simulation, enabling reliable proactive messaging.
Workflow
- Install the gate:
npm install proactive-gate - Create a gate with a Redis store and default checks:
createGate({store:new RedisStore(redis), checks:defaultChecks({dailyLimit:3, quietHoursFloor:'high'}), onDecision:d=>log.info('gate',d)}) - Evaluate a candidate:
const decision=await gate.evaluate({user,candidate}) - If allowed and commit succeeds, send the message:
if(decision.allowed && await gate.commit(decision,{user,candidate})) await send(decision.surfaces,candidate.payload) - Use
npx proactive-gate simulateto replay traffic and analyze policy impact before shipping. - Define policies as JSON files and replay with
npx proactive-gate replay --policy policy.jsonto test new rules. - Handle store errors by configuring
onStoreErrorto either allow or reject on failure.
Evidence
Zero dependencies, TypeScript, Node 20 or newer.
The budget is enforced at send time, not at evaluate time
When Redis is down, the default lets the candidate through and writes outcome: "skip"
- Record date: 2026-09-18T05:30:32.507Z