@highflame/policy 2.2.33 → 2.2.35
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/agent_ops/templates/ported/agent-security/agent_identity_multi_agent_safety.cedar +3 -17
- package/_schemas/agent_ops/templates/ported/threat-detection/security_patterns.cedar +7 -19
- package/_schemas/agent_ops/templates/ported/threat-detection/semantic_defaults.cedar +7 -33
- package/_schemas/agent_ops/templates/templates.json +4 -6
- package/_schemas/ai_gateway/templates/defaults/tools.cedar +3 -17
- package/_schemas/ai_gateway/templates/templates.json +1 -2
- package/_schemas/guardrails/templates/defaults/security_patterns.cedar +7 -19
- package/_schemas/guardrails/templates/profiles/multi_agent/agent_safety.cedar +3 -17
- package/_schemas/guardrails/templates/templates.json +4 -6
- package/_schemas/overwatch/context.json +222 -0
- package/_schemas/overwatch/schema.cedarschema +72 -0
- package/_schemas/sentry/templates/templates.json +0 -14
- package/dist/aarm-annotation.d.ts +18 -0
- package/dist/aarm-annotation.js +36 -1
- package/dist/aarm-annotations.gen.js +21 -0
- package/dist/agent_ops-defaults.gen.js +25 -79
- package/dist/ai_gateway-defaults.gen.js +6 -21
- package/dist/ai_gateway-detectors.gen.js +2 -2
- package/dist/guardrails-defaults.gen.js +18 -46
- package/dist/guardrails-detectors.gen.js +2 -2
- package/dist/overwatch-context.gen.d.ts +2 -1
- package/dist/overwatch-context.gen.js +2 -0
- package/dist/overwatch-defaults.gen.js +105 -42
- package/dist/overwatch-detectors.gen.js +2 -2
- package/dist/overwatch-entities.gen.js +5 -1
- package/dist/sentry-defaults.gen.d.ts +1 -1
- package/dist/sentry-defaults.gen.js +0 -56
- package/dist/sentry-detectors.gen.js +2 -2
- package/dist/service-schemas.gen.d.ts +1 -1
- package/dist/service-schemas.gen.js +114 -0
- package/package.json +1 -1
- package/_schemas/sentry/templates/defaults/file_safety.cedar +0 -31
|
@@ -188,14 +188,66 @@ when {
|
|
|
188
188
|
)
|
|
189
189
|
};
|
|
190
190
|
`;
|
|
191
|
+
const OVERWATCH_DATA_PROTECTION_REDACT_SECRETS_IN_TOOL_OUTPUT_CEDAR = `// =============================================================================
|
|
192
|
+
// Mask Secrets In Tool Output (Default, inactive)
|
|
193
|
+
// =============================================================================
|
|
194
|
+
// Masks secrets in tool output instead of withholding it.
|
|
195
|
+
//
|
|
196
|
+
// Context keys consumed:
|
|
197
|
+
// - secrets_detected: Bool
|
|
198
|
+
//
|
|
199
|
+
// Compliance:
|
|
200
|
+
// - NIST 800-53 SC-28, IA-5
|
|
201
|
+
// - OWASP LLM06
|
|
202
|
+
//
|
|
203
|
+
// Category: data-protection
|
|
204
|
+
// Namespace: Overwatch
|
|
205
|
+
// =============================================================================
|
|
206
|
+
//
|
|
207
|
+
// The companion to data-protection.block-secrets-*, for the one surface where
|
|
208
|
+
// blocking is not available: post_tool_call fires after the tool has already
|
|
209
|
+
// run, so a permission verdict is meaningless and the only enforcement left is
|
|
210
|
+
// changing what the model sees.
|
|
211
|
+
//
|
|
212
|
+
// @redaction_strategy makes Shield emit decision=modify with redacted_content,
|
|
213
|
+
// which the agent client substitutes for the real output. Clients differ in how
|
|
214
|
+
// far they can honour that — Claude Code and Cursor (MCP tools only) replace the
|
|
215
|
+
// output in place, while Codex and Gemini CLI can only withhold it wholesale.
|
|
216
|
+
//
|
|
217
|
+
// Not active by default: it changes the outcome for tool output from "nothing"
|
|
218
|
+
// to "masked", and on withhold-only clients from "nothing" to "output
|
|
219
|
+
// suppressed". Turn it on deliberately.
|
|
220
|
+
//
|
|
221
|
+
// Ordering note: Shield resolves most-restrictive-first (block > redact >
|
|
222
|
+
// observe). A hard secrets forbid in enforce posture that also matches this
|
|
223
|
+
// action will beat this rule and block. Scope hard forbids off post_tool_call
|
|
224
|
+
// if you want masking rather than suppression.
|
|
225
|
+
|
|
226
|
+
@id("data-protection.redact-secrets-in-tool-output")
|
|
227
|
+
@name("Mask secrets in tool output")
|
|
228
|
+
@description("Masks detected credentials in tool output instead of letting them enter the agent context.")
|
|
229
|
+
@severity("high")
|
|
230
|
+
@tags("category:data-protection,threat:secrets,detection:rule,surface:post-tool-call,owasp:llm06")
|
|
231
|
+
@redaction_strategy("mask")
|
|
232
|
+
forbid (
|
|
233
|
+
principal,
|
|
234
|
+
action == Overwatch::Action::"post_tool_call",
|
|
235
|
+
resource
|
|
236
|
+
)
|
|
237
|
+
when { context has secrets_detected && context.secrets_detected == true };
|
|
238
|
+
`;
|
|
191
239
|
const OVERWATCH_SEMANTIC_DEFAULTS_CEDAR = `// =============================================================================
|
|
192
240
|
// Semantic Threat Detection (Default)
|
|
193
241
|
// =============================================================================
|
|
194
|
-
// Blocks injection attacks (
|
|
195
|
-
//
|
|
242
|
+
// Blocks injection attacks (SQL, path traversal), prompt injection, jailbreak
|
|
243
|
+
// attempts, and encoded payloads using two detection tiers:
|
|
196
244
|
//
|
|
197
245
|
// Tier 1 — Pattern-based (always available, no external dependency)
|
|
198
|
-
//
|
|
246
|
+
// sql_injection, path_traversal, detect_encoded
|
|
247
|
+
//
|
|
248
|
+
// The command-injection rules were removed while that detector is disabled, so
|
|
249
|
+
// this template cannot instantiate rules that can never fire. See
|
|
250
|
+
// highflame-shield#386; restore them when the detector is re-enabled.
|
|
199
251
|
//
|
|
200
252
|
// Tier 2 — ML classifiers (require Highflame API token)
|
|
201
253
|
// injection_score, jailbreak_score
|
|
@@ -220,36 +272,6 @@ const OVERWATCH_SEMANTIC_DEFAULTS_CEDAR = `// ==================================
|
|
|
220
272
|
// Tier 1: Pattern-based injection detection
|
|
221
273
|
// ---------------------------------------------------------------------------
|
|
222
274
|
|
|
223
|
-
@id("semantic.block-command-injection-tool")
|
|
224
|
-
@name("Block command injection in tool calls")
|
|
225
|
-
@description("Blocks call_tool when detected_threats contains \\"command_injection\\".")
|
|
226
|
-
@severity("critical")
|
|
227
|
-
@tags("category:semantic,threat:command-injection,detection:pattern,surface:call-tool,mitre:t1059,owasp:asi02")
|
|
228
|
-
@reject_message("Tool execution blocked: command injection pattern detected — reverse shell, destructive command, or privilege escalation.")
|
|
229
|
-
forbid (
|
|
230
|
-
principal,
|
|
231
|
-
action == Overwatch::Action::"call_tool",
|
|
232
|
-
resource
|
|
233
|
-
)
|
|
234
|
-
when {
|
|
235
|
-
context has detected_threats && context.detected_threats.contains("command_injection")
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
@id("semantic.block-command-injection-prompt")
|
|
239
|
-
@name("Block command injection in prompts")
|
|
240
|
-
@description("Blocks process_prompt when detected_threats contains \\"command_injection\\".")
|
|
241
|
-
@severity("critical")
|
|
242
|
-
@tags("category:semantic,threat:command-injection,detection:pattern,surface:process-prompt,mitre:t1059")
|
|
243
|
-
@reject_message("Prompt blocked: command injection pattern detected.")
|
|
244
|
-
forbid (
|
|
245
|
-
principal,
|
|
246
|
-
action == Overwatch::Action::"process_prompt",
|
|
247
|
-
resource
|
|
248
|
-
)
|
|
249
|
-
when {
|
|
250
|
-
context has detected_threats && context.detected_threats.contains("command_injection")
|
|
251
|
-
};
|
|
252
|
-
|
|
253
275
|
@id("semantic.block-sql-injection-tool")
|
|
254
276
|
@name("Block SQL injection in tool calls")
|
|
255
277
|
@description("Blocks call_tool when detected_threats contains \\"sql_injection\\".")
|
|
@@ -1803,7 +1825,7 @@ when {
|
|
|
1803
1825
|
export const OVERWATCH_CATEGORIES = [
|
|
1804
1826
|
{ id: 'data-protection', name: 'Secrets & Data Protection', description: 'Block credential leakage and protect sensitive file paths.' },
|
|
1805
1827
|
{ id: 'privacy', name: 'PII Detection', description: 'Block personally identifiable information across prompts, tool calls, and file operations.' },
|
|
1806
|
-
{ id: 'semantic', name: 'Semantic Threat Detection', description: 'Block injection attacks (
|
|
1828
|
+
{ id: 'semantic', name: 'Semantic Threat Detection', description: 'Block injection attacks (SQL, path traversal, encoded), prompt injection, and jailbreak attempts.' },
|
|
1807
1829
|
{ id: 'trust-safety', name: 'Content Safety', description: 'Block violent, hateful, sexual, criminal, or excessively profane content.' },
|
|
1808
1830
|
{ id: 'tools', name: 'Tool Permissioning', description: 'Control shell execution, file operations, MCP servers, and sensitive system paths.' },
|
|
1809
1831
|
{ id: 'agent-identity', name: 'Agent-Specific Guardrails', description: 'Per-agent security policies applied based on agent identity.' },
|
|
@@ -1848,10 +1870,19 @@ export const OVERWATCH_TEMPLATES = [
|
|
|
1848
1870
|
severity: 'critical',
|
|
1849
1871
|
tags: ['category:data-protection', 'threat:secrets', 'owasp:llm06'],
|
|
1850
1872
|
},
|
|
1873
|
+
{
|
|
1874
|
+
id: 'data-protection.redact-secrets-in-tool-output',
|
|
1875
|
+
name: 'Mask Secrets In Tool Output',
|
|
1876
|
+
description: 'Masks detected credentials in tool output instead of letting them enter the agent context. Off by default; masking-capable clients replace the output, withhold-only clients suppress it.',
|
|
1877
|
+
category: 'data-protection',
|
|
1878
|
+
cedarText: OVERWATCH_DATA_PROTECTION_REDACT_SECRETS_IN_TOOL_OUTPUT_CEDAR,
|
|
1879
|
+
severity: 'high',
|
|
1880
|
+
tags: ['category:data-protection', 'threat:secrets', 'detection:rule', 'owasp:llm06'],
|
|
1881
|
+
},
|
|
1851
1882
|
{
|
|
1852
1883
|
id: 'semantic.defaults',
|
|
1853
1884
|
name: 'Semantic Threat Detection',
|
|
1854
|
-
description: 'Block injection attacks (
|
|
1885
|
+
description: 'Block injection attacks (SQL, path, encoded) plus ML-detected prompt injection and jailbreak attempts.',
|
|
1855
1886
|
category: 'semantic',
|
|
1856
1887
|
cedarText: OVERWATCH_SEMANTIC_DEFAULTS_CEDAR,
|
|
1857
1888
|
severity: 'critical',
|
|
@@ -2015,7 +2046,7 @@ export const OVERWATCH_TEMPLATES_JSON = `{
|
|
|
2015
2046
|
{
|
|
2016
2047
|
"id": "semantic",
|
|
2017
2048
|
"name": "Semantic Threat Detection",
|
|
2018
|
-
"description": "Block injection attacks (
|
|
2049
|
+
"description": "Block injection attacks (SQL, path traversal, encoded), prompt injection, and jailbreak attempts."
|
|
2019
2050
|
},
|
|
2020
2051
|
{
|
|
2021
2052
|
"id": "trust-safety",
|
|
@@ -2051,7 +2082,10 @@ export const OVERWATCH_TEMPLATES_JSON = `{
|
|
|
2051
2082
|
"category": "organization",
|
|
2052
2083
|
"file": "defaults/baseline.cedar",
|
|
2053
2084
|
"severity": "low",
|
|
2054
|
-
"tags": [
|
|
2085
|
+
"tags": [
|
|
2086
|
+
"category:organization",
|
|
2087
|
+
"posture:permit-default"
|
|
2088
|
+
],
|
|
2055
2089
|
"is_active": true
|
|
2056
2090
|
}
|
|
2057
2091
|
],
|
|
@@ -2063,7 +2097,10 @@ export const OVERWATCH_TEMPLATES_JSON = `{
|
|
|
2063
2097
|
"category": "organization",
|
|
2064
2098
|
"file": "defaults/baseline.cedar",
|
|
2065
2099
|
"severity": "low",
|
|
2066
|
-
"tags": [
|
|
2100
|
+
"tags": [
|
|
2101
|
+
"category:organization",
|
|
2102
|
+
"posture:permit-default"
|
|
2103
|
+
],
|
|
2067
2104
|
"auto_deploy": true
|
|
2068
2105
|
},
|
|
2069
2106
|
{
|
|
@@ -2073,12 +2110,30 @@ export const OVERWATCH_TEMPLATES_JSON = `{
|
|
|
2073
2110
|
"category": "data-protection",
|
|
2074
2111
|
"file": "defaults/secrets.cedar",
|
|
2075
2112
|
"severity": "critical",
|
|
2076
|
-
"tags": [
|
|
2113
|
+
"tags": [
|
|
2114
|
+
"category:data-protection",
|
|
2115
|
+
"threat:secrets",
|
|
2116
|
+
"owasp:llm06"
|
|
2117
|
+
]
|
|
2118
|
+
},
|
|
2119
|
+
{
|
|
2120
|
+
"id": "data-protection.redact-secrets-in-tool-output",
|
|
2121
|
+
"name": "Mask Secrets In Tool Output",
|
|
2122
|
+
"description": "Masks detected credentials in tool output instead of letting them enter the agent context. Off by default; masking-capable clients replace the output, withhold-only clients suppress it.",
|
|
2123
|
+
"category": "data-protection",
|
|
2124
|
+
"file": "defaults/secrets_redaction.cedar",
|
|
2125
|
+
"severity": "high",
|
|
2126
|
+
"tags": [
|
|
2127
|
+
"category:data-protection",
|
|
2128
|
+
"threat:secrets",
|
|
2129
|
+
"detection:rule",
|
|
2130
|
+
"owasp:llm06"
|
|
2131
|
+
]
|
|
2077
2132
|
},
|
|
2078
2133
|
{
|
|
2079
2134
|
"id": "semantic.defaults",
|
|
2080
2135
|
"name": "Semantic Threat Detection",
|
|
2081
|
-
"description": "Block injection attacks (
|
|
2136
|
+
"description": "Block injection attacks (SQL, path, encoded) plus ML-detected prompt injection and jailbreak attempts.",
|
|
2082
2137
|
"category": "semantic",
|
|
2083
2138
|
"file": "defaults/semantic.cedar",
|
|
2084
2139
|
"severity": "critical",
|
|
@@ -2223,7 +2278,11 @@ export const OVERWATCH_TEMPLATES_JSON = `{
|
|
|
2223
2278
|
"category": "tools",
|
|
2224
2279
|
"file": "mcp_server_allowlist.cedar",
|
|
2225
2280
|
"severity": "medium",
|
|
2226
|
-
"tags": [
|
|
2281
|
+
"tags": [
|
|
2282
|
+
"category:tools",
|
|
2283
|
+
"scope:org-wide",
|
|
2284
|
+
"posture:deny-default"
|
|
2285
|
+
]
|
|
2227
2286
|
},
|
|
2228
2287
|
{
|
|
2229
2288
|
"id": "tools.mcp-tool-permissions",
|
|
@@ -2284,7 +2343,11 @@ export const OVERWATCH_TEMPLATES_JSON = `{
|
|
|
2284
2343
|
"category": "agent-identity",
|
|
2285
2344
|
"file": "agent_guardrails.cedar",
|
|
2286
2345
|
"severity": "critical",
|
|
2287
|
-
"tags": [
|
|
2346
|
+
"tags": [
|
|
2347
|
+
"category:agent-identity",
|
|
2348
|
+
"scope:per-agent",
|
|
2349
|
+
"threat:injection"
|
|
2350
|
+
]
|
|
2288
2351
|
},
|
|
2289
2352
|
{
|
|
2290
2353
|
"id": "agent-security.malicious-package",
|
|
@@ -51,8 +51,8 @@ export const OVERWATCH_DETECTORS = [
|
|
|
51
51
|
inhouse: false,
|
|
52
52
|
model: null,
|
|
53
53
|
latencyP50Ms: 2,
|
|
54
|
-
emits: [{ name: "secrets_detected", type: "Bool", modifiable: false, semantic: "boolean_flag", description: "True iff at least one secret pattern matched." }, { name: "secret_types", type: "Set<String>", modifiable:
|
|
55
|
-
supportedModes: ["enforce", "monitor", "alert"],
|
|
54
|
+
emits: [{ name: "secrets_detected", type: "Bool", modifiable: false, semantic: "boolean_flag", description: "True iff at least one secret pattern matched." }, { name: "secret_types", type: "Set<String>", modifiable: true, semantic: "category_set", description: "Distinct secret types detected." }, { name: "secret_count", type: "Long", modifiable: false, semantic: "count", description: "Total secret matches detected." }],
|
|
55
|
+
supportedModes: ["enforce", "monitor", "alert", "modify"],
|
|
56
56
|
defendsAgainst: ["credential_leakage", "prompt_leakage"],
|
|
57
57
|
exampleAttacks: [{ title: "Key surfaced from a file read", vulnerabilityId: "credential_leakage", snippet: "(tool read .env) OPENAI_API_KEY=sk-proj-AAbb1234567890ZZ", expectedSignal: { "secrets_detected": true } }],
|
|
58
58
|
},
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
export const OVERWATCH_ENTITIES = {
|
|
8
8
|
principals: ['Agent', 'User'],
|
|
9
9
|
resources: ['FilePath', 'LlmPrompt', 'Server', 'Tool'],
|
|
10
|
-
actions: ['call_tool', 'connect_server', 'process_prompt', 'read_file', 'write_file'],
|
|
10
|
+
actions: ['call_tool', 'connect_server', 'post_tool_call', 'process_prompt', 'read_file', 'write_file'],
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* Per-action entity mapping for Overwatch.
|
|
@@ -22,6 +22,10 @@ export const OVERWATCH_ACTION_ENTITIES = {
|
|
|
22
22
|
principals: ['Agent', 'User'],
|
|
23
23
|
resources: ['Server'],
|
|
24
24
|
},
|
|
25
|
+
'post_tool_call': {
|
|
26
|
+
principals: ['Agent', 'User'],
|
|
27
|
+
resources: ['FilePath', 'LlmPrompt', 'Tool'],
|
|
28
|
+
},
|
|
25
29
|
'process_prompt': {
|
|
26
30
|
principals: ['Agent', 'User'],
|
|
27
31
|
resources: ['LlmPrompt'],
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Sentry policy category identifiers.
|
|
3
3
|
* Maps to UI tab names in Studio.
|
|
4
4
|
*/
|
|
5
|
-
export type SentryCategory = 'data-protection' | 'privacy' | 'semantic' | 'trust-safety' | '
|
|
5
|
+
export type SentryCategory = 'data-protection' | 'privacy' | 'semantic' | 'trust-safety' | 'clipboard' | 'organization';
|
|
6
6
|
/**
|
|
7
7
|
* Category metadata for UI display.
|
|
8
8
|
*/
|
|
@@ -1110,38 +1110,6 @@ when {
|
|
|
1110
1110
|
)
|
|
1111
1111
|
};
|
|
1112
1112
|
`;
|
|
1113
|
-
const SENTRY_FILE_SAFETY_BLOCK_UPLOAD_SECRETS_CEDAR = `// =============================================================================
|
|
1114
|
-
// File & Attachment Safety (Default)
|
|
1115
|
-
// =============================================================================
|
|
1116
|
-
// Blocks file uploads to AI chat services when document content contains
|
|
1117
|
-
// secrets. PII in uploads is handled by the canonical privacy.* templates
|
|
1118
|
-
// (defaults/pii*.cedar), which scope to upload_file.
|
|
1119
|
-
//
|
|
1120
|
-
// Context keys consumed:
|
|
1121
|
-
// - secrets_detected: Bool
|
|
1122
|
-
//
|
|
1123
|
-
// Compliance:
|
|
1124
|
-
// - NIST 800-53 SC-28; GDPR Art. 32
|
|
1125
|
-
//
|
|
1126
|
-
// Category: file-safety
|
|
1127
|
-
// Namespace: Sentry
|
|
1128
|
-
// =============================================================================
|
|
1129
|
-
|
|
1130
|
-
@id("file-safety.block-upload-secrets")
|
|
1131
|
-
@name("Block file uploads with secrets")
|
|
1132
|
-
@description("Blocks upload_file when secrets_detected is true.")
|
|
1133
|
-
@severity("critical")
|
|
1134
|
-
@tags("category:file-safety,threat:secrets,detection:rule,surface:upload-file,owasp:llm06")
|
|
1135
|
-
@reject_message("File upload blocked: secrets or credentials detected in document content.")
|
|
1136
|
-
forbid (
|
|
1137
|
-
principal,
|
|
1138
|
-
action == Sentry::Action::"upload_file",
|
|
1139
|
-
resource
|
|
1140
|
-
)
|
|
1141
|
-
when {
|
|
1142
|
-
context has secrets_detected && context.secrets_detected == true
|
|
1143
|
-
};
|
|
1144
|
-
`;
|
|
1145
1113
|
const SENTRY_CLIPBOARD_DEFAULTS_CEDAR = `// =============================================================================
|
|
1146
1114
|
// Clipboard Policy (Default)
|
|
1147
1115
|
// =============================================================================
|
|
@@ -1263,7 +1231,6 @@ export const SENTRY_CATEGORIES = [
|
|
|
1263
1231
|
{ id: 'privacy', name: 'PII Detection', description: 'Block personally identifiable information across messages and uploads.' },
|
|
1264
1232
|
{ id: 'semantic', name: 'Semantic Threat Detection', description: 'Block prompt injection, jailbreak attempts, and high-severity threats.' },
|
|
1265
1233
|
{ id: 'trust-safety', name: 'Content Safety', description: 'Block violent, harmful, hateful, sexual, or profane content.' },
|
|
1266
|
-
{ id: 'file-safety', name: 'File & Attachment Safety', description: 'Block file uploads containing secrets or PII.' },
|
|
1267
1234
|
{ id: 'clipboard', name: 'Clipboard Policy', description: 'Control paste operations into AI chat services.' },
|
|
1268
1235
|
{ id: 'organization', name: 'Organization Rules', description: 'Organization-wide baselines and session-aware threat escalation.' },
|
|
1269
1236
|
];
|
|
@@ -1350,15 +1317,6 @@ export const SENTRY_TEMPLATES = [
|
|
|
1350
1317
|
severity: 'critical',
|
|
1351
1318
|
tags: ['category:privacy', 'threat:pii', 'detection:pattern', 'compliance:pci-dss', 'compliance:hipaa'],
|
|
1352
1319
|
},
|
|
1353
|
-
{
|
|
1354
|
-
id: 'file-safety.block-upload-secrets',
|
|
1355
|
-
name: 'File & Attachment Safety',
|
|
1356
|
-
description: 'Block file uploads containing secrets in document content.',
|
|
1357
|
-
category: 'file-safety',
|
|
1358
|
-
cedarText: SENTRY_FILE_SAFETY_BLOCK_UPLOAD_SECRETS_CEDAR,
|
|
1359
|
-
severity: 'critical',
|
|
1360
|
-
tags: ['category:file-safety', 'threat:secrets'],
|
|
1361
|
-
},
|
|
1362
1320
|
{
|
|
1363
1321
|
id: 'clipboard.defaults',
|
|
1364
1322
|
name: 'Clipboard Policy',
|
|
@@ -1407,11 +1365,6 @@ export const SENTRY_TEMPLATES_JSON = `{
|
|
|
1407
1365
|
"name": "Content Safety",
|
|
1408
1366
|
"description": "Block violent, harmful, hateful, sexual, or profane content."
|
|
1409
1367
|
},
|
|
1410
|
-
{
|
|
1411
|
-
"id": "file-safety",
|
|
1412
|
-
"name": "File & Attachment Safety",
|
|
1413
|
-
"description": "Block file uploads containing secrets or PII."
|
|
1414
|
-
},
|
|
1415
1368
|
{
|
|
1416
1369
|
"id": "clipboard",
|
|
1417
1370
|
"name": "Clipboard Policy",
|
|
@@ -1530,15 +1483,6 @@ export const SENTRY_TEMPLATES_JSON = `{
|
|
|
1530
1483
|
"compliance:hipaa"
|
|
1531
1484
|
]
|
|
1532
1485
|
},
|
|
1533
|
-
{
|
|
1534
|
-
"id": "file-safety.block-upload-secrets",
|
|
1535
|
-
"name": "File & Attachment Safety",
|
|
1536
|
-
"description": "Block file uploads containing secrets in document content.",
|
|
1537
|
-
"category": "file-safety",
|
|
1538
|
-
"file": "defaults/file_safety.cedar",
|
|
1539
|
-
"severity": "critical",
|
|
1540
|
-
"tags": ["category:file-safety", "threat:secrets"]
|
|
1541
|
-
},
|
|
1542
1486
|
{
|
|
1543
1487
|
"id": "clipboard.defaults",
|
|
1544
1488
|
"name": "Clipboard Policy",
|
|
@@ -37,8 +37,8 @@ export const SENTRY_DETECTORS = [
|
|
|
37
37
|
inhouse: false,
|
|
38
38
|
model: null,
|
|
39
39
|
latencyP50Ms: 2,
|
|
40
|
-
emits: [{ name: "secrets_detected", type: "Bool", modifiable: false, semantic: "boolean_flag", description: "True iff a secret pattern matched." }, { name: "secret_types", type: "Set<String>", modifiable:
|
|
41
|
-
supportedModes: ["enforce", "monitor", "alert"],
|
|
40
|
+
emits: [{ name: "secrets_detected", type: "Bool", modifiable: false, semantic: "boolean_flag", description: "True iff a secret pattern matched." }, { name: "secret_types", type: "Set<String>", modifiable: true, semantic: "category_set", description: "Distinct secret types detected." }, { name: "secret_count", type: "Long", modifiable: false, semantic: "count", description: "Total secret matches detected." }],
|
|
41
|
+
supportedModes: ["enforce", "monitor", "alert", "modify"],
|
|
42
42
|
defendsAgainst: ["credential_leakage", "prompt_leakage"],
|
|
43
43
|
exampleAttacks: [],
|
|
44
44
|
},
|
|
@@ -21,7 +21,7 @@ export declare const GUARDRAILS_SCHEMA = "// ===================================
|
|
|
21
21
|
*
|
|
22
22
|
* Full Cedar schema for overwatch, embedded at codegen time.
|
|
23
23
|
*/
|
|
24
|
-
export declare const OVERWATCH_SCHEMA = "// Overwatch Cedar Schema\n// ===================================\n// IDE Agent Security & Policy Enforcement\n//\n// Overwatch protects IDE agent operations (prompts, tool calls, file access, MCP connections)\n// by evaluating threats detected by the detection engine pipeline against Cedar policies.\n//\n// Architecture:\n// User/Agent \u2192 IDE Hook \u2192 Detection Engine \u2192 Cedar Policy \u2192 Allow/Deny\n//\n// Supported IDEs:\n// - Cursor (beforeSubmitPrompt, beforeShellExecution, beforeMCPExecution, etc.)\n// - Claude Code (UserPromptSubmit, PreToolUse)\n// - GitHub Copilot (userPromptSubmitted, preToolUse)\n//\n// Threat Coverage:\n// - OWASP Top 10 for LLM Applications 2025 (LLM01-LLM10)\n// - OWASP Top 10 for Agentic Applications (ASI01-ASI10)\n// - OWASP MCP Top 10 (MCP01-MCP05)\n// - MITRE ATLAS Agent Techniques (AML.T0051, AML.T0080-T0082)\n\nnamespace Overwatch {\n\n// =============================================================================\n// ENTITIES - Tenant Hierarchy (ReBAC)\n// =============================================================================\n// Aligned with Guardrails entity hierarchy (Account \u2192 Project).\n// Overwatch does not have app-specific policies, so App is omitted.\n//\n// Entity hierarchy enables Cedar's `in` operator for policy scoping:\n// Account (org root)\n// \u2514\u2500\u2500 Project in [Account]\n// \u2514\u2500\u2500 Tool/Server/FilePath/LlmPrompt in [Project]\n//\n// Policy scoping examples:\n// resource == Overwatch::Tool::\"shell\" \u2192 specific tool\n// resource in Overwatch::Project::\"<uuid>\" \u2192 project-wide\n// resource in Overwatch::Account::\"<uuid>\" \u2192 org-wide\n\n/// Account represents an organization (top-level tenant)\nentity Account;\n\n/// Project represents a project within an account\nentity Project in [Account];\n\n// =============================================================================\n// ENTITIES - Principals\n// =============================================================================\n\n/// Human user or service account making requests to the IDE\nentity User;\n\n/// AI agent (Claude, GitHub Copilot, etc.)\nentity Agent;\n\n// =============================================================================\n// ENTITIES - Resources (scoped under Project)\n// =============================================================================\n\n/// LLM prompt or session \u2014 resource for process_prompt action\nentity LlmPrompt in [Project];\n\n/// MCP tool or native IDE tool \u2014 resource for call_tool action\nentity Tool in [Project];\n\n/// MCP server \u2014 resource for connect_server action\nentity Server in [Project];\n\n/// File system path \u2014 resource for read_file/write_file/call_tool actions\nentity FilePath in [Project];\n\n// =============================================================================\n// ACTIONS\n// =============================================================================\n\n// User submits a prompt or receives AI response\n// Threat focus: injection, jailbreak, secrets, PII, content safety, invisible chars\naction process_prompt appliesTo {\n principal: [User, Agent],\n resource: [LlmPrompt],\n context: {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n role?: String,\n privilege_scope?: Set<String>,\n // --- Event & Source ---\n content: String, // Raw content being scanned\n source: String, // IDE source: \"cursor\", \"claudecode\", \"github_copilot\"\n event: String, // Hook event name\n user_email: String, // User identifier\n\n // --- Workspace ---\n cwd?: String, // Current working directory\n workspace_root?: String, // Workspace/repository root\n\n // --- Threat Detection (from detection engine pipeline) ---\n threat_count: Long, // Total threats detected\n highest_severity: String, // \"critical\", \"high\", \"medium\", \"low\", \"none\"\n threat_categories: Set<String>, // Threat category names\n detected_threats: Set<String>, // Detection rule names that matched\n max_threat_severity: Long, // Numeric severity (0=none, 1=low, 2=medium, 3=high, 4=critical)\n secrets_detected: Bool, // Whether secrets/credentials detected\n\n // --- Secrets (granular) ---\n secret_types?: Set<String>, // Types: \"aws_access_key\", \"github_token\", \"ssh_private_key\", etc.\n secret_count?: Long, // Number of distinct secrets found\n\n // --- PII Detection ---\n pii_detected?: Bool, // Whether any PII patterns matched\n pii_types?: Set<String>, // Types: \"ssn\", \"credit_card\", \"email\", \"phone\", etc.\n pii_count?: Long, // Number of PII matches\n\n // --- Encoding & Unicode Attacks ---\n invisible_chars_detected?: Bool, // Zero-width chars, bidi overrides, tag chars detected\n invisible_chars_score?: Long, // Unicode attack severity (0-100)\n\n // --- Content Safety Scores (0-100, from ML classifiers) ---\n violence_score: Long,\n weapons_score: Long,\n hate_speech_score: Long,\n crime_score: Long,\n sexual_score: Long,\n profanity_score: Long,\n\n // --- ML Detector Confidence Scores (0-100) ---\n pii_score: Long, // PII detection classifier confidence\n injection_score: Long, // Combined injection confidence: MAX(pulse, deep_context)\n jailbreak_score: Long, // Combined jailbreak confidence: MAX(pulse, deep_context)\n injection_pulse_score?: Long, // 0-100 Pulse single-turn classifier\n injection_deep_context_score?: Long, // 0-100 DeepContext multi-turn\n jailbreak_pulse_score?: Long, // 0-100 Pulse single-turn classifier\n jailbreak_deep_context_score?: Long, // 0-100 DeepContext multi-turn\n\n // --- Agent Security (0-100) ---\n indirect_injection_score: Long, // Indirect prompt injection risk (OWASP LLM01, ASI01)\n\n // --- Session Detection History (cross-turn sticky flags) ---\n session_pii_detected?: Bool,\n session_pii_types?: Set<String>,\n session_secrets_detected?: Bool,\n session_secret_types?: Set<String>,\n session_injection_detected?: Bool,\n session_command_injection?: Bool,\n session_threat_turns?: Long,\n session_max_injection_score?: Long,\n session_max_jailbreak_score?: Long,\n session_max_command_injection_score?: Long,\n session_max_pii_score?: Long,\n session_max_secret_score?: Long,\n session_cumulative_risk_score?: Long,\n\n // --- Legacy ---\n prompt_text?: String, // Same as content (backward compatibility)\n response_content?: String, // Response content (if available)\n },\n};\n\n// User calls a tool (native IDE tool or MCP tool)\n// Threat focus: command injection, tool poisoning, rug pull, data exfiltration, loops\naction call_tool appliesTo {\n principal: [User, Agent],\n resource: [Tool, FilePath],\n context: {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n role?: String,\n privilege_scope?: Set<String>,\n // --- Event & Source ---\n content: String, // Raw content being scanned (e.g., shell command, tool args)\n source: String, // IDE source\n event: String, // Hook event name\n user_email: String, // User identifier\n\n // --- Tool & MCP ---\n tool_name?: String, // Normalized tool name (\"shell\", \"read_file\", etc.)\n mcp_server?: String, // MCP server name\n mcp_tool?: String, // MCP tool name\n\n // --- File & Path ---\n path?: String, // File path (if file operation)\n\n // --- Workspace ---\n cwd?: String,\n workspace_root?: String,\n\n // --- Threat Detection ---\n threat_count?: Long,\n highest_severity?: String,\n threat_categories?: Set<String>,\n detected_threats?: Set<String>,\n max_threat_severity?: Long,\n secrets_detected?: Bool,\n\n // --- Secrets (granular) ---\n secret_types?: Set<String>,\n secret_count?: Long,\n\n // --- PII Detection ---\n pii_detected?: Bool,\n pii_types?: Set<String>,\n pii_count?: Long,\n\n // --- Encoding & Unicode Attacks ---\n invisible_chars_detected?: Bool,\n invisible_chars_score?: Long,\n\n // --- Content Safety Scores (0-100) ---\n violence_score?: Long,\n weapons_score?: Long,\n hate_speech_score?: Long,\n crime_score?: Long,\n sexual_score?: Long,\n profanity_score?: Long,\n\n // --- ML Detector Confidence Scores (0-100) ---\n pii_score?: Long,\n injection_score?: Long, // Combined injection confidence: MAX(pulse, deep_context)\n jailbreak_score?: Long, // Combined jailbreak confidence: MAX(pulse, deep_context)\n injection_pulse_score?: Long, // 0-100 Pulse single-turn classifier\n injection_deep_context_score?: Long, // 0-100 DeepContext multi-turn\n jailbreak_pulse_score?: Long, // 0-100 Pulse single-turn classifier\n jailbreak_deep_context_score?: Long, // 0-100 DeepContext multi-turn\n\n // --- Agent Security (0-100) --- (OWASP ASI01, ASI02, ASI04; MITRE AML.T0051)\n tool_poisoning_score?: Long, // Hidden instructions in tool description/args\n tool_poisoning_detected?: Bool, // Boolean flag for tool poisoning\n rug_pull_score?: Long, // Tool behavior drift after trust establishment\n rug_pull_detected?: Bool, // Boolean flag for rug pull\n indirect_injection_score?: Long, // Indirect injection via tool output\n\n // --- Tool Risk Assessment ---\n tool_risk_score?: Long, // Computed tool risk (0-100)\n tool_category?: String, // \"safe\", \"sensitive\", \"dangerous\"\n tool_is_sensitive?: Bool, // Sensitivity classification\n tool_is_builtin?: Bool, // Built-in IDE tool vs MCP tool\n\n // --- Behavioral Analysis --- (OWASP LLM10, ASI02, ASI08)\n loop_detected?: Bool, // Consecutive same-tool call loop\n loop_count?: Long, // Number of consecutive repeat calls\n loop_tool?: String, // Tool name in loop\n suspicious_pattern?: Bool, // Data exfiltration or attack sequence detected\n pattern_type?: String, // \"data_exfiltration\", \"secret_exfiltration\", \"credential_theft\", \"destructive_sequence\"\n sequence_risk?: Long, // Sequence risk score (0-100)\n\n // --- MCP Trust ---\n mcp_server_verified?: Bool, // Whether server is from verified registry\n\n // --- Tool Operation Classifier ---\n tool_operation_classes?: Set<String>, // subset of {\"readonly\", \"write_enabling\", \"execute_enabling\", \"network_access\", \"unknown\"}\n\n // --- Session Detection History (cross-turn sticky flags) ---\n session_pii_detected?: Bool,\n session_pii_types?: Set<String>,\n session_secrets_detected?: Bool,\n session_secret_types?: Set<String>,\n session_injection_detected?: Bool,\n session_command_injection?: Bool,\n session_threat_turns?: Long,\n session_max_injection_score?: Long,\n session_max_jailbreak_score?: Long,\n session_max_command_injection_score?: Long,\n session_max_pii_score?: Long,\n session_max_secret_score?: Long,\n session_cumulative_risk_score?: Long,\n\n // --- Legacy ---\n response_content?: String,\n },\n};\n\n// Connect to an MCP server\n// Threat focus: supply chain, tool poisoning, rug pull, config risk\naction connect_server appliesTo {\n principal: [User, Agent],\n resource: [Server],\n context: {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n role?: String,\n privilege_scope?: Set<String>,\n content?: String, // Server config content (if available)\n source: String,\n event: String,\n user_email: String,\n mcp_server?: String,\n\n // --- Threat Detection ---\n threat_count?: Long,\n highest_severity?: String,\n threat_categories?: Set<String>,\n max_threat_severity?: Long,\n\n // --- Agent Security (0-100) --- (OWASP ASI04, MCP01-MCP05)\n tool_poisoning_score?: Long, // Poisoned tool descriptions in server\n tool_poisoning_detected?: Bool,\n rug_pull_score?: Long, // Server behavior change after approval\n rug_pull_detected?: Bool,\n indirect_injection_score?: Long, // Injection payloads in server responses\n\n // --- MCP Trust & Config Risk ---\n mcp_server_verified?: Bool, // Verified registry status\n mcp_config_risk?: Bool, // Risky server config detected (inline code exec, etc.)\n mcp_risk_score?: Long, // Config risk severity (0-100)\n\n // --- Session Detection History (cross-turn sticky flags) ---\n session_pii_detected?: Bool,\n session_pii_types?: Set<String>,\n session_secrets_detected?: Bool,\n session_secret_types?: Set<String>,\n session_injection_detected?: Bool,\n session_command_injection?: Bool,\n session_threat_turns?: Long,\n session_max_injection_score?: Long,\n session_max_jailbreak_score?: Long,\n session_max_command_injection_score?: Long,\n session_max_pii_score?: Long,\n session_max_secret_score?: Long,\n session_cumulative_risk_score?: Long,\n },\n};\n\n// Read a file from disk\n// Threat focus: secrets exposure, PII exposure, path traversal, sensitive paths\naction read_file appliesTo {\n principal: [User, Agent],\n resource: [FilePath],\n context: {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n role?: String,\n privilege_scope?: Set<String>,\n content: String,\n source: String,\n event: String,\n user_email: String,\n path?: String,\n cwd?: String,\n workspace_root?: String,\n\n // --- Threat Detection ---\n threat_count?: Long,\n highest_severity?: String,\n threat_categories?: Set<String>,\n detected_threats?: Set<String>,\n max_threat_severity?: Long,\n secrets_detected?: Bool,\n\n // --- Secrets (granular) ---\n secret_types?: Set<String>,\n secret_count?: Long,\n\n // --- PII Detection ---\n pii_detected?: Bool,\n pii_types?: Set<String>,\n pii_count?: Long,\n\n // --- Session Detection History (cross-turn sticky flags) ---\n session_pii_detected?: Bool,\n session_pii_types?: Set<String>,\n session_secrets_detected?: Bool,\n session_secret_types?: Set<String>,\n session_injection_detected?: Bool,\n session_command_injection?: Bool,\n session_threat_turns?: Long,\n session_max_injection_score?: Long,\n session_max_jailbreak_score?: Long,\n session_max_command_injection_score?: Long,\n session_max_pii_score?: Long,\n session_max_secret_score?: Long,\n session_cumulative_risk_score?: Long,\n\n // --- Agent Security ---\n indirect_injection_score?: Long, // Indirect injection via file content\n },\n};\n\n// Write a file to disk\n// Threat focus: secrets in output, PII in output, sensitive paths, malicious code\naction write_file appliesTo {\n principal: [User, Agent],\n resource: [FilePath],\n context: {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n role?: String,\n privilege_scope?: Set<String>,\n content: String,\n source: String,\n event: String,\n user_email: String,\n path?: String,\n cwd?: String,\n workspace_root?: String,\n\n // --- Threat Detection ---\n threat_count?: Long,\n highest_severity?: String,\n threat_categories?: Set<String>,\n detected_threats?: Set<String>,\n max_threat_severity?: Long,\n secrets_detected?: Bool,\n\n // --- Secrets (granular) ---\n secret_types?: Set<String>,\n secret_count?: Long,\n\n // --- PII Detection ---\n pii_detected?: Bool,\n pii_types?: Set<String>,\n pii_count?: Long,\n\n // --- Session Detection History (cross-turn sticky flags) ---\n session_pii_detected?: Bool,\n session_pii_types?: Set<String>,\n session_secrets_detected?: Bool,\n session_secret_types?: Set<String>,\n session_injection_detected?: Bool,\n session_command_injection?: Bool,\n session_threat_turns?: Long,\n session_max_injection_score?: Long,\n session_max_jailbreak_score?: Long,\n session_max_command_injection_score?: Long,\n session_max_pii_score?: Long,\n session_max_secret_score?: Long,\n session_cumulative_risk_score?: Long,\n\n // --- Agent Security ---\n indirect_injection_score?: Long, // Indirect injection via file content\n },\n};\n\n}\n";
|
|
24
|
+
export declare const OVERWATCH_SCHEMA = "// Overwatch Cedar Schema\n// ===================================\n// IDE Agent Security & Policy Enforcement\n//\n// Overwatch protects IDE agent operations (prompts, tool calls, file access, MCP connections)\n// by evaluating threats detected by the detection engine pipeline against Cedar policies.\n//\n// Architecture:\n// User/Agent \u2192 IDE Hook \u2192 Detection Engine \u2192 Cedar Policy \u2192 Allow/Deny\n//\n// Supported IDEs:\n// - Cursor (beforeSubmitPrompt, beforeShellExecution, beforeMCPExecution, etc.)\n// - Claude Code (UserPromptSubmit, PreToolUse)\n// - GitHub Copilot (userPromptSubmitted, preToolUse)\n//\n// Threat Coverage:\n// - OWASP Top 10 for LLM Applications 2025 (LLM01-LLM10)\n// - OWASP Top 10 for Agentic Applications (ASI01-ASI10)\n// - OWASP MCP Top 10 (MCP01-MCP05)\n// - MITRE ATLAS Agent Techniques (AML.T0051, AML.T0080-T0082)\n\nnamespace Overwatch {\n\n// =============================================================================\n// ENTITIES - Tenant Hierarchy (ReBAC)\n// =============================================================================\n// Aligned with Guardrails entity hierarchy (Account \u2192 Project).\n// Overwatch does not have app-specific policies, so App is omitted.\n//\n// Entity hierarchy enables Cedar's `in` operator for policy scoping:\n// Account (org root)\n// \u2514\u2500\u2500 Project in [Account]\n// \u2514\u2500\u2500 Tool/Server/FilePath/LlmPrompt in [Project]\n//\n// Policy scoping examples:\n// resource == Overwatch::Tool::\"shell\" \u2192 specific tool\n// resource in Overwatch::Project::\"<uuid>\" \u2192 project-wide\n// resource in Overwatch::Account::\"<uuid>\" \u2192 org-wide\n\n/// Account represents an organization (top-level tenant)\nentity Account;\n\n/// Project represents a project within an account\nentity Project in [Account];\n\n// =============================================================================\n// ENTITIES - Principals\n// =============================================================================\n\n/// Human user or service account making requests to the IDE\nentity User;\n\n/// AI agent (Claude, GitHub Copilot, etc.)\nentity Agent;\n\n// =============================================================================\n// ENTITIES - Resources (scoped under Project)\n// =============================================================================\n\n/// LLM prompt or session \u2014 resource for process_prompt action\nentity LlmPrompt in [Project];\n\n/// MCP tool or native IDE tool \u2014 resource for call_tool action\nentity Tool in [Project];\n\n/// MCP server \u2014 resource for connect_server action\nentity Server in [Project];\n\n/// File system path \u2014 resource for read_file/write_file/call_tool actions\nentity FilePath in [Project];\n\n// =============================================================================\n// ACTIONS\n// =============================================================================\n\n// User submits a prompt or receives AI response\n// Threat focus: injection, jailbreak, secrets, PII, content safety, invisible chars\naction process_prompt appliesTo {\n principal: [User, Agent],\n resource: [LlmPrompt],\n context: {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n role?: String,\n privilege_scope?: Set<String>,\n // --- Event & Source ---\n content: String, // Raw content being scanned\n source: String, // IDE source: \"cursor\", \"claudecode\", \"github_copilot\"\n event: String, // Hook event name\n user_email: String, // User identifier\n\n // --- Workspace ---\n cwd?: String, // Current working directory\n workspace_root?: String, // Workspace/repository root\n\n // --- Threat Detection (from detection engine pipeline) ---\n threat_count: Long, // Total threats detected\n highest_severity: String, // \"critical\", \"high\", \"medium\", \"low\", \"none\"\n threat_categories: Set<String>, // Threat category names\n detected_threats: Set<String>, // Detection rule names that matched\n max_threat_severity: Long, // Numeric severity (0=none, 1=low, 2=medium, 3=high, 4=critical)\n secrets_detected: Bool, // Whether secrets/credentials detected\n\n // --- Secrets (granular) ---\n secret_types?: Set<String>, // Types: \"aws_access_key\", \"github_token\", \"ssh_private_key\", etc.\n secret_count?: Long, // Number of distinct secrets found\n\n // --- PII Detection ---\n pii_detected?: Bool, // Whether any PII patterns matched\n pii_types?: Set<String>, // Types: \"ssn\", \"credit_card\", \"email\", \"phone\", etc.\n pii_count?: Long, // Number of PII matches\n\n // --- Encoding & Unicode Attacks ---\n invisible_chars_detected?: Bool, // Zero-width chars, bidi overrides, tag chars detected\n invisible_chars_score?: Long, // Unicode attack severity (0-100)\n\n // --- Content Safety Scores (0-100, from ML classifiers) ---\n violence_score: Long,\n weapons_score: Long,\n hate_speech_score: Long,\n crime_score: Long,\n sexual_score: Long,\n profanity_score: Long,\n\n // --- ML Detector Confidence Scores (0-100) ---\n pii_score: Long, // PII detection classifier confidence\n injection_score: Long, // Combined injection confidence: MAX(pulse, deep_context)\n jailbreak_score: Long, // Combined jailbreak confidence: MAX(pulse, deep_context)\n injection_pulse_score?: Long, // 0-100 Pulse single-turn classifier\n injection_deep_context_score?: Long, // 0-100 DeepContext multi-turn\n jailbreak_pulse_score?: Long, // 0-100 Pulse single-turn classifier\n jailbreak_deep_context_score?: Long, // 0-100 DeepContext multi-turn\n\n // --- Agent Security (0-100) ---\n indirect_injection_score: Long, // Indirect prompt injection risk (OWASP LLM01, ASI01)\n\n // --- Session Detection History (cross-turn sticky flags) ---\n session_pii_detected?: Bool,\n session_pii_types?: Set<String>,\n session_secrets_detected?: Bool,\n session_secret_types?: Set<String>,\n session_injection_detected?: Bool,\n session_command_injection?: Bool,\n session_threat_turns?: Long,\n session_max_injection_score?: Long,\n session_max_jailbreak_score?: Long,\n session_max_command_injection_score?: Long,\n session_max_pii_score?: Long,\n session_max_secret_score?: Long,\n session_cumulative_risk_score?: Long,\n\n // --- Legacy ---\n prompt_text?: String, // Same as content (backward compatibility)\n response_content?: String, // Response content (if available)\n },\n};\n\n// User calls a tool (native IDE tool or MCP tool)\n// Threat focus: command injection, tool poisoning, rug pull, data exfiltration, loops\naction call_tool appliesTo {\n principal: [User, Agent],\n resource: [Tool, FilePath],\n context: {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n role?: String,\n privilege_scope?: Set<String>,\n // --- Event & Source ---\n content: String, // Raw content being scanned (e.g., shell command, tool args)\n source: String, // IDE source\n event: String, // Hook event name\n user_email: String, // User identifier\n\n // --- Tool & MCP ---\n tool_name?: String, // Normalized tool name (\"shell\", \"read_file\", etc.)\n mcp_server?: String, // MCP server name\n mcp_tool?: String, // MCP tool name\n\n // --- File & Path ---\n path?: String, // File path (if file operation)\n\n // --- Workspace ---\n cwd?: String,\n workspace_root?: String,\n\n // --- Threat Detection ---\n threat_count?: Long,\n highest_severity?: String,\n threat_categories?: Set<String>,\n detected_threats?: Set<String>,\n max_threat_severity?: Long,\n secrets_detected?: Bool,\n\n // --- Secrets (granular) ---\n secret_types?: Set<String>,\n secret_count?: Long,\n\n // --- PII Detection ---\n pii_detected?: Bool,\n pii_types?: Set<String>,\n pii_count?: Long,\n\n // --- Encoding & Unicode Attacks ---\n invisible_chars_detected?: Bool,\n invisible_chars_score?: Long,\n\n // --- Content Safety Scores (0-100) ---\n violence_score?: Long,\n weapons_score?: Long,\n hate_speech_score?: Long,\n crime_score?: Long,\n sexual_score?: Long,\n profanity_score?: Long,\n\n // --- ML Detector Confidence Scores (0-100) ---\n pii_score?: Long,\n injection_score?: Long, // Combined injection confidence: MAX(pulse, deep_context)\n jailbreak_score?: Long, // Combined jailbreak confidence: MAX(pulse, deep_context)\n injection_pulse_score?: Long, // 0-100 Pulse single-turn classifier\n injection_deep_context_score?: Long, // 0-100 DeepContext multi-turn\n jailbreak_pulse_score?: Long, // 0-100 Pulse single-turn classifier\n jailbreak_deep_context_score?: Long, // 0-100 DeepContext multi-turn\n\n // --- Agent Security (0-100) --- (OWASP ASI01, ASI02, ASI04; MITRE AML.T0051)\n tool_poisoning_score?: Long, // Hidden instructions in tool description/args\n tool_poisoning_detected?: Bool, // Boolean flag for tool poisoning\n rug_pull_score?: Long, // Tool behavior drift after trust establishment\n rug_pull_detected?: Bool, // Boolean flag for rug pull\n indirect_injection_score?: Long, // Indirect injection via tool output\n\n // --- Tool Risk Assessment ---\n tool_risk_score?: Long, // Computed tool risk (0-100)\n tool_category?: String, // \"safe\", \"sensitive\", \"dangerous\"\n tool_is_sensitive?: Bool, // Sensitivity classification\n tool_is_builtin?: Bool, // Built-in IDE tool vs MCP tool\n\n // --- Behavioral Analysis --- (OWASP LLM10, ASI02, ASI08)\n loop_detected?: Bool, // Consecutive same-tool call loop\n loop_count?: Long, // Number of consecutive repeat calls\n loop_tool?: String, // Tool name in loop\n suspicious_pattern?: Bool, // Data exfiltration or attack sequence detected\n pattern_type?: String, // \"data_exfiltration\", \"secret_exfiltration\", \"credential_theft\", \"destructive_sequence\"\n sequence_risk?: Long, // Sequence risk score (0-100)\n\n // --- MCP Trust ---\n mcp_server_verified?: Bool, // Whether server is from verified registry\n\n // --- Tool Operation Classifier ---\n tool_operation_classes?: Set<String>, // subset of {\"readonly\", \"write_enabling\", \"execute_enabling\", \"network_access\", \"unknown\"}\n\n // --- Session Detection History (cross-turn sticky flags) ---\n session_pii_detected?: Bool,\n session_pii_types?: Set<String>,\n session_secrets_detected?: Bool,\n session_secret_types?: Set<String>,\n session_injection_detected?: Bool,\n session_command_injection?: Bool,\n session_threat_turns?: Long,\n session_max_injection_score?: Long,\n session_max_jailbreak_score?: Long,\n session_max_command_injection_score?: Long,\n session_max_pii_score?: Long,\n session_max_secret_score?: Long,\n session_cumulative_risk_score?: Long,\n\n // --- Legacy ---\n response_content?: String,\n },\n};\n\n// Inspect the OUTPUT of a tool that has already run.\n// Threat focus: a credential or PII printed by a tool entering the agent's\n// context. The tool has run, so a permission verdict is meaningless here \u2014 the\n// only enforcement available is rewriting or withholding what the model sees,\n// which is why transform rules (@redaction_strategy) are the point of this\n// action. Context is deliberately narrower than call_tool: pre-execution\n// signals (tool risk, loop, sequence) belong to the call, not its result.\naction post_tool_call appliesTo {\n principal: [User, Agent],\n resource: [Tool, FilePath, LlmPrompt],\n context: {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n role?: String,\n privilege_scope?: Set<String>,\n // --- Event & Source ---\n content: String, // The tool's OUTPUT (stdout+stderr, or serialized response)\n source: String, // IDE source\n event: String, // Hook event name\n user_email: String, // User identifier\n\n // --- Tool & MCP ---\n tool_name?: String,\n mcp_server?: String,\n mcp_tool?: String,\n\n // --- Result ---\n exit_code?: Long, // Absent when the IDE does not propagate it\n\n // --- File & Path ---\n path?: String,\n\n // --- Workspace ---\n cwd?: String,\n workspace_root?: String,\n\n // --- Threat Detection ---\n threat_count?: Long,\n highest_severity?: String,\n threat_categories?: Set<String>,\n detected_threats?: Set<String>,\n max_threat_severity?: Long,\n\n // --- Secrets --- the primary signal for this surface\n secrets_detected?: Bool,\n secret_types?: Set<String>,\n secret_count?: Long,\n\n // --- PII Detection ---\n pii_detected?: Bool,\n pii_types?: Set<String>,\n pii_count?: Long,\n pii_score?: Long,\n\n // --- Indirect injection via tool output --- (OWASP ASI01)\n indirect_injection_score?: Long,\n\n // --- Encoding & Unicode Attacks ---\n invisible_chars_detected?: Bool,\n invisible_chars_score?: Long,\n\n // --- Session Detection History (cross-turn sticky flags) ---\n session_pii_detected?: Bool,\n session_pii_types?: Set<String>,\n session_secrets_detected?: Bool,\n session_secret_types?: Set<String>,\n session_threat_turns?: Long,\n session_max_secret_score?: Long,\n session_max_pii_score?: Long,\n session_cumulative_risk_score?: Long,\n },\n};\n\n// Connect to an MCP server\n// Threat focus: supply chain, tool poisoning, rug pull, config risk\naction connect_server appliesTo {\n principal: [User, Agent],\n resource: [Server],\n context: {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n role?: String,\n privilege_scope?: Set<String>,\n content?: String, // Server config content (if available)\n source: String,\n event: String,\n user_email: String,\n mcp_server?: String,\n\n // --- Threat Detection ---\n threat_count?: Long,\n highest_severity?: String,\n threat_categories?: Set<String>,\n max_threat_severity?: Long,\n\n // --- Agent Security (0-100) --- (OWASP ASI04, MCP01-MCP05)\n tool_poisoning_score?: Long, // Poisoned tool descriptions in server\n tool_poisoning_detected?: Bool,\n rug_pull_score?: Long, // Server behavior change after approval\n rug_pull_detected?: Bool,\n indirect_injection_score?: Long, // Injection payloads in server responses\n\n // --- MCP Trust & Config Risk ---\n mcp_server_verified?: Bool, // Verified registry status\n mcp_config_risk?: Bool, // Risky server config detected (inline code exec, etc.)\n mcp_risk_score?: Long, // Config risk severity (0-100)\n\n // --- Session Detection History (cross-turn sticky flags) ---\n session_pii_detected?: Bool,\n session_pii_types?: Set<String>,\n session_secrets_detected?: Bool,\n session_secret_types?: Set<String>,\n session_injection_detected?: Bool,\n session_command_injection?: Bool,\n session_threat_turns?: Long,\n session_max_injection_score?: Long,\n session_max_jailbreak_score?: Long,\n session_max_command_injection_score?: Long,\n session_max_pii_score?: Long,\n session_max_secret_score?: Long,\n session_cumulative_risk_score?: Long,\n },\n};\n\n// Read a file from disk\n// Threat focus: secrets exposure, PII exposure, path traversal, sensitive paths\naction read_file appliesTo {\n principal: [User, Agent],\n resource: [FilePath],\n context: {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n role?: String,\n privilege_scope?: Set<String>,\n content: String,\n source: String,\n event: String,\n user_email: String,\n path?: String,\n cwd?: String,\n workspace_root?: String,\n\n // --- Threat Detection ---\n threat_count?: Long,\n highest_severity?: String,\n threat_categories?: Set<String>,\n detected_threats?: Set<String>,\n max_threat_severity?: Long,\n secrets_detected?: Bool,\n\n // --- Secrets (granular) ---\n secret_types?: Set<String>,\n secret_count?: Long,\n\n // --- PII Detection ---\n pii_detected?: Bool,\n pii_types?: Set<String>,\n pii_count?: Long,\n\n // --- Session Detection History (cross-turn sticky flags) ---\n session_pii_detected?: Bool,\n session_pii_types?: Set<String>,\n session_secrets_detected?: Bool,\n session_secret_types?: Set<String>,\n session_injection_detected?: Bool,\n session_command_injection?: Bool,\n session_threat_turns?: Long,\n session_max_injection_score?: Long,\n session_max_jailbreak_score?: Long,\n session_max_command_injection_score?: Long,\n session_max_pii_score?: Long,\n session_max_secret_score?: Long,\n session_cumulative_risk_score?: Long,\n\n // --- Agent Security ---\n indirect_injection_score?: Long, // Indirect injection via file content\n },\n};\n\n// Write a file to disk\n// Threat focus: secrets in output, PII in output, sensitive paths, malicious code\naction write_file appliesTo {\n principal: [User, Agent],\n resource: [FilePath],\n context: {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n role?: String,\n privilege_scope?: Set<String>,\n content: String,\n source: String,\n event: String,\n user_email: String,\n path?: String,\n cwd?: String,\n workspace_root?: String,\n\n // --- Threat Detection ---\n threat_count?: Long,\n highest_severity?: String,\n threat_categories?: Set<String>,\n detected_threats?: Set<String>,\n max_threat_severity?: Long,\n secrets_detected?: Bool,\n\n // --- Secrets (granular) ---\n secret_types?: Set<String>,\n secret_count?: Long,\n\n // --- PII Detection ---\n pii_detected?: Bool,\n pii_types?: Set<String>,\n pii_count?: Long,\n\n // --- Session Detection History (cross-turn sticky flags) ---\n session_pii_detected?: Bool,\n session_pii_types?: Set<String>,\n session_secrets_detected?: Bool,\n session_secret_types?: Set<String>,\n session_injection_detected?: Bool,\n session_command_injection?: Bool,\n session_threat_turns?: Long,\n session_max_injection_score?: Long,\n session_max_jailbreak_score?: Long,\n session_max_command_injection_score?: Long,\n session_max_pii_score?: Long,\n session_max_secret_score?: Long,\n session_cumulative_risk_score?: Long,\n\n // --- Agent Security ---\n indirect_injection_score?: Long, // Indirect injection via file content\n },\n};\n\n}\n";
|
|
25
25
|
/**
|
|
26
26
|
* Palisade Cedar schema
|
|
27
27
|
*
|
|
@@ -2352,6 +2352,78 @@ action call_tool appliesTo {
|
|
|
2352
2352
|
},
|
|
2353
2353
|
};
|
|
2354
2354
|
|
|
2355
|
+
// Inspect the OUTPUT of a tool that has already run.
|
|
2356
|
+
// Threat focus: a credential or PII printed by a tool entering the agent's
|
|
2357
|
+
// context. The tool has run, so a permission verdict is meaningless here — the
|
|
2358
|
+
// only enforcement available is rewriting or withholding what the model sees,
|
|
2359
|
+
// which is why transform rules (@redaction_strategy) are the point of this
|
|
2360
|
+
// action. Context is deliberately narrower than call_tool: pre-execution
|
|
2361
|
+
// signals (tool risk, loop, sequence) belong to the call, not its result.
|
|
2362
|
+
action post_tool_call appliesTo {
|
|
2363
|
+
principal: [User, Agent],
|
|
2364
|
+
resource: [Tool, FilePath, LlmPrompt],
|
|
2365
|
+
context: {
|
|
2366
|
+
// Identity (AARM R6 / CAP-IDN-011) — projected from the principal's token; optional.
|
|
2367
|
+
role?: String,
|
|
2368
|
+
privilege_scope?: Set<String>,
|
|
2369
|
+
// --- Event & Source ---
|
|
2370
|
+
content: String, // The tool's OUTPUT (stdout+stderr, or serialized response)
|
|
2371
|
+
source: String, // IDE source
|
|
2372
|
+
event: String, // Hook event name
|
|
2373
|
+
user_email: String, // User identifier
|
|
2374
|
+
|
|
2375
|
+
// --- Tool & MCP ---
|
|
2376
|
+
tool_name?: String,
|
|
2377
|
+
mcp_server?: String,
|
|
2378
|
+
mcp_tool?: String,
|
|
2379
|
+
|
|
2380
|
+
// --- Result ---
|
|
2381
|
+
exit_code?: Long, // Absent when the IDE does not propagate it
|
|
2382
|
+
|
|
2383
|
+
// --- File & Path ---
|
|
2384
|
+
path?: String,
|
|
2385
|
+
|
|
2386
|
+
// --- Workspace ---
|
|
2387
|
+
cwd?: String,
|
|
2388
|
+
workspace_root?: String,
|
|
2389
|
+
|
|
2390
|
+
// --- Threat Detection ---
|
|
2391
|
+
threat_count?: Long,
|
|
2392
|
+
highest_severity?: String,
|
|
2393
|
+
threat_categories?: Set<String>,
|
|
2394
|
+
detected_threats?: Set<String>,
|
|
2395
|
+
max_threat_severity?: Long,
|
|
2396
|
+
|
|
2397
|
+
// --- Secrets --- the primary signal for this surface
|
|
2398
|
+
secrets_detected?: Bool,
|
|
2399
|
+
secret_types?: Set<String>,
|
|
2400
|
+
secret_count?: Long,
|
|
2401
|
+
|
|
2402
|
+
// --- PII Detection ---
|
|
2403
|
+
pii_detected?: Bool,
|
|
2404
|
+
pii_types?: Set<String>,
|
|
2405
|
+
pii_count?: Long,
|
|
2406
|
+
pii_score?: Long,
|
|
2407
|
+
|
|
2408
|
+
// --- Indirect injection via tool output --- (OWASP ASI01)
|
|
2409
|
+
indirect_injection_score?: Long,
|
|
2410
|
+
|
|
2411
|
+
// --- Encoding & Unicode Attacks ---
|
|
2412
|
+
invisible_chars_detected?: Bool,
|
|
2413
|
+
invisible_chars_score?: Long,
|
|
2414
|
+
|
|
2415
|
+
// --- Session Detection History (cross-turn sticky flags) ---
|
|
2416
|
+
session_pii_detected?: Bool,
|
|
2417
|
+
session_pii_types?: Set<String>,
|
|
2418
|
+
session_secrets_detected?: Bool,
|
|
2419
|
+
session_secret_types?: Set<String>,
|
|
2420
|
+
session_threat_turns?: Long,
|
|
2421
|
+
session_max_secret_score?: Long,
|
|
2422
|
+
session_max_pii_score?: Long,
|
|
2423
|
+
session_cumulative_risk_score?: Long,
|
|
2424
|
+
},
|
|
2425
|
+
};
|
|
2426
|
+
|
|
2355
2427
|
// Connect to an MCP server
|
|
2356
2428
|
// Threat focus: supply chain, tool poisoning, rug pull, config risk
|
|
2357
2429
|
action connect_server appliesTo {
|
|
@@ -4385,6 +4457,48 @@ export const OVERWATCH_CONTEXT = {
|
|
|
4385
4457
|
{ "key": "session_cumulative_risk_score", "type": "number", "required": false, "description": "Sum of per-turn risk scores across the session. Catches death-by-a-thousand-cuts where no single turn is high but cumulative risk is significant" }
|
|
4386
4458
|
]
|
|
4387
4459
|
},
|
|
4460
|
+
{
|
|
4461
|
+
"name": "post_tool_call",
|
|
4462
|
+
"description": "Inspect the output of a tool that has already run. The tool has run, so enforcement is limited to rewriting or withholding what the model sees.",
|
|
4463
|
+
"context_attributes": [
|
|
4464
|
+
{ "key": "role", "type": "string", "required": false, "description": "role projected for the post_tool_call surface." },
|
|
4465
|
+
{ "key": "privilege_scope", "type": "array", "required": false, "description": "privilege_scope projected for the post_tool_call surface." },
|
|
4466
|
+
{ "key": "content", "type": "string", "required": true, "description": "The tool\'s OUTPUT (stdout+stderr, or serialized response)" },
|
|
4467
|
+
{ "key": "source", "type": "string", "required": true, "description": "IDE source" },
|
|
4468
|
+
{ "key": "event", "type": "string", "required": true, "description": "Hook event name" },
|
|
4469
|
+
{ "key": "user_email", "type": "string", "required": true, "description": "User identifier" },
|
|
4470
|
+
{ "key": "tool_name", "type": "string", "required": false, "description": "tool_name projected for the post_tool_call surface." },
|
|
4471
|
+
{ "key": "mcp_server", "type": "string", "required": false, "description": "mcp_server projected for the post_tool_call surface." },
|
|
4472
|
+
{ "key": "mcp_tool", "type": "string", "required": false, "description": "mcp_tool projected for the post_tool_call surface." },
|
|
4473
|
+
{ "key": "exit_code", "type": "number", "required": false, "description": "Absent when the IDE does not propagate it" },
|
|
4474
|
+
{ "key": "path", "type": "string", "required": false, "description": "path projected for the post_tool_call surface." },
|
|
4475
|
+
{ "key": "cwd", "type": "string", "required": false, "description": "cwd projected for the post_tool_call surface." },
|
|
4476
|
+
{ "key": "workspace_root", "type": "string", "required": false, "description": "workspace_root projected for the post_tool_call surface." },
|
|
4477
|
+
{ "key": "threat_count", "type": "number", "required": false, "description": "threat_count projected for the post_tool_call surface." },
|
|
4478
|
+
{ "key": "highest_severity", "type": "string", "required": false, "description": "highest_severity projected for the post_tool_call surface." },
|
|
4479
|
+
{ "key": "threat_categories", "type": "array", "required": false, "description": "threat_categories projected for the post_tool_call surface." },
|
|
4480
|
+
{ "key": "detected_threats", "type": "array", "required": false, "description": "detected_threats projected for the post_tool_call surface." },
|
|
4481
|
+
{ "key": "max_threat_severity", "type": "number", "required": false, "description": "max_threat_severity projected for the post_tool_call surface." },
|
|
4482
|
+
{ "key": "secrets_detected", "type": "boolean", "required": false, "description": "secrets_detected projected for the post_tool_call surface." },
|
|
4483
|
+
{ "key": "secret_types", "type": "array", "required": false, "description": "secret_types projected for the post_tool_call surface." },
|
|
4484
|
+
{ "key": "secret_count", "type": "number", "required": false, "description": "secret_count projected for the post_tool_call surface." },
|
|
4485
|
+
{ "key": "pii_detected", "type": "boolean", "required": false, "description": "pii_detected projected for the post_tool_call surface." },
|
|
4486
|
+
{ "key": "pii_types", "type": "array", "required": false, "description": "pii_types projected for the post_tool_call surface." },
|
|
4487
|
+
{ "key": "pii_count", "type": "number", "required": false, "description": "pii_count projected for the post_tool_call surface." },
|
|
4488
|
+
{ "key": "pii_score", "type": "number", "required": false, "description": "pii_score projected for the post_tool_call surface." },
|
|
4489
|
+
{ "key": "indirect_injection_score", "type": "number", "required": false, "description": "indirect_injection_score projected for the post_tool_call surface." },
|
|
4490
|
+
{ "key": "invisible_chars_detected", "type": "boolean", "required": false, "description": "invisible_chars_detected projected for the post_tool_call surface." },
|
|
4491
|
+
{ "key": "invisible_chars_score", "type": "number", "required": false, "description": "invisible_chars_score projected for the post_tool_call surface." },
|
|
4492
|
+
{ "key": "session_pii_detected", "type": "boolean", "required": false, "description": "session_pii_detected projected for the post_tool_call surface." },
|
|
4493
|
+
{ "key": "session_pii_types", "type": "array", "required": false, "description": "session_pii_types projected for the post_tool_call surface." },
|
|
4494
|
+
{ "key": "session_secrets_detected", "type": "boolean", "required": false, "description": "session_secrets_detected projected for the post_tool_call surface." },
|
|
4495
|
+
{ "key": "session_secret_types", "type": "array", "required": false, "description": "session_secret_types projected for the post_tool_call surface." },
|
|
4496
|
+
{ "key": "session_threat_turns", "type": "number", "required": false, "description": "session_threat_turns projected for the post_tool_call surface." },
|
|
4497
|
+
{ "key": "session_max_secret_score", "type": "number", "required": false, "description": "session_max_secret_score projected for the post_tool_call surface." },
|
|
4498
|
+
{ "key": "session_max_pii_score", "type": "number", "required": false, "description": "session_max_pii_score projected for the post_tool_call surface." },
|
|
4499
|
+
{ "key": "session_cumulative_risk_score", "type": "number", "required": false, "description": "session_cumulative_risk_score projected for the post_tool_call surface." }
|
|
4500
|
+
]
|
|
4501
|
+
},
|
|
4388
4502
|
{
|
|
4389
4503
|
"name": "connect_server",
|
|
4390
4504
|
"description": "Connect to an MCP server",
|