@highflame/policy 2.0.10 → 2.1.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 (46) hide show
  1. package/_schemas/guardrails/context.json +435 -0
  2. package/_schemas/guardrails/schema.cedarschema +225 -0
  3. package/_schemas/guardrails/templates/defaults/agentic_safety.cedar +94 -0
  4. package/_schemas/guardrails/templates/defaults/baseline.cedar +24 -0
  5. package/_schemas/guardrails/templates/defaults/injection.cedar +70 -0
  6. package/_schemas/guardrails/templates/defaults/pii.cedar +48 -0
  7. package/_schemas/guardrails/templates/defaults/secrets.cedar +40 -0
  8. package/_schemas/guardrails/templates/defaults/semantic.cedar +59 -0
  9. package/_schemas/guardrails/templates/defaults/tool_risk.cedar +58 -0
  10. package/_schemas/guardrails/templates/defaults/toxicity.cedar +76 -0
  11. package/_schemas/guardrails/templates/mcp_tool_permissions.cedar +84 -0
  12. package/_schemas/guardrails/templates/profiles/chat_assistant/privacy.cedar +22 -0
  13. package/_schemas/guardrails/templates/profiles/chat_assistant/security.cedar +35 -0
  14. package/_schemas/guardrails/templates/profiles/chat_assistant/trust_safety.cedar +43 -0
  15. package/_schemas/guardrails/templates/profiles/chat_assistant.cedar +85 -0
  16. package/_schemas/guardrails/templates/profiles/code_agent/agentic_security.cedar +109 -0
  17. package/_schemas/guardrails/templates/profiles/code_agent/security.cedar +22 -0
  18. package/_schemas/guardrails/templates/profiles/code_agent.cedar +125 -0
  19. package/_schemas/guardrails/templates/profiles/data_pipeline/agentic_security.cedar +38 -0
  20. package/_schemas/guardrails/templates/profiles/data_pipeline/privacy.cedar +40 -0
  21. package/_schemas/guardrails/templates/profiles/data_pipeline/security.cedar +49 -0
  22. package/_schemas/guardrails/templates/profiles/data_pipeline.cedar +111 -0
  23. package/_schemas/guardrails/templates/templates.json +213 -0
  24. package/dist/builder.d.ts +61 -0
  25. package/dist/builder.js +4 -2
  26. package/dist/entities.gen.d.ts +4 -0
  27. package/dist/entities.gen.js +4 -0
  28. package/dist/explain.d.ts +178 -0
  29. package/dist/explain.js +390 -0
  30. package/dist/guardrails-context.gen.d.ts +49 -0
  31. package/dist/guardrails-context.gen.js +50 -0
  32. package/dist/guardrails-defaults.gen.d.ts +61 -0
  33. package/dist/guardrails-defaults.gen.js +1278 -0
  34. package/dist/guardrails-entities.gen.d.ts +11 -0
  35. package/dist/guardrails-entities.gen.js +37 -0
  36. package/dist/index.d.ts +6 -1
  37. package/dist/index.js +6 -1
  38. package/dist/overwatch-defaults.gen.js +98 -0
  39. package/dist/parser.js +136 -4
  40. package/dist/schema.gen.d.ts +1 -1
  41. package/dist/schema.gen.js +6 -0
  42. package/dist/service-schemas.gen.d.ts +10 -0
  43. package/dist/service-schemas.gen.js +337 -1
  44. package/dist/types.d.ts +6 -1
  45. package/dist/types.js +6 -1
  46. package/package.json +5 -1
@@ -1,12 +1,244 @@
1
1
  // Code generated by highflame-policy-codegen. DO NOT EDIT.
2
- // Source: schemas/overwatch/schema.cedarschema, schemas/palisade/schema.cedarschema
2
+ // Source: schemas/guardrails/schema.cedarschema, schemas/overwatch/schema.cedarschema, schemas/palisade/schema.cedarschema
3
3
  //
4
4
  // Service-specific Cedar schemas and context metadata.
