@node9/policy-engine 2.58.0 → 2.59.1
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -3
- package/dist/index.mjs +25 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2476,7 +2476,7 @@ declare const CANONICAL_EXTRACTOR_VERSION = "canonical-v39";
|
|
|
2476
2476
|
* files changed, this hash must change too, and you must consciously
|
|
2477
2477
|
* decide whether to bump CANONICAL_EXTRACTOR_VERSION."
|
|
2478
2478
|
*/
|
|
2479
|
-
declare const CANONICAL_EXTRACTOR_HASH = "
|
|
2479
|
+
declare const CANONICAL_EXTRACTOR_HASH = "1c4a57ad24e7c8c3";
|
|
2480
2480
|
declare function extractCanonicalFindings(call: ToolCallEntry, ctx: ExtractContext): CanonicalFinding[];
|
|
2481
2481
|
declare function extractSessionLevelFindings(calls: ReadonlyArray<SessionToolCall>, ctx: SessionExtractContext): CanonicalFinding[];
|
|
2482
2482
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -2476,7 +2476,7 @@ declare const CANONICAL_EXTRACTOR_VERSION = "canonical-v39";
|
|
|
2476
2476
|
* files changed, this hash must change too, and you must consciously
|
|
2477
2477
|
* decide whether to bump CANONICAL_EXTRACTOR_VERSION."
|
|
2478
2478
|
*/
|
|
2479
|
-
declare const CANONICAL_EXTRACTOR_HASH = "
|
|
2479
|
+
declare const CANONICAL_EXTRACTOR_HASH = "1c4a57ad24e7c8c3";
|
|
2480
2480
|
declare function extractCanonicalFindings(call: ToolCallEntry, ctx: ExtractContext): CanonicalFinding[];
|
|
2481
2481
|
declare function extractSessionLevelFindings(calls: ReadonlyArray<SessionToolCall>, ctx: SessionExtractContext): CanonicalFinding[];
|
|
2482
2482
|
/**
|
package/dist/index.js
CHANGED
|
@@ -2696,7 +2696,12 @@ var CHECK_TEXT = {
|
|
|
2696
2696
|
"behavior.cost-budget": {
|
|
2697
2697
|
plain: "The session, or the whole day, has spent more than the ceiling you set, and the agent keeps going.",
|
|
2698
2698
|
example: "A session at $12 of a $10 budget running one more search",
|
|
2699
|
-
advice: "Set a ceiling
|
|
2699
|
+
advice: "Set a ceiling per session or per day and choose Log or Block. It counts API value on every plan, so it also catches a runaway agent on a flat plan. The figure is the one cost sync reads, up to ten minutes behind."
|
|
2700
|
+
},
|
|
2701
|
+
"behavior.spend-budget": {
|
|
2702
|
+
plain: "The person's monthly budget for usage beyond plans is used up, and an agent no plan covers keeps going.",
|
|
2703
|
+
example: "A Codex session paid by API key after $150 of a $150 monthly budget",
|
|
2704
|
+
advice: "Set budgets on Usage & budgets. Log records the calls past a budget; Block stops them until an owner raises it. Agents a plan covers keep working."
|
|
2700
2705
|
},
|
|
2701
2706
|
"behavior.prompt-injection": {
|
|
2702
2707
|
plain: "Text the agent read (a web page, a file, a tool result) contains instructions aimed at the AI.",
|
|
@@ -3445,10 +3450,22 @@ var PRODUCT_CHECKS = [
|
|
|
3445
3450
|
owasp: "ASI08",
|
|
3446
3451
|
title: "Spend past the budget",
|
|
3447
3452
|
catches: "a call made after the session or the day passed the spend ceiling the user set",
|
|
3448
|
-
|
|
3453
|
+
// No review (fw#427): past a ceiling every call would ask again.
|
|
3454
|
+
values: ["off", "log", "block"],
|
|
3449
3455
|
defaultValue: "off",
|
|
3450
3456
|
legacy: ["cost-budget", "\u{1F6E1}\uFE0F Node9 Cost Budget"]
|
|
3451
3457
|
},
|
|
3458
|
+
{
|
|
3459
|
+
id: "behavior.spend-budget",
|
|
3460
|
+
group: "behavior",
|
|
3461
|
+
owasp: "ASI08",
|
|
3462
|
+
title: "Usage past the monthly budget",
|
|
3463
|
+
catches: "a call by an agent no plan covers, after the person's monthly budget for usage beyond plans is used up",
|
|
3464
|
+
// The budget and the status come from the dashboard (Usage & budgets,
|
|
3465
|
+
// fw#427); log records the calls past it, block stops them.
|
|
3466
|
+
values: ["off", "log", "block"],
|
|
3467
|
+
defaultValue: "log"
|
|
3468
|
+
},
|
|
3452
3469
|
{
|
|
3453
3470
|
id: "behavior.prompt-injection",
|
|
3454
3471
|
group: "behavior",
|
|
@@ -3727,6 +3744,9 @@ function checkIdForCheckedBy(checkedBy) {
|
|
|
3727
3744
|
case "cost-budget-review":
|
|
3728
3745
|
case "cost-budget-block":
|
|
3729
3746
|
return "behavior.cost-budget";
|
|
3747
|
+
case "spend-budget":
|
|
3748
|
+
case "spend-budget-block":
|
|
3749
|
+
return "behavior.spend-budget";
|
|
3730
3750
|
default:
|
|
3731
3751
|
return void 0;
|
|
3732
3752
|
}
|
|
@@ -17751,6 +17771,8 @@ var MAP_GOVERNED = /* @__PURE__ */ new Set([
|
|
|
17751
17771
|
// Cascading failures (node9Firewall#427): both detectors read the map.
|
|
17752
17772
|
"behavior.fanout",
|
|
17753
17773
|
"behavior.cost-budget",
|
|
17774
|
+
// Usage & budgets (fw#427): the detector reads the map.
|
|
17775
|
+
"behavior.spend-budget",
|
|
17754
17776
|
"files.shell-startup",
|
|
17755
17777
|
"files.password-hashes",
|
|
17756
17778
|
"files.system-dirs",
|
|
@@ -21130,7 +21152,7 @@ function matchCanaryArgs(args, values) {
|
|
|
21130
21152
|
// src/scan/canonical.ts
|
|
21131
21153
|
var LONG_OUTPUT_THRESHOLD_BYTES = 100 * 1024;
|
|
21132
21154
|
var CANONICAL_EXTRACTOR_VERSION = "canonical-v39";
|
|
21133
|
-
var CANONICAL_EXTRACTOR_HASH = "
|
|
21155
|
+
var CANONICAL_EXTRACTOR_HASH = "1c4a57ad24e7c8c3";
|
|
21134
21156
|
var DEDUPE_PREVIEW_LEN = 120;
|
|
21135
21157
|
function extractCanonicalFindings(call, ctx) {
|
|
21136
21158
|
const out = [];
|
package/dist/index.mjs
CHANGED
|
@@ -2429,7 +2429,12 @@ var CHECK_TEXT = {
|
|
|
2429
2429
|
"behavior.cost-budget": {
|
|
2430
2430
|
plain: "The session, or the whole day, has spent more than the ceiling you set, and the agent keeps going.",
|
|
2431
2431
|
example: "A session at $12 of a $10 budget running one more search",
|
|
2432
|
-
advice: "Set a ceiling
|
|
2432
|
+
advice: "Set a ceiling per session or per day and choose Log or Block. It counts API value on every plan, so it also catches a runaway agent on a flat plan. The figure is the one cost sync reads, up to ten minutes behind."
|
|
2433
|
+
},
|
|
2434
|
+
"behavior.spend-budget": {
|
|
2435
|
+
plain: "The person's monthly budget for usage beyond plans is used up, and an agent no plan covers keeps going.",
|
|
2436
|
+
example: "A Codex session paid by API key after $150 of a $150 monthly budget",
|
|
2437
|
+
advice: "Set budgets on Usage & budgets. Log records the calls past a budget; Block stops them until an owner raises it. Agents a plan covers keep working."
|
|
2433
2438
|
},
|
|
2434
2439
|
"behavior.prompt-injection": {
|
|
2435
2440
|
plain: "Text the agent read (a web page, a file, a tool result) contains instructions aimed at the AI.",
|
|
@@ -3178,10 +3183,22 @@ var PRODUCT_CHECKS = [
|
|
|
3178
3183
|
owasp: "ASI08",
|
|
3179
3184
|
title: "Spend past the budget",
|
|
3180
3185
|
catches: "a call made after the session or the day passed the spend ceiling the user set",
|
|
3181
|
-
|
|
3186
|
+
// No review (fw#427): past a ceiling every call would ask again.
|
|
3187
|
+
values: ["off", "log", "block"],
|
|
3182
3188
|
defaultValue: "off",
|
|
3183
3189
|
legacy: ["cost-budget", "\u{1F6E1}\uFE0F Node9 Cost Budget"]
|
|
3184
3190
|
},
|
|
3191
|
+
{
|
|
3192
|
+
id: "behavior.spend-budget",
|
|
3193
|
+
group: "behavior",
|
|
3194
|
+
owasp: "ASI08",
|
|
3195
|
+
title: "Usage past the monthly budget",
|
|
3196
|
+
catches: "a call by an agent no plan covers, after the person's monthly budget for usage beyond plans is used up",
|
|
3197
|
+
// The budget and the status come from the dashboard (Usage & budgets,
|
|
3198
|
+
// fw#427); log records the calls past it, block stops them.
|
|
3199
|
+
values: ["off", "log", "block"],
|
|
3200
|
+
defaultValue: "log"
|
|
3201
|
+
},
|
|
3185
3202
|
{
|
|
3186
3203
|
id: "behavior.prompt-injection",
|
|
3187
3204
|
group: "behavior",
|
|
@@ -3460,6 +3477,9 @@ function checkIdForCheckedBy(checkedBy) {
|
|
|
3460
3477
|
case "cost-budget-review":
|
|
3461
3478
|
case "cost-budget-block":
|
|
3462
3479
|
return "behavior.cost-budget";
|
|
3480
|
+
case "spend-budget":
|
|
3481
|
+
case "spend-budget-block":
|
|
3482
|
+
return "behavior.spend-budget";
|
|
3463
3483
|
default:
|
|
3464
3484
|
return void 0;
|
|
3465
3485
|
}
|
|
@@ -17484,6 +17504,8 @@ var MAP_GOVERNED = /* @__PURE__ */ new Set([
|
|
|
17484
17504
|
// Cascading failures (node9Firewall#427): both detectors read the map.
|
|
17485
17505
|
"behavior.fanout",
|
|
17486
17506
|
"behavior.cost-budget",
|
|
17507
|
+
// Usage & budgets (fw#427): the detector reads the map.
|
|
17508
|
+
"behavior.spend-budget",
|
|
17487
17509
|
"files.shell-startup",
|
|
17488
17510
|
"files.password-hashes",
|
|
17489
17511
|
"files.system-dirs",
|
|
@@ -20863,7 +20885,7 @@ function matchCanaryArgs(args, values) {
|
|
|
20863
20885
|
// src/scan/canonical.ts
|
|
20864
20886
|
var LONG_OUTPUT_THRESHOLD_BYTES = 100 * 1024;
|
|
20865
20887
|
var CANONICAL_EXTRACTOR_VERSION = "canonical-v39";
|
|
20866
|
-
var CANONICAL_EXTRACTOR_HASH = "
|
|
20888
|
+
var CANONICAL_EXTRACTOR_HASH = "1c4a57ad24e7c8c3";
|
|
20867
20889
|
var DEDUPE_PREVIEW_LEN = 120;
|
|
20868
20890
|
function extractCanonicalFindings(call, ctx) {
|
|
20869
20891
|
const out = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node9/policy-engine",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.59.1",
|
|
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",
|