@highflame/policy 1.2.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +219 -0
  2. package/_schemas/overwatch/context.json +433 -0
  3. package/_schemas/overwatch/schema.cedarschema +179 -0
  4. package/_schemas/palisade/context.json +325 -0
  5. package/_schemas/palisade/schema.cedarschema +168 -0
  6. package/dist/builder.d.ts +1 -2
  7. package/dist/builder.d.ts.map +1 -1
  8. package/dist/builder.js +16 -3
  9. package/dist/builder.js.map +1 -1
  10. package/dist/context.gen.d.ts +1 -94
  11. package/dist/context.gen.d.ts.map +1 -1
  12. package/dist/context.gen.js +1 -97
  13. package/dist/context.gen.js.map +1 -1
  14. package/dist/engine.d.ts +18 -18
  15. package/dist/engine.d.ts.map +1 -1
  16. package/dist/engine.js +44 -28
  17. package/dist/engine.js.map +1 -1
  18. package/dist/engine.test.js.map +1 -1
  19. package/dist/entities.gen.d.ts +1 -0
  20. package/dist/entities.gen.d.ts.map +1 -1
  21. package/dist/entities.gen.js +1 -0
  22. package/dist/entities.gen.js.map +1 -1
  23. package/dist/index.d.ts +4 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +5 -0
  26. package/dist/index.js.map +1 -1
  27. package/dist/overwatch-context.gen.d.ts +29 -0
  28. package/dist/overwatch-context.gen.d.ts.map +1 -0
  29. package/dist/overwatch-context.gen.js +30 -0
  30. package/dist/overwatch-context.gen.js.map +1 -0
  31. package/dist/palisade-context.gen.d.ts +25 -0
  32. package/dist/palisade-context.gen.d.ts.map +1 -0
  33. package/dist/palisade-context.gen.js +26 -0
  34. package/dist/palisade-context.gen.js.map +1 -0
  35. package/dist/schema.gen.d.ts +1 -1
  36. package/dist/schema.gen.d.ts.map +1 -1
  37. package/dist/schema.gen.js +60 -541
  38. package/dist/schema.gen.js.map +1 -1
  39. package/dist/schemas.d.ts +64 -0
  40. package/dist/schemas.d.ts.map +1 -0
  41. package/dist/schemas.js +70 -0
  42. package/dist/schemas.js.map +1 -0
  43. package/dist/schemas.test.d.ts +8 -0
  44. package/dist/schemas.test.d.ts.map +1 -0
  45. package/dist/schemas.test.js +377 -0
  46. package/dist/schemas.test.js.map +1 -0
  47. package/dist/service-schemas.gen.d.ts +48 -0
  48. package/dist/service-schemas.gen.d.ts.map +1 -0
  49. package/dist/service-schemas.gen.js +581 -0
  50. package/dist/service-schemas.gen.js.map +1 -0
  51. package/dist/studio-ui.test.d.ts +8 -0
  52. package/dist/studio-ui.test.d.ts.map +1 -0
  53. package/dist/studio-ui.test.js +165 -0
  54. package/dist/studio-ui.test.js.map +1 -0
  55. package/dist/types.d.ts +4 -0
  56. package/dist/types.d.ts.map +1 -1
  57. package/dist/types.js +5 -0
  58. package/dist/types.js.map +1 -1
  59. package/package.json +9 -6
  60. package/src/builder.ts +18 -5
  61. package/src/context.gen.ts +0 -97
  62. package/src/engine.test.ts +0 -1
  63. package/src/engine.ts +62 -33
  64. package/src/entities.gen.ts +1 -0
  65. package/src/index.ts +17 -0
  66. package/src/overwatch-context.gen.ts +32 -0
  67. package/src/palisade-context.gen.ts +28 -0
  68. package/src/schema.gen.ts +60 -541
  69. package/src/schemas.test.ts +445 -0
  70. package/src/schemas.ts +91 -0
  71. package/src/service-schemas.gen.ts +608 -0
  72. package/src/studio-ui.test.ts +207 -0
  73. package/src/types.ts +17 -0