5
5
  // Works in both browser and Node.js environments.
6
6
  //
7
7
  // Usage:
8
+ // import { GUARDRAILS_SCHEMA, GUARDRAILS_CONTEXT } from '@highflame/policy/types';
8
9
  // import { OVERWATCH_SCHEMA, OVERWATCH_CONTEXT } from '@highflame/policy/types';
9
10
  // import { PALISADE_SCHEMA, PALISADE_CONTEXT } from '@highflame/policy/types';
11
+ /**
12
+ * Guardrails Cedar schema
13
+ *
14
+ * Full Cedar schema for guardrails, embedded at codegen time.
15
+ */
16
+ export const GUARDRAILS_SCHEMA = `// =============================================================================
17
+ // Guardrails Cedar Schema
18
+ // =============================================================================
19
+ // Defines entity types, actions, and context attributes for the highflame-shield
20
+ // guardrails service. This schema enables type-safe policy authoring and
21
+ // validation in both Studio UI and backend.
22
+ //
23
+ // Service: highflame-shield (guardrails)
24
+ // Namespace: Guardrails
25
+ // =============================================================================
26
+
27
+ namespace Guardrails {
28
+ // =========================================================================
29
+ // Entity Types — ReBAC Hierarchy
30
+ // =========================================================================
31
+ // Entity hierarchy enables Cedar's \`in\` operator for policy scoping:
32
+ // Account (org root)
33
+ // └── Project in [Account]
34
+ // └── App in [Project]
35
+ // └── Session in [App]
36
+ //
37
+ // Policy scoping examples:
38
+ // resource == Guardrails::App::"<uuid>" → app-scoped
39
+ // resource in Guardrails::Project::"<uuid>" → project-wide
40
+ // resource in Guardrails::Account::"<uuid>" → org-wide
41
+ // =========================================================================
42
+
43
+ /// Account represents an organization (top-level tenant)
44
+ entity Account;
45
+
46
+ /// Project represents a project within an account
47
+ entity Project in [Account];
48
+
49
+ /// User represents a principal (human or service) making requests
50
+ entity User;
51
+
52
+ /// Agent represents an AI agent (Claude, Cursor, Copilot, etc.) making requests
53
+ entity Agent;
54
+
55
+ /// App represents a protected application (guardrails-enabled LLM app)
56
+ entity App in [Project];
57
+
58
+ /// Session represents an agentic conversation session with state tracking
59
+ entity Session in [App];
60
+
61
+ // =========================================================================
62
+ // Actions
63
+ // =========================================================================
64
+
65
+ /// Process user prompts and AI responses for security threats and content violations
66
+ action "process_prompt" appliesTo {
67
+ principal: [User, Agent],
68
+ resource: [App, Session],
69
+ context: ProcessPromptContext
70
+ };
71
+
72
+ /// Execute tool calls (shell, file operations, MCP tools)
73
+ action "call_tool" appliesTo {
74
+ principal: [User, Agent],
75
+ resource: [Session],
76
+ context: CallToolContext
77
+ };
78
+
79
+ /// Read file operations
80
+ action "read_file" appliesTo {
81
+ principal: [User, Agent],
82
+ resource: [Session],
83
+ context: FileReadContext
84
+ };
85
+
86
+ /// Write file operations
87
+ action "write_file" appliesTo {
88
+ principal: [User, Agent],
89
+ resource: [Session],
90
+ context: FileWriteContext
91
+ };
92
+
93
+ /// Connect to an MCP server
94
+ action "connect_server" appliesTo {
95
+ principal: [User, Agent],
96
+ resource: [Session],
97
+ context: ConnectServerContext
98
+ };
99
+
100
+ // =========================================================================
101
+ // Context Types (Action-Specific)
102
+ // =========================================================================
103
+
104
+ /// Context for process_prompt action (user prompts & AI responses)
105
+ type ProcessPromptContext = {
106
+ // Core metadata (required)
107
+ "request_id": String,
108
+ "timestamp": Long,
109
+ "direction": String, // "input" | "output"
110
+ "content_type": String, // "prompt" | "response" | "tool_call" | "file"
111
+ "detector_count": Long,
112
+
113
+ // Security - Injection & Jailbreak (optional)
114
+ "injection_score"?: Long, // 0-100
115
+ "jailbreak_score"?: Long, // 0-100
116
+ "injection_type"?: String, // "prompt" | "sql" | "command" | "none"
117
+
118
+ // Privacy - Secrets (optional)
119
+ "contains_secrets"?: Bool,
120
+ "secret_count"?: Long,
121
+ "secret_types"?: Set<String>, // ["aws_access_key", "github_token", ...]
122
+
123
+ // Privacy - PII (optional)
124
+ "pii_detected"?: Bool,
125
+ "pii_count"?: Long,
126
+ "pii_types"?: Set<String>, // ["email", "phone", "ssn", "credit_card", ...]
127
+
128
+ // Trust & Safety - Toxicity (optional)
129
+ "violence_score"?: Long, // 0-100
130
+ "hate_speech_score"?: Long, // 0-100
131
+ "sexual_score"?: Long, // 0-100
132
+ "weapons_score"?: Long, // 0-100
133
+ "crime_score"?: Long, // 0-100
134
+ "profanity_score"?: Long, // 0-100
135
+
136
+ // Semantic - Topic Classification (optional)
137
+ "content_topics"?: Set<String>, // ["controlled_substances", "weapons_manufacturing", ...]
138
+ "topic_confidence"?: Long, // 0-100
139
+
140
+ // Security - Invisible Character Detection (optional)
141
+ "contains_invisible_chars"?: Bool,
142
+ "invisible_chars_score"?: Long, // 0-100
143
+
144
+ // Additional detectors (optional)
145
+ "hallucination_score"?: Long,
146
+ "sentiment_score"?: Long,
147
+ "contains_code"?: Bool,
148
+ "code_languages"?: Set<String>,
149
+ "keyword_matched"?: Bool,
150
+ "keyword_categories"?: Set<String>,
151
+ "detected_language"?: String,
152
+ "phishing_detected"?: Bool,
153
+
154
+ };
155
+
156
+ /// Context for call_tool action (agentic tool execution)
157
+ type CallToolContext = {
158
+ // Core metadata (required)
159
+ "request_id": String,
160
+ "timestamp": Long,
161
+
162
+ // Tool Risk (optional)
163
+ "tool_name"?: String, // "shell", "write_file", "http_post", etc.
164
+ "tool_risk_score"?: Long, // 0-100
165
+ "tool_is_sensitive"?: Bool,
166
+ "tool_category"?: String, // "safe" | "sensitive" | "dangerous"
167
+ "tool_is_builtin"?: Bool,
168
+
169
+ // MCP context (optional — only present for MCP tool calls)
170
+ "mcp_server"?: String, // MCP server name (e.g., "github", "filesystem")
171
+ "mcp_tool"?: String, // MCP tool name within the server
172
+ "mcp_server_verified"?: Bool, // Whether server is from verified registry
173
+
174
+ // Agentic - Behavioral Patterns (optional)
175
+ "suspicious_pattern"?: Bool,
176
+ "pattern_type"?: String, // "data_exfiltration" | "secret_exfiltration" | "db_exfiltration" | "none"
177
+ "sequence_risk"?: Long, // 0-100
178
+
179
+ // Agentic - Loop Detection (optional)
180
+ "loop_detected"?: Bool,
181
+ "loop_count"?: Long,
182
+ "loop_tool"?: String,
183
+
184
+ // Agentic - Budget Control (optional)
185
+ "budget_remaining_pct"?: Long, // 0-100
186
+ "budget_exceeded"?: Bool,
187
+
188
+ // Semantic - Topic Classification (optional)
189
+ "content_topics"?: Set<String>, // ["controlled_substances", "weapons_manufacturing", ...]
190
+ "topic_confidence"?: Long, // 0-100
191
+
192
+ // Security checks on tool arguments (optional)
193
+ "contains_secrets"?: Bool,
194
+ "secret_types"?: Set<String>,
195
+ "pii_detected"?: Bool,
196
+ "pii_types"?: Set<String>,
197
+ "injection_score"?: Long,
198
+
199
+ };
200
+
201
+ /// Context for read_file action
202
+ type FileReadContext = {
203
+ // Core metadata (required)
204
+ "request_id": String,
205
+ "timestamp": Long,
206
+
207
+ // Security checks on file content (optional)
208
+ "contains_secrets"?: Bool,
209
+ "secret_types"?: Set<String>,
210
+ "pii_detected"?: Bool,
211
+ "pii_types"?: Set<String>,
212
+
213
+ };
214
+
215
+ /// Context for write_file action
216
+ type FileWriteContext = {
217
+ // Core metadata (required)
218
+ "request_id": String,
219
+ "timestamp": Long,
220
+
221
+ // Security checks on content being written (optional)
222
+ "contains_secrets"?: Bool,
223
+ "secret_types"?: Set<String>,
224
+ "pii_detected"?: Bool,
225
+ "pii_types"?: Set<String>,
226
+
227
+ };
228
+
229
+ /// Context for connect_server action (MCP server connections)
230
+ type ConnectServerContext = {
231
+ // Core metadata (required)
232
+ "request_id": String,
233
+ "timestamp": Long,
234
+
235
+ // MCP context (optional)
236
+ "mcp_server"?: String, // MCP server name (e.g., "github", "filesystem")
237
+ "mcp_server_verified"?: Bool, // Whether server is from verified registry
238
+
239
+ };
240
+ }
241
+ `;
10
242
  /**
11
243
  * Overwatch Cedar schema
12
244
  *
@@ -434,6 +666,110 @@ action scan_package appliesTo {
434
666
 
435
667
  }
436
668
  `;
669
+ /**
670
+ * Guardrails context metadata (parsed JSON)
671
+ */
672
+ export const GUARDRAILS_CONTEXT = {
673
+ "service": "guardrails",
674
+ "version": "1.0.0",
675
+ "description": "Guardrails (Shield) content security & policy enforcement for LLM applications",
676
+ "actions": [
677
+ {
678
+ "name": "process_prompt",
679
+ "description": "Analyze user prompts and AI responses for security threats, PII, and content violations",
680
+ "context_attributes": [
681
+ { "key": "request_id", "type": "string", "required": true, "description": "Unique identifier for this request, useful for audit trails and debugging" },
682
+ { "key": "timestamp", "type": "number", "required": true, "description": "Unix timestamp in milliseconds when the request was processed" },
683
+ { "key": "direction", "type": "string", "required": true, "description": "Content flow direction: \'input\' for user prompts, \'output\' for AI responses. Use this to apply different policies to inputs vs outputs (e.g., block PII only in outputs)" },
684
+ { "key": "content_type", "type": "string", "required": true, "description": "Type of content being analyzed: \'prompt\', \'response\', \'tool_call\', or \'file\'" },
685
+ { "key": "detector_count", "type": "number", "required": true, "description": "Number of detectors that were executed for this request" },
686
+ { "key": "injection_score", "type": "number", "required": false, "description": "ML-based confidence score for prompt injection attacks (0-100). Higher scores indicate higher confidence. Typical threshold: >85 for high-confidence blocks" },
687
+ { "key": "jailbreak_score", "type": "number", "required": false, "description": "ML-based confidence score for jailbreak attempts (0-100). Detects attempts to bypass safety guardrails. Typical threshold: >80 for blocks" },
688
+ { "key": "injection_type", "type": "string", "required": false, "description": "Type of injection detected: \'prompt\', \'sql\', \'command\', or \'none\'. Use this to apply different policies per injection type" },
689
+ { "key": "contains_secrets", "type": "boolean", "required": false, "description": "Whether any API keys, tokens, passwords, or credentials were detected in the content. True indicates presence of secrets" },
690
+ { "key": "secret_count", "type": "number", "required": false, "description": "Total number of secret matches found. Multiple matches may indicate data dumps or accidental credential exposure" },
691
+ { "key": "secret_types", "type": "array", "required": false, "description": "Array of secret types found (e.g., [\'aws_access_key\', \'github_token\']). Use set operations like .contains() to check for specific types" },
692
+ { "key": "pii_detected", "type": "boolean", "required": false, "description": "Whether personally identifiable information (PII) was found in the content. Commonly used to block PII in outputs to prevent data leakage" },
693
+ { "key": "pii_count", "type": "number", "required": false, "description": "Total number of PII matches found (emails, phone numbers, SSNs, etc.)" },
694
+ { "key": "pii_types", "type": "array", "required": false, "description": "Array of PII types detected (e.g., [\'email\', \'phone\', \'ssn\', \'credit_card\']). Use .contains() to block specific sensitive types" },
695
+ { "key": "violence_score", "type": "number", "required": false, "description": "ML-based score for violent content references (0-100). Typical threshold: >90 for critical blocks, >60 for warnings" },
696
+ { "key": "hate_speech_score", "type": "number", "required": false, "description": "ML-based score for hate speech, discriminatory language, or targeted harassment (0-100). Typical threshold: >75 for blocks" },
697
+ { "key": "sexual_score", "type": "number", "required": false, "description": "ML-based score for sexual or adult content (0-100). Adjust thresholds based on your application\'s audience" },
698
+ { "key": "weapons_score", "type": "number", "required": false, "description": "ML-based score for weapons references or violent imagery (0-100)" },
699
+ { "key": "crime_score", "type": "number", "required": false, "description": "ML-based score for criminal activity discussions (0-100)" },
700
+ { "key": "profanity_score", "type": "number", "required": false, "description": "ML-based score for profanity and vulgar language (0-100)" },
701
+ { "key": "content_topics", "type": "array", "required": false, "description": "Semantic topics detected in content (e.g., [\'controlled_substances\', \'weapons_manufacturing\']). Use .contains() to block specific topics per application" },
702
+ { "key": "topic_confidence", "type": "number", "required": false, "description": "Confidence score from topic classifier (0-100). Use with content_topics to tune sensitivity — higher thresholds reduce false positives" },
703
+ { "key": "contains_invisible_chars", "type": "boolean", "required": false, "description": "Whether invisible Unicode characters (zero-width joiners, RTL marks, etc.) were detected in the content. Commonly used for prompt injection evasion" },
704
+ { "key": "invisible_chars_score", "type": "number", "required": false, "description": "Density score for invisible characters in the content (0-100). Higher scores indicate more invisible characters, suggesting evasion attempts" }
705
+ ]
706
+ },
707
+ {
708
+ "name": "call_tool",
709
+ "description": "Execute agentic tool calls, including shell commands, file operations, and MCP tools",
710
+ "context_attributes": [
711
+ { "key": "request_id", "type": "string", "required": true, "description": "Unique identifier for this request" },
712
+ { "key": "timestamp", "type": "number", "required": true, "description": "Unix timestamp in milliseconds" },
713
+ { "key": "tool_name", "type": "string", "required": false, "description": "Name of the tool being called (e.g., \'shell\', \'write_file\', \'http_post\'). Use this to block specific dangerous tools" },
714
+ { "key": "tool_risk_score", "type": "number", "required": false, "description": "Computed risk score for this tool call (0-100). Considers tool sensitivity, argument patterns, and MCP verification status. Typical threshold: >85 for dangerous tools" },
715
+ { "key": "tool_is_sensitive", "type": "boolean", "required": false, "description": "Whether the tool is classified as sensitive (shell, file operations, network access, etc.)" },
716
+ { "key": "tool_category", "type": "string", "required": false, "description": "Tool classification: \'safe\', \'sensitive\', or \'dangerous\'. Based on tool type and argument patterns" },
717
+ { "key": "tool_is_builtin", "type": "boolean", "required": false, "description": "Whether the tool is a built-in tool (vs MCP external tool). Built-in tools are generally more trusted" },
718
+ { "key": "mcp_server", "type": "string", "required": false, "description": "Name of the MCP server providing this tool (e.g., \'github\', \'filesystem\', \'slack\'). Empty for built-in tools. Use this to control which tools are allowed per MCP server" },
719
+ { "key": "mcp_tool", "type": "string", "required": false, "description": "Name of the specific tool within the MCP server (e.g., \'read_issues\', \'create_file\'). Use with mcp_server for fine-grained per-tool permissioning" },
720
+ { "key": "mcp_server_verified", "type": "boolean", "required": false, "description": "Whether the MCP server is from a verified/trusted registry. Unverified servers have elevated risk scores. Use this to block tool calls from unverified sources" },
721
+ { "key": "suspicious_pattern", "type": "boolean", "required": false, "description": "Whether a suspicious action sequence was detected (e.g., read_file → http_post indicating data exfiltration). Requires session tracking" },
722
+ { "key": "pattern_type", "type": "string", "required": false, "description": "Type of suspicious pattern: \'data_exfiltration\', \'secret_exfiltration\', \'db_exfiltration\', or \'none\'. Use this to apply different policies per threat type" },
723
+ { "key": "sequence_risk", "type": "number", "required": false, "description": "Risk score from action sequence analysis (0-100). Analyzes history of tool calls to detect attack patterns. Typical threshold: >80 for blocks" },
724
+ { "key": "loop_detected", "type": "boolean", "required": false, "description": "Whether a tool call loop was detected (same tool called repeatedly). May indicate infinite loops or runaway agents. Requires session tracking" },
725
+ { "key": "loop_count", "type": "number", "required": false, "description": "Number of consecutive repeated tool calls. Typical threshold: >3 for loop detection" },
726
+ { "key": "loop_tool", "type": "string", "required": false, "description": "Name of the tool involved in the loop" },
727
+ { "key": "budget_remaining_pct", "type": "number", "required": false, "description": "Remaining token budget as percentage (0-100). Use this to warn or block when budget is low. Requires session with token budget configuration" },
728
+ { "key": "budget_exceeded", "type": "boolean", "required": false, "description": "Whether the token budget has been exceeded. Use this to enforce cost controls on agentic sessions" },
729
+ { "key": "content_topics", "type": "array", "required": false, "description": "Semantic topics detected in tool arguments or content (e.g., [\'controlled_substances\']). Use .contains() to restrict tool calls involving specific topics" },
730
+ { "key": "topic_confidence", "type": "number", "required": false, "description": "Confidence score from topic classifier for tool content (0-100)" },
731
+ { "key": "contains_secrets", "type": "boolean", "required": false, "description": "Whether secrets were detected in tool arguments or content" },
732
+ { "key": "secret_types", "type": "array", "required": false, "description": "Array of secret types found in tool arguments" },
733
+ { "key": "pii_detected", "type": "boolean", "required": false, "description": "Whether PII was detected in tool arguments or content" },
734
+ { "key": "pii_types", "type": "array", "required": false, "description": "Array of PII types found in tool arguments" }
735
+ ]
736
+ },
737
+ {
738
+ "name": "read_file",
739
+ "description": "Read file operations for analyzing file content before allowing access",
740
+ "context_attributes": [
741
+ { "key": "request_id", "type": "string", "required": true, "description": "Unique identifier for this request" },
742
+ { "key": "timestamp", "type": "number", "required": true, "description": "Unix timestamp in milliseconds" },
743
+ { "key": "contains_secrets", "type": "boolean", "required": false, "description": "Whether secrets were detected in the file content being read" },
744
+ { "key": "secret_types", "type": "array", "required": false, "description": "Array of secret types found in file content" },
745
+ { "key": "pii_detected", "type": "boolean", "required": false, "description": "Whether PII was detected in the file content" },
746
+ { "key": "pii_types", "type": "array", "required": false, "description": "Array of PII types found in file content" }
747
+ ]
748
+ },
749
+ {
750
+ "name": "write_file",
751
+ "description": "Write file operations for preventing writes of sensitive content",
752
+ "context_attributes": [
753
+ { "key": "request_id", "type": "string", "required": true, "description": "Unique identifier for this request" },
754
+ { "key": "timestamp", "type": "number", "required": true, "description": "Unix timestamp in milliseconds" },
755
+ { "key": "contains_secrets", "type": "boolean", "required": false, "description": "Whether secrets were detected in the content being written. Block writes containing credentials" },
756
+ { "key": "secret_types", "type": "array", "required": false, "description": "Array of secret types found in write content" },
757
+ { "key": "pii_detected", "type": "boolean", "required": false, "description": "Whether PII was detected in the content being written" },
758
+ { "key": "pii_types", "type": "array", "required": false, "description": "Array of PII types found in write content" }
759
+ ]
760
+ },
761
+ {
762
+ "name": "connect_server",
763
+ "description": "Connect to an MCP server, used to control which MCP servers are allowed",
764
+ "context_attributes": [
765
+ { "key": "request_id", "type": "string", "required": true, "description": "Unique identifier for this request" },
766
+ { "key": "timestamp", "type": "number", "required": true, "description": "Unix timestamp in milliseconds" },
767
+ { "key": "mcp_server", "type": "string", "required": false, "description": "Name of the MCP server being connected to (e.g., \'github\', \'filesystem\', \'slack\'). Use this to allow or block specific MCP servers" },
768
+ { "key": "mcp_server_verified", "type": "boolean", "required": false, "description": "Whether the MCP server is from a verified/trusted registry. Use this to block connections to unverified servers" }
769
+ ]
770
+ }
771
+ ]
772
+ };
437
773
  /**
438
774
  * Overwatch context metadata (parsed JSON)
439
775
  */
