@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.
- package/README.md +219 -0
- package/_schemas/overwatch/context.json +433 -0
- package/_schemas/overwatch/schema.cedarschema +179 -0
- package/_schemas/palisade/context.json +325 -0
- package/_schemas/palisade/schema.cedarschema +168 -0
- package/dist/builder.d.ts +1 -2
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +16 -3
- package/dist/builder.js.map +1 -1
- package/dist/context.gen.d.ts +1 -94
- package/dist/context.gen.d.ts.map +1 -1
- package/dist/context.gen.js +1 -97
- package/dist/context.gen.js.map +1 -1
- package/dist/engine.d.ts +18 -18
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +44 -28
- package/dist/engine.js.map +1 -1
- package/dist/engine.test.js.map +1 -1
- package/dist/entities.gen.d.ts +1 -0
- package/dist/entities.gen.d.ts.map +1 -1
- package/dist/entities.gen.js +1 -0
- package/dist/entities.gen.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/overwatch-context.gen.d.ts +29 -0
- package/dist/overwatch-context.gen.d.ts.map +1 -0
- package/dist/overwatch-context.gen.js +30 -0
- package/dist/overwatch-context.gen.js.map +1 -0
- package/dist/palisade-context.gen.d.ts +25 -0
- package/dist/palisade-context.gen.d.ts.map +1 -0
- package/dist/palisade-context.gen.js +26 -0
- package/dist/palisade-context.gen.js.map +1 -0
- package/dist/schema.gen.d.ts +1 -1
- package/dist/schema.gen.d.ts.map +1 -1
- package/dist/schema.gen.js +60 -541
- package/dist/schema.gen.js.map +1 -1
- package/dist/schemas.d.ts +64 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +70 -0
- package/dist/schemas.js.map +1 -0
- package/dist/schemas.test.d.ts +8 -0
- package/dist/schemas.test.d.ts.map +1 -0
- package/dist/schemas.test.js +377 -0
- package/dist/schemas.test.js.map +1 -0
- package/dist/service-schemas.gen.d.ts +48 -0
- package/dist/service-schemas.gen.d.ts.map +1 -0
- package/dist/service-schemas.gen.js +581 -0
- package/dist/service-schemas.gen.js.map +1 -0
- package/dist/studio-ui.test.d.ts +8 -0
- package/dist/studio-ui.test.d.ts.map +1 -0
- package/dist/studio-ui.test.js +165 -0
- package/dist/studio-ui.test.js.map +1 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -1
- package/package.json +9 -6
- package/src/builder.ts +18 -5
- package/src/context.gen.ts +0 -97
- package/src/engine.test.ts +0 -1
- package/src/engine.ts +62 -33
- package/src/entities.gen.ts +1 -0
- package/src/index.ts +17 -0
- package/src/overwatch-context.gen.ts +32 -0
- package/src/palisade-context.gen.ts +28 -0
- package/src/schema.gen.ts +60 -541
- package/src/schemas.test.ts +445 -0
- package/src/schemas.ts +91 -0
- package/src/service-schemas.gen.ts +608 -0
- package/src/studio-ui.test.ts +207 -0
- package/src/types.ts +17 -0
package/src/schema.gen.ts
CHANGED
|
@@ -5,611 +5,130 @@
|
|
|
5
5
|
* Embedded Cedar schema for policy validation.
|
|
6
6
|
* This is the Highflame Cedar schema used across all services.
|
|
7
7
|
*/
|
|
8
|
-
export const CEDAR_SCHEMA = `// Highflame Cedar Schema
|
|
9
|
-
//
|
|
10
|
-
// This
|
|
11
|
-
//
|
|
8
|
+
export const CEDAR_SCHEMA = `// Highflame Cedar Schema - Entity and Action Definitions
|
|
9
|
+
// =======================================================
|
|
10
|
+
// This file defines all entity types and actions used across Highflame services.
|
|
11
|
+
// Used for code generation (EntityType and ActionType constants).
|
|
12
12
|
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
// - Policies are validated against this schema when created/updated
|
|
19
|
-
// - Generated types prevent typos in application code
|
|
20
|
-
// - Cedar CLI can validate: cedar validate --schema highflame.cedarschema --policies policy.cedar
|
|
13
|
+
// For policy validation, use service-specific schemas:
|
|
14
|
+
// - schemas/overwatch/schema.cedarschema (Guardian IDE security)
|
|
15
|
+
// - schemas/palisade/schema.cedarschema (ML supply chain security)
|
|
16
|
+
|
|
17
|
+
namespace Highflame {
|
|
21
18
|
|
|
22
19
|
// =============================================================================
|
|
23
|
-
//
|
|
20
|
+
// ENTITIES
|
|
24
21
|
// =============================================================================
|
|
25
22
|
|
|
26
|
-
// Human user or service account making requests
|
|
27
|
-
// Well-known IDs: "mcp_client", "threat_processor"
|
|
28
23
|
entity User {
|
|
29
|
-
// User type: "external", "internal"
|
|
30
24
|
user_type: String,
|
|
31
25
|
};
|
|
32
26
|
|
|
33
|
-
// AI agent or bot
|
|
34
27
|
entity Agent {
|
|
35
|
-
// Agent type: "llm", "scanner", "bot", "coding_assistant"
|
|
36
28
|
agent_type: String,
|
|
37
29
|
};
|
|
38
30
|
|
|
39
|
-
// Security scanner service
|
|
40
|
-
// Well-known IDs: "ramparts", "palisade"
|
|
41
31
|
entity Scanner {
|
|
42
|
-
// Scanner type: "ramparts", "palisade"
|
|
43
32
|
scanner_type: String,
|
|
44
|
-
// Scanner version
|
|
45
|
-
version: String,
|
|
46
33
|
};
|
|
47
34
|
|
|
48
|
-
// Backend service account
|
|
49
35
|
entity Service {
|
|
50
|
-
|
|
51
|
-
service_name: String,
|
|
52
|
-
// Environment: "production", "staging", "development"
|
|
53
|
-
environment: String,
|
|
36
|
+
service_type: String,
|
|
54
37
|
};
|
|
55
38
|
|
|
56
|
-
// =============================================================================
|
|
57
|
-
// RESOURCE TYPES (What is being accessed)
|
|
58
|
-
// =============================================================================
|
|
59
|
-
|
|
60
|
-
// Generic resource
|
|
61
|
-
// Well-known IDs: "threat_analysis", "tools/list", "tools/call", "resources/list",
|
|
62
|
-
// "resources/read", "prompts/list", "unknown"
|
|
63
39
|
entity Resource {};
|
|
64
40
|
|
|
65
|
-
|
|
66
|
-
|
|
41
|
+
entity LlmPrompt {
|
|
42
|
+
prompt_type: String,
|
|
43
|
+
};
|
|
44
|
+
|
|
67
45
|
entity ResponseData {};
|
|
68
46
|
|
|
69
|
-
// MCP tool that can be called
|
|
70
47
|
entity Tool {
|
|
71
|
-
// Tool name
|
|
72
48
|
tool_name: String,
|
|
73
|
-
// Risk level: "safe", "moderate", "dangerous"
|
|
74
|
-
risk_level: String,
|
|
75
|
-
// Category: "file", "network", "shell", "api"
|
|
76
|
-
category: String,
|
|
77
49
|
};
|
|
78
50
|
|
|
79
|
-
// File system path
|
|
80
51
|
entity FilePath {
|
|
81
|
-
// Full path
|
|
82
52
|
path: String,
|
|
83
|
-
// File extension
|
|
84
|
-
extension: String,
|
|
85
|
-
// Whether file is sensitive (.env, credentials, etc.)
|
|
86
|
-
is_sensitive: Bool,
|
|
87
53
|
};
|
|
88
54
|
|
|
89
|
-
// HTTP endpoint
|
|
90
55
|
entity HttpEndpoint {
|
|
91
|
-
// Hostname
|
|
92
56
|
hostname: String,
|
|
93
|
-
// Scheme: "http", "https"
|
|
94
|
-
scheme: String,
|
|
95
|
-
// Port number
|
|
96
|
-
port: Long,
|
|
97
|
-
// Whether endpoint is internal
|
|
98
|
-
is_internal: Bool,
|
|
99
57
|
};
|
|
100
58
|
|
|
101
|
-
// MCP Server
|
|
102
59
|
entity Server {
|
|
103
|
-
// Server name
|
|
104
60
|
server_name: String,
|
|
105
61
|
};
|
|
106
62
|
|
|
107
|
-
// ML model artifact (for Palisade)
|
|
108
63
|
entity Artifact {
|
|
109
|
-
|
|
110
|
-
artifact_type: String,
|
|
111
|
-
// Source URL or path
|
|
112
|
-
source: String,
|
|
113
|
-
// SHA256 hash
|
|
114
|
-
hash: String,
|
|
115
|
-
// Whether artifact is signed
|
|
116
|
-
is_signed: Bool,
|
|
64
|
+
artifact_format: String,
|
|
117
65
|
};
|
|
118
66
|
|
|
119
|
-
// Code repository
|
|
120
67
|
entity Repository {
|
|
121
|
-
|
|
122
|
-
url: String,
|
|
68
|
+
repo_url: String,
|
|
123
69
|
};
|
|
124
70
|
|
|
125
|
-
// Software package
|
|
126
71
|
entity Package {
|
|
127
|
-
|
|
128
|
-
name: String,
|
|
129
|
-
// Package version
|
|
130
|
-
version: String,
|
|
72
|
+
package_name: String,
|
|
131
73
|
};
|
|
132
74
|
|
|
133
|
-
// Git branch (for branch protection policies)
|
|
134
75
|
entity GitBranch {
|
|
135
|
-
// Branch name (e.g., "main", "develop", "feature/xyz")
|
|
136
76
|
branch_name: String,
|
|
137
|
-
// Whether this is a protected branch
|
|
138
|
-
is_protected: Bool,
|
|
139
77
|
};
|
|
140
78
|
|
|
141
|
-
// LLM Model (for model-specific policies)
|
|
142
79
|
entity Model {
|
|
143
|
-
// Model name (e.g., "gpt-4", "claude-3-opus")
|
|
144
80
|
model_name: String,
|
|
145
|
-
// Provider (e.g., "openai", "anthropic", "google")
|
|
146
|
-
provider: String,
|
|
147
|
-
// Whether model is in preview/beta
|
|
148
|
-
is_preview: Bool,
|
|
149
81
|
};
|
|
150
82
|
|
|
151
|
-
// External API endpoint (for external service calls)
|
|
152
83
|
entity ExternalAPI {
|
|
153
|
-
// API name or identifier
|
|
154
84
|
api_name: String,
|
|
155
|
-
// Base URL or hostname
|
|
156
|
-
base_url: String,
|
|
157
|
-
// Whether the API is trusted/verified
|
|
158
|
-
is_trusted: Bool,
|
|
159
85
|
};
|
|
160
86
|
|
|
161
|
-
// Agent memory or RAG storage
|
|
162
87
|
entity Memory {
|
|
163
|
-
// Memory type: "short_term", "long_term", "rag", "vector_store"
|
|
164
88
|
memory_type: String,
|
|
165
|
-
// Whether memory contains sensitive data
|
|
166
|
-
is_sensitive: Bool,
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
// =============================================================================
|
|
170
|
-
// ACTIONS - LLM/Guardrails
|
|
171
|
-
// =============================================================================
|
|
172
|
-
|
|
173
|
-
// Process an LLM prompt
|
|
174
|
-
// Context: prompt_text, yara_threats, threat_count, max_threat_severity,
|
|
175
|
-
// user_type, monitoring_enabled, injection_score, content_score
|
|
176
|
-
action process_prompt appliesTo {
|
|
177
|
-
principal: [User, Agent],
|
|
178
|
-
resource: [Resource],
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
// Process an LLM response
|
|
182
|
-
// Context: response_size_mb, contains_pii, pii_types, content_category
|
|
183
|
-
action process_response appliesTo {
|
|
184
|
-
principal: [User, Agent],
|
|
185
|
-
resource: [ResponseData],
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
// Invoke an LLM model
|
|
189
|
-
// Context: model_name, model_provider, is_preview_model, estimated_tokens,
|
|
190
|
-
// max_tokens, temperature, top_p, is_streaming
|
|
191
|
-
action invoke_model appliesTo {
|
|
192
|
-
principal: [User, Agent, Service],
|
|
193
|
-
resource: [Model, Resource],
|
|
194
89
|
};
|
|
195
90
|
|
|
196
|
-
// Filter content (apply content filtering policies)
|
|
197
|
-
// Context: content_type, content_category, content_score, harm_categories,
|
|
198
|
-
// language, is_harmful, filter_action
|
|
199
|
-
action filter_content appliesTo {
|
|
200
|
-
principal: [User, Agent, Service],
|
|
201
|
-
resource: [Resource, ResponseData],
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
// =============================================================================
|
|
205
|
-
// ACTIONS - MCP/Tool
|
|
206
|
-
// =============================================================================
|
|
207
|
-
|
|
208
|
-
// Call an MCP tool
|
|
209
|
-
// Context: tool_name, tool_arguments, risk_level
|
|
210
|
-
action call_tool appliesTo {
|
|
211
|
-
principal: [User, Agent, Service],
|
|
212
|
-
resource: [Tool, Resource],
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
// Connect to an MCP server
|
|
216
|
-
// Context: server_name, server_url, transport_type
|
|
217
|
-
action connect_server appliesTo {
|
|
218
|
-
principal: [User, Agent, Service],
|
|
219
|
-
resource: [Server, Resource],
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
// Access a server-specific resource
|
|
223
|
-
// Context: tool_name, resource_name, prompt_name
|
|
224
|
-
action access_server_resource appliesTo {
|
|
225
|
-
principal: [User, Agent, Service],
|
|
226
|
-
resource: [Resource],
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
// Skip guardrails for an operation
|
|
230
|
-
action skip_guardrails appliesTo {
|
|
231
|
-
principal: [User, Agent, Service],
|
|
232
|
-
resource: [Resource],
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
// =============================================================================
|
|
236
|
-
// ACTIONS - File System
|
|
237
91
|
// =============================================================================
|
|
238
|
-
|
|
239
|
-
//
|
|
240
|
-
|
|
241
|
-
action
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
action
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
action
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
action
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
action
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
// =============================================================================
|
|
281
|
-
|
|
282
|
-
// Execute code in a sandbox or environment
|
|
283
|
-
// Context: code_language, is_sandboxed, code_size_bytes, has_network_access,
|
|
284
|
-
// has_filesystem_access, execution_timeout_ms
|
|
285
|
-
action execute_code appliesTo {
|
|
286
|
-
principal: [User, Agent],
|
|
287
|
-
resource: [Resource],
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
// Run tests
|
|
291
|
-
// Context: test_framework, test_count, is_sandboxed, code_language
|
|
292
|
-
action run_tests appliesTo {
|
|
293
|
-
principal: [User, Agent, Service],
|
|
294
|
-
resource: [Repository, Resource],
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
// Run build process
|
|
298
|
-
// Context: build_tool, is_sandboxed, code_language
|
|
299
|
-
action run_build appliesTo {
|
|
300
|
-
principal: [User, Agent, Service],
|
|
301
|
-
resource: [Repository, Resource],
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
// =============================================================================
|
|
305
|
-
// ACTIONS - Git Operations
|
|
306
|
-
// =============================================================================
|
|
307
|
-
|
|
308
|
-
// General git operation (use for policies that apply to all git actions)
|
|
309
|
-
// Context: git_op, target_branch, source_branch, is_force, is_protected_branch,
|
|
310
|
-
// changed_files_count, commit_message, remote_url
|
|
311
|
-
action git_operation appliesTo {
|
|
312
|
-
principal: [User, Agent],
|
|
313
|
-
resource: [Repository, GitBranch, Resource],
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
// Clone a repository
|
|
317
|
-
// Context: remote_url, is_shallow, depth
|
|
318
|
-
action git_clone appliesTo {
|
|
319
|
-
principal: [User, Agent],
|
|
320
|
-
resource: [Repository, Resource],
|
|
321
|
-
};
|
|
322
|
-
|
|
323
|
-
// Create a commit
|
|
324
|
-
// Context: commit_message, changed_files_count, author, is_amend
|
|
325
|
-
action git_commit appliesTo {
|
|
326
|
-
principal: [User, Agent],
|
|
327
|
-
resource: [Repository, GitBranch, Resource],
|
|
328
|
-
};
|
|
329
|
-
|
|
330
|
-
// Push changes to remote
|
|
331
|
-
// Context: target_branch, is_force_push, is_protected_branch, remote_url
|
|
332
|
-
action git_push appliesTo {
|
|
333
|
-
principal: [User, Agent],
|
|
334
|
-
resource: [Repository, GitBranch, Resource],
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
// Pull changes from remote
|
|
338
|
-
// Context: source_branch, remote_url, is_rebase
|
|
339
|
-
action git_pull appliesTo {
|
|
340
|
-
principal: [User, Agent],
|
|
341
|
-
resource: [Repository, GitBranch, Resource],
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
// Merge branches
|
|
345
|
-
// Context: source_branch, target_branch, is_protected_branch, merge_strategy
|
|
346
|
-
action git_merge appliesTo {
|
|
347
|
-
principal: [User, Agent],
|
|
348
|
-
resource: [Repository, GitBranch, Resource],
|
|
349
|
-
};
|
|
350
|
-
|
|
351
|
-
// Checkout branch or commit
|
|
352
|
-
// Context: target_branch, is_new_branch, commit_hash
|
|
353
|
-
action git_checkout appliesTo {
|
|
354
|
-
principal: [User, Agent],
|
|
355
|
-
resource: [Repository, GitBranch, Resource],
|
|
356
|
-
};
|
|
357
|
-
|
|
358
|
-
// Reset changes (potentially destructive)
|
|
359
|
-
// Context: reset_mode, target_commit, is_hard_reset
|
|
360
|
-
action git_reset appliesTo {
|
|
361
|
-
principal: [User, Agent],
|
|
362
|
-
resource: [Repository, GitBranch, Resource],
|
|
363
|
-
};
|
|
364
|
-
|
|
365
|
-
// Rebase branch
|
|
366
|
-
// Context: source_branch, target_branch, is_interactive
|
|
367
|
-
action git_rebase appliesTo {
|
|
368
|
-
principal: [User, Agent],
|
|
369
|
-
resource: [Repository, GitBranch, Resource],
|
|
370
|
-
};
|
|
371
|
-
|
|
372
|
-
// =============================================================================
|
|
373
|
-
// ACTIONS - Agent Orchestration
|
|
374
|
-
// =============================================================================
|
|
375
|
-
|
|
376
|
-
// Delegate task to another agent
|
|
377
|
-
// Context: delegation_depth, parent_agent_id, task_type, is_autonomous
|
|
378
|
-
action delegate_task appliesTo {
|
|
379
|
-
principal: [Agent, Service],
|
|
380
|
-
resource: [Resource],
|
|
381
|
-
};
|
|
382
|
-
|
|
383
|
-
// Spawn a subprocess or child process
|
|
384
|
-
// Context: process_name, is_sandboxed, has_network_access, has_filesystem_access
|
|
385
|
-
action spawn_subprocess appliesTo {
|
|
386
|
-
principal: [User, Agent, Service],
|
|
387
|
-
resource: [Resource],
|
|
388
|
-
};
|
|
389
|
-
|
|
390
|
-
// Access agent memory or RAG storage
|
|
391
|
-
// Context: memory_type, operation (read, write, delete), is_sensitive
|
|
392
|
-
action access_memory appliesTo {
|
|
393
|
-
principal: [Agent, Service],
|
|
394
|
-
resource: [Memory, Resource],
|
|
395
|
-
};
|
|
396
|
-
|
|
397
|
-
// =============================================================================
|
|
398
|
-
// ACTIONS - Scanner
|
|
399
|
-
// =============================================================================
|
|
400
|
-
|
|
401
|
-
// Scan a target (MCP server, repository, etc.)
|
|
402
|
-
action scan_target appliesTo {
|
|
403
|
-
principal: [Scanner, Service],
|
|
404
|
-
resource: [Resource, Repository, Server],
|
|
405
|
-
};
|
|
406
|
-
|
|
407
|
-
// Scan a software package
|
|
408
|
-
action scan_package appliesTo {
|
|
409
|
-
principal: [Scanner, Service],
|
|
410
|
-
resource: [Package, Resource],
|
|
411
|
-
};
|
|
412
|
-
|
|
413
|
-
// =============================================================================
|
|
414
|
-
// ACTIONS - Palisade/ML
|
|
415
|
-
// =============================================================================
|
|
416
|
-
|
|
417
|
-
// Scan an ML artifact
|
|
418
|
-
// Context: environment, artifact_format, artifact_signed, severity, finding_type,
|
|
419
|
-
// provenance_signer, pickle_exec_path_detected, metadata_malicious_pattern,
|
|
420
|
-
// tokenizer_added_tokens_count, safetensors_integrity_violation,
|
|
421
|
-
// gguf_suspicious_metadata, adapter_base_digest_mismatch,
|
|
422
|
-
// metadata_cosai_level_numeric
|
|
423
|
-
action scan_artifact appliesTo {
|
|
424
|
-
principal: [Scanner, Service],
|
|
425
|
-
resource: [Artifact, Resource],
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
// Validate artifact integrity
|
|
429
|
-
action validate_integrity appliesTo {
|
|
430
|
-
principal: [Scanner, Service],
|
|
431
|
-
resource: [Artifact],
|
|
432
|
-
};
|
|
433
|
-
|
|
434
|
-
// Validate artifact provenance
|
|
435
|
-
action validate_provenance appliesTo {
|
|
436
|
-
principal: [Scanner, Service],
|
|
437
|
-
resource: [Artifact],
|
|
438
|
-
};
|
|
439
|
-
|
|
440
|
-
// Quarantine an artifact
|
|
441
|
-
action quarantine_artifact appliesTo {
|
|
442
|
-
principal: [Scanner, Service],
|
|
443
|
-
resource: [Artifact],
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
// Load an ML model
|
|
447
|
-
action load_model appliesTo {
|
|
448
|
-
principal: [User, Agent, Service],
|
|
449
|
-
resource: [Artifact],
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
// Deploy an ML model
|
|
453
|
-
action deploy_model appliesTo {
|
|
454
|
-
principal: [User, Service],
|
|
455
|
-
resource: [Artifact],
|
|
456
|
-
};
|
|
457
|
-
|
|
458
|
-
// =============================================================================
|
|
459
|
-
// ACTIONS - Data Loss Prevention (DLP)
|
|
460
|
-
// =============================================================================
|
|
461
|
-
|
|
462
|
-
// Transfer data (for DLP policies)
|
|
463
|
-
// Context: data_classification, destination_type, transfer_size_bytes,
|
|
464
|
-
// contains_pii, pii_types, is_encrypted
|
|
465
|
-
action transfer_data appliesTo {
|
|
466
|
-
principal: [User, Agent, Service],
|
|
467
|
-
resource: [Resource],
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
// Export data (for DLP policies)
|
|
471
|
-
// Context: export_format, data_classification, destination_type, is_encrypted
|
|
472
|
-
action export_data appliesTo {
|
|
473
|
-
principal: [User, Agent, Service],
|
|
474
|
-
resource: [Resource],
|
|
475
|
-
};
|
|
476
|
-
|
|
477
|
-
// =============================================================================
|
|
478
|
-
// CONTEXT ATTRIBUTES REFERENCE (Documentation Only)
|
|
479
|
-
// =============================================================================
|
|
480
|
-
// Cedar context is dynamic and not enforced by schema, but these are the
|
|
481
|
-
// standard attributes used across Highflame services:
|
|
482
|
-
//
|
|
483
|
-
// -----------------------------------------------------------------------------
|
|
484
|
-
// GUARDRAILS/CORE
|
|
485
|
-
// -----------------------------------------------------------------------------
|
|
486
|
-
// tool_name: String - Name of tool being called
|
|
487
|
-
// resource_name: String - Name of resource being accessed
|
|
488
|
-
// prompt_name: String - Name of prompt
|
|
489
|
-
// prompt_text: String - Raw prompt text (for injection detection)
|
|
490
|
-
// response_size_mb: Long - Response size in megabytes
|
|
491
|
-
// yara_threats: Set<String> - Set of detected YARA threat names
|
|
492
|
-
// threat_count: Long - Number of threats detected
|
|
493
|
-
// max_threat_severity: Long - Highest severity (0=INFO, 4=CRITICAL)
|
|
494
|
-
// user_type: String - "external" or "internal"
|
|
495
|
-
// monitoring_enabled: Bool - Whether monitoring is active
|
|
496
|
-
// path: String - File path
|
|
497
|
-
// hostname: String - HTTP hostname
|
|
498
|
-
// ip_address: String - IP address (for SSRF detection)
|
|
499
|
-
// scheme: String - HTTP scheme
|
|
500
|
-
// port: Long - Port number
|
|
501
|
-
//
|
|
502
|
-
// -----------------------------------------------------------------------------
|
|
503
|
-
// MODEL INVOCATION
|
|
504
|
-
// -----------------------------------------------------------------------------
|
|
505
|
-
// model_name: String - Name of the model (e.g., "gpt-4", "claude-3-opus")
|
|
506
|
-
// model_provider: String - Provider name (e.g., "openai", "anthropic", "google", "azure", "bedrock")
|
|
507
|
-
// is_preview_model: Bool - Whether model is in preview/beta
|
|
508
|
-
// estimated_tokens: Long - Estimated input + output tokens
|
|
509
|
-
// max_tokens: Long - Maximum tokens allowed for response
|
|
510
|
-
// temperature: Long - Temperature setting (scaled by 100, e.g., 70 = 0.7)
|
|
511
|
-
// top_p: Long - Top-p sampling (scaled by 100)
|
|
512
|
-
// is_streaming: Bool - Whether response is streamed
|
|
513
|
-
//
|
|
514
|
-
// -----------------------------------------------------------------------------
|
|
515
|
-
// CONTENT FILTERING
|
|
516
|
-
// -----------------------------------------------------------------------------
|
|
517
|
-
// content_type: String - Type of content ("text", "code", "image", "audio", "video")
|
|
518
|
-
// content_category: String - Category ("general", "adult", "violence", "hate", etc.)
|
|
519
|
-
// content_score: Long - Content risk score (0-100)
|
|
520
|
-
// injection_score: Long - Prompt injection detection score (0-100)
|
|
521
|
-
// jailbreak_score: Long - Jailbreak attempt detection score (0-100)
|
|
522
|
-
// contains_pii: Bool - Whether content contains PII
|
|
523
|
-
// pii_types: Set<String> - Types of PII detected ("email", "phone", "ssn", "credit_card", etc.)
|
|
524
|
-
// language: String - Detected language code (e.g., "en", "es", "zh")
|
|
525
|
-
// is_harmful: Bool - Whether content is harmful
|
|
526
|
-
// harm_categories: Set<String> - Categories of harm ("violence", "hate", "self_harm", "sexual", etc.)
|
|
527
|
-
// filter_action: String - Action to take ("inspect", "mask", "redact", "replace", "anonymize", "reject")
|
|
528
|
-
// csam_detected: Bool - Whether CSAM was detected
|
|
529
|
-
// hallucination_score: Long - Hallucination detection score (0-100)
|
|
530
|
-
//
|
|
531
|
-
// -----------------------------------------------------------------------------
|
|
532
|
-
// RATE LIMITING
|
|
533
|
-
// -----------------------------------------------------------------------------
|
|
534
|
-
// concurrent_calls: Long - Current number of concurrent calls
|
|
535
|
-
// requests_per_minute: Long - Current requests per minute
|
|
536
|
-
// tokens_per_minute: Long - Current tokens per minute
|
|
537
|
-
// rate_limit_bucket: String - Rate limit bucket identifier
|
|
538
|
-
// is_rate_limited: Bool - Whether rate limit is exceeded
|
|
539
|
-
//
|
|
540
|
-
// -----------------------------------------------------------------------------
|
|
541
|
-
// GIT OPERATIONS
|
|
542
|
-
// -----------------------------------------------------------------------------
|
|
543
|
-
// git_op: String - Type of git operation ("clone", "commit", "push", "pull", etc.)
|
|
544
|
-
// target_branch: String - Target branch name
|
|
545
|
-
// source_branch: String - Source branch name
|
|
546
|
-
// is_force_push: Bool - Whether this is a force push
|
|
547
|
-
// is_protected_branch: Bool - Whether target is a protected branch
|
|
548
|
-
// changed_files_count: Long - Number of files changed
|
|
549
|
-
// commit_message: String - Commit message text
|
|
550
|
-
// remote_url: String - Remote repository URL
|
|
551
|
-
// is_shallow: Bool - Whether clone is shallow
|
|
552
|
-
// depth: Long - Clone depth for shallow clones
|
|
553
|
-
// is_amend: Bool - Whether commit is an amend
|
|
554
|
-
// merge_strategy: String - Merge strategy ("merge", "rebase", "squash")
|
|
555
|
-
// is_hard_reset: Bool - Whether reset is hard (destructive)
|
|
556
|
-
// reset_mode: String - Reset mode ("soft", "mixed", "hard")
|
|
557
|
-
// is_interactive: Bool - Whether operation is interactive
|
|
558
|
-
//
|
|
559
|
-
// -----------------------------------------------------------------------------
|
|
560
|
-
// CODE EXECUTION
|
|
561
|
-
// -----------------------------------------------------------------------------
|
|
562
|
-
// code_language: String - Programming language ("python", "javascript", "go", etc.)
|
|
563
|
-
// is_sandboxed: Bool - Whether code runs in a sandbox
|
|
564
|
-
// code_size_bytes: Long - Size of code in bytes
|
|
565
|
-
// has_network_access: Bool - Whether code has network access
|
|
566
|
-
// has_filesystem_access: Bool - Whether code has filesystem access
|
|
567
|
-
// execution_timeout_ms: Long - Execution timeout in milliseconds
|
|
568
|
-
// test_framework: String - Test framework being used
|
|
569
|
-
// test_count: Long - Number of tests being run
|
|
570
|
-
// build_tool: String - Build tool being used
|
|
571
|
-
//
|
|
572
|
-
// -----------------------------------------------------------------------------
|
|
573
|
-
// AGENT ORCHESTRATION
|
|
574
|
-
// -----------------------------------------------------------------------------
|
|
575
|
-
// delegation_depth: Long - Current delegation nesting depth
|
|
576
|
-
// parent_agent_id: String - ID of parent agent (if delegated)
|
|
577
|
-
// task_type: String - Type of task being performed
|
|
578
|
-
// is_autonomous: Bool - Whether agent is operating autonomously
|
|
579
|
-
// session_id: String - Agent session identifier
|
|
580
|
-
// process_name: String - Name of subprocess being spawned
|
|
581
|
-
//
|
|
582
|
-
// -----------------------------------------------------------------------------
|
|
583
|
-
// MEMORY/RAG
|
|
584
|
-
// -----------------------------------------------------------------------------
|
|
585
|
-
// memory_type: String - Type of memory ("short_term", "long_term", "rag", "vector_store")
|
|
586
|
-
// memory_operation: String - Operation being performed ("read", "write", "delete", "search")
|
|
587
|
-
// memory_is_sensitive: Bool - Whether memory contains sensitive data
|
|
588
|
-
//
|
|
589
|
-
// -----------------------------------------------------------------------------
|
|
590
|
-
// DATA LOSS PREVENTION (DLP)
|
|
591
|
-
// -----------------------------------------------------------------------------
|
|
592
|
-
// data_classification: String - Classification level ("public", "internal", "confidential", "restricted")
|
|
593
|
-
// destination_type: String - Where data is going ("internal", "external", "cloud", "email")
|
|
594
|
-
// transfer_size_bytes: Long - Size of data being transferred
|
|
595
|
-
// is_encrypted: Bool - Whether data is encrypted
|
|
596
|
-
// export_format: String - Format of exported data ("json", "csv", "pdf", etc.)
|
|
597
|
-
//
|
|
598
|
-
// -----------------------------------------------------------------------------
|
|
599
|
-
// PALISADE/ML
|
|
600
|
-
// -----------------------------------------------------------------------------
|
|
601
|
-
// environment: String - "production", "development", "research"
|
|
602
|
-
// artifact_format: String - "pickle", "safetensors", "gguf", "onnx"
|
|
603
|
-
// artifact_signed: Bool - Whether artifact has signature
|
|
604
|
-
// severity: String - "CRITICAL", "HIGH", "MEDIUM", "LOW", "INFO"
|
|
605
|
-
// finding_type: String - Type of security finding
|
|
606
|
-
// provenance_signer: String - Who signed ("unknown", "unsigned", or name)
|
|
607
|
-
// pickle_exec_path_detected: Bool - RCE path found in pickle
|
|
608
|
-
// metadata_malicious_pattern: Bool - Malicious pattern in metadata
|
|
609
|
-
// tokenizer_added_tokens_count: Long - Number of added tokens
|
|
610
|
-
// safetensors_integrity_violation: Bool - Safetensors integrity failed
|
|
611
|
-
// gguf_suspicious_metadata: Bool - Suspicious GGUF metadata
|
|
612
|
-
// adapter_base_digest_mismatch: Bool - LoRA adapter digest mismatch
|
|
613
|
-
// metadata_cosai_level_numeric: Long - CoSAI maturity level (0-5)
|
|
614
|
-
//
|
|
92
|
+
// ACTIONS
|
|
93
|
+
// =============================================================================
|
|
94
|
+
|
|
95
|
+
action process_prompt;
|
|
96
|
+
action process_response;
|
|
97
|
+
action invoke_model;
|
|
98
|
+
action filter_content;
|
|
99
|
+
action call_tool;
|
|
100
|
+
action connect_server;
|
|
101
|
+
action access_server_resource;
|
|
102
|
+
action skip_guardrails;
|
|
103
|
+
action read_file;
|
|
104
|
+
action write_file;
|
|
105
|
+
action delete_file;
|
|
106
|
+
action http_request;
|
|
107
|
+
action call_external_api;
|
|
108
|
+
action execute_code;
|
|
109
|
+
action run_tests;
|
|
110
|
+
action run_build;
|
|
111
|
+
action git_operation;
|
|
112
|
+
action git_clone;
|
|
113
|
+
action git_commit;
|
|
114
|
+
action git_push;
|
|
115
|
+
action git_pull;
|
|
116
|
+
action git_merge;
|
|
117
|
+
action git_checkout;
|
|
118
|
+
action git_reset;
|
|
119
|
+
action git_rebase;
|
|
120
|
+
action delegate_task;
|
|
121
|
+
action spawn_subprocess;
|
|
122
|
+
action access_memory;
|
|
123
|
+
action scan_target;
|
|
124
|
+
action scan_package;
|
|
125
|
+
action scan_artifact;
|
|
126
|
+
action validate_integrity;
|
|
127
|
+
action validate_provenance;
|
|
128
|
+
action quarantine_artifact;
|
|
129
|
+
action load_model;
|
|
130
|
+
action deploy_model;
|
|
131
|
+
action transfer_data;
|
|
132
|
+
action export_data;
|
|
133
|
+
}
|
|
615
134
|
`;
|