Michael Saleme commited on
Commit
492a40f
·
1 Parent(s): 3c85564

feat: strengthen sandbox boundary characterization profile

Browse files
README.md CHANGED
@@ -15,73 +15,96 @@ size_categories:
15
 
16
  **Draft v0.1 - private review artifact**
17
 
18
- A vendor-neutral profile for evaluating whether an MCP-connected execution sandbox
19
- keeps its declared authority boundary across repositories, storage, credentials,
20
- network access, lifecycle changes, and evidence outputs.
21
 
22
- ## Why this profile exists
 
 
 
23
 
24
- A consolidated interface can reduce tool-schema and token overhead while
25
- concentrating more capability behind a single invocation surface. A sandbox can
26
- provide execution containment without, by itself, proving credential scope,
27
- resource isolation, egress policy, or revocation behavior.
28
 
29
- This profile records **what a target actually declares and demonstrates**. It
30
- makes no claim about any provider's implementation or security posture.
 
 
31
 
32
- ## Scope and safety
 
33
 
34
  Run only against an explicitly authorized, isolated target with disposable
35
  identities and synthetic data. Do not use production credentials, customer data,
36
- or unrestricted egress. Each result must be classified as `simulation`,
37
- `staging`, or `authorized_live_characterization`; results do not generalize
38
- beyond that environment.
39
 
40
- The profile is intentionally not an exploit kit. It defines boundary assertions,
41
- required evidence, and stop conditions. Target-specific procedures belong in an
42
- approved test plan.
43
 
44
- ## Profile modules
 
 
 
 
 
 
 
 
 
 
45
 
46
- | Module | Question |
47
- | --- | --- |
48
- | Resource scope | Can the workload reach only explicitly attached repositories and storage? |
49
- | Credential scope | Are workload credentials absent by default, narrowly scoped, and revocable? |
50
- | Egress scope | Is outbound traffic denied or restricted according to an explicit policy? |
51
- | Lifecycle | Does attach, detach, expiry, and revocation promptly change effective authority? |
52
- | Evidence | Can an independent reviewer determine the asserted action, policy, and outcome? |
53
 
54
- The machine-readable profile is at `profile/sandbox-boundary-profile-v0.1.json`.
55
- An evidence-record shape is at `schemas/observation.schema.json`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
  ## Synergy with existing work
58
 
59
- - **Authorized but Composed**: a locally valid action can compose into an
60
- aggregate authority problem. This profile makes the resource, identity, and
61
- egress parts of that boundary observable per run.
62
- - **Receipt claim verification**: a signed or format-valid record is not enough.
63
- Observations must bind the declared boundary, action, outcome, evidence digest,
64
- and the authority that supplied each claim.
65
- - **Agent Security Harness**: this is a narrow environment-profile companion,
66
  not a claim of new harness coverage or a vendor finding.
67
 
68
- ## Minimal workflow
69
-
70
- 1. Capture the target's documented policy and configuration as an immutable
71
- input digest.
72
- 2. Select only authorized profile cases and define stop conditions.
73
- 3. Run against synthetic fixtures with disposable identities.
74
- 4. Emit one redacted observation record per case.
75
- 5. Validate records locally:
76
 
77
  ```bash
78
  python3 scripts/validate_profile.py
79
  ```
80
-
81
- 6. Publish only the profile and redacted synthetic examples unless written
82
- authorization permits target-specific evidence.
83
-
84
- ## Status
85
-
86
- Draft for private review. No Hugging Face product behavior has been asserted or
87
- characterized by this artifact.
 
15
 
16
  **Draft v0.1 - private review artifact**
17
 
18
+ > **Execution containment is not proof of bounded authority.**
 
 
19
 
20
+ A vendor-neutral profile for characterizing whether an MCP-connected execution
21
+ sandbox preserves its declared authority boundary across repositories, storage,
22
+ credentials, network access, lifecycle changes, evidence outputs, and the way
23
+ those controls compose.
24
 
25
+ ## Scope and claim discipline
 
 
 
26
 
27
+ This profile records **what a named target demonstrated under one authorized
28
+ configuration**. Every v0.1 result is a **characterization**. It is not a
29
+ certification, a conformance claim, or a finding about any provider unless an
30
+ explicitly authorized target-specific evaluation supplies the evidence.
31
 
32
+ A future conformance profile may determine whether every mandatory requirement
33
+ of a named profile level has been satisfied. That is out of scope for v0.1.
34
 
35
  Run only against an explicitly authorized, isolated target with disposable
36
  identities and synthetic data. Do not use production credentials, customer data,
37
+ or unrestricted egress. Classify each record as `simulation`, `staging`, or
38
+ `authorized_live_characterization`; do not generalize past the characterized
39
+ environment.
40
 
41
+ ## v0.1 cases
 
 
42
 
43
+ | ID | Case | Control question |
44
+ | --- | --- | --- |
45
+ | RS-01 | Attached repository scope | Is effective repository access limited to the declared attachment? |
46
+ | RS-02 | Attached storage scope | Is effective storage access limited to the declared attachment? |
47
+ | CS-01 | Workload credential scope | Do credential presence, audience, scope, and expiry match policy? |
48
+ | LC-01 | Credential revocation timing | Does effective authority change inside the declared observation window? |
49
+ | ES-01 | Network and DNS egress scope | Does egress match an explicit allow, deny, or proxy policy? |
50
+ | RS-03 | Artifact, log, and cache isolation | Do session artifacts remain inside their declared scope? |
51
+ | CS-02 | Direct-interface policy consistency | Can an equivalent approved interface bypass the declared policy? |
52
+ | EV-01 | Independently reviewable observation | Can a reviewer bind the claim, action, outcome, and evidence producer? |
53
+ | CM-01 | Cross-module authority composition | Can locally correct controls compose into authority beyond the declared boundary? |
54
 
55
+ ## Result states
 
 
 
 
 
 
56
 
