@agenttrail/guardrails 0.2.6 → 0.2.7
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/README.md +11 -2
- package/dist/{chunk-XIRL7M4H.js → chunk-3BH4CH3D.js} +3 -3
- package/dist/{chunk-XIRL7M4H.js.map → chunk-3BH4CH3D.js.map} +1 -1
- package/dist/{chunk-U7KZ447W.js → chunk-GBV64XPP.js} +13 -2
- package/dist/chunk-GBV64XPP.js.map +1 -0
- package/dist/guardrails.cjs +2 -2
- package/dist/guardrails.cjs.map +1 -1
- package/dist/guardrails.d.cts +4 -4
- package/dist/guardrails.d.ts +4 -4
- package/dist/guardrails.js +1 -1
- package/dist/index.cjs +14 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -2
- package/dist/{schema-B2pYoi9Z.d.cts → schema-DmT-Vm1T.d.cts} +110 -23
- package/dist/{schema-B2pYoi9Z.d.ts → schema-DmT-Vm1T.d.ts} +110 -23
- package/dist/schema.cjs +12 -1
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.d.cts +1 -1
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +5 -1
- package/package.json +1 -1
- package/dist/chunk-U7KZ447W.js.map +0 -1
|
@@ -101,6 +101,23 @@ declare const DETAIL_MATCHES_MAX_PATTERNS = 10;
|
|
|
101
101
|
* @returns `true` when the pattern nests unbounded quantifiers.
|
|
102
102
|
*/
|
|
103
103
|
declare function hasNestedUnboundedQuantifier(source: string): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Which text a condition's `detail_contains` / `detail_matches` read.
|
|
106
|
+
*
|
|
107
|
+
* - `command`: the text a tool call runs. For `Bash` and `PowerShell` that is the command;
|
|
108
|
+
* for an MCP call it is only the argument fields that execute (a terminal server's
|
|
109
|
+
* `command`, a database server's `sql`), never free text such as a ticket description.
|
|
110
|
+
* - `content`: the call's whole input text. For an MCP call that is its serialized input;
|
|
111
|
+
* for every other tool it is the same text `command` reads. For guardrails whose signal is
|
|
112
|
+
* the text itself wherever it is written, such as a credential.
|
|
113
|
+
*
|
|
114
|
+
* When a condition omits it, the channel is `command`, unless the condition's `label` can
|
|
115
|
+
* only name MCP tools (it starts with `mcp__`), in which case it is `content`: a condition
|
|
116
|
+
* scoped to one MCP server is about that server's input.
|
|
117
|
+
*/
|
|
118
|
+
declare const CHANNELS: readonly ["command", "content"];
|
|
119
|
+
/** The text a condition's detail matchers read. */
|
|
120
|
+
declare const ChannelSchema: z.ZodEnum<["command", "content"]>;
|
|
104
121
|
/**
|
|
105
122
|
* One condition matched against a tool call.
|
|
106
123
|
*
|
|
@@ -115,6 +132,9 @@ declare function hasNestedUnboundedQuantifier(source: string): boolean;
|
|
|
115
132
|
* - `detail_matches`: optional. Regex patterns against the same text; at least
|
|
116
133
|
* one must match (OR, unlike `detail_contains`). Case-insensitive.
|
|
117
134
|
* - `file_glob`: optional. Case-insensitive glob against the file path.
|
|
135
|
+
* - `channel`: optional. Which text `detail_contains` / `detail_matches` read; see
|
|
136
|
+
* `CHANNELS`. Only meaningful beside one of them, so a condition carrying `channel`
|
|
137
|
+
* without a detail matcher is refused.
|
|
118
138
|
*
|
|
119
139
|
* ── Two engine fields are deliberately absent ────────────────────────────────
|
|
120
140
|
*
|
|
@@ -142,30 +162,35 @@ declare const MatchConditionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
142
162
|
detail_contains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
143
163
|
detail_matches: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
144
164
|
file_glob: z.ZodOptional<z.ZodString>;
|
|
165
|
+
channel: z.ZodOptional<z.ZodEnum<["command", "content"]>>;
|
|
145
166
|
}, "strict", z.ZodTypeAny, {
|
|
146
167
|
kind: string;
|
|
147
168
|
label?: string | undefined;
|
|
148
169
|
detail_contains?: string[] | undefined;
|
|
149
170
|
detail_matches?: string[] | undefined;
|
|
150
171
|
file_glob?: string | undefined;
|
|
172
|
+
channel?: "command" | "content" | undefined;
|
|
151
173
|
}, {
|
|
152
174
|
kind: string;
|
|
153
175
|
label?: string | undefined;
|
|
154
176
|
detail_contains?: string[] | undefined;
|
|
155
177
|
detail_matches?: string[] | undefined;
|
|
156
178
|
file_glob?: string | undefined;
|
|
179
|
+
channel?: "command" | "content" | undefined;
|
|
157
180
|
}>, {
|
|
158
181
|
kind: string;
|
|
159
182
|
label?: string | undefined;
|
|
160
183
|
detail_contains?: string[] | undefined;
|
|
161
184
|
detail_matches?: string[] | undefined;
|
|
162
185
|
file_glob?: string | undefined;
|
|
186
|
+
channel?: "command" | "content" | undefined;
|
|
163
187
|
}, {
|
|
164
188
|
kind: string;
|
|
165
189
|
label?: string | undefined;
|
|
166
190
|
detail_contains?: string[] | undefined;
|
|
167
191
|
detail_matches?: string[] | undefined;
|
|
168
192
|
file_glob?: string | undefined;
|
|
193
|
+
channel?: "command" | "content" | undefined;
|
|
169
194
|
}>;
|
|
170
195
|
/**
|
|
171
196
|
* Match composition — conditions combined with `any_of` (OR), `all_of` (AND)
|
|
@@ -183,30 +208,35 @@ declare const MatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
183
208
|
detail_contains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
184
209
|
detail_matches: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
185
210
|
file_glob: z.ZodOptional<z.ZodString>;
|
|
211
|
+
channel: z.ZodOptional<z.ZodEnum<["command", "content"]>>;
|
|
186
212
|
}, "strict", z.ZodTypeAny, {
|
|
187
213
|
kind: string;
|
|
188
214
|
label?: string | undefined;
|
|
189
215
|
detail_contains?: string[] | undefined;
|
|
190
216
|
detail_matches?: string[] | undefined;
|
|
191
217
|
file_glob?: string | undefined;
|
|
218
|
+
channel?: "command" | "content" | undefined;
|
|
192
219
|
}, {
|
|
193
220
|
kind: string;
|
|
194
221
|
label?: string | undefined;
|
|
195
222
|
detail_contains?: string[] | undefined;
|
|
196
223
|
detail_matches?: string[] | undefined;
|
|
197
224
|
file_glob?: string | undefined;
|
|
225
|
+
channel?: "command" | "content" | undefined;
|
|
198
226
|
}>, {
|
|
199
227
|
kind: string;
|
|
200
228
|
label?: string | undefined;
|
|
201
229
|
detail_contains?: string[] | undefined;
|
|
202
230
|
detail_matches?: string[] | undefined;
|
|
203
231
|
file_glob?: string | undefined;
|
|
232
|
+
channel?: "command" | "content" | undefined;
|
|
204
233
|
}, {
|
|
205
234
|
kind: string;
|
|
206
235
|
label?: string | undefined;
|
|
207
236
|
detail_contains?: string[] | undefined;
|
|
208
237
|
detail_matches?: string[] | undefined;
|
|
209
238
|
file_glob?: string | undefined;
|
|
239
|
+
channel?: "command" | "content" | undefined;
|
|
210
240
|
}>, "many">>;
|
|
211
241
|
all_of: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
212
242
|
kind: z.ZodString;
|
|
@@ -214,30 +244,35 @@ declare const MatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
214
244
|
detail_contains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
215
245
|
detail_matches: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
216
246
|
file_glob: z.ZodOptional<z.ZodString>;
|
|
247
|
+
channel: z.ZodOptional<z.ZodEnum<["command", "content"]>>;
|
|
217
248
|
}, "strict", z.ZodTypeAny, {
|
|
218
249
|
kind: string;
|
|
219
250
|
label?: string | undefined;
|
|
220
251
|
detail_contains?: string[] | undefined;
|
|
221
252
|
detail_matches?: string[] | undefined;
|
|
222
253
|
file_glob?: string | undefined;
|
|
254
|
+
channel?: "command" | "content" | undefined;
|
|
223
255
|
}, {
|
|
224
256
|
kind: string;
|
|
225
257
|
label?: string | undefined;
|
|
226
258
|
detail_contains?: string[] | undefined;
|
|
227
259
|
detail_matches?: string[] | undefined;
|
|
228
260
|
file_glob?: string | undefined;
|
|
261
|
+
channel?: "command" | "content" | undefined;
|
|
229
262
|
}>, {
|
|
230
263
|
kind: string;
|
|
231
264
|
label?: string | undefined;
|
|
232
265
|
detail_contains?: string[] | undefined;
|
|
233
266
|
detail_matches?: string[] | undefined;
|
|
234
267
|
file_glob?: string | undefined;
|
|
268
|
+
channel?: "command" | "content" | undefined;
|
|
235
269
|
}, {
|
|
236
270
|
kind: string;
|
|
237
271
|
label?: string | undefined;
|
|
238
272
|
detail_contains?: string[] | undefined;
|
|
239
273
|
detail_matches?: string[] | undefined;
|
|
240
274
|
file_glob?: string | undefined;
|
|
275
|
+
channel?: "command" | "content" | undefined;
|
|
241
276
|
}>, "many">>;
|
|
242
277
|
none_of: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
243
278
|
kind: z.ZodString;
|
|
@@ -245,30 +280,35 @@ declare const MatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
245
280
|
detail_contains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
246
281
|
detail_matches: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
247
282
|
file_glob: z.ZodOptional<z.ZodString>;
|
|
283
|
+
channel: z.ZodOptional<z.ZodEnum<["command", "content"]>>;
|
|
248
284
|
}, "strict", z.ZodTypeAny, {
|
|
249
285
|
kind: string;
|
|
250
286
|
label?: string | undefined;
|
|
251
287
|
detail_contains?: string[] | undefined;
|
|
252
288
|
detail_matches?: string[] | undefined;
|
|
253
289
|
file_glob?: string | undefined;
|
|
290
|
+
channel?: "command" | "content" | undefined;
|
|
254
291
|
}, {
|
|
255
292
|
kind: string;
|
|
256
293
|
label?: string | undefined;
|
|
257
294
|
detail_contains?: string[] | undefined;
|
|
258
295
|
detail_matches?: string[] | undefined;
|
|
259
296
|
file_glob?: string | undefined;
|
|
297
|
+
channel?: "command" | "content" | undefined;
|
|
260
298
|
}>, {
|
|
261
299
|
kind: string;
|
|
262
300
|
label?: string | undefined;
|
|
263
301
|
detail_contains?: string[] | undefined;
|
|
264
302
|
detail_matches?: string[] | undefined;
|
|
265
303
|
file_glob?: string | undefined;
|
|
304
|
+
channel?: "command" | "content" | undefined;
|
|
266
305
|
}, {
|
|
267
306
|
kind: string;
|
|
268
307
|
label?: string | undefined;
|
|
269
308
|
detail_contains?: string[] | undefined;
|
|
270
309
|
detail_matches?: string[] | undefined;
|
|
271
310
|
file_glob?: string | undefined;
|
|
311
|
+
channel?: "command" | "content" | undefined;
|
|
272
312
|
}>, "many">>;
|
|
273
313
|
}, "strict", z.ZodTypeAny, {
|
|
274
314
|
any_of?: {
|
|
@@ -277,6 +317,7 @@ declare const MatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
277
317
|
detail_contains?: string[] | undefined;
|
|
278
318
|
detail_matches?: string[] | undefined;
|
|
279
319
|
file_glob?: string | undefined;
|
|
320
|
+
channel?: "command" | "content" | undefined;
|
|
280
321
|
}[] | undefined;
|
|
281
322
|
all_of?: {
|
|
282
323
|
kind: string;
|
|
@@ -284,6 +325,7 @@ declare const MatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
284
325
|
detail_contains?: string[] | undefined;
|
|
285
326
|
detail_matches?: string[] | undefined;
|
|
286
327
|
file_glob?: string | undefined;
|
|
328
|
+
channel?: "command" | "content" | undefined;
|
|
287
329
|
}[] | undefined;
|
|
288
330
|
none_of?: {
|
|
289
331
|
kind: string;
|
|
@@ -291,6 +333,7 @@ declare const MatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
291
333
|
detail_contains?: string[] | undefined;
|
|
292
334
|
detail_matches?: string[] | undefined;
|
|
293
335
|
file_glob?: string | undefined;
|
|
336
|
+
channel?: "command" | "content" | undefined;
|
|
294
337
|
}[] | undefined;
|
|
295
338
|
}, {
|
|
296
339
|
any_of?: {
|
|
@@ -299,6 +342,7 @@ declare const MatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
299
342
|
detail_contains?: string[] | undefined;
|
|
300
343
|
detail_matches?: string[] | undefined;
|
|
301
344
|
file_glob?: string | undefined;
|
|
345
|
+
channel?: "command" | "content" | undefined;
|
|
302
346
|
}[] | undefined;
|
|
303
347
|
all_of?: {
|
|
304
348
|
kind: string;
|
|
@@ -306,6 +350,7 @@ declare const MatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
306
350
|
detail_contains?: string[] | undefined;
|
|
307
351
|
detail_matches?: string[] | undefined;
|
|
308
352
|
file_glob?: string | undefined;
|
|
353
|
+
channel?: "command" | "content" | undefined;
|
|
309
354
|
}[] | undefined;
|
|
310
355
|
none_of?: {
|
|
311
356
|
kind: string;
|
|
@@ -313,6 +358,7 @@ declare const MatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
313
358
|
detail_contains?: string[] | undefined;
|
|
314
359
|
detail_matches?: string[] | undefined;
|
|
315
360
|
file_glob?: string | undefined;
|
|
361
|
+
channel?: "command" | "content" | undefined;
|
|
316
362
|
}[] | undefined;
|
|
317
363
|
}>, {
|
|
318
364
|
any_of?: {
|
|
@@ -321,6 +367,7 @@ declare const MatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
321
367
|
detail_contains?: string[] | undefined;
|
|
322
368
|
detail_matches?: string[] | undefined;
|
|
323
369
|
file_glob?: string | undefined;
|
|
370
|
+
channel?: "command" | "content" | undefined;
|
|
324
371
|
}[] | undefined;
|
|
325
372
|
all_of?: {
|
|
326
373
|
kind: string;
|
|
@@ -328,6 +375,7 @@ declare const MatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
328
375
|
detail_contains?: string[] | undefined;
|
|
329
376
|
detail_matches?: string[] | undefined;
|
|
330
377
|
file_glob?: string | undefined;
|
|
378
|
+
channel?: "command" | "content" | undefined;
|
|
331
379
|
}[] | undefined;
|
|
332
380
|
none_of?: {
|
|
333
381
|
kind: string;
|
|
@@ -335,6 +383,7 @@ declare const MatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
335
383
|
detail_contains?: string[] | undefined;
|
|
336
384
|
detail_matches?: string[] | undefined;
|
|
337
385
|
file_glob?: string | undefined;
|
|
386
|
+
channel?: "command" | "content" | undefined;
|
|
338
387
|
}[] | undefined;
|
|
339
388
|
}, {
|
|
340
389
|
any_of?: {
|
|
@@ -343,6 +392,7 @@ declare const MatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
343
392
|
detail_contains?: string[] | undefined;
|
|
344
393
|
detail_matches?: string[] | undefined;
|
|
345
394
|
file_glob?: string | undefined;
|
|
395
|
+
channel?: "command" | "content" | undefined;
|
|
346
396
|
}[] | undefined;
|
|
347
397
|
all_of?: {
|
|
348
398
|
kind: string;
|
|
@@ -350,6 +400,7 @@ declare const MatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
350
400
|
detail_contains?: string[] | undefined;
|
|
351
401
|
detail_matches?: string[] | undefined;
|
|
352
402
|
file_glob?: string | undefined;
|
|
403
|
+
channel?: "command" | "content" | undefined;
|
|
353
404
|
}[] | undefined;
|
|
354
405
|
none_of?: {
|
|
355
406
|
kind: string;
|
|
@@ -357,6 +408,7 @@ declare const MatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
357
408
|
detail_contains?: string[] | undefined;
|
|
358
409
|
detail_matches?: string[] | undefined;
|
|
359
410
|
file_glob?: string | undefined;
|
|
411
|
+
channel?: "command" | "content" | undefined;
|
|
360
412
|
}[] | undefined;
|
|
361
413
|
}>;
|
|
362
414
|
/**
|
|
@@ -390,11 +442,11 @@ declare const FixtureSchema: z.ZodUnion<[z.ZodEffects<z.ZodString, {
|
|
|
390
442
|
tool: z.ZodString;
|
|
391
443
|
command: z.ZodString;
|
|
392
444
|
}, "strict", z.ZodTypeAny, {
|
|
393
|
-
tool: string;
|
|
394
445
|
command: string;
|
|
395
|
-
}, {
|
|
396
446
|
tool: string;
|
|
447
|
+
}, {
|
|
397
448
|
command: string;
|
|
449
|
+
tool: string;
|
|
398
450
|
}>, z.ZodObject<{
|
|
399
451
|
tool: z.ZodString;
|
|
400
452
|
file_path: z.ZodString;
|
|
@@ -426,11 +478,11 @@ declare const FixturesSchema: z.ZodObject<{
|
|
|
426
478
|
tool: z.ZodString;
|
|
427
479
|
command: z.ZodString;
|
|
428
480
|
}, "strict", z.ZodTypeAny, {
|
|
429
|
-
tool: string;
|
|
430
481
|
command: string;
|
|
431
|
-
}, {
|
|
432
482
|
tool: string;
|
|
483
|
+
}, {
|
|
433
484
|
command: string;
|
|
485
|
+
tool: string;
|
|
434
486
|
}>, z.ZodObject<{
|
|
435
487
|
tool: z.ZodString;
|
|
436
488
|
file_path: z.ZodString;
|
|
@@ -448,11 +500,11 @@ declare const FixturesSchema: z.ZodObject<{
|
|
|
448
500
|
tool: z.ZodString;
|
|
449
501
|
command: z.ZodString;
|
|
450
502
|
}, "strict", z.ZodTypeAny, {
|
|
451
|
-
tool: string;
|
|
452
503
|
command: string;
|
|
453
|
-
}, {
|
|
454
504
|
tool: string;
|
|
505
|
+
}, {
|
|
455
506
|
command: string;
|
|
507
|
+
tool: string;
|
|
456
508
|
}>, z.ZodObject<{
|
|
457
509
|
tool: z.ZodString;
|
|
458
510
|
file_path: z.ZodString;
|
|
@@ -465,8 +517,8 @@ declare const FixturesSchema: z.ZodObject<{
|
|
|
465
517
|
}>]>, "many">;
|
|
466
518
|
}, "strict", z.ZodTypeAny, {
|
|
467
519
|
block: ({
|
|
468
|
-
tool: string;
|
|
469
520
|
command: string;
|
|
521
|
+
tool: string;
|
|
470
522
|
} | {
|
|
471
523
|
tool: string;
|
|
472
524
|
file_path: string;
|
|
@@ -475,8 +527,8 @@ declare const FixturesSchema: z.ZodObject<{
|
|
|
475
527
|
command: string;
|
|
476
528
|
})[];
|
|
477
529
|
allow: ({
|
|
478
|
-
tool: string;
|
|
479
530
|
command: string;
|
|
531
|
+
tool: string;
|
|
480
532
|
} | {
|
|
481
533
|
tool: string;
|
|
482
534
|
file_path: string;
|
|
@@ -486,15 +538,15 @@ declare const FixturesSchema: z.ZodObject<{
|
|
|
486
538
|
})[];
|
|
487
539
|
}, {
|
|
488
540
|
block: (string | {
|
|
489
|
-
tool: string;
|
|
490
541
|
command: string;
|
|
542
|
+
tool: string;
|
|
491
543
|
} | {
|
|
492
544
|
tool: string;
|
|
493
545
|
file_path: string;
|
|
494
546
|
})[];
|
|
495
547
|
allow: (string | {
|
|
496
|
-
tool: string;
|
|
497
548
|
command: string;
|
|
549
|
+
tool: string;
|
|
498
550
|
} | {
|
|
499
551
|
tool: string;
|
|
500
552
|
file_path: string;
|
|
@@ -546,30 +598,35 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
546
598
|
detail_contains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
547
599
|
detail_matches: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
548
600
|
file_glob: z.ZodOptional<z.ZodString>;
|
|
601
|
+
channel: z.ZodOptional<z.ZodEnum<["command", "content"]>>;
|
|
549
602
|
}, "strict", z.ZodTypeAny, {
|
|
550
603
|
kind: string;
|
|
551
604
|
label?: string | undefined;
|
|
552
605
|
detail_contains?: string[] | undefined;
|
|
553
606
|
detail_matches?: string[] | undefined;
|
|
554
607
|
file_glob?: string | undefined;
|
|
608
|
+
channel?: "command" | "content" | undefined;
|
|
555
609
|
}, {
|
|
556
610
|
kind: string;
|
|
557
611
|
label?: string | undefined;
|
|
558
612
|
detail_contains?: string[] | undefined;
|
|
559
613
|
detail_matches?: string[] | undefined;
|
|
560
614
|
file_glob?: string | undefined;
|
|
615
|
+
channel?: "command" | "content" | undefined;
|
|
561
616
|
}>, {
|
|
562
617
|
kind: string;
|
|
563
618
|
label?: string | undefined;
|
|
564
619
|
detail_contains?: string[] | undefined;
|
|
565
620
|
detail_matches?: string[] | undefined;
|
|
566
621
|
file_glob?: string | undefined;
|
|
622
|
+
channel?: "command" | "content" | undefined;
|
|
567
623
|
}, {
|
|
568
624
|
kind: string;
|
|
569
625
|
label?: string | undefined;
|
|
570
626
|
detail_contains?: string[] | undefined;
|
|
571
627
|
detail_matches?: string[] | undefined;
|
|
572
628
|
file_glob?: string | undefined;
|
|
629
|
+
channel?: "command" | "content" | undefined;
|
|
573
630
|
}>, "many">>;
|
|
574
631
|
all_of: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
575
632
|
kind: z.ZodString;
|
|
@@ -577,30 +634,35 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
577
634
|
detail_contains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
578
635
|
detail_matches: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
579
636
|
file_glob: z.ZodOptional<z.ZodString>;
|
|
637
|
+
channel: z.ZodOptional<z.ZodEnum<["command", "content"]>>;
|
|
580
638
|
}, "strict", z.ZodTypeAny, {
|
|
581
639
|
kind: string;
|
|
582
640
|
label?: string | undefined;
|
|
583
641
|
detail_contains?: string[] | undefined;
|
|
584
642
|
detail_matches?: string[] | undefined;
|
|
585
643
|
file_glob?: string | undefined;
|
|
644
|
+
channel?: "command" | "content" | undefined;
|
|
586
645
|
}, {
|
|
587
646
|
kind: string;
|
|
588
647
|
label?: string | undefined;
|
|
589
648
|
detail_contains?: string[] | undefined;
|
|
590
649
|
detail_matches?: string[] | undefined;
|
|
591
650
|
file_glob?: string | undefined;
|
|
651
|
+
channel?: "command" | "content" | undefined;
|
|
592
652
|
}>, {
|
|
593
653
|
kind: string;
|
|
594
654
|
label?: string | undefined;
|
|
595
655
|
detail_contains?: string[] | undefined;
|
|
596
656
|
detail_matches?: string[] | undefined;
|
|
597
657
|
file_glob?: string | undefined;
|
|
658
|
+
channel?: "command" | "content" | undefined;
|
|
598
659
|
}, {
|
|
599
660
|
kind: string;
|
|
600
661
|
label?: string | undefined;
|
|
601
662
|
detail_contains?: string[] | undefined;
|
|
602
663
|
detail_matches?: string[] | undefined;
|
|
603
664
|
file_glob?: string | undefined;
|
|
665
|
+
channel?: "command" | "content" | undefined;
|
|
604
666
|
}>, "many">>;
|
|
605
667
|
none_of: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
606
668
|
kind: z.ZodString;
|
|
@@ -608,30 +670,35 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
608
670
|
detail_contains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
609
671
|
detail_matches: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
610
672
|
file_glob: z.ZodOptional<z.ZodString>;
|
|
673
|
+
channel: z.ZodOptional<z.ZodEnum<["command", "content"]>>;
|
|
611
674
|
}, "strict", z.ZodTypeAny, {
|
|
612
675
|
kind: string;
|
|
613
676
|
label?: string | undefined;
|
|
614
677
|
detail_contains?: string[] | undefined;
|
|
615
678
|
detail_matches?: string[] | undefined;
|
|
616
679
|
file_glob?: string | undefined;
|
|
680
|
+
channel?: "command" | "content" | undefined;
|
|
617
681
|
}, {
|
|
618
682
|
kind: string;
|
|
619
683
|
label?: string | undefined;
|
|
620
684
|
detail_contains?: string[] | undefined;
|
|
621
685
|
detail_matches?: string[] | undefined;
|
|
622
686
|
file_glob?: string | undefined;
|
|
687
|
+
channel?: "command" | "content" | undefined;
|
|
623
688
|
}>, {
|
|
624
689
|
kind: string;
|
|
625
690
|
label?: string | undefined;
|
|
626
691
|
detail_contains?: string[] | undefined;
|
|
627
692
|
detail_matches?: string[] | undefined;
|
|
628
693
|
file_glob?: string | undefined;
|
|
694
|
+
channel?: "command" | "content" | undefined;
|
|
629
695
|
}, {
|
|
630
696
|
kind: string;
|
|
631
697
|
label?: string | undefined;
|
|
632
698
|
detail_contains?: string[] | undefined;
|
|
633
699
|
detail_matches?: string[] | undefined;
|
|
634
700
|
file_glob?: string | undefined;
|
|
701
|
+
channel?: "command" | "content" | undefined;
|
|
635
702
|
}>, "many">>;
|
|
636
703
|
}, "strict", z.ZodTypeAny, {
|
|
637
704
|
any_of?: {
|
|
@@ -640,6 +707,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
640
707
|
detail_contains?: string[] | undefined;
|
|
641
708
|
detail_matches?: string[] | undefined;
|
|
642
709
|
file_glob?: string | undefined;
|
|
710
|
+
channel?: "command" | "content" | undefined;
|
|
643
711
|
}[] | undefined;
|
|
644
712
|
all_of?: {
|
|
645
713
|
kind: string;
|
|
@@ -647,6 +715,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
647
715
|
detail_contains?: string[] | undefined;
|
|
648
716
|
detail_matches?: string[] | undefined;
|
|
649
717
|
file_glob?: string | undefined;
|
|
718
|
+
channel?: "command" | "content" | undefined;
|
|
650
719
|
}[] | undefined;
|
|
651
720
|
none_of?: {
|
|
652
721
|
kind: string;
|
|
@@ -654,6 +723,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
654
723
|
detail_contains?: string[] | undefined;
|
|
655
724
|
detail_matches?: string[] | undefined;
|
|
656
725
|
file_glob?: string | undefined;
|
|
726
|
+
channel?: "command" | "content" | undefined;
|
|
657
727
|
}[] | undefined;
|
|
658
728
|
}, {
|
|
659
729
|
any_of?: {
|
|
@@ -662,6 +732,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
662
732
|
detail_contains?: string[] | undefined;
|
|
663
733
|
detail_matches?: string[] | undefined;
|
|
664
734
|
file_glob?: string | undefined;
|
|
735
|
+
channel?: "command" | "content" | undefined;
|
|
665
736
|
}[] | undefined;
|
|
666
737
|
all_of?: {
|
|
667
738
|
kind: string;
|
|
@@ -669,6 +740,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
669
740
|
detail_contains?: string[] | undefined;
|
|
670
741
|
detail_matches?: string[] | undefined;
|
|
671
742
|
file_glob?: string | undefined;
|
|
743
|
+
channel?: "command" | "content" | undefined;
|
|
672
744
|
}[] | undefined;
|
|
673
745
|
none_of?: {
|
|
674
746
|
kind: string;
|
|
@@ -676,6 +748,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
676
748
|
detail_contains?: string[] | undefined;
|
|
677
749
|
detail_matches?: string[] | undefined;
|
|
678
750
|
file_glob?: string | undefined;
|
|
751
|
+
channel?: "command" | "content" | undefined;
|
|
679
752
|
}[] | undefined;
|
|
680
753
|
}>, {
|
|
681
754
|
any_of?: {
|
|
@@ -684,6 +757,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
684
757
|
detail_contains?: string[] | undefined;
|
|
685
758
|
detail_matches?: string[] | undefined;
|
|
686
759
|
file_glob?: string | undefined;
|
|
760
|
+
channel?: "command" | "content" | undefined;
|
|
687
761
|
}[] | undefined;
|
|
688
762
|
all_of?: {
|
|
689
763
|
kind: string;
|
|
@@ -691,6 +765,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
691
765
|
detail_contains?: string[] | undefined;
|
|
692
766
|
detail_matches?: string[] | undefined;
|
|
693
767
|
file_glob?: string | undefined;
|
|
768
|
+
channel?: "command" | "content" | undefined;
|
|
694
769
|
}[] | undefined;
|
|
695
770
|
none_of?: {
|
|
696
771
|
kind: string;
|
|
@@ -698,6 +773,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
698
773
|
detail_contains?: string[] | undefined;
|
|
699
774
|
detail_matches?: string[] | undefined;
|
|
700
775
|
file_glob?: string | undefined;
|
|
776
|
+
channel?: "command" | "content" | undefined;
|
|
701
777
|
}[] | undefined;
|
|
702
778
|
}, {
|
|
703
779
|
any_of?: {
|
|
@@ -706,6 +782,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
706
782
|
detail_contains?: string[] | undefined;
|
|
707
783
|
detail_matches?: string[] | undefined;
|
|
708
784
|
file_glob?: string | undefined;
|
|
785
|
+
channel?: "command" | "content" | undefined;
|
|
709
786
|
}[] | undefined;
|
|
710
787
|
all_of?: {
|
|
711
788
|
kind: string;
|
|
@@ -713,6 +790,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
713
790
|
detail_contains?: string[] | undefined;
|
|
714
791
|
detail_matches?: string[] | undefined;
|
|
715
792
|
file_glob?: string | undefined;
|
|
793
|
+
channel?: "command" | "content" | undefined;
|
|
716
794
|
}[] | undefined;
|
|
717
795
|
none_of?: {
|
|
718
796
|
kind: string;
|
|
@@ -720,6 +798,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
720
798
|
detail_contains?: string[] | undefined;
|
|
721
799
|
detail_matches?: string[] | undefined;
|
|
722
800
|
file_glob?: string | undefined;
|
|
801
|
+
channel?: "command" | "content" | undefined;
|
|
723
802
|
}[] | undefined;
|
|
724
803
|
}>;
|
|
725
804
|
fixtures: z.ZodObject<{
|
|
@@ -730,11 +809,11 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
730
809
|
tool: z.ZodString;
|
|
731
810
|
command: z.ZodString;
|
|
732
811
|
}, "strict", z.ZodTypeAny, {
|
|
733
|
-
tool: string;
|
|
734
812
|
command: string;
|
|
735
|
-
}, {
|
|
736
813
|
tool: string;
|
|
814
|
+
}, {
|
|
737
815
|
command: string;
|
|
816
|
+
tool: string;
|
|
738
817
|
}>, z.ZodObject<{
|
|
739
818
|
tool: z.ZodString;
|
|
740
819
|
file_path: z.ZodString;
|
|
@@ -752,11 +831,11 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
752
831
|
tool: z.ZodString;
|
|
753
832
|
command: z.ZodString;
|
|
754
833
|
}, "strict", z.ZodTypeAny, {
|
|
755
|
-
tool: string;
|
|
756
834
|
command: string;
|
|
757
|
-
}, {
|
|
758
835
|
tool: string;
|
|
836
|
+
}, {
|
|
759
837
|
command: string;
|
|
838
|
+
tool: string;
|
|
760
839
|
}>, z.ZodObject<{
|
|
761
840
|
tool: z.ZodString;
|
|
762
841
|
file_path: z.ZodString;
|
|
@@ -769,8 +848,8 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
769
848
|
}>]>, "many">;
|
|
770
849
|
}, "strict", z.ZodTypeAny, {
|
|
771
850
|
block: ({
|
|
772
|
-
tool: string;
|
|
773
851
|
command: string;
|
|
852
|
+
tool: string;
|
|
774
853
|
} | {
|
|
775
854
|
tool: string;
|
|
776
855
|
file_path: string;
|
|
@@ -779,8 +858,8 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
779
858
|
command: string;
|
|
780
859
|
})[];
|
|
781
860
|
allow: ({
|
|
782
|
-
tool: string;
|
|
783
861
|
command: string;
|
|
862
|
+
tool: string;
|
|
784
863
|
} | {
|
|
785
864
|
tool: string;
|
|
786
865
|
file_path: string;
|
|
@@ -790,15 +869,15 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
790
869
|
})[];
|
|
791
870
|
}, {
|
|
792
871
|
block: (string | {
|
|
793
|
-
tool: string;
|
|
794
872
|
command: string;
|
|
873
|
+
tool: string;
|
|
795
874
|
} | {
|
|
796
875
|
tool: string;
|
|
797
876
|
file_path: string;
|
|
798
877
|
})[];
|
|
799
878
|
allow: (string | {
|
|
800
|
-
tool: string;
|
|
801
879
|
command: string;
|
|
880
|
+
tool: string;
|
|
802
881
|
} | {
|
|
803
882
|
tool: string;
|
|
804
883
|
file_path: string;
|
|
@@ -818,6 +897,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
818
897
|
detail_contains?: string[] | undefined;
|
|
819
898
|
detail_matches?: string[] | undefined;
|
|
820
899
|
file_glob?: string | undefined;
|
|
900
|
+
channel?: "command" | "content" | undefined;
|
|
821
901
|
}[] | undefined;
|
|
822
902
|
all_of?: {
|
|
823
903
|
kind: string;
|
|
@@ -825,6 +905,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
825
905
|
detail_contains?: string[] | undefined;
|
|
826
906
|
detail_matches?: string[] | undefined;
|
|
827
907
|
file_glob?: string | undefined;
|
|
908
|
+
channel?: "command" | "content" | undefined;
|
|
828
909
|
}[] | undefined;
|
|
829
910
|
none_of?: {
|
|
830
911
|
kind: string;
|
|
@@ -832,12 +913,13 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
832
913
|
detail_contains?: string[] | undefined;
|
|
833
914
|
detail_matches?: string[] | undefined;
|
|
834
915
|
file_glob?: string | undefined;
|
|
916
|
+
channel?: "command" | "content" | undefined;
|
|
835
917
|
}[] | undefined;
|
|
836
918
|
};
|
|
837
919
|
fixtures: {
|
|
838
920
|
block: ({
|
|
839
|
-
tool: string;
|
|
840
921
|
command: string;
|
|
922
|
+
tool: string;
|
|
841
923
|
} | {
|
|
842
924
|
tool: string;
|
|
843
925
|
file_path: string;
|
|
@@ -846,8 +928,8 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
846
928
|
command: string;
|
|
847
929
|
})[];
|
|
848
930
|
allow: ({
|
|
849
|
-
tool: string;
|
|
850
931
|
command: string;
|
|
932
|
+
tool: string;
|
|
851
933
|
} | {
|
|
852
934
|
tool: string;
|
|
853
935
|
file_path: string;
|
|
@@ -871,6 +953,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
871
953
|
detail_contains?: string[] | undefined;
|
|
872
954
|
detail_matches?: string[] | undefined;
|
|
873
955
|
file_glob?: string | undefined;
|
|
956
|
+
channel?: "command" | "content" | undefined;
|
|
874
957
|
}[] | undefined;
|
|
875
958
|
all_of?: {
|
|
876
959
|
kind: string;
|
|
@@ -878,6 +961,7 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
878
961
|
detail_contains?: string[] | undefined;
|
|
879
962
|
detail_matches?: string[] | undefined;
|
|
880
963
|
file_glob?: string | undefined;
|
|
964
|
+
channel?: "command" | "content" | undefined;
|
|
881
965
|
}[] | undefined;
|
|
882
966
|
none_of?: {
|
|
883
967
|
kind: string;
|
|
@@ -885,19 +969,20 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
885
969
|
detail_contains?: string[] | undefined;
|
|
886
970
|
detail_matches?: string[] | undefined;
|
|
887
971
|
file_glob?: string | undefined;
|
|
972
|
+
channel?: "command" | "content" | undefined;
|
|
888
973
|
}[] | undefined;
|
|
889
974
|
};
|
|
890
975
|
fixtures: {
|
|
891
976
|
block: (string | {
|
|
892
|
-
tool: string;
|
|
893
977
|
command: string;
|
|
978
|
+
tool: string;
|
|
894
979
|
} | {
|
|
895
980
|
tool: string;
|
|
896
981
|
file_path: string;
|
|
897
982
|
})[];
|
|
898
983
|
allow: (string | {
|
|
899
|
-
tool: string;
|
|
900
984
|
command: string;
|
|
985
|
+
tool: string;
|
|
901
986
|
} | {
|
|
902
987
|
tool: string;
|
|
903
988
|
file_path: string;
|
|
@@ -909,6 +994,8 @@ declare const RuleSchema: z.ZodObject<{
|
|
|
909
994
|
type Severity = (typeof SEVERITIES)[number];
|
|
910
995
|
/** What the guard does on a match. */
|
|
911
996
|
type Action = (typeof ACTIONS)[number];
|
|
997
|
+
/** Which text a condition's detail matchers read. */
|
|
998
|
+
type Channel = (typeof CHANNELS)[number];
|
|
912
999
|
/** One condition matched against a tool call. */
|
|
913
1000
|
type MatchCondition = z.infer<typeof MatchConditionSchema>;
|
|
914
1001
|
/** A composed match — `any_of` / `all_of` / `none_of`. */
|
|
@@ -948,4 +1035,4 @@ declare function parseRuleOrThrow(input: unknown): Rule;
|
|
|
948
1035
|
*/
|
|
949
1036
|
declare function defineRule(rule: RuleInput): Rule;
|
|
950
1037
|
|
|
951
|
-
export { type Action as A,
|
|
1038
|
+
export { type Action as A, hasNestedUnboundedQuantifier as B, CHANNELS as C, DETAIL_MATCHES_MAX_PATTERNS as D, parseRule as E, type Fixture as F, parseRuleOrThrow as G, type MatchCondition as M, OWASP_AGENTIC as O, type Rule as R, type Severity as S, type FixtureInput as a, type Fixtures as b, type Match as c, OWASP_IDS as d, OWASP_LLM as e, OWASP_SOURCES as f, type OwaspId as g, type OwaspRisk as h, type RuleInput as i, isOwaspId as j, owaspTitle as k, ACTIONS as l, ActionSchema as m, type Channel as n, owaspIndex as o, ChannelSchema as p, DETAIL_MATCHES_MAX_PATTERN_LENGTH as q, FixtureSchema as r, FixturesSchema as s, MatchConditionSchema as t, MatchSchema as u, OwaspIdsSchema as v, RuleSchema as w, SEVERITIES as x, SeveritySchema as y, defineRule as z };
|