agenteval-toolkit 0.1.0__py3-none-any.whl
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.
- agenteval/__init__.py +5 -0
- agenteval/_starter/certification/policy.yaml +15 -0
- agenteval/_starter/certification/systems/northwind-cs-staging.yaml +16 -0
- agenteval/_starter/certification/systems/northwind-cs.yaml +17 -0
- agenteval/_starter/examples/agents/demo-good.yaml +41 -0
- agenteval/_starter/examples/agents/demo-weak.yaml +34 -0
- agenteval/_starter/examples/agents/openai-compatible.example.yaml +15 -0
- agenteval/_starter/examples/agents/webhook.example.yaml +21 -0
- agenteval/_starter/examples/attestations-certification.yaml +16 -0
- agenteval/_starter/examples/attestations.yaml +19 -0
- agenteval/_starter/examples/snapshots/sample-cluster.json +323 -0
- agenteval/_starter/exams/customer-service/cs-ecommerce-v1.yaml +222 -0
- agenteval/_starter/rules/industry-pci-dss/i18n/zh.yaml +27 -0
- agenteval/_starter/rules/industry-pci-dss/pack.yaml +9 -0
- agenteval/_starter/rules/industry-pci-dss/rules.yaml +83 -0
- agenteval/_starter/rules/us-ca/i18n/zh.yaml +21 -0
- agenteval/_starter/rules/us-ca/pack.yaml +9 -0
- agenteval/_starter/rules/us-ca/rules.yaml +72 -0
- agenteval/_starter/rules/us-federal/governance.yaml +216 -0
- agenteval/_starter/rules/us-federal/i18n/zh.yaml +107 -0
- agenteval/_starter/rules/us-federal/pack.yaml +8 -0
- agenteval/_starter/rules/us-federal/security.yaml +164 -0
- agenteval/certification/__init__.py +16 -0
- agenteval/certification/assess.py +137 -0
- agenteval/certification/issuer.py +165 -0
- agenteval/certification/models.py +113 -0
- agenteval/certification/render.py +100 -0
- agenteval/certification/signing.py +86 -0
- agenteval/cli.py +533 -0
- agenteval/collectors/__init__.py +30 -0
- agenteval/collectors/kubernetes.py +70 -0
- agenteval/collectors/normalize.py +247 -0
- agenteval/config.py +49 -0
- agenteval/engine/__init__.py +12 -0
- agenteval/engine/conditions.py +109 -0
- agenteval/engine/evaluator.py +133 -0
- agenteval/engine/loader.py +131 -0
- agenteval/evaluation/__init__.py +17 -0
- agenteval/evaluation/adapters.py +276 -0
- agenteval/evaluation/assertions.py +73 -0
- agenteval/evaluation/judges.py +214 -0
- agenteval/evaluation/messages.py +56 -0
- agenteval/evaluation/models.py +174 -0
- agenteval/evaluation/papers.py +103 -0
- agenteval/evaluation/report.py +80 -0
- agenteval/evaluation/runner.py +154 -0
- agenteval/i18n.py +118 -0
- agenteval/models.py +136 -0
- agenteval/reports/__init__.py +86 -0
- agenteval/reports/templates/certificate.html.j2 +178 -0
- agenteval/reports/templates/eval_report.html.j2 +191 -0
- agenteval/reports/templates/report.html.j2 +75 -0
- agenteval/schema.py +66 -0
- agenteval/schemas/attestations.schema.json +76 -0
- agenteval/schemas/exam.schema.json +85 -0
- agenteval/schemas/pack.schema.json +48 -0
- agenteval/schemas/policy.schema.json +67 -0
- agenteval/schemas/rule.schema.json +298 -0
- agenteval/schemas/system.schema.json +76 -0
- agenteval/schemas/translations.schema.json +32 -0
- agenteval_toolkit-0.1.0.dist-info/METADATA +307 -0
- agenteval_toolkit-0.1.0.dist-info/RECORD +67 -0
- agenteval_toolkit-0.1.0.dist-info/WHEEL +5 -0
- agenteval_toolkit-0.1.0.dist-info/entry_points.txt +2 -0
- agenteval_toolkit-0.1.0.dist-info/licenses/LICENSE +202 -0
- agenteval_toolkit-0.1.0.dist-info/licenses/NOTICE +19 -0
- agenteval_toolkit-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://agenteval.dev/schemas/v1/rule.schema.json",
|
|
4
|
+
"title": "AgentEval rule file",
|
|
5
|
+
"description": "A rules YAML file: a single rule, a list of rules, or {rules: [...]}.",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "#/$defs/rule"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": {
|
|
13
|
+
"$ref": "#/$defs/rule"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"type": "object",
|
|
18
|
+
"required": [
|
|
19
|
+
"rules"
|
|
20
|
+
],
|
|
21
|
+
"additionalProperties": false,
|
|
22
|
+
"properties": {
|
|
23
|
+
"rules": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": {
|
|
26
|
+
"$ref": "#/$defs/rule"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"$defs": {
|
|
33
|
+
"condition": {
|
|
34
|
+
"oneOf": [
|
|
35
|
+
{
|
|
36
|
+
"type": "object",
|
|
37
|
+
"required": [
|
|
38
|
+
"all"
|
|
39
|
+
],
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"properties": {
|
|
42
|
+
"all": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"minItems": 1,
|
|
45
|
+
"items": {
|
|
46
|
+
"$ref": "#/$defs/condition"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "object",
|
|
53
|
+
"required": [
|
|
54
|
+
"any"
|
|
55
|
+
],
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"properties": {
|
|
58
|
+
"any": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"minItems": 1,
|
|
61
|
+
"items": {
|
|
62
|
+
"$ref": "#/$defs/condition"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"type": "object",
|
|
69
|
+
"required": [
|
|
70
|
+
"not"
|
|
71
|
+
],
|
|
72
|
+
"additionalProperties": false,
|
|
73
|
+
"properties": {
|
|
74
|
+
"not": {
|
|
75
|
+
"$ref": "#/$defs/condition"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"type": "object",
|
|
81
|
+
"required": [
|
|
82
|
+
"field",
|
|
83
|
+
"op"
|
|
84
|
+
],
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"properties": {
|
|
87
|
+
"field": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$"
|
|
90
|
+
},
|
|
91
|
+
"op": {
|
|
92
|
+
"enum": [
|
|
93
|
+
"eq",
|
|
94
|
+
"ne",
|
|
95
|
+
"in",
|
|
96
|
+
"not_in",
|
|
97
|
+
"exists",
|
|
98
|
+
"not_exists",
|
|
99
|
+
"truthy",
|
|
100
|
+
"falsy",
|
|
101
|
+
"contains",
|
|
102
|
+
"not_contains",
|
|
103
|
+
"regex",
|
|
104
|
+
"gt",
|
|
105
|
+
"gte",
|
|
106
|
+
"lt",
|
|
107
|
+
"lte",
|
|
108
|
+
"empty",
|
|
109
|
+
"not_empty"
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"value": {}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
"rule": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"required": [
|
|
120
|
+
"id",
|
|
121
|
+
"title",
|
|
122
|
+
"description",
|
|
123
|
+
"severity",
|
|
124
|
+
"type",
|
|
125
|
+
"category",
|
|
126
|
+
"applies_to",
|
|
127
|
+
"remediation",
|
|
128
|
+
"sources"
|
|
129
|
+
],
|
|
130
|
+
"additionalProperties": false,
|
|
131
|
+
"properties": {
|
|
132
|
+
"id": {
|
|
133
|
+
"description": "Unique rule ID: an uppercase prefix plus segments, e.g. FED-SEC-001.",
|
|
134
|
+
"type": "string",
|
|
135
|
+
"pattern": "^[A-Z]{2,6}(-[A-Z0-9]{2,8})+$"
|
|
136
|
+
},
|
|
137
|
+
"title": {
|
|
138
|
+
"description": "One-line requirement, phrased as what must be true.",
|
|
139
|
+
"type": "string",
|
|
140
|
+
"minLength": 3
|
|
141
|
+
},
|
|
142
|
+
"description": {
|
|
143
|
+
"description": "Why the rule exists and what it checks.",
|
|
144
|
+
"type": "string",
|
|
145
|
+
"minLength": 3
|
|
146
|
+
},
|
|
147
|
+
"severity": {
|
|
148
|
+
"description": "critical/high block certification by default.",
|
|
149
|
+
"enum": [
|
|
150
|
+
"critical",
|
|
151
|
+
"high",
|
|
152
|
+
"medium",
|
|
153
|
+
"low",
|
|
154
|
+
"info"
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
"type": {
|
|
158
|
+
"description": "automated = evaluated from collected facts; attestation = needs human evidence.",
|
|
159
|
+
"enum": [
|
|
160
|
+
"automated",
|
|
161
|
+
"attestation"
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"jurisdiction": {
|
|
165
|
+
"description": "Optional override; normally inherited from pack.yaml.",
|
|
166
|
+
"type": "string"
|
|
167
|
+
},
|
|
168
|
+
"category": {
|
|
169
|
+
"description": "Free-form grouping, e.g. security, governance, privacy.",
|
|
170
|
+
"type": "string"
|
|
171
|
+
},
|
|
172
|
+
"applies_to": {
|
|
173
|
+
"description": "Which assets the rule targets.",
|
|
174
|
+
"type": "object",
|
|
175
|
+
"required": [
|
|
176
|
+
"asset_types"
|
|
177
|
+
],
|
|
178
|
+
"additionalProperties": false,
|
|
179
|
+
"properties": {
|
|
180
|
+
"asset_types": {
|
|
181
|
+
"type": "array",
|
|
182
|
+
"minItems": 1,
|
|
183
|
+
"items": {
|
|
184
|
+
"type": "string"
|
|
185
|
+
},
|
|
186
|
+
"description": "Asset types, e.g. inference_service, cluster."
|
|
187
|
+
},
|
|
188
|
+
"when": {
|
|
189
|
+
"description": "Optional pre-filter; if false the rule is not_applicable.",
|
|
190
|
+
"$ref": "#/$defs/condition"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
"check": {
|
|
195
|
+
"description": "Condition that must evaluate to true for the asset to PASS (automated rules).",
|
|
196
|
+
"$ref": "#/$defs/condition"
|
|
197
|
+
},
|
|
198
|
+
"attestation": {
|
|
199
|
+
"description": "Evidence a human must supply (attestation rules).",
|
|
200
|
+
"type": "object",
|
|
201
|
+
"required": [
|
|
202
|
+
"evidence_required"
|
|
203
|
+
],
|
|
204
|
+
"additionalProperties": false,
|
|
205
|
+
"properties": {
|
|
206
|
+
"evidence_required": {
|
|
207
|
+
"type": "array",
|
|
208
|
+
"minItems": 1,
|
|
209
|
+
"items": {
|
|
210
|
+
"type": "string"
|
|
211
|
+
},
|
|
212
|
+
"description": "Evidence keys that must all be present and non-empty."
|
|
213
|
+
},
|
|
214
|
+
"max_age_days": {
|
|
215
|
+
"type": "integer",
|
|
216
|
+
"minimum": 1,
|
|
217
|
+
"description": "Attestation older than this fails."
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"remediation": {
|
|
222
|
+
"description": "Concrete fix shown in reports.",
|
|
223
|
+
"type": "string"
|
|
224
|
+
},
|
|
225
|
+
"sources": {
|
|
226
|
+
"description": "Regulatory or framework references. Mark verified: true only after legal review.",
|
|
227
|
+
"type": "array",
|
|
228
|
+
"minItems": 1,
|
|
229
|
+
"items": {
|
|
230
|
+
"type": "object",
|
|
231
|
+
"required": [
|
|
232
|
+
"framework",
|
|
233
|
+
"reference"
|
|
234
|
+
],
|
|
235
|
+
"additionalProperties": false,
|
|
236
|
+
"properties": {
|
|
237
|
+
"framework": {
|
|
238
|
+
"type": "string"
|
|
239
|
+
},
|
|
240
|
+
"reference": {
|
|
241
|
+
"type": "string"
|
|
242
|
+
},
|
|
243
|
+
"url": {
|
|
244
|
+
"type": "string"
|
|
245
|
+
},
|
|
246
|
+
"verified": {
|
|
247
|
+
"type": "boolean"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"effective_date": {
|
|
253
|
+
"description": "ISO date the obligation takes effect (quote it in YAML).",
|
|
254
|
+
"type": "string",
|
|
255
|
+
"format": "date"
|
|
256
|
+
},
|
|
257
|
+
"version": {
|
|
258
|
+
"description": "Bump when the rule logic changes.",
|
|
259
|
+
"type": "string"
|
|
260
|
+
},
|
|
261
|
+
"enabled": {
|
|
262
|
+
"description": "Set false to keep a rule in the repo without running it.",
|
|
263
|
+
"type": "boolean"
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"allOf": [
|
|
267
|
+
{
|
|
268
|
+
"if": {
|
|
269
|
+
"properties": {
|
|
270
|
+
"type": {
|
|
271
|
+
"const": "automated"
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"then": {
|
|
276
|
+
"required": [
|
|
277
|
+
"check"
|
|
278
|
+
]
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"if": {
|
|
283
|
+
"properties": {
|
|
284
|
+
"type": {
|
|
285
|
+
"const": "attestation"
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"then": {
|
|
290
|
+
"required": [
|
|
291
|
+
"attestation"
|
|
292
|
+
]
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://agenteval.dev/schemas/v1/system.schema.json",
|
|
4
|
+
"title": "AgentEval AI system registration (certification/systems/*.yaml)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"id",
|
|
9
|
+
"name",
|
|
10
|
+
"organization",
|
|
11
|
+
"asset_id",
|
|
12
|
+
"agent_name",
|
|
13
|
+
"exam",
|
|
14
|
+
"rule_packs"
|
|
15
|
+
],
|
|
16
|
+
"properties": {
|
|
17
|
+
"id": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"pattern": "^[a-z0-9][a-z0-9-]{1,62}$"
|
|
20
|
+
},
|
|
21
|
+
"name": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"minLength": 1
|
|
24
|
+
},
|
|
25
|
+
"name_zh": {
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"organization": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"minLength": 1
|
|
31
|
+
},
|
|
32
|
+
"industry": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
"description": {
|
|
36
|
+
"type": "string"
|
|
37
|
+
},
|
|
38
|
+
"description_zh": {
|
|
39
|
+
"type": "string"
|
|
40
|
+
},
|
|
41
|
+
"asset_id": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"pattern": "^[a-z]+/[^/]+(/[^/]+)?$",
|
|
44
|
+
"description": "Scanned asset, e.g. deployment/<namespace>/<name>."
|
|
45
|
+
},
|
|
46
|
+
"model": {
|
|
47
|
+
"type": "string"
|
|
48
|
+
},
|
|
49
|
+
"agent": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"description": "Optional agent config file name."
|
|
52
|
+
},
|
|
53
|
+
"agent_name": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"minLength": 1,
|
|
56
|
+
"description": "Agent name recorded in evaluation runs."
|
|
57
|
+
},
|
|
58
|
+
"exam": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"minLength": 1,
|
|
61
|
+
"description": "Exam paper ID the agent must pass."
|
|
62
|
+
},
|
|
63
|
+
"rule_packs": {
|
|
64
|
+
"type": "array",
|
|
65
|
+
"minItems": 1,
|
|
66
|
+
"uniqueItems": true,
|
|
67
|
+
"items": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"pattern": "^[a-z0-9][a-z0-9-]{1,62}$"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"contact": {
|
|
73
|
+
"type": "string"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://agenteval.dev/schemas/v1/translations.schema.json",
|
|
4
|
+
"title": "AgentEval rule translations (i18n/<lang>.yaml)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"propertyNames": {
|
|
7
|
+
"pattern": "^[A-Z]{2,6}(-[A-Z0-9]{2,8})+$"
|
|
8
|
+
},
|
|
9
|
+
"additionalProperties": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"additionalProperties": false,
|
|
12
|
+
"minProperties": 1,
|
|
13
|
+
"properties": {
|
|
14
|
+
"title": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"description": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"remediation": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"sources": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"description": "Translated source references, in the same order as the rule's sources."
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|