package/dist/types.d.ts CHANGED
@@ -5,12 +5,17 @@ export * from './schema.gen.js';
5
5
  export * from './builder.js';
6
6
  export * from './errors.js';
7
7
  export * from './annotations.js';
8
- export { OVERWATCH_SCHEMA, OVERWATCH_CONTEXT, PALISADE_SCHEMA, PALISADE_CONTEXT, } from './service-schemas.gen.js';
8
+ export * from './explain.js';
9
+ export { GUARDRAILS_SCHEMA, GUARDRAILS_CONTEXT, OVERWATCH_SCHEMA, OVERWATCH_CONTEXT, PALISADE_SCHEMA, PALISADE_CONTEXT, } from './service-schemas.gen.js';
9
10
  export type { ContextAttribute, ActionContext, ServiceContext, } from './service-schemas.gen.js';
11
+ export { GuardrailsContextKey } from './guardrails-context.gen.js';
10
12
  export { OverwatchContextKey } from './overwatch-context.gen.js';
11
13
  export { PalisadeContextKey } from './palisade-context.gen.js';
14
+ export { GUARDRAILS_ENTITIES, GUARDRAILS_ACTION_ENTITIES, } from './guardrails-entities.gen.js';
12
15
  export { OVERWATCH_ENTITIES, OVERWATCH_ACTION_ENTITIES, } from './overwatch-entities.gen.js';