@@ -0,0 +1,179 @@
1
+ // Overwatch (Guardian) Cedar Schema
2
+ // ===================================
3
+ // IDE Security & Policy Enforcement
4
+ //
5
+ // Overwatch protects IDE operations (prompts, tool calls, file access) by evaluating
6
+ // threats detected by YARA and Javelin scanners against Cedar policies.
7
+ //
8
+ // Architecture:
9
+ // User/Agent → IDE Hook → YARA/Javelin → Cedar Policy → Allow/Deny
10
+ //
11
+ // Supported IDEs:
12
+ // - Cursor (beforeSubmitPrompt, beforeShellExecution, beforeMCPExecution, etc.)
13
+ // - Claude Code (UserPromptSubmit, PreToolUse)
14
+ // - GitHub Copilot (userPromptSubmitted, preToolUse)
15
+
16
+ namespace Overwatch {
17
+
18
+ // =============================================================================
19
+ // ENTITIES
20
+ // =============================================================================
21
+
22
+ // Human user or service account making requests to the IDE
23
+ entity User {
24
+ user_type: String, // "external" or "internal"
25
+ email: String, // User email (optional)
26
+ };
27
+
28
+ // AI agent (Claude, GitHub Copilot, etc.)
29
+ entity Agent {
30
+ agent_type: String, // "claude", "copilot", etc.
31
+ };
32
+
33
+ // LLM prompt or session
34
+ entity LlmPrompt {
35
+ prompt_type: String, // "user_prompt", "session"
36
+ };
37
+
38
+ // MCP tool or native IDE tool
39
+ entity Tool {
40
+ tool_name: String, // "shell", "read_file", "playwright", etc.
41
+ risk_level: String, // "low", "medium", "high"
42
+ };
43
+
44
+ // MCP server
45
+ entity Server {
46
+ server_name: String, // "filesystem", "playwright", etc.
47
+ };
48
+
49
+ // File system path
50
+ entity FilePath {
51
+ path: String,
52
+ is_within_workspace: Bool,
53
+ };
54
+
55
+ // =============================================================================
56
+ // ACTIONS
57
+ // =============================================================================
58
+
59
+ // User submits a prompt or receives AI response
60
+ action process_prompt appliesTo {
61
+ principal: [User, Agent],
62
+ resource: [LlmPrompt],
63
+ context: {
64
+ // Event & Source
65
+ content: String, // Raw content being scanned
66
+ source: String, // IDE source: "cursor", "claudecode", "github_copilot"
67
+ event: String, // Hook event name
68
+ user_email: String, // User identifier
69
+
70
+ // Workspace
71
+ cwd: String, // Current working directory
72
+ workspace_root: String, // Workspace/repository root
73
+
74
+ // Threat Detection
75
+ threat_count: Long, // Total threats detected
76
+ highest_severity: String, // "critical", "high", "medium", "low"
77
+ threat_categories: Set<String>, // Threat category names
78
+ threat_types: Set<String>, // YARA threat categories
79
+ yara_threats: Set<String>, // YARA rule names
80
+ max_threat_severity: Long, // Numeric severity (0-4)
81
+ contains_secrets: Bool, // Whether secrets detected
82
+ prompt_text: String, // Same as content (legacy)
83
+ response_content: String, // Response content (if available)
84
+ },
85
+ };
86
+
87
+ // User calls a tool (native IDE tool or MCP tool)
88
+ action call_tool appliesTo {
89
+ principal: [User, Agent],
90
+ resource: [Tool, FilePath],
91
+ context: {
92
+ // Event & Source
93
+ content: String, // Raw content being scanned (e.g., shell command)
94
+ source: String, // IDE source
95
+ event: String, // Hook event name
96
+ user_email: String, // User identifier
97
+
98
+ // Tool & MCP
99
+ tool_name: String, // Normalized tool name ("shell", "read_file", etc.)
100
+ mcp_server: String, // MCP server name
101
+ mcp_tool: String, // MCP tool name
102
+
103
+ // File & Path
104
+ path: String, // File path (if file operation)
105
+
106
+ // Workspace
107
+ cwd: String,
108
+ workspace_root: String,
109
+
110
+ // Threat Detection
111
+ threat_count: Long,
112
+ highest_severity: String,
113
+ threat_categories: Set<String>,
114
+ threat_types: Set<String>,
115
+ yara_threats: Set<String>,
116
+ max_threat_severity: Long,
117
+ contains_secrets: Bool,
118
+ response_content: String,
119
+ },
120
+ };
121
+
122
+ // Connect to an MCP server
123
+ action connect_server appliesTo {
124
+ principal: [User, Agent],
125
+ resource: [Server],
126
+ context: {
127
+ content: String,
128
+ source: String,
129
+ event: String,
130
+ user_email: String,
131
+ mcp_server: String,
132
+ threat_count: Long,
133
+ highest_severity: String,
134
+ threat_categories: Set<String>,
135
+ max_threat_severity: Long,
136
+ },
137
+ };
138
+
139
+ // Read a file from disk
140
+ action read_file appliesTo {
141
+ principal: [User, Agent],
142
+ resource: [FilePath],
143
+ context: {
144
+ content: String,
145
+ source: String,
146
+ event: String,
147
+ user_email: String,
148
+ path: String,
149
+ cwd: String,
150
+ workspace_root: String,
151
+ threat_count: Long,
152
+ highest_severity: String,
153
+ threat_categories: Set<String>,
154
+ max_threat_severity: Long,
155
+ contains_secrets: Bool,
156
+ },
157
+ };
158
+
159
+ // Write a file to disk
160
+ action write_file appliesTo {
161
+ principal: [User, Agent],
162
+ resource: [FilePath],
163
+ context: {
164
+ content: String,
165
+ source: String,
166
+ event: String,
167
+ user_email: String,
168
+ path: String,
169
+ cwd: String,
170
+ workspace_root: String,
171
+ threat_count: Long,
172
+ highest_severity: String,
173
+ threat_categories: Set<String>,
174
+ max_threat_severity: Long,
175
+ contains_secrets: Bool,
176
+ },
177
+ };
178
+
179
+ }
@@ -0,0 +1,325 @@
1
+ {
2
+ "service": "palisade",
3
+ "version": "1.0.0",
4
+ "description": "Palisade ML supply chain security & artifact scanning",
5
+ "actions": [
6
+ {
7
+ "name": "scan_artifact",
8
+ "description": "Scan an ML artifact for security issues",
9
+ "context_attributes": [
10
+ {
11
+ "key": "finding_type",
12
+ "type": "string",
13
+ "required": true,
14
+ "description": "Type of security finding (e.g., backdoor_detected, safetensors_integrity_violation)"
15
+ },
16
+ {
17
+ "key": "severity",
18
+ "type": "string",
19
+ "required": true,
20
+ "description": "Severity level: CRITICAL, HIGH, MEDIUM, LOW, INFO"
21
+ },
22
+ {
23
+ "key": "environment",
24
+ "type": "string",
25
+ "required": true,
26
+ "description": "Deployment environment: production, strict_production, development, permissive_development, research"
27
+ },
28
+ {
29
+ "key": "artifact_format",
30
+ "type": "string",
31
+ "required": true,
32
+ "description": "Model format: safetensors, gguf, pickle, pytorch, onnx"
33
+ },
34
+ {
35
+ "key": "path",
36
+ "type": "string",
37
+ "required": true,
38
+ "description": "File path to the ML artifact"
39
+ },
40
+ {
41
+ "key": "artifact_signed",
42
+ "type": "boolean",
43
+ "required": true,
44
+ "description": "Whether the artifact is digitally signed"
45
+ },
46
+ {
47
+ "key": "provenance_signer",
48
+ "type": "string",
49
+ "required": true,
50
+ "description": "Who signed the artifact: unknown, unsigned, or signer name"
51
+ },
52
+ {
53
+ "key": "pickle_exec_path_detected",
54
+ "type": "boolean",
55
+ "required": false,
56
+ "description": "Pickle RCE execution path detected (CRITICAL security issue)"
57
+ },
58
+ {
59
+ "key": "tokenizer_added_tokens_count",
60
+ "type": "number",
61
+ "required": false,
62
+ "description": "Number of added tokens in tokenizer (0-5000+, high count suspicious)"
63
+ },
64
+ {
65
+ "key": "adapter_base_digest_mismatch",
66
+ "type": "boolean",
67
+ "required": false,
68
+ "description": "LoRA adapter base model digest mismatch (integrity issue)"
69
+ },
70
+ {
71
+ "key": "gguf_suspicious_metadata",
72
+ "type": "boolean",
73
+ "required": false,
74
+ "description": "GGUF metadata contains suspicious patterns"
75
+ },
76
+ {
77
+ "key": "safetensors_integrity_violation",
78
+ "type": "boolean",
79
+ "required": false,
80
+ "description": "SafeTensors file integrity violated or corrupted"
81
+ },
82
+ {
83
+ "key": "metadata_malicious_pattern",
84
+ "type": "boolean",
85
+ "required": false,
86
+ "description": "Metadata contains malicious patterns"
87
+ },
88
+ {
89
+ "key": "metadata_cosai_level_numeric",
90
+ "type": "number",
91
+ "required": false,
92
+ "description": "CoSAI maturity level (0-5, where higher = more trustworthy)"
93
+ },
94
+ {
95
+ "key": "match_count",
96
+ "type": "number",
97
+ "required": false,
98
+ "description": "Number of behavioral backdoor indicator matches (for confidence scoring)"
99
+ }
100
+ ]
101
+ },
102
+ {
103
+ "name": "validate_integrity",
104
+ "description": "Validate artifact integrity (checksum, signature)",
105
+ "context_attributes": [
106
+ {
107
+ "key": "artifact_format",
108
+ "type": "string",
109
+ "required": true,
110
+ "description": "Model format"
111
+ },
112
+ {
113
+ "key": "path",
114
+ "type": "string",
115
+ "required": true,
116
+ "description": "File path"
117
+ },
118
+ {
119
+ "key": "artifact_signed",
120
+ "type": "boolean",
121
+ "required": true,
122
+ "description": "Whether digitally signed"
123
+ },
124
+ {
125
+ "key": "provenance_signer",
126
+ "type": "string",
127
+ "required": true,
128
+ "description": "Signer name"
129
+ },
130
+ {
131
+ "key": "safetensors_integrity_violation",
132
+ "type": "boolean",
133
+ "required": false,
134
+ "description": "SafeTensors integrity check result"
135
+ },
136
+ {
137
+ "key": "finding_type",
138
+ "type": "string",
139
+ "required": false,
140
+ "description": "Type of integrity finding"
141
+ },
142
+ {
143
+ "key": "severity",
144
+ "type": "string",
145
+ "required": false,
146
+ "description": "Severity of integrity issue"
147
+ }
148
+ ]
149
+ },
150
+ {
151
+ "name": "validate_provenance",
152
+ "description": "Validate artifact provenance (signer, origin)",
153
+ "context_attributes": [
154
+ {
155
+ "key": "artifact_format",
156
+ "type": "string",
157
+ "required": true,
158
+ "description": "Model format"
159
+ },
160
+ {
161
+ "key": "path",
162
+ "type": "string",
163
+ "required": true,
164
+ "description": "File path"
165
+ },
166
+ {
167
+ "key": "artifact_signed",
168
+ "type": "boolean",
169
+ "required": true,
170
+ "description": "Whether signed"
171
+ },
172
+ {
173
+ "key": "provenance_signer",
174
+ "type": "string",
175
+ "required": true,
176
+ "description": "Signer identity"
177
+ },
178
+ {
179
+ "key": "metadata_cosai_level_numeric",
180
+ "type": "number",
181
+ "required": false,
182
+ "description": "CoSAI maturity level"
183
+ },
184
+ {
185
+ "key": "finding_type",
186
+ "type": "string",
187
+ "required": false,
188
+ "description": "Type of provenance finding"
189
+ },
190
+ {
191
+ "key": "severity",
192
+ "type": "string",
193
+ "required": false,
194
+ "description": "Severity level"
195
+ }
196
+ ]
197
+ },
198
+ {
199
+ "name": "quarantine_artifact",
200
+ "description": "Quarantine a malicious artifact",
201
+ "context_attributes": [
202
+ {
203
+ "key": "finding_type",
204
+ "type": "string",
205
+ "required": true,
206
+ "description": "Type of security finding"
207
+ },
208
+ {
209
+ "key": "severity",
210
+ "type": "string",
211
+ "required": true,
212
+ "description": "Severity level"
213
+ },
214
+ {
215
+ "key": "environment",
216
+ "type": "string",
217
+ "required": true,
218
+ "description": "Deployment environment"
219
+ },
220
+ {
221
+ "key": "artifact_format",
222
+ "type": "string",
223
+ "required": true,
224
+ "description": "Model format"
225
+ },
226
+ {
227
+ "key": "path",
228
+ "type": "string",
229
+ "required": true,
230
+ "description": "File path"
231
+ }
232
+ ]
233
+ },
234
+ {
235
+ "name": "load_model",
236
+ "description": "Load an ML model into memory",
237
+ "context_attributes": [
238
+ {
239
+ "key": "artifact_format",
240
+ "type": "string",
241
+ "required": true,
242
+ "description": "Model format"
243
+ },
244
+ {
245
+ "key": "environment",
246
+ "type": "string",
247
+ "required": true,
248
+ "description": "Deployment environment"
249
+ },
250
+ {
251
+ "key": "artifact_signed",
252
+ "type": "boolean",
253
+ "required": true,
254
+ "description": "Whether signed"
255
+ },
256
+ {
257
+ "key": "severity",
258
+ "type": "string",
259
+ "required": false,
260
+ "description": "Severity of any findings"
261
+ }
262
+ ]
263
+ },
264
+ {
265
+ "name": "deploy_model",
266
+ "description": "Deploy an ML model to production",
267
+ "context_attributes": [
268
+ {
269
+ "key": "artifact_format",
270
+ "type": "string",
271
+ "required": true,
272
+ "description": "Model format"
273
+ },
274
+ {
275
+ "key": "environment",
276
+ "type": "string",
277
+ "required": true,
278
+ "description": "Deployment environment"
279
+ },
280
+ {
281
+ "key": "artifact_signed",
282
+ "type": "boolean",
283
+ "required": true,
284
+ "description": "Whether signed"
285
+ },
286
+ {
287
+ "key": "provenance_signer",
288
+ "type": "string",
289
+ "required": true,
290
+ "description": "Signer identity"
291
+ },
292
+ {
293
+ "key": "severity",
294
+ "type": "string",
295
+ "required": false,
296
+ "description": "Severity of any findings"
297
+ }
298
+ ]
299
+ },
300
+ {
301
+ "name": "scan_package",
302
+ "description": "Scan a software package",
303
+ "context_attributes": [
304
+ {
305
+ "key": "finding_type",
306
+ "type": "string",
307
+ "required": false,
308
+ "description": "Type of finding"
309
+ },
310
+ {
311
+ "key": "severity",
312
+ "type": "string",
313
+ "required": false,
314
+ "description": "Severity level"
315
+ },
316
+ {
317
+ "key": "environment",
318
+ "type": "string",
319
+ "required": true,
320
+ "description": "Deployment environment"
321
+ }
322
+ ]
323
+ }
324
+ ]
325
+ }
@@ -0,0 +1,168 @@
1
+ // Palisade Cedar Schema
2
+ // =====================
3
+ // ML Supply Chain Security & Artifact Scanning
4
+ //
5
+ // Palisade scans ML model artifacts (safetensors, GGUF, pickle, PyTorch) for
6
+ // security vulnerabilities and enforces policies based on findings.
7
+ //
8
+ // Architecture:
9
+ // Scanner → Validators (Pickle, SafeTensors, GGUF, etc.) → Cedar Policy → Allow/Deny/Quarantine
10
+ //
11
+ // Supported Formats:
12
+ // - SafeTensors (.safetensors)
13
+ // - GGUF (.gguf)
14
+ // - Pickle (.pkl, .pickle, .pt)
15
+ // - PyTorch (.pth, .pt)
16
+ // - ONNX (.onnx)
17
+
18
+ namespace Palisade {
19
+
20
+ // =============================================================================
21
+ // ENTITIES
22
+ // =============================================================================
23
+
24
+ // Security scanner service
25
+ entity Scanner {
26
+ scanner_type: String, // "palisade", "redteam", etc.
27
+ };
28
+
29
+ // ML model artifact
30
+ entity Artifact {
31
+ artifact_format: String, // "safetensors", "gguf", "pickle", "pytorch", "onnx"
32
+ path: String, // File path
33
+ signed: Bool, // Whether digitally signed
34
+ signer: String, // Who signed (if applicable)
35
+ };
36
+
37
+ // Software package (npm, PyPI, etc.)
38
+ entity Package {
39
+ package_name: String,
40
+ package_version: String,
41
+ };
42
+
43
+ // =============================================================================
44
+ // ACTIONS
45
+ // =============================================================================
46
+
47
+ // Scan an ML artifact for security issues
48
+ action scan_artifact appliesTo {
49
+ principal: [Scanner],
50
+ resource: [Artifact],
51
+ context: {
52
+ // Core Finding & Severity
53
+ finding_type: String, // Type of finding (e.g., "backdoor_detected", "safetensors_integrity_violation")
54
+ severity: String, // "CRITICAL", "HIGH", "MEDIUM", "LOW", "INFO"
55
+ environment: String, // "production", "strict_production", "development", "permissive_development", "research"
56
+
57
+ // Artifact Metadata
58
+ artifact_format: String, // "safetensors", "gguf", "pickle", "pytorch", "onnx"
59
+ path: String, // File path to artifact
60
+ artifact_signed: Bool, // Whether artifact is digitally signed
61
+ provenance_signer: String, // "unknown", "unsigned", or signer name
62
+
63
+ // Pickle Security
64
+ pickle_exec_path_detected: Bool, // Pickle RCE execution path detected (CRITICAL)
65
+
66
+ // Tokenizer Security
67
+ tokenizer_added_tokens_count: Long, // Number of added tokens (0-5000+)
68
+
69
+ // LoRA Security
70
+ adapter_base_digest_mismatch: Bool, // LoRA adapter base model digest mismatch
71
+
72
+ // GGUF Security
73
+ gguf_suspicious_metadata: Bool, // GGUF metadata contains suspicious patterns
74
+
75
+ // SafeTensors Security
76
+ safetensors_integrity_violation: Bool, // SafeTensors file integrity violated
77
+
78
+ // General Metadata Security
79
+ metadata_malicious_pattern: Bool, // Metadata contains malicious patterns
80
+
81
+ // CoSAI Maturity
82
+ metadata_cosai_level_numeric: Long, // CoSAI maturity level (0-5, higher = more trustworthy)
83
+
84
+ // Backdoor Detection
85
+ match_count: Long, // Number of behavioral backdoor indicator matches
86
+ },
87
+ };
88
+
89
+ // Validate artifact integrity (checksum, signature)
90
+ action validate_integrity appliesTo {
91
+ principal: [Scanner],
92
+ resource: [Artifact],
93
+ context: {
94
+ artifact_format: String,
95
+ path: String,
96
+ artifact_signed: Bool,
97
+ provenance_signer: String,
98
+ safetensors_integrity_violation: Bool,
99
+ finding_type: String,
100
+ severity: String,
101
+ },
102
+ };
103
+
104
+ // Validate artifact provenance (signer, origin)
105
+ action validate_provenance appliesTo {
106
+ principal: [Scanner],
107
+ resource: [Artifact],
108
+ context: {
109
+ artifact_format: String,
110
+ path: String,
111
+ artifact_signed: Bool,
112
+ provenance_signer: String,
113
+ metadata_cosai_level_numeric: Long,
114
+ finding_type: String,
115
+ severity: String,
116
+ },
117
+ };
118
+
119
+ // Quarantine a malicious artifact
120
+ action quarantine_artifact appliesTo {
121
+ principal: [Scanner],
122
+ resource: [Artifact],
123
+ context: {
124
+ finding_type: String,
125
+ severity: String,
126
+ environment: String,
127
+ artifact_format: String,
128
+ path: String,
129
+ },
130
+ };
131
+
132
+ // Load an ML model into memory
133
+ action load_model appliesTo {
134
+ principal: [Scanner],
135
+ resource: [Artifact],
136
+ context: {
137
+ artifact_format: String,
138
+ environment: String,
139
+ artifact_signed: Bool,
140
+ severity: String,
141
+ },
142
+ };
143
+
144
+ // Deploy an ML model to production
145
+ action deploy_model appliesTo {
146
+ principal: [Scanner],
147
+ resource: [Artifact],
148
+ context: {
149
+ artifact_format: String,
150
+ environment: String,
151
+ artifact_signed: Bool,
152
+ provenance_signer: String,
153
+ severity: String,
154
+ },
155
+ };
156
+
157
+ // Scan a software package
158
+ action scan_package appliesTo {
159
+ principal: [Scanner],
160
+ resource: [Package],
161
+ context: {
162
+ finding_type: String,
163
+ severity: String,
164
+ environment: String,
165
+ },
166
+ };
167
+
168
+ }
package/dist/builder.d.ts CHANGED
@@ -23,7 +23,6 @@
23
23
  */
24
24
  import { EntityType, EntityUID } from './entities.gen.js';
25
25
  import { ActionType } from './actions.gen.js';
26
- import { ContextKey } from './context.gen.js';
27
26
  /**
28
27
  * Policy effect - permit or forbid
29
28
  */
@@ -199,7 +198,7 @@ export declare class PolicyBuilder {
199
198
  /**
200
199
  * Add a structured condition
201
200
  */
202
- when(field: ContextKey | string, operator: ConditionOperator, value: string | number | boolean | string[]): PolicyBuilder;
201
+ when(field: string, operator: ConditionOperator, value: string | number | boolean | string[]): PolicyBuilder;
203
202
  /**
204
203
  * Add a raw condition string (for advanced users)
205
204
  */