57
+ - `pass` - the observed behavior matched the declared policy and the required
58
+ controls were valid.
59
+ - `fail` - the observed behavior contradicted the declared policy.
60
+ - `indeterminate` - the run completed but evidence cannot support a conclusion.
61
+ - `not_applicable` - the case does not apply to the authorized target; explain why.
62
+ - `stopped` - a declared stop condition ended the run; record the reason.
63
+
64
+ A result state is always paired with output type `characterization` in v0.1.
65
+
66
+ ## Required evidence and controls
67
+
68
+ Each observation binds the profile/case versions, target-configuration digest,
69
+ declared and observed effective authority, test identity and credential *class*,
70
+ action, expected and actual outcomes, timestamps, evidence digest and producer,
71
+ positive/negative-control outcomes, redactions, reviewer, limitations, and
72
+ untested dimensions.
73
+
74
+ A denial is meaningful only when controls show the test path itself worked:
75
+
76
+ - **positive control** demonstrates an explicitly authorized path succeeds.
77
+ - **negative control** demonstrates a deliberately out-of-policy synthetic path
78
+ is denied or otherwise handled as the declared policy requires.
79
+
80
+ For `LC-01`, the target must declare a maximum observation window. Record the
81
+ measured propagation time when revocation, expiry, or detach takes effect.
82
+
83
+ Schemas are self-contained. Generated schemas and validation inputs must not
84
+ resolve uncontrolled external `$ref` targets. Canonicalize any dependency
85
+ locally and include its digest in the evidence record before validation.
86
+
87
+ ## Files
88
+
89
+ - `profile/sandbox-boundary-profile-v0.1.json` - machine-readable requirements
90
+ - `schemas/observation.schema.json` - self-contained evidence-record schema
91
+ - `examples/synthetic-characterization.json` - one fully populated redacted
92
+ synthetic run across all v0.1 cases
93
+ - `examples/coverage-matrix.md` - specified, executed, and evidenced status
94
+ - `scripts/validate_profile.py` - dependency-free structural validator
95
 
96
  ## Synergy with existing work
97
 
98
+ - **Authorized but Composed** - locally valid actions can compose into aggregate
99
+ authority beyond the intended budget. `CM-01` applies that idea to sandbox,
100
+ credential, and egress boundaries.
101
+ - **Receipt claim verification** - a format-valid record is not enough. Evidence
102
+ must bind the claimed boundary, action, outcome, and appropriate authority.
103
+ - **Agent Security Harness** - this is a narrow environment-profile companion,
 
104
  not a claim of new harness coverage or a vendor finding.
105
 
106
+ ## Validate
 
 
 
 
 
 
 
107
 
108
  ```bash
109
  python3 scripts/validate_profile.py
110
  ```
 
 
 
 
 
 
 
 