13
16
  export { PALISADE_ENTITIES, PALISADE_ACTION_ENTITIES, } from './palisade-entities.gen.js';
14
17
  export type { ServiceEntityMetadata, ActionEntityMetadata } from './entity-metadata-types.gen.js';
18
+ export { GUARDRAILS_DEFAULTS, GUARDRAILS_TEMPLATES, GUARDRAILS_CATEGORIES, GUARDRAILS_TEMPLATES_JSON, getGuardrailsDefaultsByCategory, getGuardrailsTemplatesByCategory, getGuardrailsTemplateById, } from './guardrails-defaults.gen.js';
19
+ export type { GuardrailsCategory, GuardrailsCategoryInfo, GuardrailsDefaultPolicy, GuardrailsTemplate, } from './guardrails-defaults.gen.js';
15
20
  export { OVERWATCH_DEFAULTS, OVERWATCH_TEMPLATES, OVERWATCH_CATEGORIES, OVERWATCH_TEMPLATES_JSON, getOverwatchDefaultsByCategory, getOverwatchTemplatesByCategory, getOverwatchTemplateById, } from './overwatch-defaults.gen.js';
16
21
  export type { OverwatchCategory, OverwatchCategoryInfo, OverwatchDefaultPolicy, OverwatchTemplate, } from './overwatch-defaults.gen.js';
