@agenttrail/guardrails 0.2.5 → 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-SLJLCAZK.js → chunk-3BH4CH3D.js} +3 -3
- package/dist/{chunk-SLJLCAZK.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 +29 -37
- package/dist/chunk-U7KZ447W.js.map +0 -1
package/dist/guardrails.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MatchCondition, F as Fixture, R as Rule } from './schema-
|
|
2
|
-
export { A as Action, a as FixtureInput, b as Fixtures, c as Match, O as OWASP_AGENTIC, d as OWASP_IDS, e as OWASP_LLM, f as OWASP_SOURCES, g as OwaspId, h as OwaspRisk, i as RuleInput, S as Severity, j as isOwaspId, o as owaspIndex, k as owaspTitle } from './schema-
|
|
1
|
+
import { M as MatchCondition, F as Fixture, R as Rule } from './schema-DmT-Vm1T.cjs';
|
|
2
|
+
export { A as Action, a as FixtureInput, b as Fixtures, c as Match, O as OWASP_AGENTIC, d as OWASP_IDS, e as OWASP_LLM, f as OWASP_SOURCES, g as OwaspId, h as OwaspRisk, i as RuleInput, S as Severity, j as isOwaspId, o as owaspIndex, k as owaspTitle } from './schema-DmT-Vm1T.cjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -360,7 +360,7 @@ declare function mentions(text: string): Fixture[];
|
|
|
360
360
|
* Pinned to `package.json`'s `version` by `__tests__/stamp.test.ts` — this is a copy
|
|
361
361
|
* of that value, not an independent one, and the test is what makes the copy safe.
|
|
362
362
|
*/
|
|
363
|
-
declare const CATALOG_VERSION = "0.2.
|
|
363
|
+
declare const CATALOG_VERSION = "0.2.7";
|
|
364
364
|
/**
|
|
365
365
|
* When the guardrails in this catalog reached their current state, as an ISO-8601
|
|
366
366
|
* instant. The question it answers is not "when did this reach a registry" but "how
|
|
@@ -370,7 +370,7 @@ declare const CATALOG_VERSION = "0.2.5";
|
|
|
370
370
|
* the guard handles a missing date, and a wrong date that looks right is worse than
|
|
371
371
|
* a missing one.
|
|
372
372
|
*/
|
|
373
|
-
declare const CATALOG_PUBLISHED_AT = "2026-
|
|
373
|
+
declare const CATALOG_PUBLISHED_AT = "2026-11-06T07:10:34Z";
|
|
374
374
|
|
|
375
375
|
/**
|
|
376
376
|
* The corpus itself — guardrails only, and **deliberately free of zod**.
|
package/dist/guardrails.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MatchCondition, F as Fixture, R as Rule } from './schema-
|
|
2
|
-
export { A as Action, a as FixtureInput, b as Fixtures, c as Match, O as OWASP_AGENTIC, d as OWASP_IDS, e as OWASP_LLM, f as OWASP_SOURCES, g as OwaspId, h as OwaspRisk, i as RuleInput, S as Severity, j as isOwaspId, o as owaspIndex, k as owaspTitle } from './schema-
|
|
1
|
+
import { M as MatchCondition, F as Fixture, R as Rule } from './schema-DmT-Vm1T.js';
|
|
2
|
+
export { A as Action, a as FixtureInput, b as Fixtures, c as Match, O as OWASP_AGENTIC, d as OWASP_IDS, e as OWASP_LLM, f as OWASP_SOURCES, g as OwaspId, h as OwaspRisk, i as RuleInput, S as Severity, j as isOwaspId, o as owaspIndex, k as owaspTitle } from './schema-DmT-Vm1T.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -360,7 +360,7 @@ declare function mentions(text: string): Fixture[];
|
|
|
360
360
|
* Pinned to `package.json`'s `version` by `__tests__/stamp.test.ts` — this is a copy
|
|
361
361
|
* of that value, not an independent one, and the test is what makes the copy safe.
|
|
362
362
|
*/
|
|
363
|
-
declare const CATALOG_VERSION = "0.2.
|
|
363
|
+
declare const CATALOG_VERSION = "0.2.7";
|
|
364
364
|
/**
|
|
365
365
|
* When the guardrails in this catalog reached their current state, as an ISO-8601
|
|
366
366
|
* instant. The question it answers is not "when did this reach a registry" but "how
|
|
@@ -370,7 +370,7 @@ declare const CATALOG_VERSION = "0.2.5";
|
|
|
370
370
|
* the guard handles a missing date, and a wrong date that looks right is worse than
|
|
371
371
|
* a missing one.
|
|
372
372
|
*/
|
|
373
|
-
declare const CATALOG_PUBLISHED_AT = "2026-
|
|
373
|
+
declare const CATALOG_PUBLISHED_AT = "2026-11-06T07:10:34Z";
|
|
374
374
|
|
|
375
375
|
/**
|
|
376
376
|
* The corpus itself — guardrails only, and **deliberately free of zod**.
|
package/dist/guardrails.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -24,6 +24,8 @@ __export(src_exports, {
|
|
|
24
24
|
ActionSchema: () => ActionSchema,
|
|
25
25
|
CATALOG_PUBLISHED_AT: () => CATALOG_PUBLISHED_AT,
|
|
26
26
|
CATALOG_VERSION: () => CATALOG_VERSION,
|
|
27
|
+
CHANNELS: () => CHANNELS,
|
|
28
|
+
ChannelSchema: () => ChannelSchema,
|
|
27
29
|
DETAIL_MATCHES_MAX_PATTERNS: () => DETAIL_MATCHES_MAX_PATTERNS,
|
|
28
30
|
DETAIL_MATCHES_MAX_PATTERN_LENGTH: () => DETAIL_MATCHES_MAX_PATTERN_LENGTH,
|
|
29
31
|
FixtureSchema: () => FixtureSchema,
|
|
@@ -4058,8 +4060,8 @@ function owaspTitle(id) {
|
|
|
4058
4060
|
}
|
|
4059
4061
|
|
|
4060
4062
|
// src/stamp.ts
|
|
4061
|
-
var CATALOG_VERSION = "0.2.
|
|
4062
|
-
var CATALOG_PUBLISHED_AT = "2026-
|
|
4063
|
+
var CATALOG_VERSION = "0.2.7";
|
|
4064
|
+
var CATALOG_PUBLISHED_AT = "2026-11-06T07:10:34Z";
|
|
4063
4065
|
|
|
4064
4066
|
// src/rules.ts
|
|
4065
4067
|
var RULES_BY_PACK = {
|
|
@@ -4166,14 +4168,23 @@ var DetailMatchPatternSchema = import_zod.z.string().min(1).max(DETAIL_MATCHES_M
|
|
|
4166
4168
|
});
|
|
4167
4169
|
}
|
|
4168
4170
|
});
|
|
4171
|
+
var CHANNELS = ["command", "content"];
|
|
4172
|
+
var ChannelSchema = import_zod.z.enum(CHANNELS);
|
|
4169
4173
|
var MatchConditionSchema = import_zod.z.object({
|
|
4170
4174
|
kind: import_zod.z.string().min(1),
|
|
4171
4175
|
label: import_zod.z.string().min(1).optional(),
|
|
4172
4176
|
detail_contains: import_zod.z.array(import_zod.z.string().min(1)).min(1).optional(),
|
|
4173
4177
|
detail_matches: import_zod.z.array(DetailMatchPatternSchema).min(1).max(DETAIL_MATCHES_MAX_PATTERNS).optional(),
|
|
4174
|
-
file_glob: import_zod.z.string().min(1).optional()
|
|
4178
|
+
file_glob: import_zod.z.string().min(1).optional(),
|
|
4179
|
+
channel: ChannelSchema.optional()
|
|
4175
4180
|
}).strict().superRefine((condition, ctx) => {
|
|
4176
4181
|
const hasCommandMatcher = condition.detail_contains !== void 0 || condition.detail_matches !== void 0;
|
|
4182
|
+
if (condition.channel !== void 0 && !hasCommandMatcher) {
|
|
4183
|
+
ctx.addIssue({
|
|
4184
|
+
code: import_zod.z.ZodIssueCode.custom,
|
|
4185
|
+
message: "`channel` says which text detail_contains / detail_matches read, so a condition carrying it needs one of them"
|
|
4186
|
+
});
|
|
4187
|
+
}
|
|
4177
4188
|
if (hasCommandMatcher && condition.file_glob !== void 0) {
|
|
4178
4189
|
ctx.addIssue({
|
|
4179
4190
|
code: import_zod.z.ZodIssueCode.custom,
|