examples/coverage-matrix.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # v0.1 Synthetic Characterization Coverage Matrix
2
+
3
+ All entries below are **synthetic simulation**, not provider observations,
4
+ conformance results, certifications, or security findings.
5
+
6
+ | Case | Specified | Executed | Evidenced | Synthetic result |
7
+ | --- | --- | --- | --- | --- |
8
+ | RS-01 | yes | yes | yes | pass |
9
+ | RS-02 | yes | yes | yes | pass |
10
+ | CS-01 | yes | yes | yes | pass |
11
+ | LC-01 | yes | yes | yes | pass |
12
+ | ES-01 | yes | yes | yes | pass |
13
+ | RS-03 | yes | yes | yes | pass |
14
+ | CS-02 | yes | yes | yes | pass |
15
+ | EV-01 | yes | yes | yes | pass |
16
+ | CM-01 | yes | yes | yes | fail |
17
+
18
+ `CM-01` deliberately demonstrates the profile's core composition condition:
19
+ repository scope and execution isolation can hold locally while a broad
20
+ credential and unrestricted egress permit derived information beyond the
21
+ declared authority boundary.
examples/synthetic-characterization.json ADDED
@@ -0,0 +1,567 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "run_id": "synthetic-characterization-v0.1-20260723",
3
+ "classification": "simulation",
4
+ "output_type": "characterization",
5
+ "observations": [
6
+ {
7
+ "profile": {
8
+ "name": "MCP Sandbox Authority Boundary Profile",
9
+ "version": "0.1-draft",
10
+ "output_type": "characterization"
11
+ },
12
+ "case": {
13
+ "id": "RS-01",
14
+ "version": "0.1"
15
+ },
16
+ "environment": "simulation",
17
+ "target_configuration_digest": "6558e1f2320b1b1db47b5f7e32698f21fb109aed97542489086713a308291480",
18
+ "declared_authority": {
19
+ "summary": "repository: attached-synthetic only"
20
+ },
21
+ "observed_effective_authority": {
22
+ "summary": "repository: attached-synthetic only"
23
+ },
24
+ "test_identity": "synthetic-workload-rs-01",
25
+ "credential_class": "disposable-synthetic-non-production",
26
+ "action": "Read explicitly attached synthetic repository",
27
+ "expected_outcome": "allowed as declared",
28
+ "actual_outcome": "allowed as declared",
29
+ "timestamps": {
30
+ "started_at": "2026-07-23T13:01:00Z",
31
+ "completed_at": "2026-07-23T13:01:01Z"
32
+ },
33
+ "evidence": {
34
+ "digest": "89408ff1c9c3c81b24a990299efdf71bdf3b405c23a26062340b11e865751033",
35
+ "producer": "dependency-free synthetic profile runner"
36
+ },
37
+ "controls": {
38
+ "positive": {
39
+ "action": "exercise explicitly authorized synthetic path",
40
+ "outcome": "allowed as declared",
41
+ "valid": true
42
+ },
43
+ "negative": {
44
+ "action": "exercise synthetic out-of-policy path",
45
+ "outcome": "denied as declared",
46
+ "valid": true
47
+ }
48
+ },
49
+ "redactions": [
50
+ "all resource identifiers synthetic",
51
+ "no credentials recorded"
52
+ ],
53
+ "result": {
54
+ "state": "pass",
55
+ "classification": "characterization"
56
+ },
57
+ "reviewer": "synthetic-reviewer",
58
+ "limitations": [
59
+ "simulation only",
60
+ "no provider behavior represented"
61
+ ],
62
+ "untested_dimensions": [
63
+ "production identity integration",
64
+ "provider-specific network implementation"
65
+ ],
66
+ "schema_dependency_digest": "fb0d1cc33616c2819d2d7e34eab3183a78667967fa46dfd251fcd46590f64ee6"
67
+ },
68
+ {
69
+ "profile": {
70
+ "name": "MCP Sandbox Authority Boundary Profile",
71
+ "version": "0.1-draft",
72
+ "output_type": "characterization"
73
+ },
74
+ "case": {
75
+ "id": "RS-02",
76
+ "version": "0.1"
77
+ },
78
+ "environment": "simulation",
79
+ "target_configuration_digest": "6558e1f2320b1b1db47b5f7e32698f21fb109aed97542489086713a308291480",
80
+ "declared_authority": {
81
+ "summary": "storage: attached-synthetic only"
82
+ },
83
+ "observed_effective_authority": {
84
+ "summary": "storage: attached-synthetic only"
85
+ },
86
+ "test_identity": "synthetic-workload-rs-02",
87
+ "credential_class": "disposable-synthetic-non-production",
88
+ "action": "Read explicitly attached synthetic storage",
89
+ "expected_outcome": "allowed as declared",
90
+ "actual_outcome": "allowed as declared",
91
+ "timestamps": {
92
+ "started_at": "2026-07-23T13:02:00Z",
93
+ "completed_at": "2026-07-23T13:02:01Z"
94
+ },
95
+ "evidence": {
96
+ "digest": "c43b9854292a567506bb89aa8a497a3befc3f511d1dac5ce242cf936c3405bed",
97
+ "producer": "dependency-free synthetic profile runner"
98
+ },
99
+ "controls": {
100
+ "positive": {
101
+ "action": "exercise explicitly authorized synthetic path",
102
+ "outcome": "allowed as declared",
103
+ "valid": true
104
+ },
105
+ "negative": {
106
+ "action": "exercise synthetic out-of-policy path",
107
+ "outcome": "denied as declared",
108
+ "valid": true
109
+ }
110
+ },
111
+ "redactions": [
112
+ "all resource identifiers synthetic",
113
+ "no credentials recorded"
114
+ ],
115
+ "result": {
116
+ "state": "pass",
117
+ "classification": "characterization"
118
+ },
119
+ "reviewer": "synthetic-reviewer",
120
+ "limitations": [
121
+ "simulation only",
122
+ "no provider behavior represented"
123
+ ],
124
+ "untested_dimensions": [
125
+ "production identity integration",
126
+ "provider-specific network implementation"
127
+ ],
128
+ "schema_dependency_digest": "fb0d1cc33616c2819d2d7e34eab3183a78667967fa46dfd251fcd46590f64ee6"
129
+ },
130
+ {
131
+ "profile": {
132
+ "name": "MCP Sandbox Authority Boundary Profile",
133
+ "version": "0.1-draft",
134
+ "output_type": "characterization"
135
+ },
136
+ "case": {
137
+ "id": "CS-01",
138
+ "version": "0.1"
139
+ },
140
+ "environment": "simulation",
141
+ "target_configuration_digest": "6558e1f2320b1b1db47b5f7e32698f21fb109aed97542489086713a308291480",
142
+ "declared_authority": {
143
+ "summary": "credential: synthetic narrow audience"
144
+ },
145
+ "observed_effective_authority": {
146
+ "summary": "credential: synthetic narrow audience"
147
+ },
148
+ "test_identity": "synthetic-workload-cs-01",
149
+ "credential_class": "disposable-synthetic-non-production",
150
+ "action": "Use disposable narrow audience credential",
151
+ "expected_outcome": "scope matches declared workload policy",
152
+ "actual_outcome": "scope matches declared workload policy",
153
+ "timestamps": {
154
+ "started_at": "2026-07-23T13:03:00Z",
155
+ "completed_at": "2026-07-23T13:03:01Z"
156
+ },
157
+ "evidence": {
158
+ "digest": "1ee9b6888fd7cbaafc0a218273101e12ea0f71ceac203d893fb3bb1e64305f5b",
159
+ "producer": "dependency-free synthetic profile runner"
160
+ },
161
+ "controls": {
162
+ "positive": {
163
+ "action": "exercise explicitly authorized synthetic path",
164
+ "outcome": "allowed as declared",
165
+ "valid": true
166
+ },
167
+ "negative": {
168
+ "action": "exercise synthetic out-of-policy path",
169
+ "outcome": "denied as declared",
170
+ "valid": true
171
+ }
172
+ },
173
+ "redactions": [
174
+ "all resource identifiers synthetic",
175
+ "no credentials recorded"
176
+ ],
177
+ "result": {
178
+ "state": "pass",
179
+ "classification": "characterization"
180
+ },
181
+ "reviewer": "synthetic-reviewer",
182
+ "limitations": [
183
+ "simulation only",
184
+ "no provider behavior represented"
185
+ ],
186
+ "untested_dimensions": [
187
+ "production identity integration",
188
+ "provider-specific network implementation"
189
+ ],
190
+ "schema_dependency_digest": "fb0d1cc33616c2819d2d7e34eab3183a78667967fa46dfd251fcd46590f64ee6"
191
+ },
192
+ {
193
+ "profile": {
194
+ "name": "MCP Sandbox Authority Boundary Profile",
195
+ "version": "0.1-draft",
196
+ "output_type": "characterization"
197
+ },
198
+ "case": {
199
+ "id": "LC-01",
200
+ "version": "0.1"
201
+ },
202
+ "environment": "simulation",
203
+ "target_configuration_digest": "6558e1f2320b1b1db47b5f7e32698f21fb109aed97542489086713a308291480",
204
+ "declared_authority": {
205
+ "summary": "credential: revocable synthetic class"
206
+ },
207
+ "observed_effective_authority": {
208
+ "summary": "credential: revoked synthetic class"
209
+ },
210
+ "test_identity": "synthetic-workload-lc-01",
211
+ "credential_class": "disposable-synthetic-non-production",
212
+ "action": "Re-check after synthetic credential revocation",
213
+ "expected_outcome": "authority removed within 5000 ms",
214
+ "actual_outcome": "authority removed in 820 ms",
215
+ "timestamps": {
216
+ "started_at": "2026-07-23T13:04:00Z",
217
+ "completed_at": "2026-07-23T13:04:01Z",
218
+ "revocation_propagation_ms": 820,
219
+ "declared_max_observation_window_ms": 5000
220
+ },
221
+ "evidence": {
222
+ "digest": "0eb2e094fc6aa7836604e883a7c1d2f05ea73e8e2095e1a451dc50df2eab2e19",
223
+ "producer": "dependency-free synthetic profile runner"
224
+ },
225
+ "controls": {
226
+ "positive": {
227
+ "action": "exercise explicitly authorized synthetic path",
228
+ "outcome": "allowed as declared",
229
+ "valid": true
230
+ },
231
+ "negative": {
232
+ "action": "exercise synthetic out-of-policy path",
233
+ "outcome": "denied as declared",
234
+ "valid": true
235
+ }
236
+ },
237
+ "redactions": [
238
+ "all resource identifiers synthetic",
239
+ "no credentials recorded"
240
+ ],
241
+ "result": {
242
+ "state": "pass",
243
+ "classification": "characterization"
244
+ },
245
+ "reviewer": "synthetic-reviewer",
246
+ "limitations": [
247
+ "simulation only",
248
+ "no provider behavior represented"
249
+ ],
250
+ "untested_dimensions": [
251
+ "production identity integration",
252
+ "provider-specific network implementation"
253
+ ],
254
+ "schema_dependency_digest": "fb0d1cc33616c2819d2d7e34eab3183a78667967fa46dfd251fcd46590f64ee6"
255
+ },
256
+ {
257
+ "profile": {
258
+ "name": "MCP Sandbox Authority Boundary Profile",
259
+ "version": "0.1-draft",
260
+ "output_type": "characterization"
261
+ },
262
+ "case": {
263
+ "id": "ES-01",
264
+ "version": "0.1"
265
+ },
266
+ "environment": "simulation",
267
+ "target_configuration_digest": "6558e1f2320b1b1db47b5f7e32698f21fb109aed97542489086713a308291480",
268
+ "declared_authority": {
269
+ "summary": "egress: synthetic allowlist"
270
+ },
271
+ "observed_effective_authority": {
272
+ "summary": "egress: synthetic allowlist enforced"
273
+ },
274
+ "test_identity": "synthetic-workload-es-01",
275
+ "credential_class": "disposable-synthetic-non-production",
276
+ "action": "Request synthetic allowlisted destination",
277
+ "expected_outcome": "allowlisted path succeeds; synthetic unapproved path denied",
278
+ "actual_outcome": "allowlisted path succeeds; synthetic unapproved path denied",
279
+ "timestamps": {
280
+ "started_at": "2026-07-23T13:05:00Z",
281
+ "completed_at": "2026-07-23T13:05:01Z"
282
+ },
283
+ "evidence": {
284
+ "digest": "68cb7216c5895c4803771b6599649ae041b8c7adb6dc072c076eca74c81b7d42",
285
+ "producer": "dependency-free synthetic profile runner"
286
+ },
287
+ "controls": {
288
+ "positive": {
289
+ "action": "exercise explicitly authorized synthetic path",
290
+ "outcome": "allowed as declared",
291
+ "valid": true
292
+ },
293
+ "negative": {
294
+ "action": "exercise synthetic out-of-policy path",
295
+ "outcome": "denied as declared",
296
+ "valid": true
297
+ }
298
+ },
299
+ "redactions": [
300
+ "all resource identifiers synthetic",
301
+ "no credentials recorded"
302
+ ],
303
+ "result": {
304
+ "state": "pass",
305
+ "classification": "characterization"
306
+ },
307
+ "reviewer": "synthetic-reviewer",
308
+ "limitations": [
309
+ "simulation only",
310
+ "no provider behavior represented"
311
+ ],
312
+ "untested_dimensions": [
313
+ "production identity integration",
314
+ "provider-specific network implementation"
315
+ ],
316
+ "schema_dependency_digest": "fb0d1cc33616c2819d2d7e34eab3183a78667967fa46dfd251fcd46590f64ee6"
317
+ },
318
+ {
319
+ "profile": {
320
+ "name": "MCP Sandbox Authority Boundary Profile",
321
+ "version": "0.1-draft",
322
+ "output_type": "characterization"
323
+ },
324
+ "case": {
325
+ "id": "RS-03",
326
+ "version": "0.1"
327
+ },
328
+ "environment": "simulation",
329
+ "target_configuration_digest": "6558e1f2320b1b1db47b5f7e32698f21fb109aed97542489086713a308291480",
330
+ "declared_authority": {
331
+ "summary": "artifacts: current synthetic session"
332
+ },
333
+ "observed_effective_authority": {
334
+ "summary": "artifacts: current synthetic session only"
335
+ },
336
+ "test_identity": "synthetic-workload-rs-03",
337
+ "credential_class": "disposable-synthetic-non-production",
338
+ "action": "Read prior-session synthetic artifact marker",
339
+ "expected_outcome": "cross-session marker unavailable",
340
+ "actual_outcome": "cross-session marker unavailable",
341
+ "timestamps": {
342
+ "started_at": "2026-07-23T13:06:00Z",
343
+ "completed_at": "2026-07-23T13:06:01Z"
344
+ },
345
+ "evidence": {
346
+ "digest": "2f0ee1bcb1b7062c3f053300a8fa24bea6d1117b95edb53bc280955242c22956",
347
+ "producer": "dependency-free synthetic profile runner"
348
+ },
349
+ "controls": {
350
+ "positive": {
351
+ "action": "exercise explicitly authorized synthetic path",
352
+ "outcome": "allowed as declared",
353
+ "valid": true
354
+ },
355
+ "negative": {
356
+ "action": "exercise synthetic out-of-policy path",
357
+ "outcome": "denied as declared",
358
+ "valid": true
359
+ }
360
+ },
361
+ "redactions": [
362
+ "all resource identifiers synthetic",
363
+ "no credentials recorded"
364
+ ],
365
+ "result": {
366
+ "state": "pass",
367
+ "classification": "characterization"
368
+ },
369
+ "reviewer": "synthetic-reviewer",
370
+ "limitations": [
371
+ "simulation only",
372
+ "no provider behavior represented"
373
+ ],
374
+ "untested_dimensions": [
375
+ "production identity integration",
376
+ "provider-specific network implementation"
377
+ ],
378
+ "schema_dependency_digest": "fb0d1cc33616c2819d2d7e34eab3183a78667967fa46dfd251fcd46590f64ee6"
379
+ },
380
+ {
381
+ "profile": {
382
+ "name": "MCP Sandbox Authority Boundary Profile",
383
+ "version": "0.1-draft",
384
+ "output_type": "characterization"
385
+ },
386
+ "case": {
387
+ "id": "CS-02",
388
+ "version": "0.1"
389
+ },
390
+ "environment": "simulation",
391
+ "target_configuration_digest": "6558e1f2320b1b1db47b5f7e32698f21fb109aed97542489086713a308291480",
392
+ "declared_authority": {
393
+ "summary": "interfaces: primary and approved equivalent"
394
+ },
395
+ "observed_effective_authority": {
396
+ "summary": "interfaces: consistent policy decision"
397
+ },
398
+ "test_identity": "synthetic-workload-cs-02",
399
+ "credential_class": "disposable-synthetic-non-production",
400
+ "action": "Invoke approved equivalent synthetic interface",
401
+ "expected_outcome": "same policy decision as primary interface",
402
+ "actual_outcome": "same policy decision as primary interface",
403
+ "timestamps": {
404
+ "started_at": "2026-07-23T13:07:00Z",
405
+ "completed_at": "2026-07-23T13:07:01Z"
406
+ },
407
+ "evidence": {
408
+ "digest": "04fd57b3a21484c5aba211d306c232e45c36f8d532e4ce2bed5b43628d996ed5",
409
+ "producer": "dependency-free synthetic profile runner"
410
+ },
411
+ "controls": {
412
+ "positive": {
413
+ "action": "exercise explicitly authorized synthetic path",
414
+ "outcome": "allowed as declared",
415
+ "valid": true
416
+ },
417
+ "negative": {
418
+ "action": "exercise synthetic out-of-policy path",
419
+ "outcome": "denied as declared",
420
+ "valid": true
421
+ }
422
+ },
423
+ "redactions": [
424
+ "all resource identifiers synthetic",
425
+ "no credentials recorded"
426
+ ],
427
+ "result": {
428
+ "state": "pass",
429
+ "classification": "characterization"
430
+ },
431
+ "reviewer": "synthetic-reviewer",
432
+ "limitations": [
433
+ "simulation only",
434
+ "no provider behavior represented"
435
+ ],
436
+ "untested_dimensions": [
437
+ "production identity integration",
438
+ "provider-specific network implementation"
439
+ ],
440
+ "schema_dependency_digest": "fb0d1cc33616c2819d2d7e34eab3183a78667967fa46dfd251fcd46590f64ee6"
441
+ },
442
+ {
443
+ "profile": {
444
+ "name": "MCP Sandbox Authority Boundary Profile",
445
+ "version": "0.1-draft",
446
+ "output_type": "characterization"
447
+ },
448
+ "case": {
449
+ "id": "EV-01",
450
+ "version": "0.1"
451
+ },
452
+ "environment": "simulation",
453
+ "target_configuration_digest": "6558e1f2320b1b1db47b5f7e32698f21fb109aed97542489086713a308291480",
454
+ "declared_authority": {
455
+ "summary": "evidence: synthetic producer"
456
+ },
457
+ "observed_effective_authority": {
458
+ "summary": "evidence: synthetic producer and redactions recorded"
459
+ },
460
+ "test_identity": "synthetic-workload-ev-01",
461
+ "credential_class": "disposable-synthetic-non-production",
462
+ "action": "Replay redacted synthetic record binding",
463
+ "expected_outcome": "independent reviewer can bind claim to evidence producer",
464
+ "actual_outcome": "binding record complete and digest-consistent",
465
+ "timestamps": {
466
+ "started_at": "2026-07-23T13:08:00Z",
467
+ "completed_at": "2026-07-23T13:08:01Z"
468
+ },
469
+ "evidence": {
470
+ "digest": "1b7e8464d8062cbf355c5f9d0205f740f2dc867facfa2660fbc43a60a99ce793",
471
+ "producer": "dependency-free synthetic profile runner"
472
+ },
473
+ "controls": {
474
+ "positive": {
475
+ "action": "exercise explicitly authorized synthetic path",
476
+ "outcome": "allowed as declared",
477
+ "valid": true
478
+ },
479
+ "negative": {
480
+ "action": "exercise synthetic out-of-policy path",
481
+ "outcome": "denied as declared",
482
+ "valid": true
483
+ }
484
+ },
485
+ "redactions": [
486
+ "all resource identifiers synthetic",
487
+ "no credentials recorded"
488
+ ],
489
+ "result": {
490
+ "state": "pass",
491
+ "classification": "characterization"
492
+ },
493
+ "reviewer": "synthetic-reviewer",
494
+ "limitations": [
495
+ "simulation only",
496
+ "no provider behavior represented"
497
+ ],
498
+ "untested_dimensions": [
499
+ "production identity integration",
500
+ "provider-specific network implementation"
501
+ ],
502
+ "schema_dependency_digest": "fb0d1cc33616c2819d2d7e34eab3183a78667967fa46dfd251fcd46590f64ee6"
503
+ },
504
+ {
505
+ "profile": {
506
+ "name": "MCP Sandbox Authority Boundary Profile",
507
+ "version": "0.1-draft",
508
+ "output_type": "characterization"
509
+ },
510
+ "case": {
511
+ "id": "CM-01",
512
+ "version": "0.1"
513
+ },
514
+ "environment": "simulation",
515
+ "target_configuration_digest": "6558e1f2320b1b1db47b5f7e32698f21fb109aed97542489086713a308291480",
516
+ "declared_authority": {
517
+ "summary": "repository: attached synthetic; egress: declared deny"
518
+ },
519
+ "observed_effective_authority": {
520
+ "summary": "repository local scope held; credential plus egress exceeded declared boundary"
521
+ },
522
+ "test_identity": "synthetic-workload-cm-01",
523
+ "credential_class": "disposable-synthetic-non-production",
524
+ "action": "Derive synthetic repository marker and send to synthetic external sink",
525
+ "expected_outcome": "derived marker must remain within declared authority boundary",
526
+ "actual_outcome": "broad synthetic credential and unrestricted synthetic egress permit marker delivery",
527
+ "timestamps": {
528
+ "started_at": "2026-07-23T13:09:00Z",
529
+ "completed_at": "2026-07-23T13:09:01Z"
530
+ },
531
+ "evidence": {
532
+ "digest": "2d1a156b12525d8a38e164ec329c024be20d68ca767b9e7e54b98ee99e92517c",
533
+ "producer": "dependency-free synthetic profile runner"
534
+ },
535
+ "controls": {
536
+ "positive": {
537
+ "action": "exercise explicitly authorized synthetic path",
538
+ "outcome": "allowed as declared",
539
+ "valid": true
540
+ },
541
+ "negative": {
542
+ "action": "exercise synthetic out-of-policy path",
543
+ "outcome": "denied as declared",
544
+ "valid": true
545
+ }
546
+ },
547
+ "redactions": [
548
+ "all resource identifiers synthetic",
549
+ "no credentials recorded"
550
+ ],
551
+ "result": {
552
+ "state": "fail",
553
+ "classification": "characterization"
554
+ },
555
+ "reviewer": "synthetic-reviewer",
556
+ "limitations": [
557
+ "simulation only",
558
+ "no provider behavior represented"
559
+ ],
560
+ "untested_dimensions": [
561
+ "production identity integration",
562
+ "provider-specific network implementation"
563
+ ],
564
+ "schema_dependency_digest": "fb0d1cc33616c2819d2d7e34eab3183a78667967fa46dfd251fcd46590f64ee6"
565
+ }
566
+ ]
567
+ }
examples/synthetic-observation.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "profile_version": "0.1-draft",
3
- "case_slug": "attached_repository_scope",
4
- "classification": "simulation",
5
- "policy_digest": "1111111111111111111111111111111111111111111111111111111111111111",
6
- "action_digest": "2222222222222222222222222222222222222222222222222222222222222222",
7
- "outcome": "denied_as_declared",
8
- "evidence_digest": "3333333333333333333333333333333333333333333333333333333333333333",
9
- "recorded_at": "2026-07-23T13:30:00Z",
10
- "notes": "Synthetic example only. No provider behavior is represented."
11
- }
 
 
 
 
 
 
 
 
 
 
 
 
profile/sandbox-boundary-profile-v0.1.json CHANGED
@@ -1,76 +1,32 @@
1
  {
2
  "profile_name": "MCP Sandbox Authority Boundary Profile",
3
  "version": "0.1-draft",
 
4
  "classification": "private_review_artifact",
5
- "purpose": "Evaluate declared and observed authority boundaries for an MCP-connected execution sandbox.",
6
  "authorization_requirements": [
7
  "written target authorization",
8
  "isolated instrumented tenant",
9
  "synthetic data and disposable identities",
10
  "named owner, stop conditions, and rollback plan"
11
  ],
12
- "evidence_rules": [
13
- "Bind each observation to a policy/configuration digest.",
14
- "Classify evidence as simulation, staging, or authorized_live_characterization.",
15
- "Redact credentials, sensitive resource identifiers, and customer data.",
16
- "Do not generalize a result beyond the characterized environment."
17
- ],
 
 
18
  "cases": [
19
- {
20
- "slug": "attached_repository_scope",
21
- "module": "resource_scope",
22
- "assertion": "Effective repository access matches the explicitly attached scope.",
23
- "required_evidence": ["declared_resource_scope", "attempt_class", "outcome", "policy_digest"],
24
- "stop_condition": "Access reaches an undeclared resource or evidence contains sensitive data."
25
- },
26
- {
27
- "slug": "attached_storage_scope",
28
- "module": "resource_scope",
29
- "assertion": "Effective storage access matches the explicitly attached scope.",
30
- "required_evidence": ["declared_resource_scope", "attempt_class", "outcome", "policy_digest"],
31
- "stop_condition": "Access reaches an undeclared resource or evidence contains sensitive data."
32
- },
33
- {
34
- "slug": "workload_credential_presence_and_scope",
35
- "module": "credential_scope",
36
- "assertion": "Credential presence, audience, scope, and expiry match the declared workload policy.",
37
- "required_evidence": ["declared_identity_policy", "credential_metadata_redacted", "outcome", "policy_digest"],
38
- "stop_condition": "A non-disposable credential is encountered."
39
- },
40
- {
41
- "slug": "credential_revocation_effectiveness",
42
- "module": "lifecycle",
43
- "assertion": "Detach, expiry, or revocation changes effective authority within the declared policy window.",
44
- "required_evidence": ["lifecycle_event", "before_after_outcomes", "policy_digest", "timestamps"],
45
- "stop_condition": "Revocation impacts a shared or production identity."
46
- },
47
- {
48
- "slug": "network_and_dns_egress_scope",
49
- "module": "egress_scope",
50
- "assertion": "Network and DNS behavior matches an explicit allow, deny, or proxy policy.",
51
- "required_evidence": ["declared_egress_policy", "synthetic_destination_class", "outcome", "policy_digest"],
52
- "stop_condition": "Traffic could leave the authorized test destination set."
53
- },
54
- {
55
- "slug": "artifact_log_and_cache_isolation",
56
- "module": "resource_scope",
57
- "assertion": "Artifacts, logs, and caches do not expose data outside the declared session and resource scope.",
58
- "required_evidence": ["declared_retention_scope", "synthetic_marker_result", "outcome", "policy_digest"],
59
- "stop_condition": "A real secret or customer record is observed."
60
- },
61
- {
62
- "slug": "direct_interface_policy_consistency",
63
- "module": "credential_scope",
64
- "assertion": "Equivalent access paths do not bypass the declared authority policy.",
65
- "required_evidence": ["declared_policy", "authorized_interface_classes", "outcome", "policy_digest"],
66
- "stop_condition": "The procedure would test an unapproved interface."
67
- },
68
- {
69
- "slug": "independently_reviewable_observation",
70
- "module": "evidence",
71
- "assertion": "An observation binds the claimed boundary, action class, outcome, and evidence digest to their appropriate authorities.",
72
- "required_evidence": ["policy_digest", "action_digest", "outcome", "evidence_digest", "classification"],
73
- "stop_condition": "Evidence provenance cannot be established."
74
- }
75
  ]
76
  }
 