package/dist/types.js CHANGED
@@ -15,13 +15,18 @@ export * from './builder.js';
15
15
  export * from './errors.js';
16
16
  // Annotations - works in browser (no WASM dependency)
17
17
  export * from './annotations.js';
18
+ // Decision explanation - works in browser (no WASM dependency)
19
+ export * from './explain.js';
18
20
  // Service-specific schemas and context (inlined, browser-safe)
19
- export { OVERWATCH_SCHEMA, OVERWATCH_CONTEXT, PALISADE_SCHEMA, PALISADE_CONTEXT, } from './service-schemas.gen.js';
21
+ export { GUARDRAILS_SCHEMA, GUARDRAILS_CONTEXT, OVERWATCH_SCHEMA, OVERWATCH_CONTEXT, PALISADE_SCHEMA, PALISADE_CONTEXT, } from './service-schemas.gen.js';
20
22
  // Service-specific context key enums
23
+ export { GuardrailsContextKey } from './guardrails-context.gen.js';
21
24
  export { OverwatchContextKey } from './overwatch-context.gen.js';
22
25
  export { PalisadeContextKey } from './palisade-context.gen.js';
23
26
  // Service-specific entity metadata (for UI - principals, resources, actions)
27
+ export { GUARDRAILS_ENTITIES, GUARDRAILS_ACTION_ENTITIES, } from './guardrails-entities.gen.js';
24
28
  export { OVERWATCH_ENTITIES, OVERWATCH_ACTION_ENTITIES, } from './overwatch-entities.gen.js';
