@highflame/policy 2.1.1 → 2.1.3
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/_schemas/guardrails/context.json +502 -0
- package/_schemas/guardrails/schema.cedarschema +150 -2
- package/_schemas/guardrails/templates/defaults/agentic_safety.cedar +45 -0
- package/_schemas/guardrails/templates/defaults/security_patterns.cedar +59 -0
- package/_schemas/guardrails/templates/templates.json +12 -2
- package/_schemas/overwatch/context.json +313 -61
- package/_schemas/overwatch/schema.cedarschema +251 -133
- package/dist/guardrails-context.gen.d.ts +46 -0
- package/dist/guardrails-context.gen.js +46 -0
- package/dist/guardrails-defaults.gen.js +129 -4
- package/dist/overwatch-context.gen.d.ts +23 -3
- package/dist/overwatch-context.gen.js +23 -3
- package/dist/overwatch-defaults.gen.d.ts +1 -1
- package/dist/overwatch-defaults.gen.js +1189 -458
- package/dist/service-schemas.gen.d.ts +2 -2
- package/dist/service-schemas.gen.js +579 -191
- package/package.json +1 -1
|
@@ -1,210 +1,285 @@
|
|
|
1
|
-
// Overwatch
|
|
1
|
+
// Overwatch Cedar Schema
|
|
2
2
|
// ===================================
|
|
3
|
-
// IDE Security & Policy Enforcement
|
|
3
|
+
// IDE Agent Security & Policy Enforcement
|
|
4
4
|
//
|
|
5
|
-
// Overwatch protects IDE operations (prompts, tool calls, file access
|
|
6
|
-
// threats detected by
|
|
5
|
+
// Overwatch protects IDE agent operations (prompts, tool calls, file access, MCP connections)
|
|
6
|
+
// by evaluating threats detected by the detection engine pipeline against Cedar policies.
|
|
7
7
|
//
|
|
8
8
|
// Architecture:
|
|
9
|
-
// User/Agent → IDE Hook →
|
|
9
|
+
// User/Agent → IDE Hook → Detection Engine → Cedar Policy → Allow/Deny
|
|
10
10
|
//
|
|
11
11
|
// Supported IDEs:
|
|
12
12
|
// - Cursor (beforeSubmitPrompt, beforeShellExecution, beforeMCPExecution, etc.)
|
|
13
13
|
// - Claude Code (UserPromptSubmit, PreToolUse)
|
|
14
14
|
// - GitHub Copilot (userPromptSubmitted, preToolUse)
|
|
15
|
+
//
|
|
16
|
+
// Threat Coverage:
|
|
17
|
+
// - OWASP Top 10 for LLM Applications 2025 (LLM01-LLM10)
|
|
18
|
+
// - OWASP Top 10 for Agentic Applications (ASI01-ASI10)
|
|
19
|
+
// - OWASP MCP Top 10 (MCP01-MCP05)
|
|
20
|
+
// - MITRE ATLAS Agent Techniques (AML.T0051, AML.T0080-T0082)
|
|
15
21
|
|
|
16
22
|
namespace Overwatch {
|
|
17
23
|
|
|
18
24
|
// =============================================================================
|
|
19
|
-
// ENTITIES -
|
|
25
|
+
// ENTITIES - Tenant Hierarchy (ReBAC)
|
|
20
26
|
// =============================================================================
|
|
27
|
+
// Aligned with Guardrails entity hierarchy (Account → Project).
|
|
28
|
+
// Overwatch does not have app-specific policies, so App is omitted.
|
|
29
|
+
//
|
|
30
|
+
// Entity hierarchy enables Cedar's `in` operator for policy scoping:
|
|
31
|
+
// Account (org root)
|
|
32
|
+
// └── Project in [Account]
|
|
33
|
+
// └── Tool/Server/FilePath/LlmPrompt in [Project]
|
|
34
|
+
//
|
|
35
|
+
// Policy scoping examples:
|
|
36
|
+
// resource == Overwatch::Tool::"shell" → specific tool
|
|
37
|
+
// resource in Overwatch::Project::"<uuid>" → project-wide
|
|
38
|
+
// resource in Overwatch::Account::"<uuid>" → org-wide
|
|
21
39
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
entity Organization {
|
|
25
|
-
name: String, // "Acme Corp", "Highflame"
|
|
26
|
-
};
|
|
40
|
+
/// Account represents an organization (top-level tenant)
|
|
41
|
+
entity Account;
|
|
27
42
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
entity Team in [Organization] {
|
|
31
|
-
name: String, // "security", "engineering", "devops"
|
|
32
|
-
};
|
|
43
|
+
/// Project represents a project within an account
|
|
44
|
+
entity Project in [Account];
|
|
33
45
|
|
|
34
46
|
// =============================================================================
|
|
35
47
|
// ENTITIES - Principals
|
|
36
48
|
// =============================================================================
|
|
37
49
|
|
|
38
|
-
|
|
39
|
-
entity User
|
|
40
|
-
user_type: String, // "external" or "internal"
|
|
41
|
-
email: String, // User email (optional)
|
|
42
|
-
};
|
|
50
|
+
/// Human user or service account making requests to the IDE
|
|
51
|
+
entity User;
|
|
43
52
|
|
|
44
|
-
|
|
45
|
-
entity Agent
|
|
46
|
-
agent_type: String, // "claude", "copilot", etc.
|
|
47
|
-
};
|
|
53
|
+
/// AI agent (Claude, GitHub Copilot, etc.)
|
|
54
|
+
entity Agent;
|
|
48
55
|
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
56
|
+
// =============================================================================
|
|
57
|
+
// ENTITIES - Resources (scoped under Project)
|
|
58
|
+
// =============================================================================
|
|
53
59
|
|
|
54
|
-
|
|
55
|
-
entity
|
|
56
|
-
tool_name: String, // "shell", "read_file", "playwright", etc.
|
|
57
|
-
risk_level: String, // "low", "medium", "high"
|
|
58
|
-
};
|
|
60
|
+
/// LLM prompt or session — resource for process_prompt action
|
|
61
|
+
entity LlmPrompt in [Project];
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
entity
|
|
62
|
-
server_name: String, // "filesystem", "playwright", etc.
|
|
63
|
-
};
|
|
63
|
+
/// MCP tool or native IDE tool — resource for call_tool action
|
|
64
|
+
entity Tool in [Project];
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
entity
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
/// MCP server — resource for connect_server action
|
|
67
|
+
entity Server in [Project];
|
|
68
|
+
|
|
69
|
+
/// File system path — resource for read_file/write_file/call_tool actions
|
|
70
|
+
entity FilePath in [Project];
|
|
70
71
|
|
|
71
72
|
// =============================================================================
|
|
72
73
|
// ACTIONS
|
|
73
74
|
// =============================================================================
|
|
74
75
|
|
|
75
76
|
// User submits a prompt or receives AI response
|
|
77
|
+
// Threat focus: injection, jailbreak, secrets, PII, content safety, invisible chars
|
|
76
78
|
action process_prompt appliesTo {
|
|
77
79
|
principal: [User, Agent],
|
|
78
80
|
resource: [LlmPrompt],
|
|
79
81
|
context: {
|
|
80
|
-
// Event & Source
|
|
81
|
-
content: String,
|
|
82
|
-
source: String,
|
|
83
|
-
event: String,
|
|
84
|
-
user_email: String,
|
|
85
|
-
|
|
86
|
-
// Workspace
|
|
87
|
-
cwd?: String,
|
|
88
|
-
workspace_root?: String,
|
|
89
|
-
|
|
90
|
-
// Threat Detection
|
|
91
|
-
threat_count: Long,
|
|
92
|
-
highest_severity: String,
|
|
93
|
-
threat_categories: Set<String>,
|
|
94
|
-
|
|
95
|
-
max_threat_severity: Long,
|
|
96
|
-
contains_secrets: Bool,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
//
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
//
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
82
|
+
// --- Event & Source ---
|
|
83
|
+
content: String, // Raw content being scanned
|
|
84
|
+
source: String, // IDE source: "cursor", "claudecode", "github_copilot"
|
|
85
|
+
event: String, // Hook event name
|
|
86
|
+
user_email: String, // User identifier
|
|
87
|
+
|
|
88
|
+
// --- Workspace ---
|
|
89
|
+
cwd?: String, // Current working directory
|
|
90
|
+
workspace_root?: String, // Workspace/repository root
|
|
91
|
+
|
|
92
|
+
// --- Threat Detection (from detection engine pipeline) ---
|
|
93
|
+
threat_count: Long, // Total threats detected
|
|
94
|
+
highest_severity: String, // "critical", "high", "medium", "low", "none"
|
|
95
|
+
threat_categories: Set<String>, // Threat category names
|
|
96
|
+
detected_threats: Set<String>, // Detection rule names that matched
|
|
97
|
+
max_threat_severity: Long, // Numeric severity (0=none, 1=low, 2=medium, 3=high, 4=critical)
|
|
98
|
+
contains_secrets: Bool, // Whether secrets/credentials detected
|
|
99
|
+
|
|
100
|
+
// --- Secrets (granular) ---
|
|
101
|
+
secret_types?: Set<String>, // Types: "aws_access_key", "github_token", "ssh_private_key", etc.
|
|
102
|
+
secret_count?: Long, // Number of distinct secrets found
|
|
103
|
+
|
|
104
|
+
// --- PII Detection ---
|
|
105
|
+
pii_detected?: Bool, // Whether any PII patterns matched
|
|
106
|
+
pii_types?: Set<String>, // Types: "ssn", "credit_card", "email", "phone", etc.
|
|
107
|
+
pii_count?: Long, // Number of PII matches
|
|
108
|
+
|
|
109
|
+
// --- Encoding & Unicode Attacks ---
|
|
110
|
+
contains_invisible_chars?: Bool, // Zero-width chars, bidi overrides, tag chars detected
|
|
111
|
+
invisible_chars_score?: Long, // Unicode attack severity (0-100)
|
|
112
|
+
|
|
113
|
+
// --- Content Safety Scores (0-100, from ML classifiers) ---
|
|
114
|
+
violence_score: Long,
|
|
115
|
+
weapons_score: Long,
|
|
116
|
+
hate_speech_score: Long,
|
|
117
|
+
crime_score: Long,
|
|
118
|
+
sexual_score: Long,
|
|
119
|
+
profanity_score: Long,
|
|
120
|
+
|
|
121
|
+
// --- ML Detector Confidence Scores (0-100) ---
|
|
122
|
+
pii_confidence: Long, // PII detection classifier confidence
|
|
123
|
+
injection_confidence: Long, // Prompt injection classifier confidence
|
|
124
|
+
jailbreak_confidence: Long, // Jailbreak detection classifier confidence
|
|
125
|
+
|
|
126
|
+
// --- Agent Security (0-100) ---
|
|
127
|
+
indirect_injection_score: Long, // Indirect prompt injection risk (OWASP LLM01, ASI01)
|
|
128
|
+
|
|
129
|
+
// --- Session Detection History (cross-turn sticky flags) ---
|
|
130
|
+
session_pii_detected?: Bool,
|
|
131
|
+
session_pii_types?: Set<String>,
|
|
132
|
+
session_secrets_detected?: Bool,
|
|
133
|
+
session_secret_types?: Set<String>,
|
|
134
|
+
session_injection_detected?: Bool,
|
|
135
|
+
session_command_injection?: Bool,
|
|
136
|
+
session_threat_turns?: Long,
|
|
137
|
+
|
|
138
|
+
// --- Legacy ---
|
|
139
|
+
prompt_text?: String, // Same as content (backward compatibility)
|
|
140
|
+
response_content?: String, // Response content (if available)
|
|
118
141
|
},
|
|
119
142
|
};
|
|
120
143
|
|
|
121
144
|
// User calls a tool (native IDE tool or MCP tool)
|
|
145
|
+
// Threat focus: command injection, tool poisoning, rug pull, data exfiltration, loops
|
|
122
146
|
action call_tool appliesTo {
|
|
123
147
|
principal: [User, Agent],
|
|
124
148
|
resource: [Tool, FilePath],
|
|
125
149
|
context: {
|
|
126
|
-
// Event & Source
|
|
127
|
-
content: String,
|
|
128
|
-
source: String,
|
|
129
|
-
event: String,
|
|
130
|
-
user_email: String,
|
|
150
|
+
// --- Event & Source ---
|
|
151
|
+
content: String, // Raw content being scanned (e.g., shell command, tool args)
|
|
152
|
+
source: String, // IDE source
|
|
153
|
+
event: String, // Hook event name
|
|
154
|
+
user_email: String, // User identifier
|
|
131
155
|
|
|
132
|
-
// Tool & MCP
|
|
133
|
-
tool_name?: String,
|
|
134
|
-
mcp_server?: String,
|
|
135
|
-
mcp_tool?: String,
|
|
156
|
+
// --- Tool & MCP ---
|
|
157
|
+
tool_name?: String, // Normalized tool name ("shell", "read_file", etc.)
|
|
158
|
+
mcp_server?: String, // MCP server name
|
|
159
|
+
mcp_tool?: String, // MCP tool name
|
|
136
160
|
|
|
137
|
-
// File & Path
|
|
138
|
-
path?: String,
|
|
161
|
+
// --- File & Path ---
|
|
162
|
+
path?: String, // File path (if file operation)
|
|
139
163
|
|
|
140
|
-
// Workspace
|
|
164
|
+
// --- Workspace ---
|
|
141
165
|
cwd?: String,
|
|
142
166
|
workspace_root?: String,
|
|
143
167
|
|
|
144
|
-
// Threat Detection
|
|
168
|
+
// --- Threat Detection ---
|
|
145
169
|
threat_count?: Long,
|
|
146
170
|
highest_severity?: String,
|
|
147
171
|
threat_categories?: Set<String>,
|
|
148
|
-
|
|
172
|
+
detected_threats?: Set<String>,
|
|
149
173
|
max_threat_severity?: Long,
|
|
150
174
|
contains_secrets?: Bool,
|
|
151
|
-
response_content?: String,
|
|
152
175
|
|
|
153
|
-
//
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
//
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
//
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
// --- Secrets (granular) ---
|
|
177
|
+
secret_types?: Set<String>,
|
|
178
|
+
secret_count?: Long,
|
|
179
|
+
|
|
180
|
+
// --- PII Detection ---
|
|
181
|
+
pii_detected?: Bool,
|
|
182
|
+
pii_types?: Set<String>,
|
|
183
|
+
pii_count?: Long,
|
|
184
|
+
|
|
185
|
+
// --- Encoding & Unicode Attacks ---
|
|
186
|
+
contains_invisible_chars?: Bool,
|
|
187
|
+
invisible_chars_score?: Long,
|
|
188
|
+
|
|
189
|
+
// --- Content Safety Scores (0-100) ---
|
|
190
|
+
violence_score?: Long,
|
|
191
|
+
weapons_score?: Long,
|
|
192
|
+
hate_speech_score?: Long,
|
|
193
|
+
crime_score?: Long,
|
|
194
|
+
sexual_score?: Long,
|
|
195
|
+
profanity_score?: Long,
|
|
196
|
+
|
|
197
|
+
// --- ML Detector Confidence Scores (0-100) ---
|
|
198
|
+
pii_confidence?: Long,
|
|
199
|
+
injection_confidence?: Long,
|
|
200
|
+
jailbreak_confidence?: Long,
|
|
201
|
+
|
|
202
|
+
// --- Agent Security (0-100) --- (OWASP ASI01, ASI02, ASI04; MITRE AML.T0051)
|
|
203
|
+
tool_poisoning_score?: Long, // Hidden instructions in tool description/args
|
|
204
|
+
tool_poisoning_detected?: Bool, // Boolean flag for tool poisoning
|
|
205
|
+
rug_pull_score?: Long, // Tool behavior drift after trust establishment
|
|
206
|
+
rug_pull_detected?: Bool, // Boolean flag for rug pull
|
|
207
|
+
indirect_injection_score?: Long, // Indirect injection via tool output
|
|
208
|
+
|
|
209
|
+
// --- Tool Risk Assessment ---
|
|
210
|
+
tool_risk_score?: Long, // Computed tool risk (0-100)
|
|
211
|
+
tool_category?: String, // "safe", "sensitive", "dangerous"
|
|
212
|
+
tool_is_sensitive?: Bool, // Sensitivity classification
|
|
213
|
+
tool_is_builtin?: Bool, // Built-in IDE tool vs MCP tool
|
|
214
|
+
|
|
215
|
+
// --- Behavioral Analysis --- (OWASP LLM10, ASI02, ASI08)
|
|
216
|
+
loop_detected?: Bool, // Consecutive same-tool call loop
|
|
217
|
+
loop_count?: Long, // Number of consecutive repeat calls
|
|
218
|
+
loop_tool?: String, // Tool name in loop
|
|
219
|
+
suspicious_pattern?: Bool, // Data exfiltration or attack sequence detected
|
|
220
|
+
pattern_type?: String, // "data_exfiltration", "secret_exfiltration", "credential_theft", "destructive_sequence"
|
|
221
|
+
sequence_risk?: Long, // Sequence risk score (0-100)
|
|
222
|
+
|
|
223
|
+
// --- MCP Trust ---
|
|
224
|
+
mcp_server_verified?: Bool, // Whether server is from verified registry
|
|
225
|
+
|
|
226
|
+
// --- Session Detection History (cross-turn sticky flags) ---
|
|
227
|
+
session_pii_detected?: Bool,
|
|
228
|
+
session_pii_types?: Set<String>,
|
|
229
|
+
session_secrets_detected?: Bool,
|
|
230
|
+
session_secret_types?: Set<String>,
|
|
231
|
+
session_injection_detected?: Bool,
|
|
232
|
+
session_command_injection?: Bool,
|
|
233
|
+
session_threat_turns?: Long,
|
|
234
|
+
|
|
235
|
+
// --- Legacy ---
|
|
236
|
+
response_content?: String,
|
|
177
237
|
},
|
|
178
238
|
};
|
|
179
239
|
|
|
180
240
|
// Connect to an MCP server
|
|
241
|
+
// Threat focus: supply chain, tool poisoning, rug pull, config risk
|
|
181
242
|
action connect_server appliesTo {
|
|
182
243
|
principal: [User, Agent],
|
|
183
244
|
resource: [Server],
|
|
184
245
|
context: {
|
|
185
|
-
content?: String,
|
|
246
|
+
content?: String, // Server config content (if available)
|
|
186
247
|
source: String,
|
|
187
248
|
event: String,
|
|
188
249
|
user_email: String,
|
|
189
250
|
mcp_server?: String,
|
|
190
|
-
|
|
251
|
+
|
|
252
|
+
// --- Threat Detection ---
|
|
253
|
+
threat_count?: Long,
|
|
191
254
|
highest_severity?: String,
|
|
192
255
|
threat_categories?: Set<String>,
|
|
193
256
|
max_threat_severity?: Long,
|
|
194
257
|
|
|
195
|
-
// Agent Security (0-100)
|
|
196
|
-
//
|
|
197
|
-
|
|
198
|
-
rug_pull_score?: Long,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
//
|
|
203
|
-
mcp_server_verified?: Bool,
|
|
258
|
+
// --- Agent Security (0-100) --- (OWASP ASI04, MCP01-MCP05)
|
|
259
|
+
tool_poisoning_score?: Long, // Poisoned tool descriptions in server
|
|
260
|
+
tool_poisoning_detected?: Bool,
|
|
261
|
+
rug_pull_score?: Long, // Server behavior change after approval
|
|
262
|
+
rug_pull_detected?: Bool,
|
|
263
|
+
indirect_injection_score?: Long, // Injection payloads in server responses
|
|
264
|
+
|
|
265
|
+
// --- MCP Trust & Config Risk ---
|
|
266
|
+
mcp_server_verified?: Bool, // Verified registry status
|
|
267
|
+
mcp_config_risk?: Bool, // Risky server config detected (inline code exec, etc.)
|
|
268
|
+
mcp_risk_score?: Long, // Config risk severity (0-100)
|
|
269
|
+
|
|
270
|
+
// --- Session Detection History (cross-turn sticky flags) ---
|
|
271
|
+
session_pii_detected?: Bool,
|
|
272
|
+
session_pii_types?: Set<String>,
|
|
273
|
+
session_secrets_detected?: Bool,
|
|
274
|
+
session_secret_types?: Set<String>,
|
|
275
|
+
session_injection_detected?: Bool,
|
|
276
|
+
session_command_injection?: Bool,
|
|
277
|
+
session_threat_turns?: Long,
|
|
204
278
|
},
|
|
205
279
|
};
|
|
206
280
|
|
|
207
281
|
// Read a file from disk
|
|
282
|
+
// Threat focus: secrets exposure, PII exposure, path traversal, sensitive paths
|
|
208
283
|
action read_file appliesTo {
|
|
209
284
|
principal: [User, Agent],
|
|
210
285
|
resource: [FilePath],
|
|
@@ -216,15 +291,37 @@ action read_file appliesTo {
|
|
|
216
291
|
path?: String,
|
|
217
292
|
cwd?: String,
|
|
218
293
|
workspace_root?: String,
|
|
219
|
-
|
|
294
|
+
|
|
295
|
+
// --- Threat Detection ---
|
|
296
|
+
threat_count?: Long,
|
|
220
297
|
highest_severity?: String,
|
|
221
298
|
threat_categories?: Set<String>,
|
|
299
|
+
detected_threats?: Set<String>,
|
|
222
300
|
max_threat_severity?: Long,
|
|
223
301
|
contains_secrets?: Bool,
|
|
302
|
+
|
|
303
|
+
// --- Secrets (granular) ---
|
|
304
|
+
secret_types?: Set<String>,
|
|
305
|
+
secret_count?: Long,
|
|
306
|
+
|
|
307
|
+
// --- PII Detection ---
|
|
308
|
+
pii_detected?: Bool,
|
|
309
|
+
pii_types?: Set<String>,
|
|
310
|
+
pii_count?: Long,
|
|
311
|
+
|
|
312
|
+
// --- Session Detection History (cross-turn sticky flags) ---
|
|
313
|
+
session_pii_detected?: Bool,
|
|
314
|
+
session_pii_types?: Set<String>,
|
|
315
|
+
session_secrets_detected?: Bool,
|
|
316
|
+
session_secret_types?: Set<String>,
|
|
317
|
+
session_injection_detected?: Bool,
|
|
318
|
+
session_command_injection?: Bool,
|
|
319
|
+
session_threat_turns?: Long,
|
|
224
320
|
},
|
|
225
321
|
};
|
|
226
322
|
|
|
227
323
|
// Write a file to disk
|
|
324
|
+
// Threat focus: secrets in output, PII in output, sensitive paths, malicious code
|
|
228
325
|
action write_file appliesTo {
|
|
229
326
|
principal: [User, Agent],
|
|
230
327
|
resource: [FilePath],
|
|
@@ -236,11 +333,32 @@ action write_file appliesTo {
|
|
|
236
333
|
path?: String,
|
|
237
334
|
cwd?: String,
|
|
238
335
|
workspace_root?: String,
|
|
239
|
-
|
|
336
|
+
|
|
337
|
+
// --- Threat Detection ---
|
|
338
|
+
threat_count?: Long,
|
|
240
339
|
highest_severity?: String,
|
|
241
340
|
threat_categories?: Set<String>,
|
|
341
|
+
detected_threats?: Set<String>,
|
|
242
342
|
max_threat_severity?: Long,
|
|
243
343
|
contains_secrets?: Bool,
|
|
344
|
+
|
|
345
|
+
// --- Secrets (granular) ---
|
|
346
|
+
secret_types?: Set<String>,
|
|
347
|
+
secret_count?: Long,
|
|
348
|
+
|
|
349
|
+
// --- PII Detection ---
|
|
350
|
+
pii_detected?: Bool,
|
|
351
|
+
pii_types?: Set<String>,
|
|
352
|
+
pii_count?: Long,
|
|
353
|
+
|
|
354
|
+
// --- Session Detection History (cross-turn sticky flags) ---
|
|
355
|
+
session_pii_detected?: Bool,
|
|
356
|
+
session_pii_types?: Set<String>,
|
|
357
|
+
session_secrets_detected?: Bool,
|
|
358
|
+
session_secret_types?: Set<String>,
|
|
359
|
+
session_injection_detected?: Bool,
|
|
360
|
+
session_command_injection?: Bool,
|
|
361
|
+
session_threat_turns?: Long,
|
|
244
362
|
},
|
|
245
363
|
};
|
|
246
364
|
|
|
@@ -7,40 +7,86 @@
|
|
|
7
7
|
export declare const GuardrailsContextKey: {
|
|
8
8
|
readonly BudgetExceeded: "budget_exceeded";
|
|
9
9
|
readonly BudgetRemainingPct: "budget_remaining_pct";
|
|
10
|
+
readonly CodeLanguages: "code_languages";
|
|
11
|
+
readonly CodeRatio: "code_ratio";
|
|
12
|
+
readonly CommandInjectionDetected: "command_injection_detected";
|
|
13
|
+
readonly CommandInjectionScore: "command_injection_score";
|
|
14
|
+
readonly CommandInjectionType: "command_injection_type";
|
|
15
|
+
readonly ContainsCode: "contains_code";
|
|
10
16
|
readonly ContainsInvisibleChars: "contains_invisible_chars";
|
|
17
|
+
readonly ContainsNonAscii: "contains_non_ascii";
|
|
11
18
|
readonly ContainsSecrets: "contains_secrets";
|
|
19
|
+
readonly ContentSafetyBlocked: "content_safety_blocked";
|
|
20
|
+
readonly ContentSafetyScore: "content_safety_score";
|
|
12
21
|
readonly ContentTopics: "content_topics";
|
|
13
22
|
readonly ContentType: "content_type";
|
|
23
|
+
readonly ConversationTurn: "conversation_turn";
|
|
14
24
|
readonly CrimeScore: "crime_score";
|
|
25
|
+
readonly CrossOriginDetected: "cross_origin_detected";
|
|
26
|
+
readonly CrossOriginScore: "cross_origin_score";
|
|
27
|
+
readonly CrossOriginType: "cross_origin_type";
|
|
28
|
+
readonly DetectedLanguage: "detected_language";
|
|
29
|
+
readonly DetectedScript: "detected_script";
|
|
15
30
|
readonly DetectorCount: "detector_count";
|
|
16
31
|
readonly Direction: "direction";
|
|
32
|
+
readonly EncodedContentDetected: "encoded_content_detected";
|
|
33
|
+
readonly EncodedCount: "encoded_count";
|
|
34
|
+
readonly EncodedScore: "encoded_score";
|
|
35
|
+
readonly EncodedTypes: "encoded_types";
|
|
36
|
+
readonly FactualityScore: "factuality_score";
|
|
37
|
+
readonly HallucinationScore: "hallucination_score";
|
|
17
38
|
readonly HateSpeechScore: "hate_speech_score";
|
|
18
39
|
readonly InjectionScore: "injection_score";
|
|
19
40
|
readonly InjectionType: "injection_type";
|
|
20
41
|
readonly InvisibleCharsScore: "invisible_chars_score";
|
|
42
|
+
readonly IsEnglish: "is_english";
|
|
43
|
+
readonly IsLatinScript: "is_latin_script";
|
|
21
44
|
readonly JailbreakScore: "jailbreak_score";
|
|
45
|
+
readonly KeywordCategories: "keyword_categories";
|
|
46
|
+
readonly KeywordCount: "keyword_count";
|
|
47
|
+
readonly KeywordMatched: "keyword_matched";
|
|
48
|
+
readonly LanguageConfidence: "language_confidence";
|
|
22
49
|
readonly LoopCount: "loop_count";
|
|
23
50
|
readonly LoopDetected: "loop_detected";
|
|
24
51
|
readonly LoopTool: "loop_tool";
|
|
52
|
+
readonly McpConfigRisk: "mcp_config_risk";
|
|
53
|
+
readonly McpRiskScore: "mcp_risk_score";
|
|
54
|
+
readonly McpRiskType: "mcp_risk_type";
|
|
25
55
|
readonly McpServer: "mcp_server";
|
|
26
56
|
readonly McpServerVerified: "mcp_server_verified";
|
|
27
57
|
readonly McpTool: "mcp_tool";
|
|
58
|
+
readonly MultiTurnDetection: "multi_turn_detection";
|
|
59
|
+
readonly PathTraversalDetected: "path_traversal_detected";
|
|
60
|
+
readonly PathTraversalSeverity: "path_traversal_severity";
|
|
61
|
+
readonly PathTraversalType: "path_traversal_type";
|
|
28
62
|
readonly PatternType: "pattern_type";
|
|
63
|
+
readonly PhishingDetected: "phishing_detected";
|
|
29
64
|
readonly PiiCount: "pii_count";
|
|
30
65
|
readonly PiiDetected: "pii_detected";
|
|
31
66
|
readonly PiiTypes: "pii_types";
|
|
32
67
|
readonly ProfanityScore: "profanity_score";
|
|
33
68
|
readonly RequestId: "request_id";
|
|
69
|
+
readonly RugPullDetected: "rug_pull_detected";
|
|
70
|
+
readonly RugPullScore: "rug_pull_score";
|
|
71
|
+
readonly RugPullType: "rug_pull_type";
|
|
72
|
+
readonly ScriptConfidence: "script_confidence";
|
|
34
73
|
readonly SecretCount: "secret_count";
|
|
35
74
|
readonly SecretTypes: "secret_types";
|
|
75
|
+
readonly SentimentScore: "sentiment_score";
|
|
36
76
|
readonly SequenceRisk: "sequence_risk";
|
|
37
77
|
readonly SexualScore: "sexual_score";
|
|
78
|
+
readonly SqlInjectionDetected: "sql_injection_detected";
|
|
79
|
+
readonly SqlInjectionScore: "sql_injection_score";
|
|
80
|
+
readonly SqlInjectionType: "sql_injection_type";
|
|
38
81
|
readonly SuspiciousPattern: "suspicious_pattern";
|
|
39
82
|
readonly Timestamp: "timestamp";
|
|
40
83
|
readonly ToolCategory: "tool_category";
|
|
41
84
|
readonly ToolIsBuiltin: "tool_is_builtin";
|
|
42
85
|
readonly ToolIsSensitive: "tool_is_sensitive";
|
|
43
86
|
readonly ToolName: "tool_name";
|
|
87
|
+
readonly ToolPoisoningDetected: "tool_poisoning_detected";
|
|
88
|
+
readonly ToolPoisoningScore: "tool_poisoning_score";
|
|
89
|
+
readonly ToolPoisoningType: "tool_poisoning_type";
|
|
44
90
|
readonly ToolRiskScore: "tool_risk_score";
|
|
45
91
|
readonly TopicConfidence: "topic_confidence";
|
|
46
92
|
readonly ViolenceScore: "violence_score";
|