@sovr/engine 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +81 -0
- package/README.md +105 -0
- package/package.json +5 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
4
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
5
|
+
|
|
6
|
+
Parameters
|
|
7
|
+
|
|
8
|
+
Licensor: SOVR AI
|
|
9
|
+
Licensed Work: @sovr/engine v1.2.0
|
|
10
|
+
The Licensed Work is (c) 2025-2026 SOVR AI.
|
|
11
|
+
Additional Use Grant: You may use the Licensed Work for non-production
|
|
12
|
+
evaluation, development, and testing purposes.
|
|
13
|
+
Change Date: Four years from the date of each version's release.
|
|
14
|
+
Change License: Apache License, Version 2.0
|
|
15
|
+
|
|
16
|
+
Terms
|
|
17
|
+
|
|
18
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
19
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
20
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
21
|
+
production use.
|
|
22
|
+
|
|
23
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
24
|
+
available distribution of a specific version of the Licensed Work under this
|
|
25
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
26
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
27
|
+
above terminate.
|
|
28
|
+
|
|
29
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
30
|
+
currently in effect as described in this License, you must purchase a
|
|
31
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
32
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
33
|
+
|
|
34
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
35
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
36
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
37
|
+
for each version of the Licensed Work released by Licensor.
|
|
38
|
+
|
|
39
|
+
You must conspicuously display this License on each original or modified copy
|
|
40
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
41
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
42
|
+
License apply to your use of that work.
|
|
43
|
+
|
|
44
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
45
|
+
terminate your rights under this License for the current and all other
|
|
46
|
+
versions of the Licensed Work.
|
|
47
|
+
|
|
48
|
+
This License does not grant you any right in any trademark or logo of
|
|
49
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
50
|
+
Licensor as expressly required by this License).
|
|
51
|
+
|
|
52
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
53
|
+
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
54
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
55
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
56
|
+
TITLE.
|
|
57
|
+
|
|
58
|
+
MariaDB hereby grants you permission to use this License's text to license
|
|
59
|
+
your works, and to refer to it using the trademark "Business Source License",
|
|
60
|
+
as long as you comply with the Covenants of Licensor below.
|
|
61
|
+
|
|
62
|
+
Covenants of Licensor
|
|
63
|
+
|
|
64
|
+
In consideration of the right to use this License's text and the "Business
|
|
65
|
+
Source License" name and trademark, Licensor covenants to MariaDB, and to all
|
|
66
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
67
|
+
|
|
68
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
69
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
70
|
+
where "compatible" means that software provided under the Change License can
|
|
71
|
+
be included in a program with software provided under GPL Version 2.0 or a
|
|
72
|
+
later version. Licensor may specify additional Change Licenses without
|
|
73
|
+
limitation.
|
|
74
|
+
|
|
75
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
76
|
+
impose any additional restriction on the right granted in this License, as
|
|
77
|
+
the Additional Use Grant; or (b) insert the text "None".
|
|
78
|
+
|
|
79
|
+
3. To specify a Change Date.
|
|
80
|
+
|
|
81
|
+
4. Not to modify this License in any other way.
|
package/README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# @sovr/engine
|
|
2
|
+
|
|
3
|
+
**Unified Policy Engine for SOVR** — the single decision plane for all proxy channels.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@sovr/engine)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
`@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).
|
|
11
|
+
|
|
12
|
+
This package is used internally by:
|
|
13
|
+
|
|
14
|
+
- [`sovr-mcp-proxy`](https://www.npmjs.com/package/sovr-mcp-proxy) — MCP transport proxy
|
|
15
|
+
- [`@sovr/proxy-exec`](https://www.npmjs.com/package/@sovr/proxy-exec) — Shell command proxy
|
|
16
|
+
- [`@sovr/proxy-sql`](https://www.npmjs.com/package/@sovr/proxy-sql) — SQL statement proxy
|
|
17
|
+
- [`@sovr/proxy-http`](https://www.npmjs.com/package/@sovr/proxy-http) — HTTP request proxy
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @sovr/engine
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { PolicyEngine, evaluate } from '@sovr/engine';
|
|
29
|
+
|
|
30
|
+
const engine = new PolicyEngine({
|
|
31
|
+
rules: [/* your policy rules */],
|
|
32
|
+
failMode: 'fail-close',
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const result = engine.evaluate({
|
|
36
|
+
channel: 'exec',
|
|
37
|
+
action: 'rm -rf /tmp/data',
|
|
38
|
+
context: { user: 'agent-1' },
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// result.verdict: 'allow' | 'deny' | 'escalate'
|
|
42
|
+
// result.rule: the matching rule (if any)
|
|
43
|
+
// result.reason: human-readable explanation
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## API
|
|
47
|
+
|
|
48
|
+
### `PolicyEngine`
|
|
49
|
+
|
|
50
|
+
The main class for policy evaluation.
|
|
51
|
+
|
|
52
|
+
| Method | Description |
|
|
53
|
+
|--------|-------------|
|
|
54
|
+
| `evaluate(request)` | Evaluate an action against all loaded rules |
|
|
55
|
+
| `addRule(rule)` | Add a rule at runtime |
|
|
56
|
+
| `removeRule(id)` | Remove a rule by ID |
|
|
57
|
+
| `listRules()` | List all active rules |
|
|
58
|
+
| `getStats()` | Get evaluation statistics |
|
|
59
|
+
|
|
60
|
+
### `evaluate(request)`
|
|
61
|
+
|
|
62
|
+
Standalone function for one-shot evaluation without engine instantiation.
|
|
63
|
+
|
|
64
|
+
### Rule Format
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
interface PolicyRule {
|
|
68
|
+
id: string;
|
|
69
|
+
description: string;
|
|
70
|
+
channels: ('exec' | 'sql' | 'http' | 'mcp')[];
|
|
71
|
+
action_pattern: string; // regex pattern
|
|
72
|
+
resource_pattern?: string; // optional resource filter
|
|
73
|
+
effect: 'allow' | 'deny' | 'escalate';
|
|
74
|
+
risk_level: 'low' | 'medium' | 'high' | 'critical';
|
|
75
|
+
priority: number; // higher = evaluated first
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Verdict Format
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
interface Verdict {
|
|
83
|
+
verdict: 'allow' | 'deny' | 'escalate';
|
|
84
|
+
rule: PolicyRule | null;
|
|
85
|
+
reason: string;
|
|
86
|
+
timestamp: number;
|
|
87
|
+
channel: string;
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Built-in Rules
|
|
92
|
+
|
|
93
|
+
The engine ships with 15 built-in rules covering common risk patterns across all four channels. See the [sovr-mcp-proxy documentation](https://www.npmjs.com/package/sovr-mcp-proxy) for the complete list.
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
BSL-1.1 (Business Source License 1.1) — See [LICENSE](LICENSE) for details.
|
|
98
|
+
|
|
99
|
+
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.
|
|
100
|
+
|
|
101
|
+
## Links
|
|
102
|
+
|
|
103
|
+
- **Website**: [sovr.inc](https://sovr.inc)
|
|
104
|
+
- **GitHub**: [xie38388/sovr](https://github.com/xie38388/sovr)
|
|
105
|
+
- **npm**: [@sovr/engine](https://www.npmjs.com/package/@sovr/engine)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sovr/engine",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Unified Policy Engine for SOVR — the single decision plane for all proxy channels",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
|
-
"README.md"
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
18
19
|
],
|
|
19
20
|
"scripts": {
|
|
20
21
|
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
@@ -25,11 +26,11 @@
|
|
|
25
26
|
"keywords": [
|
|
26
27
|
"sovr",
|
|
27
28
|
"policy-engine",
|
|
28
|
-
"ai-
|
|
29
|
+
"ai-responsibility",
|
|
29
30
|
"proxy",
|
|
30
31
|
"rules-engine"
|
|
31
32
|
],
|
|
32
|
-
"author": "SOVR
|
|
33
|
+
"author": "SOVR AI <contact@sovrapp.com>",
|
|
33
34
|
"license": "BSL-1.1",
|
|
34
35
|
"repository": {
|
|
35
36
|
"type": "git",
|