@node9/policy-engine 1.65.0 → 1.66.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/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -1
- package/dist/index.mjs +4 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -329,6 +329,9 @@ interface PolicyConfig {
|
|
|
329
329
|
dlp: {
|
|
330
330
|
enabled: boolean;
|
|
331
331
|
scanIgnoredTools: boolean;
|
|
332
|
+
/** Inline-ask v2: 'block' upgrades review-severity DLP matches to a hard
|
|
333
|
+
* block. Optional for back-compat with callers that don't set it. */
|
|
334
|
+
reviewAction?: 'review' | 'block';
|
|
332
335
|
};
|
|
333
336
|
/** Egress / destination control (GAP-5). Optional for back-compat with
|
|
334
337
|
* callers/tests that build a PolicyConfig without it. */
|
package/dist/index.d.ts
CHANGED
|
@@ -329,6 +329,9 @@ interface PolicyConfig {
|
|
|
329
329
|
dlp: {
|
|
330
330
|
enabled: boolean;
|
|
331
331
|
scanIgnoredTools: boolean;
|
|
332
|
+
/** Inline-ask v2: 'block' upgrades review-severity DLP matches to a hard
|
|
333
|
+
* block. Optional for back-compat with callers that don't set it. */
|
|
334
|
+
reviewAction?: 'review' | 'block';
|
|
332
335
|
};
|
|
333
336
|
/** Egress / destination control (GAP-5). Optional for back-compat with
|
|
334
337
|
* callers/tests that build a PolicyConfig without it. */
|
package/dist/index.js
CHANGED
|
@@ -2262,7 +2262,10 @@ async function evaluatePolicy(config, toolName, args, context = {}, hooks = {})
|
|
|
2262
2262
|
const dlpMatch = args !== void 0 ? scanArgs(args) : null;
|
|
2263
2263
|
if (dlpMatch) {
|
|
2264
2264
|
return {
|
|
2265
|
-
|
|
2265
|
+
// reviewAction:'block' (inline-ask v2): the admin upgraded
|
|
2266
|
+
// review-severity matches to a hard block — every evaluatePolicy
|
|
2267
|
+
// caller (orchestrator, explain, gateway) must agree with the gate.
|
|
2268
|
+
decision: dlpMatch.severity === "block" || config.policy.dlp.reviewAction === "block" ? "block" : "review",
|
|
2266
2269
|
blockedByLabel: `DLP: ${dlpMatch.patternName}`,
|
|
2267
2270
|
reason: `${dlpMatch.patternName} detected in ${dlpMatch.fieldPath}`
|
|
2268
2271
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -2152,7 +2152,10 @@ async function evaluatePolicy(config, toolName, args, context = {}, hooks = {})
|
|
|
2152
2152
|
const dlpMatch = args !== void 0 ? scanArgs(args) : null;
|
|
2153
2153
|
if (dlpMatch) {
|
|
2154
2154
|
return {
|
|
2155
|
-
|
|
2155
|
+
// reviewAction:'block' (inline-ask v2): the admin upgraded
|
|
2156
|
+
// review-severity matches to a hard block — every evaluatePolicy
|
|
2157
|
+
// caller (orchestrator, explain, gateway) must agree with the gate.
|
|
2158
|
+
decision: dlpMatch.severity === "block" || config.policy.dlp.reviewAction === "block" ? "block" : "review",
|
|
2156
2159
|
blockedByLabel: `DLP: ${dlpMatch.patternName}`,
|
|
2157
2160
|
reason: `${dlpMatch.patternName} detected in ${dlpMatch.fieldPath}`
|
|
2158
2161
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node9/policy-engine",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.66.0",
|
|
4
4
|
"description": "Shared policy evaluation engine for node9 — DLP, smart rules, AST shell parsing, shields, loop detection. Pure functions, no I/O. Used by both node9-proxy and the node9 SaaS firewall.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://node9.ai",
|