25
29
  export { PALISADE_ENTITIES, PALISADE_ACTION_ENTITIES, } from './palisade-entities.gen.js';
26
30
  // Service-specific default policies, templates, and categories
31
+ export { GUARDRAILS_DEFAULTS, GUARDRAILS_TEMPLATES, GUARDRAILS_CATEGORIES, GUARDRAILS_TEMPLATES_JSON, getGuardrailsDefaultsByCategory, getGuardrailsTemplatesByCategory, getGuardrailsTemplateById, } from './guardrails-defaults.gen.js';
27
32
  export { OVERWATCH_DEFAULTS, OVERWATCH_TEMPLATES, OVERWATCH_CATEGORIES, OVERWATCH_TEMPLATES_JSON, getOverwatchDefaultsByCategory, getOverwatchTemplatesByCategory, getOverwatchTemplateById, } from './overwatch-defaults.gen.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highflame/policy",
3
- "version": "2.0.10",
3
+ "version": "2.1.1",
4
4
  "description": "Highflame Cedar policy types and engine wrapper",
5
5
  "readme": "README.md",
6
6
  "main": "dist/index.js",
@@ -42,6 +42,10 @@
42
42
  "./parser": {
43
43
  "import": "./dist/parser.js",
44
44
  "types": "./dist/parser.d.ts"
45
+ },
46
+ "./explain": {
47
+ "import": "./dist/explain.js",
48
+ "types": "./dist/explain.d.ts"
45
49
  }
46
50
  },
47
51
  "scripts": {