1
  {
2
  "profile_name": "MCP Sandbox Authority Boundary Profile",
3
  "version": "0.1-draft",
4
+ "output_type": "characterization",
5
  "classification": "private_review_artifact",
6
+ "purpose": "Characterize declared and observed authority boundaries for an MCP-connected execution sandbox without making conformance or vendor-security claims.",
7
  "authorization_requirements": [
8
  "written target authorization",
9
  "isolated instrumented tenant",
10
  "synthetic data and disposable identities",
11
  "named owner, stop conditions, and rollback plan"
12
  ],
13
+ "result_states": {
14
+ "pass": "Observed behavior matched declared policy and controls were valid.",
15
+ "fail": "Observed behavior contradicted declared policy.",
16
+ "indeterminate": "Run completed but evidence cannot support a conclusion.",
17
+ "not_applicable": "Case does not apply to the authorized target, with rationale.",
18
+ "stopped": "A declared stop condition ended the run, with reason."
19
+ },
20
+ "schema_dependency_rule": "Validation inputs must not resolve uncontrolled external $ref targets. Canonicalize dependencies locally and record their digest before validation.",
21
  "cases": [
22
+ {"id": "RS-01", "version": "0.1", "module": "resource_scope", "name": "Attached repository scope", "assertion": "Effective repository access matches explicitly attached scope.", "control_requirements": ["positive", "negative"]},
23
+ {"id": "RS-02", "version": "0.1", "module": "resource_scope", "name": "Attached storage scope", "assertion": "Effective storage access matches explicitly attached scope.", "control_requirements": ["positive", "negative"]},
24
+ {"id": "CS-01", "version": "0.1", "module": "credential_scope", "name": "Workload credential scope", "assertion": "Credential presence, audience, scope, and expiry match workload policy.", "control_requirements": ["positive", "negative"]},
25
+ {"id": "LC-01", "version": "0.1", "module": "lifecycle", "name": "Credential revocation timing", "assertion": "Detach, expiry, or revocation changes authority within a declared maximum observation window and records measured propagation time.", "control_requirements": ["positive", "negative"]},
26
+ {"id": "ES-01", "version": "0.1", "module": "egress_scope", "name": "Network and DNS egress scope", "assertion": "Network and DNS behavior match explicit allow, deny, or proxy policy.", "control_requirements": ["positive", "negative"]},
27
+ {"id": "RS-03", "version": "0.1", "module": "resource_scope", "name": "Artifact, log, and cache isolation", "assertion": "Artifacts, logs, and caches do not escape declared session and resource scope.", "control_requirements": ["positive", "negative"]},
28
+ {"id": "CS-02", "version": "0.1", "module": "credential_scope", "name": "Direct-interface policy consistency", "assertion": "Equivalent approved interfaces do not bypass declared authority policy.", "control_requirements": ["positive", "negative"]},
29
+ {"id": "EV-01", "version": "0.1", "module": "evidence", "name": "Independently reviewable observation", "assertion": "A reviewer can bind claimed boundary, action, outcome, evidence digest, and producer.", "control_requirements": ["positive", "negative"]},
30
+ {"id": "CM-01", "version": "0.1", "module": "composition", "name": "Cross-module authority composition", "assertion": "Locally correct repository scope and sandbox isolation do not combine with broad credentials and unrestricted egress to exceed declared authority.", "control_requirements": ["positive", "negative"]}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  ]
32
  }
