Sign In

@sovr/engine

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sovr/engine

Unified Policy Engine for SOVR — the single decision plane for all proxy channels

Source
npmnpm
Version
3.4.0
Version published
Weekly downloads
51
-26.09%
Maintainers
1
Weekly downloads
 
Created
Source

@sovr/engine

Unified Policy Engine for SOVR — the single decision plane for all proxy channels.

npm License

Overview

@sovr/engine is the core policy evaluation engine that powers all SOVR proxy channels. It provides a unified interface for evaluating actions against policy rules, regardless of the channel (exec, sql, http, mcp).

This package is used internally by:

Installation

npm install @sovr/engine

Usage

import { PolicyEngine, evaluate } from '@sovr/engine';

const engine = new PolicyEngine({
  rules: [/* your policy rules */],
  failMode: 'fail-close',
});

const result = engine.evaluate({
  channel: 'exec',
  action: 'rm -rf /tmp/data',
  context: { user: 'agent-1' },
});

// result.verdict: 'allow' | 'deny' | 'escalate'
// result.rule: the matching rule (if any)
// result.reason: human-readable explanation

API

PolicyEngine

The main class for policy evaluation.

MethodDescription
evaluate(request)Evaluate an action against all loaded rules
addRule(rule)Add a rule at runtime
removeRule(id)Remove a rule by ID
listRules()List all active rules
getStats()Get evaluation statistics

evaluate(request)

Standalone function for one-shot evaluation without engine instantiation.

Rule Format

interface PolicyRule {
  id: string;
  description: string;
  channels: ('exec' | 'sql' | 'http' | 'mcp')[];
  action_pattern: string;      // regex pattern
  resource_pattern?: string;   // optional resource filter
  effect: 'allow' | 'deny' | 'escalate';
  risk_level: 'low' | 'medium' | 'high' | 'critical';
  priority: number;            // higher = evaluated first
}

Verdict Format

interface Verdict {
  verdict: 'allow' | 'deny' | 'escalate';
  rule: PolicyRule | null;
  reason: string;
  timestamp: number;
  channel: string;
}

Built-in Rules

The engine ships with 15 built-in rules covering common risk patterns across all four channels. See the sovr-mcp-proxy documentation for the complete list.

License

BSL-1.1 (Business Source License 1.1) — See LICENSE for details.

The Licensed Work is the @sovr/engine software. The Change Date is four years from each version's release. After the Change Date, each version converts to Apache-2.0.

Keywords

sovr

FAQs

Package last updated on 24 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts