npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sovr/gate

v0.1.0

Published

SOVR Gate SDK - AI Execution Control Plane. Intercept, audit, and control AI agent actions before they execute.

Readme

@sovr/gate

AI Execution Control Plane — Intercept, audit, and control AI agent actions before they execute.

npm version License: MIT

Why SOVR Gate?

AI agents are powerful but dangerous. They can:

  • Send emails without review
  • Process payments without approval
  • Delete data without confirmation
  • Execute irreversible actions automatically

SOVR Gate is the missing control layer between AI decision and real-world execution.

Without SOVR Gate:
AI Agent → Direct Execution → 💥 Irreversible Error

With SOVR Gate:
AI Agent → SOVR Gate → Human Approval → Safe Execution ✓

Installation

npm install @sovr/gate
# or
yarn add @sovr/gate
# or
pnpm add @sovr/gate

Quick Start

import { createGate } from '@sovr/gate';

// Create a gate instance
const gate = createGate({
  defaultDeny: true, // Block unregistered actions
  irreversibleActions: [
    'send_email',
    'process_payment',
    'delete_user',
  ],
});

// Before executing any action, check with the gate
async function executeAction(action) {
  const result = await gate.check({
    type: action.type,
    resource: action.resource,
    params: action.params,
  });

  if (result.allowed) {
    // ✅ Safe to execute
    return performAction(action);
  }
  
  if (result.requiresApproval) {
    // ⏳ Needs human approval
    console.log(`Waiting for approval: ${result.pendingApprovalId}`);
    return { status: 'pending_approval', id: result.pendingApprovalId };
  }
  
  // ❌ Blocked
  throw new Error(`Action blocked: ${result.reason}`);
}

Core Concepts

1. Action Types

Every action has a type that determines how it's handled:

| Type | Example | Default Behavior | |------|---------|------------------| | Read | get_user, list_orders | ✅ Always allowed | | Write | create_order, update_user | ⚠️ Logged | | Irreversible | delete_user, process_payment | 🛑 Requires approval |

2. Gate Verdicts

| Verdict | Meaning | |---------|---------| | ALLOW | Action can proceed | | DENY | Action is blocked | | PENDING_APPROVAL | Waiting for human approval |

3. Kill Switch

Emergency stop all AI actions:

// Something went wrong? Stop everything immediately
gate.enableKillSwitch('Security incident detected');

// All actions are now blocked
const result = await gate.check({ type: 'any_action', resource: 'any' });
// result.allowed === false
// result.reason === 'Kill switch enabled: Security incident detected'

// Resume when safe
gate.disableKillSwitch();

LangChain Integration

Wrap Individual Tools

import { createGate, wrapTool } from '@sovr/gate';
import { SerpAPI } from 'langchain/tools';

const gate = createGate();
const searchTool = wrapTool(new SerpAPI(), gate);

// Tool calls are now gated

Callback Handler (Recommended)

import { createGate, createCallbackHandler } from '@sovr/gate';
import { AgentExecutor } from 'langchain/agents';

const gate = createGate({
  defaultDeny: true,
  approvalRequired: ['send_email', 'execute_code'],
});

const handler = createCallbackHandler(gate, {
  blockOnDeny: true,
  contextProvider: async () => ({
    userId: getCurrentUserId(),
    tenantId: getTenantId(),
  }),
});

const agent = new AgentExecutor({
  // ... your agent config
  callbacks: [handler],
});

LCEL Middleware

import { createGate, gateMiddleware } from '@sovr/gate';
import { RunnableSequence } from 'langchain/runnables';

const gate = createGate();

const chain = RunnableSequence.from([
  gateMiddleware(gate, 'process_data'),
  myDataProcessor,
  gateMiddleware(gate, 'send_notification'),
  notificationSender,
]);

Human Approval Flow

const gate = createGate({
  irreversibleActions: ['process_refund'],
  webhooks: {
    onPendingApproval: 'https://your-app.com/webhooks/approval',
  },
});

// 1. Check action (will return PENDING_APPROVAL)
const result = await gate.check({
  type: 'process_refund',
  resource: 'payment',
  params: { amount: 1000, orderId: 'ord_123' },
});

console.log(result.requiresApproval); // true
console.log(result.pendingApprovalId); // 'apr_abc123'

// 2. Human reviews and approves
await gate.approve(result.pendingApprovalId, '[email protected]', 'Verified refund request');

// 3. Now the action can proceed

Configuration

const gate = createGate({
  // Tenant/organization ID
  tenantId: 'my-company',
  
  // Enable/disable the gate (kill switch)
  enabled: true,
  
  // Block actions not in allowList (zero-trust mode)
  defaultDeny: true,
  
  // Actions that bypass all checks
  allowList: ['get_status', 'list_items'],
  
  // Actions that are always blocked
  blockList: ['delete_database', 'shutdown_server'],
  
  // Actions requiring human approval
  approvalRequired: ['send_bulk_email', 'publish_content'],
  
  // Irreversible actions (always require approval)
  irreversibleActions: [
    'process_payment',
    'delete_user',
    'send_email',
  ],
  
  // Risk thresholds
  riskThresholds: {
    maxAmount: 100000,      // Block amounts above this
    highRiskAmount: 10000,  // Flag amounts above this
    blockedCountries: ['XX', 'YY'],
  },
  
  // Webhooks
  webhooks: {
    onPendingApproval: 'https://your-app.com/webhooks/approval',
    onDecision: 'https://your-app.com/webhooks/decision',
  },
});

Custom Storage

By default, SOVR Gate uses in-memory storage. For production, implement your own:

import { createGate, StorageAdapter } from '@sovr/gate';

class PostgresStorage implements StorageAdapter {
  async saveDecision(decision) {
    await db.insert('sovr_decisions', decision);
  }
  
  async getDecision(decisionId) {
    return db.findOne('sovr_decisions', { id: decisionId });
  }
  
  // ... implement other methods
}

const gate = createGate({
  storage: new PostgresStorage(),
});

Evidence Trail

Every decision creates an immutable evidence bundle:

const result = await gate.check({ type: 'send_email', resource: 'email' });

console.log(result.evidence);
// {
//   id: 'evt_abc123',
//   chain: [
//     {
//       id: 'rec_xyz',
//       type: 'gate_decision',
//       contentHash: 'sha256:...',
//       prevHash: '0000...',
//       timestamp: '2024-01-01T00:00:00Z',
//     }
//   ],
//   integrityHash: 'sha256:...',
// }

API Reference

createGate(config?)

Create a new gate instance.

gate.check(action, context?)

Check if an action is allowed.

gate.approve(approvalId, approvedBy, reason?)

Approve a pending action.

gate.reject(approvalId, rejectedBy, reason?)

Reject a pending action.

gate.enableKillSwitch(reason)

Emergency stop all actions.

gate.disableKillSwitch()

Resume normal operation.

gate.listPendingApprovals(tenantId?)

List all pending approvals.

License

MIT © SOVR


Questions? docs.sovrapp.com | Discord | [email protected]