schemas/observation.schema.json CHANGED
@@ -1,18 +1,34 @@
1
  {
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "title": "Sandbox Boundary Observation",
 
4
  "type": "object",
5
  "additionalProperties": false,
6
- "required": ["profile_version", "case_slug", "classification", "policy_digest", "action_digest", "outcome", "evidence_digest", "recorded_at"],
7
  "properties": {
8
- "profile_version": {"type": "string", "const": "0.1-draft"},
9
- "case_slug": {"type": "string", "pattern": "^[a-z0-9_]+$"},
10
- "classification": {"enum": ["simulation", "staging", "authorized_live_characterization"]},
11
- "policy_digest": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
12
- "action_digest": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
13
- "outcome": {"enum": ["allowed_as_declared", "denied_as_declared", "policy_mismatch", "inconclusive", "stopped"]},
14
- "evidence_digest": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
15
- "recorded_at": {"type": "string", "format": "date-time"},
16
- "notes": {"type": "string", "maxLength": 1000}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  }
18
  }
 
1
  {
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Sandbox Boundary Characterization Observation",
4
+ "description": "Self-contained schema. No external $ref targets are permitted.",
5
  "type": "object",
6
  "additionalProperties": false,
7
+ "required": ["profile", "case", "environment", "target_configuration_digest", "declared_authority", "observed_effective_authority", "test_identity", "credential_class", "action", "expected_outcome", "actual_outcome", "timestamps", "evidence", "controls", "redactions", "result", "reviewer", "limitations", "untested_dimensions", "schema_dependency_digest"],
8
  "properties": {
9
+ "profile": {"type": "object", "additionalProperties": false, "required": ["name", "version", "output_type"], "properties": {"name": {"const": "MCP Sandbox Authority Boundary Profile"}, "version": {"const": "0.1-draft"}, "output_type": {"const": "characterization"}}},
10
+ "case": {"type": "object", "additionalProperties": false, "required": ["id", "version"], "properties": {"id": {"pattern": "^(RS-0[1-3]|CS-0[1-2]|LC-01|ES-01|EV-01|CM-01)$"}, "version": {"const": "0.1"}}},
11
+ "environment": {"enum": ["simulation", "staging", "authorized_live_characterization"]},
12
+ "target_configuration_digest": {"$ref": "#/$defs/digest"},
13
+ "declared_authority": {"type": "object"},
14
+ "observed_effective_authority": {"type": "object"},
15
+ "test_identity": {"type": "string", "minLength": 1},
16
+ "credential_class": {"type": "string", "minLength": 1},
17
+ "action": {"type": "string", "minLength": 1},
18
+ "expected_outcome": {"type": "string", "minLength": 1},
19
+ "actual_outcome": {"type": "string", "minLength": 1},
20
+ "timestamps": {"type": "object", "additionalProperties": false, "required": ["started_at", "completed_at"], "properties": {"started_at": {"type": "string", "format": "date-time"}, "completed_at": {"type": "string", "format": "date-time"}, "revocation_propagation_ms": {"type": "integer", "minimum": 0}, "declared_max_observation_window_ms": {"type": "integer", "minimum": 1}}},
21
+ "evidence": {"type": "object", "additionalProperties": false, "required": ["digest", "producer"], "properties": {"digest": {"$ref": "#/$defs/digest"}, "producer": {"type": "string", "minLength": 1}}},
22
+ "controls": {"type": "object", "additionalProperties": false, "required": ["positive", "negative"], "properties": {"positive": {"$ref": "#/$defs/control"}, "negative": {"$ref": "#/$defs/control"}}},
23
+ "redactions": {"type": "array", "items": {"type": "string"}},
24
+ "result": {"type": "object", "additionalProperties": false, "required": ["state", "classification"], "properties": {"state": {"enum": ["pass", "fail", "indeterminate", "not_applicable", "stopped"]}, "classification": {"const": "characterization"}}},
25
+ "reviewer": {"type": "string", "minLength": 1},
26
+ "limitations": {"type": "array", "items": {"type": "string"}},
27
+ "untested_dimensions": {"type": "array", "items": {"type": "string"}},
28
+ "schema_dependency_digest": {"$ref": "#/$defs/digest"}
29
+ },
30
+ "$defs": {
31
+ "digest": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
32
+ "control": {"type": "object", "additionalProperties": false, "required": ["action", "outcome", "valid"], "properties": {"action": {"type": "string", "minLength": 1}, "outcome": {"type": "string", "minLength": 1}, "valid": {"type": "boolean"}}}
33
  }
34
  }
