Decision engine
Every governed action goes through a policy check before execution. Allow, deny, or escalate — fully auditable.
Stellrai doesn't care how you built your app. It governs how it executes.
You don't need to change how you build.
Just route critical actions through Stellrai — and they become governed, traceable, and reversible by default.
import { HybriDBClient } from '@hybridb/sdk';
const hdb = new HybriDBClient({
baseUrl: 'https://hybridb.stellrai.com',
apiKey: process.env.HDB_API_KEY!,
});
// ─── 1. Request a decision (policy check) ───────────────────────────────────
const decision = await hdb.requestDecision({
decisionType: 'payment.authorize',
action: 'payment.initiate',
inputData: { amount: 15000, currency: 'USD', actorId: 'user:alice' },
});
if (decision.outcome !== 'approved') throw new PolicyDenyError(decision);
// ─── 2. Execute the governed pipeline ───────────────────────────────────────
const execution = await hdb.triggerPipelineByName('payment.execute.standard', {
decisionId: decision.decisionId,
input: { amount: 15000, to: 'acct_9k2x' },
});
// ─── 3. Rollback if needed — any time within the reversibility window ────────
await hdb.reversibility.rollback(execution.id, { reason: 'user_request' });Three method calls. Decision → execution → rollback. Everything else — policy enforcement, checkpointing, audit logging — happens automatically.
{
"executionId": "exec_abc123",
"status": "completed",
"audit": "recorded",
"reversible": true
}Every execution appears instantly in your dashboard with full trace, audit log, and rollback controls.