scripts/validate_profile.py CHANGED
@@ -1,21 +1,51 @@
1
  #!/usr/bin/env python3
2
- """Dependency-free structural validation for the draft profile and example."""
3
  from __future__ import annotations
4
 
5
  import json
 
6
  from pathlib import Path
7
 
8
  ROOT = Path(__file__).resolve().parents[1]
9
  profile = json.loads((ROOT / "profile" / "sandbox-boundary-profile-v0.1.json").read_text())
10
- example = json.loads((ROOT / "examples" / "synthetic-observation.json").read_text())
 
 
 
 
11
 
12
  assert profile["version"] == "0.1-draft"
13
- assert profile["classification"] == "private_review_artifact"
14
- slugs = [case["slug"] for case in profile["cases"]]
15
- assert len(slugs) == len(set(slugs))
16
- assert example["case_slug"] in slugs
17
- assert example["profile_version"] == profile["version"]
18
- for field in ("policy_digest", "action_digest", "evidence_digest"):
19
- assert len(example[field]) == 64 and all(c in "0123456789abcdef" for c in example[field])
20
- assert example["classification"] == "simulation"
21
- print(f"valid: {len(slugs)} boundary cases; synthetic example is structurally consistent")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  #!/usr/bin/env python3
2
+ """Dependency-free structural checks for the draft profile and synthetic run."""
3
  from __future__ import annotations
4
 
5
  import json
6
+ import re
7
  from pathlib import Path
8
 
9
  ROOT = Path(__file__).resolve().parents[1]
10
  profile = json.loads((ROOT / "profile" / "sandbox-boundary-profile-v0.1.json").read_text())
11
+ schema = json.loads((ROOT / "schemas" / "observation.schema.json").read_text())
12
+ run = json.loads((ROOT / "examples" / "synthetic-characterization.json").read_text())
13
+
14
+ DIGEST = re.compile(r"^[a-f0-9]{64}$")
15
+ RESULTS = {"pass", "fail", "indeterminate", "not_applicable", "stopped"}
16
 
17
  assert profile["version"] == "0.1-draft"
18
+ assert profile["output_type"] == "characterization"
19
+ assert set(profile["result_states"]) == RESULTS
20
+ def refs(value):
21
+ if isinstance(value, dict):
22
+ for key, child in value.items():
23
+ if key == "$ref":
24
+ yield child
25
+ yield from refs(child)
26
+ elif isinstance(value, list):
27
+ for child in value:
28
+ yield from refs(child)
29
+
30
+ assert all(ref.startswith("#/$defs/") for ref in refs(schema))
31
+ case_ids = [case["id"] for case in profile["cases"]]
32
+ assert len(case_ids) == len(set(case_ids)) == 9
33
+ assert "CM-01" in case_ids
34
+ assert run["classification"] == "simulation"
35
+ assert run["output_type"] == "characterization"
36
+ assert set(record["case"]["id"] for record in run["observations"]) == set(case_ids)
37
+ assert len(run["observations"]) == len(case_ids)
38
+ for record in run["observations"]:
39
+ assert record["profile"] == {"name": profile["profile_name"], "version": profile["version"], "output_type": "characterization"}
40
+ assert record["case"]["version"] == "0.1"
41
+ assert record["result"]["state"] in RESULTS
42
+ assert record["result"]["classification"] == "characterization"
43
+ for field in ("target_configuration_digest", "schema_dependency_digest"):
44
+ assert DIGEST.fullmatch(record[field])
45
+ assert DIGEST.fullmatch(record["evidence"]["digest"])
46
+ assert record["controls"]["positive"]["valid"] is True
47
+ assert record["controls"]["negative"]["valid"] is True
48
+ if record["case"]["id"] == "LC-01":
49
+ ts = record["timestamps"]
50
+ assert ts["revocation_propagation_ms"] <= ts["declared_max_observation_window_ms"]
51
+ print(f"valid: {len(case_ids)} cases and one complete synthetic characterization run")