@highflame/policy 2.1.3 → 2.1.4

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.
@@ -1,5 +1,5 @@
1
1
  // Code generated by highflame-policy-codegen. DO NOT EDIT.
2
- // Source: schemas/guardrails/schema.cedarschema, schemas/overwatch/schema.cedarschema, schemas/palisade/schema.cedarschema
2
+ // Source: schemas/guardrails/schema.cedarschema, schemas/overwatch/schema.cedarschema, schemas/palisade/schema.cedarschema, schemas/sentry/schema.cedarschema
3
3
  //
4
4
  // Service-specific Cedar schemas and context metadata.
5
5
  // Works in both browser and Node.js environments.
@@ -8,6 +8,7 @@
8
8
  // import { GUARDRAILS_SCHEMA, GUARDRAILS_CONTEXT } from '@highflame/policy/types';
9
9
  // import { OVERWATCH_SCHEMA, OVERWATCH_CONTEXT } from '@highflame/policy/types';
10
10
  // import { PALISADE_SCHEMA, PALISADE_CONTEXT } from '@highflame/policy/types';
11
+ // import { SENTRY_SCHEMA, SENTRY_CONTEXT } from '@highflame/policy/types';
11
12
  /**
12
13
  * Guardrails Cedar schema
13
14
  *
@@ -930,6 +931,400 @@ action scan_package appliesTo {
930
931
  },
931
932
  };
932
933
 
934
+ }
935
+ `;
936
+ /**
937
+ * Sentry Cedar schema
938
+ *
939
+ * Full Cedar schema for sentry, embedded at codegen time.
940
+ */
941
+ export const SENTRY_SCHEMA = `// =============================================================================
942
+ // Sentry Cedar Schema
943
+ // =============================================================================
944
+ // Browser Security — monitors AI chat interactions in the browser and enforces
945
+ // data-protection, content-safety, and compliance policies at point of use.
946
+ //
947
+ // Sentry is a lightweight browser extension (JSA) that intercepts:
948
+ // - Messages sent to AI chat services (ChatGPT, Gemini, Claude, Copilot, etc.)
949
+ // - AI responses returned to the user
950
+ // - Cut/paste operations transferring content into AI chats
951
+ // - File/document uploads into AI chat services
952
+ //
953
+ // Architecture:
954
+ // User → Browser Extension → Shield Detection Engine → Cedar Policy → Allow/Block
955
+ //
956
+ // Threat Coverage:
957
+ // - Data Leakage: PII, PHI, credentials, source code, confidential documents
958
+ // - Content Safety: Violence, hate speech, sexual content, restricted topics
959
+ // - Prompt Injection: Direct and indirect injection via pasted/uploaded content
960
+ // - Document Sensitivity: MIP label enforcement, classification-aware blocking
961
+ // - Compliance: GDPR, HIPAA, PCI DSS, CCPA, EU AI Act
962
+ //
963
+ // Supported AI Services:
964
+ // - ChatGPT (chat.openai.com)
965
+ // - Google Gemini (gemini.google.com)
966
+ // - Claude (claude.ai)
967
+ // - GitHub Copilot Chat
968
+ // - Microsoft Copilot
969
+ // - Custom/enterprise AI chat endpoints
970
+
971
+ namespace Sentry {
972
+
973
+ // =============================================================================
974
+ // ENTITIES - Tenant Hierarchy (ReBAC)
975
+ // =============================================================================
976
+ // Aligned with Guardrails/Overwatch entity hierarchy (Account -> Project).
977
+ //
978
+ // Entity hierarchy enables Cedar's \`in\` operator for policy scoping:
979
+ // Account (org root)
980
+ // └── Project in [Account]
981
+ // └── ChatSession in [Project]
982
+ //
983
+ // Policy scoping examples:
984
+ // resource in Sentry::Account::"<uuid>" → org-wide
985
+ // resource in Sentry::Project::"<uuid>" → project-wide
986
+ // resource == Sentry::ChatSession::"<id>" → specific session
987
+
988
+ /// Account represents an organization (top-level tenant)
989
+ entity Account;
990
+
991
+ /// Project represents a project within an account
992
+ entity Project in [Account];
993
+
994
+ // =============================================================================
995
+ // ENTITIES - Principals
996
+ // =============================================================================
997
+
998
+ /// Human user interacting with AI chat in the browser
999
+ entity User;
1000
+
1001
+ // =============================================================================
1002
+ // ENTITIES - Resources (scoped under Project)
1003
+ // =============================================================================
1004
+
1005
+ /// AI chat session — resource for send_message and receive_response actions
1006
+ entity ChatSession in [Project];
1007
+
1008
+ /// Document or file being uploaded — resource for upload_file action
1009
+ entity Document in [Project];
1010
+
1011
+ // =============================================================================
1012
+ // ACTIONS
1013
+ // =============================================================================
1014
+
1015
+ // User sends a message (prompt) to an AI chat service
1016
+ // Threat focus: data leakage (PII, secrets, confidential data), injection, content safety
1017
+ action send_message appliesTo {
1018
+ principal: [User],
1019
+ resource: [ChatSession],
1020
+ context: {
1021
+ // --- Core Metadata ---
1022
+ content: String, // Raw message content being sent
1023
+ source: String, // Browser extension identifier: "sentry"
1024
+ event: String, // Event type: "send_message"
1025
+ user_email: String, // User identifier (SSO/OAuth verified)
1026
+ target_app: String, // AI service: "chatgpt", "gemini", "claude", "copilot", "custom"
1027
+ target_url?: String, // Full URL of the AI chat service
1028
+
1029
+ // --- Aggregated Threat Summary (from Shield NormalizeAggregation) ---
1030
+ threat_count: Long, // Total threats detected
1031
+ highest_severity: String, // "critical", "high", "medium", "low", "none"
1032
+ threat_categories: Set<String>, // Threat category names
1033
+ detected_threats: Set<String>, // Detection rule names that matched
1034
+ max_threat_severity: Long, // Numeric severity (0=none, 1=low, 2=medium, 3=high, 4=critical)
1035
+
1036
+ // --- Secrets Detection (from SecretsDetector) ---
1037
+ contains_secrets: Bool, // Whether secrets/credentials detected
1038
+ secret_types?: Set<String>, // Types: "aws_access_key", "github_token", "ssh_private_key", etc.
1039
+ secret_count?: Long, // Number of distinct secrets found
1040
+
1041
+ // --- PII Detection (from PIIRegexDetector, normalized) ---
1042
+ pii_detected?: Bool, // Whether any PII patterns matched
1043
+ pii_types?: Set<String>, // Types: "ssn", "credit_card", "email", "phone", etc.
1044
+ pii_count?: Long, // Number of PII matches
1045
+ pii_confidence?: Long, // PII detection confidence (0-100)
1046
+
1047
+ // --- Content Safety Scores (from ToxicityDetector, 0-100) ---
1048
+ violence_score: Long,
1049
+ weapons_score: Long,
1050
+ hate_speech_score: Long,
1051
+ crime_score: Long,
1052
+ sexual_score: Long,
1053
+ profanity_score: Long,
1054
+
1055
+ // --- ML Detector Confidence Scores (0-100) ---
1056
+ injection_score: Long, // Prompt injection score (max of InjectionDetector + DeepContextDetector)
1057
+ jailbreak_score: Long, // Jailbreak detection score (max of JailbreakDetector + DeepContextDetector)
1058
+
1059
+ // --- Topic Classification (from TopicDetector) ---
1060
+ content_topics?: Set<String>, // Detected topics: "controlled_substances", "weapons_manufacturing", etc.
1061
+ topic_confidence?: Long, // Topic classifier confidence (0-100)
1062
+
1063
+ // --- Encoding & Unicode Attacks (from SecurityFiltersDetector, EncodedInjectionDetector) ---
1064
+ contains_invisible_chars?: Bool, // Zero-width chars, bidi overrides, tag chars
1065
+ invisible_chars_score?: Long, // Unicode attack severity (0-100)
1066
+ encoded_content_detected?: Bool, // Base64, hex, unicode, URL encoded content
1067
+ encoded_types?: Set<String>, // Encoding types detected
1068
+ encoded_count?: Long, // Number of encoded segments
1069
+ encoded_score?: Long, // Encoded injection severity (0-100)
1070
+
1071
+ // --- Code Detection (from CodeDetector) ---
1072
+ contains_code?: Bool, // Whether content contains source code
1073
+ code_languages?: Set<String>, // Detected languages: "python", "javascript", etc.
1074
+ code_ratio?: Long, // Percentage of content that is code (0-100)
1075
+
1076
+ // --- Language Detection (from LanguageDetector, ScriptDetector) ---
1077
+ detected_language?: String, // ISO language code
1078
+ is_english?: Bool,
1079
+ language_confidence?: Long, // 0-100
1080
+ detected_script?: String, // "latin", "cyrillic", "arabic", "unknown"
1081
+ is_latin_script?: Bool,
1082
+ script_confidence?: Long, // 0-100
1083
+
1084
+ // --- Keyword Detection (from KeywordDetector) ---
1085
+ keyword_matched?: Bool, // Whether any keywords matched
1086
+ keyword_categories?: Set<String>, // Matched keyword categories
1087
+ keyword_count?: Long, // Number of keyword matches
1088
+
1089
+ // --- Phishing Detection (from CheckPhishDetector) ---
1090
+ phishing_detected?: Bool, // Whether phishing URLs detected in content
1091
+
1092
+ // --- Session Detection History (cross-turn sticky flags) ---
1093
+ session_pii_detected?: Bool,
1094
+ session_pii_types?: Set<String>,
1095
+ session_secrets_detected?: Bool,
1096
+ session_secret_types?: Set<String>,
1097
+ session_injection_detected?: Bool,
1098
+ session_threat_turns?: Long,
1099
+ },
1100
+ };
1101
+
1102
+ // AI service responds to the user
1103
+ // Threat focus: harmful content in responses, hallucination, data leakage in output
1104
+ action receive_response appliesTo {
1105
+ principal: [User],
1106
+ resource: [ChatSession],
1107
+ context: {
1108
+ // --- Core Metadata ---
1109
+ content: String, // AI response content
1110
+ source: String,
1111
+ event: String, // "receive_response"
1112
+ user_email: String,
1113
+ target_app: String,
1114
+ target_url?: String,
1115
+
1116
+ // --- Aggregated Threat Summary ---
1117
+ threat_count: Long,
1118
+ highest_severity: String,
1119
+ threat_categories: Set<String>,
1120
+ detected_threats: Set<String>,
1121
+ max_threat_severity: Long,
1122
+
1123
+ // --- Secrets Detection ---
1124
+ contains_secrets: Bool,
1125
+ secret_types?: Set<String>,
1126
+ secret_count?: Long,
1127
+
1128
+ // --- PII Detection ---
1129
+ pii_detected?: Bool,
1130
+ pii_types?: Set<String>,
1131
+ pii_count?: Long,
1132
+ pii_confidence?: Long,
1133
+
1134
+ // --- Content Safety Scores (0-100) ---
1135
+ violence_score: Long,
1136
+ weapons_score: Long,
1137
+ hate_speech_score: Long,
1138
+ crime_score: Long,
1139
+ sexual_score: Long,
1140
+ profanity_score: Long,
1141
+
1142
+ // --- ML Detector Scores (0-100) ---
1143
+ injection_score: Long, // Indirect injection in response content
1144
+ jailbreak_score: Long,
1145
+
1146
+ // --- Hallucination Detection (from HallucinationDetector) ---
1147
+ hallucination_score?: Long, // Hallucination confidence (0-100)
1148
+ factuality_score?: Long, // Factuality score (0-100)
1149
+
1150
+ // --- Code in Response ---
1151
+ contains_code?: Bool,
1152
+ code_languages?: Set<String>,
1153
+ code_ratio?: Long,
1154
+
1155
+ // --- Phishing ---
1156
+ phishing_detected?: Bool,
1157
+
1158
+ // --- Session History ---
1159
+ session_pii_detected?: Bool,
1160
+ session_pii_types?: Set<String>,
1161
+ session_secrets_detected?: Bool,
1162
+ session_secret_types?: Set<String>,
1163
+ session_injection_detected?: Bool,
1164
+ session_threat_turns?: Long,
1165
+ },
1166
+ };
1167
+
1168
+ // User pastes content into an AI chat (clipboard, cross-tab, cross-app)
1169
+ // Threat focus: data leakage via cut/paste, injection payloads in pasted content
1170
+ action paste_content appliesTo {
1171
+ principal: [User],
1172
+ resource: [ChatSession],
1173
+ context: {
1174
+ // --- Core Metadata ---
1175
+ content: String, // Pasted content
1176
+ source: String,
1177
+ event: String, // "paste_content"
1178
+ user_email: String,
1179
+ target_app: String,
1180
+ target_url?: String,
1181
+
1182
+ // --- Paste Context ---
1183
+ paste_source_app?: String, // Source application (e.g., "outlook", "excel", "vscode", "terminal")
1184
+ paste_source_url?: String, // Source URL if from another browser tab
1185
+ paste_length?: Long, // Character length of pasted content
1186
+
1187
+ // --- Aggregated Threat Summary ---
1188
+ threat_count: Long,
1189
+ highest_severity: String,
1190
+ threat_categories: Set<String>,
1191
+ detected_threats: Set<String>,
1192
+ max_threat_severity: Long,
1193
+
1194
+ // --- Secrets Detection ---
1195
+ contains_secrets: Bool,
1196
+ secret_types?: Set<String>,
1197
+ secret_count?: Long,
1198
+
1199
+ // --- PII Detection ---
1200
+ pii_detected?: Bool,
1201
+ pii_types?: Set<String>,
1202
+ pii_count?: Long,
1203
+ pii_confidence?: Long,
1204
+
1205
+ // --- Content Safety Scores (0-100) ---
1206
+ violence_score: Long,
1207
+ weapons_score: Long,
1208
+ hate_speech_score: Long,
1209
+ crime_score: Long,
1210
+ sexual_score: Long,
1211
+ profanity_score: Long,
1212
+
1213
+ // --- ML Detector Scores (0-100) ---
1214
+ injection_score: Long,
1215
+ jailbreak_score: Long,
1216
+
1217
+ // --- Code Detection ---
1218
+ contains_code?: Bool,
1219
+ code_languages?: Set<String>,
1220
+ code_ratio?: Long,
1221
+
1222
+ // --- Encoding Attacks ---
1223
+ contains_invisible_chars?: Bool,
1224
+ invisible_chars_score?: Long,
1225
+ encoded_content_detected?: Bool,
1226
+ encoded_types?: Set<String>,
1227
+ encoded_count?: Long,
1228
+ encoded_score?: Long,
1229
+
1230
+ // --- Keyword Detection ---
1231
+ keyword_matched?: Bool,
1232
+ keyword_categories?: Set<String>,
1233
+ keyword_count?: Long,
1234
+
1235
+ // --- Session History ---
1236
+ session_pii_detected?: Bool,
1237
+ session_pii_types?: Set<String>,
1238
+ session_secrets_detected?: Bool,
1239
+ session_secret_types?: Set<String>,
1240
+ session_injection_detected?: Bool,
1241
+ session_threat_turns?: Long,
1242
+ },
1243
+ };
1244
+
1245
+ // User uploads a file or document into an AI chat
1246
+ // Threat focus: document sensitivity (MIP labels), PII/secrets in files, malware
1247
+ action upload_file appliesTo {
1248
+ principal: [User],
1249
+ resource: [Document, ChatSession],
1250
+ context: {
1251
+ // --- Core Metadata ---
1252
+ content: String, // Extracted file text content (for scanning)
1253
+ source: String,
1254
+ event: String, // "upload_file"
1255
+ user_email: String,
1256
+ target_app: String,
1257
+ target_url?: String,
1258
+
1259
+ // --- File Metadata ---
1260
+ file_name?: String, // Original file name
1261
+ file_type?: String, // MIME type: "application/pdf", "text/csv", etc.
1262
+ file_size_bytes?: Long, // File size in bytes
1263
+ file_extension?: String, // Extension: "pdf", "docx", "xlsx", "csv", "txt"
1264
+
1265
+ // --- Document Sensitivity (MIP Labels) ---
1266
+ mip_label_id?: String, // Microsoft Information Protection label ID
1267
+ mip_label_name?: String, // Label display name: "Public", "Internal", "Confidential", "Highly Confidential"
1268
+ sensitivity_level?: String, // Normalized: "public", "internal", "confidential", "restricted"
1269
+ is_encrypted?: Bool, // Whether file is encrypted (MIP protection)
1270
+ is_rights_managed?: Bool, // Whether file has rights management restrictions
1271
+
1272
+ // --- Aggregated Threat Summary ---
1273
+ threat_count: Long,
1274
+ highest_severity: String,
1275
+ threat_categories: Set<String>,
1276
+ detected_threats: Set<String>,
1277
+ max_threat_severity: Long,
1278
+
1279
+ // --- Secrets Detection ---
1280
+ contains_secrets: Bool,
1281
+ secret_types?: Set<String>,
1282
+ secret_count?: Long,
1283
+
1284
+ // --- PII Detection ---
1285
+ pii_detected?: Bool,
1286
+ pii_types?: Set<String>,
1287
+ pii_count?: Long,
1288
+ pii_confidence?: Long,
1289
+
1290
+ // --- Content Safety Scores (0-100) ---
1291
+ violence_score: Long,
1292
+ weapons_score: Long,
1293
+ hate_speech_score: Long,
1294
+ crime_score: Long,
1295
+ sexual_score: Long,
1296
+ profanity_score: Long,
1297
+
1298
+ // --- ML Detector Scores (0-100) ---
1299
+ injection_score: Long, // Prompt injection payloads hidden in documents
1300
+ jailbreak_score: Long,
1301
+
1302
+ // --- Code Detection ---
1303
+ contains_code?: Bool,
1304
+ code_languages?: Set<String>,
1305
+ code_ratio?: Long,
1306
+
1307
+ // --- Phishing ---
1308
+ phishing_detected?: Bool,
1309
+
1310
+ // --- Encoding Attacks ---
1311
+ contains_invisible_chars?: Bool,
1312
+ invisible_chars_score?: Long,
1313
+ encoded_content_detected?: Bool,
1314
+ encoded_types?: Set<String>,
1315
+ encoded_count?: Long,
1316
+ encoded_score?: Long,
1317
+
1318
+ // --- Session History ---
1319
+ session_pii_detected?: Bool,
1320
+ session_pii_types?: Set<String>,
1321
+ session_secrets_detected?: Bool,
1322
+ session_secret_types?: Set<String>,
1323
+ session_injection_detected?: Bool,
1324
+ session_threat_turns?: Long,
1325
+ },
1326
+ };
1327
+
933
1328
  }
934
1329
  `;
935
1330
  /**
@@ -1158,7 +1553,14 @@ export const OVERWATCH_CONTEXT = {
1158
1553
  { "key": "pii_confidence", "type": "number", "required": true, "description": "PII detection ML classifier confidence (0-100)" },
1159
1554
  { "key": "injection_confidence", "type": "number", "required": true, "description": "Prompt injection ML classifier confidence (0-100)" },
1160
1555
  { "key": "jailbreak_confidence", "type": "number", "required": true, "description": "Jailbreak detection ML classifier confidence (0-100)" },
1161
- { "key": "indirect_injection_score", "type": "number", "required": true, "description": "Indirect prompt injection risk score (0-100) — injection via tool outputs or retrieved content" }
1556
+ { "key": "indirect_injection_score", "type": "number", "required": true, "description": "Indirect prompt injection risk score (0-100) — injection via tool outputs or retrieved content" },
1557
+ { "key": "session_pii_detected", "type": "boolean", "required": false, "description": "Whether PII was detected in any previous turn of the session" },
1558
+ { "key": "session_pii_types", "type": "array", "required": false, "description": "PII types detected across the session (accumulated)" },
1559
+ { "key": "session_secrets_detected", "type": "boolean", "required": false, "description": "Whether secrets were detected in any previous turn of the session" },
1560
+ { "key": "session_secret_types", "type": "array", "required": false, "description": "Secret types detected across the session (accumulated)" },
1561
+ { "key": "session_injection_detected", "type": "boolean", "required": false, "description": "Whether prompt injection was detected in any previous turn of the session" },
1562
+ { "key": "session_command_injection", "type": "boolean", "required": false, "description": "Whether command injection was detected in any previous turn of the session" },
1563
+ { "key": "session_threat_turns", "type": "number", "required": false, "description": "Number of turns in the session where threats were detected" }
1162
1564
  ]
1163
1565
  },
1164
1566
  {
@@ -1213,7 +1615,14 @@ export const OVERWATCH_CONTEXT = {
1213
1615
  { "key": "suspicious_pattern", "type": "boolean", "required": false, "description": "Whether a suspicious action sequence was detected (exfiltration, theft, destructive)" },
1214
1616
  { "key": "pattern_type", "type": "string", "required": false, "description": "Type of suspicious pattern: data_exfiltration, secret_exfiltration, credential_theft, destructive_sequence" },
1215
1617
  { "key": "sequence_risk", "type": "number", "required": false, "description": "Behavioral sequence risk score (0-100)" },
1216
- { "key": "mcp_server_verified", "type": "boolean", "required": false, "description": "Whether the MCP server is from a verified registry" }
1618
+ { "key": "mcp_server_verified", "type": "boolean", "required": false, "description": "Whether the MCP server is from a verified registry" },
1619
+ { "key": "session_pii_detected", "type": "boolean", "required": false, "description": "Whether PII was detected in any previous turn of the session" },
1620
+ { "key": "session_pii_types", "type": "array", "required": false, "description": "PII types detected across the session (accumulated)" },
1621
+ { "key": "session_secrets_detected", "type": "boolean", "required": false, "description": "Whether secrets were detected in any previous turn of the session" },
1622
+ { "key": "session_secret_types", "type": "array", "required": false, "description": "Secret types detected across the session (accumulated)" },
1623
+ { "key": "session_injection_detected", "type": "boolean", "required": false, "description": "Whether prompt injection was detected in any previous turn of the session" },
1624
+ { "key": "session_command_injection", "type": "boolean", "required": false, "description": "Whether command injection was detected in any previous turn of the session" },
1625
+ { "key": "session_threat_turns", "type": "number", "required": false, "description": "Number of turns in the session where threats were detected" }
1217
1626
  ]
1218
1627
  },
1219
1628
  {
@@ -1237,7 +1646,14 @@ export const OVERWATCH_CONTEXT = {
1237
1646
  { "key": "indirect_injection_score", "type": "number", "required": false, "description": "Indirect injection risk score (0-100) — injection payloads in server responses" },
1238
1647
  { "key": "mcp_server_verified", "type": "boolean", "required": false, "description": "Whether the MCP server is from a verified registry" },
1239
1648
  { "key": "mcp_config_risk", "type": "boolean", "required": false, "description": "Whether risky server configuration was detected (inline code exec, mixed transports)" },
1240
- { "key": "mcp_risk_score", "type": "number", "required": false, "description": "MCP configuration risk severity score (0-100)" }
1649
+ { "key": "mcp_risk_score", "type": "number", "required": false, "description": "MCP configuration risk severity score (0-100)" },
1650
+ { "key": "session_pii_detected", "type": "boolean", "required": false, "description": "Whether PII was detected in any previous turn of the session" },
1651
+ { "key": "session_pii_types", "type": "array", "required": false, "description": "PII types detected across the session (accumulated)" },
1652
+ { "key": "session_secrets_detected", "type": "boolean", "required": false, "description": "Whether secrets were detected in any previous turn of the session" },
1653
+ { "key": "session_secret_types", "type": "array", "required": false, "description": "Secret types detected across the session (accumulated)" },
1654
+ { "key": "session_injection_detected", "type": "boolean", "required": false, "description": "Whether prompt injection was detected in any previous turn of the session" },
1655
+ { "key": "session_command_injection", "type": "boolean", "required": false, "description": "Whether command injection was detected in any previous turn of the session" },
1656
+ { "key": "session_threat_turns", "type": "number", "required": false, "description": "Number of turns in the session where threats were detected" }
1241
1657
  ]
1242
1658
  },
1243
1659
  {
@@ -1261,7 +1677,14 @@ export const OVERWATCH_CONTEXT = {
1261
1677
  { "key": "secret_count", "type": "number", "required": false, "description": "Number of distinct secrets detected in file" },
1262
1678
  { "key": "pii_detected", "type": "boolean", "required": false, "description": "Whether any PII patterns were matched in file content" },
1263
1679
  { "key": "pii_types", "type": "array", "required": false, "description": "Specific PII types found in file" },
1264
- { "key": "pii_count", "type": "number", "required": false, "description": "Number of PII pattern matches in file" }
1680
+ { "key": "pii_count", "type": "number", "required": false, "description": "Number of PII pattern matches in file" },
1681
+ { "key": "session_pii_detected", "type": "boolean", "required": false, "description": "Whether PII was detected in any previous turn of the session" },
1682
+ { "key": "session_pii_types", "type": "array", "required": false, "description": "PII types detected across the session (accumulated)" },
1683
+ { "key": "session_secrets_detected", "type": "boolean", "required": false, "description": "Whether secrets were detected in any previous turn of the session" },
1684
+ { "key": "session_secret_types", "type": "array", "required": false, "description": "Secret types detected across the session (accumulated)" },
1685
+ { "key": "session_injection_detected", "type": "boolean", "required": false, "description": "Whether prompt injection was detected in any previous turn of the session" },
1686
+ { "key": "session_command_injection", "type": "boolean", "required": false, "description": "Whether command injection was detected in any previous turn of the session" },
1687
+ { "key": "session_threat_turns", "type": "number", "required": false, "description": "Number of turns in the session where threats were detected" }
1265
1688
  ]
1266
1689
  },
1267
1690
  {
@@ -1286,7 +1709,14 @@ export const OVERWATCH_CONTEXT = {
1286
1709
  { "key": "pii_detected", "type": "boolean", "required": false, "description": "Whether any PII patterns were matched in content being written" },
1287
1710
  { "key": "pii_types", "type": "array", "required": false, "description": "Specific PII types found" },
1288
1711
  { "key": "pii_count", "type": "number", "required": false, "description": "Number of PII pattern matches" },
1289
- { "key": "contains_invisible_chars", "type": "boolean", "required": false, "description": "Whether invisible Unicode characters were detected in content being written" }
1712
+ { "key": "contains_invisible_chars", "type": "boolean", "required": false, "description": "Whether invisible Unicode characters were detected in content being written" },
1713
+ { "key": "session_pii_detected", "type": "boolean", "required": false, "description": "Whether PII was detected in any previous turn of the session" },
1714
+ { "key": "session_pii_types", "type": "array", "required": false, "description": "PII types detected across the session (accumulated)" },
1715
+ { "key": "session_secrets_detected", "type": "boolean", "required": false, "description": "Whether secrets were detected in any previous turn of the session" },
1716
+ { "key": "session_secret_types", "type": "array", "required": false, "description": "Secret types detected across the session (accumulated)" },
1717
+ { "key": "session_injection_detected", "type": "boolean", "required": false, "description": "Whether prompt injection was detected in any previous turn of the session" },
1718
+ { "key": "session_command_injection", "type": "boolean", "required": false, "description": "Whether command injection was detected in any previous turn of the session" },
1719
+ { "key": "session_threat_turns", "type": "number", "required": false, "description": "Number of turns in the session where threats were detected" }
1290
1720
  ]
1291
1721
  }
1292
1722
  ]
@@ -1389,3 +1819,226 @@ export const PALISADE_CONTEXT = {
1389
1819
  }
1390
1820
  ]
1391
1821
  };
1822
+ /**
1823
+ * Sentry context metadata (parsed JSON)
1824
+ */
1825
+ export const SENTRY_CONTEXT = {
1826
+ "service": "sentry",
1827
+ "version": "1.0.0",
1828
+ "description": "Sentry browser security — monitors AI chat interactions and enforces data-protection, content-safety, and compliance policies",
1829
+ "actions": [
1830
+ {
1831
+ "name": "send_message",
1832
+ "description": "User sends a message (prompt) to an AI chat service via the browser",
1833
+ "context_attributes": [
1834
+ { "key": "content", "type": "string", "required": true, "description": "Raw message content being sent to the AI service" },
1835
+ { "key": "source", "type": "string", "required": true, "description": "Browser extension identifier (always \'sentry\')" },
1836
+ { "key": "event", "type": "string", "required": true, "description": "Event type (always \'send_message\')" },
1837
+ { "key": "user_email", "type": "string", "required": true, "description": "User identifier (SSO/OAuth verified)" },
1838
+ { "key": "target_app", "type": "string", "required": true, "description": "AI service being used: chatgpt, gemini, claude, copilot, custom" },
1839
+ { "key": "target_url", "type": "string", "required": false, "description": "Full URL of the AI chat service" },
1840
+ { "key": "threat_count", "type": "number", "required": true, "description": "Total number of threats detected by Shield detection pipeline" },
1841
+ { "key": "highest_severity", "type": "string", "required": true, "description": "Highest severity level: critical, high, medium, low, none" },
1842
+ { "key": "threat_categories", "type": "array", "required": true, "description": "Threat category names from the detection aggregator" },
1843
+ { "key": "detected_threats", "type": "array", "required": true, "description": "Detection rule names that matched (e.g., prompt_injection, credit_card, secret_exposure)" },
1844
+ { "key": "max_threat_severity", "type": "number", "required": true, "description": "Numeric severity (0=none, 1=low, 2=medium, 3=high, 4=critical)" },
1845
+ { "key": "contains_secrets", "type": "boolean", "required": true, "description": "Whether secrets or credentials were detected in the message" },
1846
+ { "key": "secret_types", "type": "array", "required": false, "description": "Specific secret types: aws_access_key, aws_secret_key, github_token, github_fine_grained, slack_token, gcp_service_account, gcp_api_key, azure_connection_string, private_key, jwt_token, generic_api_key, stripe_key, openai_key, anthropic_key" },
1847
+ { "key": "secret_count", "type": "number", "required": false, "description": "Number of distinct secrets detected" },
1848
+ { "key": "pii_detected", "type": "boolean", "required": false, "description": "Whether any PII patterns were matched" },
1849
+ { "key": "pii_types", "type": "array", "required": false, "description": "Specific PII types: ssn, credit_card, email, phone_us, ip_address, date_of_birth, passport, iban, aws_key, api_key_generic" },
1850
+ { "key": "pii_count", "type": "number", "required": false, "description": "Number of PII pattern matches" },
1851
+ { "key": "pii_confidence", "type": "number", "required": false, "description": "PII detection confidence (0-100). Fixed 80 when regex PII detected, else 0" },
1852
+ { "key": "violence_score", "type": "number", "required": true, "description": "Violence content detection score (0-100, from ToxicityDetector)" },
1853
+ { "key": "weapons_score", "type": "number", "required": true, "description": "Weapons content detection score (0-100)" },
1854
+ { "key": "hate_speech_score", "type": "number", "required": true, "description": "Hate speech detection score (0-100)" },
1855
+ { "key": "crime_score", "type": "number", "required": true, "description": "Criminal content detection score (0-100)" },
1856
+ { "key": "sexual_score", "type": "number", "required": true, "description": "Sexual content detection score (0-100)" },
1857
+ { "key": "profanity_score", "type": "number", "required": true, "description": "Profanity detection score (0-100)" },
1858
+ { "key": "injection_score", "type": "number", "required": true, "description": "Prompt injection score (0-100, max of InjectionDetector + DeepContextDetector)" },
1859
+ { "key": "jailbreak_score", "type": "number", "required": true, "description": "Jailbreak detection score (0-100, max of JailbreakDetector + DeepContextDetector)" },
1860
+ { "key": "content_topics", "type": "array", "required": false, "description": "Detected topics from TopicDetector: controlled_substances, weapons_manufacturing, etc." },
1861
+ { "key": "topic_confidence", "type": "number", "required": false, "description": "Topic classifier confidence (0-100)" },
1862
+ { "key": "contains_invisible_chars", "type": "boolean", "required": false, "description": "Whether invisible Unicode characters (zero-width, bidi overrides, tag chars) were detected" },
1863
+ { "key": "invisible_chars_score", "type": "number", "required": false, "description": "Invisible character attack severity score (0-100)" },
1864
+ { "key": "encoded_content_detected", "type": "boolean", "required": false, "description": "Whether encoded content (base64, hex, unicode, URL) was detected" },
1865
+ { "key": "encoded_types", "type": "array", "required": false, "description": "Encoding types detected: base64, hex, unicode, url" },
1866
+ { "key": "encoded_count", "type": "number", "required": false, "description": "Number of encoded segments detected" },
1867
+ { "key": "encoded_score", "type": "number", "required": false, "description": "Encoded injection severity score (0-100)" },
1868
+ { "key": "contains_code", "type": "boolean", "required": false, "description": "Whether content contains source code" },
1869
+ { "key": "code_languages", "type": "array", "required": false, "description": "Detected programming languages: python, javascript, go, etc." },
1870
+ { "key": "code_ratio", "type": "number", "required": false, "description": "Percentage of content that is code (0-100)" },
1871
+ { "key": "detected_language", "type": "string", "required": false, "description": "Detected natural language ISO code from LanguageDetector" },
1872
+ { "key": "is_english", "type": "boolean", "required": false, "description": "Whether detected language is English" },
1873
+ { "key": "language_confidence", "type": "number", "required": false, "description": "Language detection confidence (0-100)" },
1874
+ { "key": "detected_script", "type": "string", "required": false, "description": "Unicode script: latin, cyrillic, arabic, unknown" },
1875
+ { "key": "is_latin_script", "type": "boolean", "required": false, "description": "Whether detected script is Latin" },
1876
+ { "key": "script_confidence", "type": "number", "required": false, "description": "Script detection confidence (0-100)" },
1877
+ { "key": "keyword_matched", "type": "boolean", "required": false, "description": "Whether any keywords from KeywordDetector matched" },
1878
+ { "key": "keyword_categories", "type": "array", "required": false, "description": "Matched keyword categories" },
1879
+ { "key": "keyword_count", "type": "number", "required": false, "description": "Number of keyword matches" },
1880
+ { "key": "phishing_detected", "type": "boolean", "required": false, "description": "Whether phishing URLs detected by CheckPhishDetector" },
1881
+ { "key": "session_pii_detected", "type": "boolean", "required": false, "description": "Whether PII was detected in any previous turn of the session" },
1882
+ { "key": "session_pii_types", "type": "array", "required": false, "description": "PII types detected across the session (accumulated)" },
1883
+ { "key": "session_secrets_detected", "type": "boolean", "required": false, "description": "Whether secrets were detected in any previous turn of the session" },
1884
+ { "key": "session_secret_types", "type": "array", "required": false, "description": "Secret types detected across the session (accumulated)" },
1885
+ { "key": "session_injection_detected", "type": "boolean", "required": false, "description": "Whether prompt injection was detected in any previous turn of the session" },
1886
+ { "key": "session_threat_turns", "type": "number", "required": false, "description": "Number of turns in the session where threats were detected" }
1887
+ ]
1888
+ },
1889
+ {
1890
+ "name": "receive_response",
1891
+ "description": "AI service responds to the user — scan response content for harmful output",
1892
+ "context_attributes": [
1893
+ { "key": "content", "type": "string", "required": true, "description": "AI response content" },
1894
+ { "key": "source", "type": "string", "required": true, "description": "Browser extension identifier" },
1895
+ { "key": "event", "type": "string", "required": true, "description": "Event type (always \'receive_response\')" },
1896
+ { "key": "user_email", "type": "string", "required": true, "description": "User identifier" },
1897
+ { "key": "target_app", "type": "string", "required": true, "description": "AI service: chatgpt, gemini, claude, copilot, custom" },
1898
+ { "key": "target_url", "type": "string", "required": false, "description": "Full URL of the AI chat service" },
1899
+ { "key": "threat_count", "type": "number", "required": true, "description": "Total number of threats detected" },
1900
+ { "key": "highest_severity", "type": "string", "required": true, "description": "Highest severity level: critical, high, medium, low, none" },
1901
+ { "key": "threat_categories", "type": "array", "required": true, "description": "Threat category names" },
1902
+ { "key": "detected_threats", "type": "array", "required": true, "description": "Detection rule names that matched" },
1903
+ { "key": "max_threat_severity", "type": "number", "required": true, "description": "Numeric severity (0-4)" },
1904
+ { "key": "contains_secrets", "type": "boolean", "required": true, "description": "Whether secrets detected in AI response" },
1905
+ { "key": "secret_types", "type": "array", "required": false, "description": "Secret types in response" },
1906
+ { "key": "secret_count", "type": "number", "required": false, "description": "Number of secrets in response" },
1907
+ { "key": "pii_detected", "type": "boolean", "required": false, "description": "Whether PII detected in response" },
1908
+ { "key": "pii_types", "type": "array", "required": false, "description": "PII types in response" },
1909
+ { "key": "pii_count", "type": "number", "required": false, "description": "Number of PII matches in response" },
1910
+ { "key": "pii_confidence", "type": "number", "required": false, "description": "PII detection confidence (0-100)" },
1911
+ { "key": "violence_score", "type": "number", "required": true, "description": "Violence score (0-100)" },
1912
+ { "key": "weapons_score", "type": "number", "required": true, "description": "Weapons score (0-100)" },
1913
+ { "key": "hate_speech_score", "type": "number", "required": true, "description": "Hate speech score (0-100)" },
1914
+ { "key": "crime_score", "type": "number", "required": true, "description": "Crime score (0-100)" },
1915
+ { "key": "sexual_score", "type": "number", "required": true, "description": "Sexual content score (0-100)" },
1916
+ { "key": "profanity_score", "type": "number", "required": true, "description": "Profanity score (0-100)" },
1917
+ { "key": "injection_score", "type": "number", "required": true, "description": "Indirect injection score in response (0-100)" },
1918
+ { "key": "jailbreak_score", "type": "number", "required": true, "description": "Jailbreak score (0-100)" },
1919
+ { "key": "hallucination_score", "type": "number", "required": false, "description": "Hallucination confidence (0-100, from HallucinationDetector)" },
1920
+ { "key": "factuality_score", "type": "number", "required": false, "description": "Factuality score (0-100)" },
1921
+ { "key": "contains_code", "type": "boolean", "required": false, "description": "Whether response contains code" },
1922
+ { "key": "code_languages", "type": "array", "required": false, "description": "Code languages in response" },
1923
+ { "key": "code_ratio", "type": "number", "required": false, "description": "Code ratio (0-100)" },
1924
+ { "key": "phishing_detected", "type": "boolean", "required": false, "description": "Whether phishing URLs detected in response" },
1925
+ { "key": "session_pii_detected", "type": "boolean", "required": false, "description": "Whether PII was detected in any previous turn of the session" },
1926
+ { "key": "session_pii_types", "type": "array", "required": false, "description": "PII types detected across the session (accumulated)" },
1927
+ { "key": "session_secrets_detected", "type": "boolean", "required": false, "description": "Whether secrets were detected in any previous turn of the session" },
1928
+ { "key": "session_secret_types", "type": "array", "required": false, "description": "Secret types detected across the session (accumulated)" },
1929
+ { "key": "session_injection_detected", "type": "boolean", "required": false, "description": "Whether prompt injection was detected in any previous turn of the session" },
1930
+ { "key": "session_threat_turns", "type": "number", "required": false, "description": "Number of turns in the session where threats were detected" }
1931
+ ]
1932
+ },
1933
+ {
1934
+ "name": "paste_content",
1935
+ "description": "User pastes content into an AI chat (clipboard, cross-tab, cross-app)",
1936
+ "context_attributes": [
1937
+ { "key": "content", "type": "string", "required": true, "description": "Pasted content" },
1938
+ { "key": "source", "type": "string", "required": true, "description": "Browser extension identifier" },
1939
+ { "key": "event", "type": "string", "required": true, "description": "Event type (always \'paste_content\')" },
1940
+ { "key": "user_email", "type": "string", "required": true, "description": "User identifier" },
1941
+ { "key": "target_app", "type": "string", "required": true, "description": "AI service: chatgpt, gemini, claude, copilot, custom" },
1942
+ { "key": "target_url", "type": "string", "required": false, "description": "Full URL of the AI chat service" },
1943
+ { "key": "paste_source_app", "type": "string", "required": false, "description": "Source application for the paste: outlook, excel, vscode, terminal, slack, etc." },
1944
+ { "key": "paste_source_url", "type": "string", "required": false, "description": "Source URL if content pasted from another browser tab" },
1945
+ { "key": "paste_length", "type": "number", "required": false, "description": "Character length of pasted content" },
1946
+ { "key": "threat_count", "type": "number", "required": true, "description": "Total threats detected" },
1947
+ { "key": "highest_severity", "type": "string", "required": true, "description": "Highest severity: critical, high, medium, low, none" },
1948
+ { "key": "threat_categories", "type": "array", "required": true, "description": "Threat category names" },
1949
+ { "key": "detected_threats", "type": "array", "required": true, "description": "Detection rule names that matched" },
1950
+ { "key": "max_threat_severity", "type": "number", "required": true, "description": "Numeric severity (0-4)" },
1951
+ { "key": "contains_secrets", "type": "boolean", "required": true, "description": "Whether secrets detected in pasted content" },
1952
+ { "key": "secret_types", "type": "array", "required": false, "description": "Secret types in pasted content" },
1953
+ { "key": "secret_count", "type": "number", "required": false, "description": "Number of secrets" },
1954
+ { "key": "pii_detected", "type": "boolean", "required": false, "description": "Whether PII detected in pasted content" },
1955
+ { "key": "pii_types", "type": "array", "required": false, "description": "PII types in pasted content" },
1956
+ { "key": "pii_count", "type": "number", "required": false, "description": "PII match count" },
1957
+ { "key": "pii_confidence", "type": "number", "required": false, "description": "PII detection confidence (0-100)" },
1958
+ { "key": "violence_score", "type": "number", "required": true, "description": "Violence score (0-100)" },
1959
+ { "key": "weapons_score", "type": "number", "required": true, "description": "Weapons score (0-100)" },
1960
+ { "key": "hate_speech_score", "type": "number", "required": true, "description": "Hate speech score (0-100)" },
1961
+ { "key": "crime_score", "type": "number", "required": true, "description": "Crime score (0-100)" },
1962
+ { "key": "sexual_score", "type": "number", "required": true, "description": "Sexual score (0-100)" },
1963
+ { "key": "profanity_score", "type": "number", "required": true, "description": "Profanity score (0-100)" },
1964
+ { "key": "injection_score", "type": "number", "required": true, "description": "Injection score (0-100)" },
1965
+ { "key": "jailbreak_score", "type": "number", "required": true, "description": "Jailbreak score (0-100)" },
1966
+ { "key": "contains_code", "type": "boolean", "required": false, "description": "Whether pasted content contains code" },
1967
+ { "key": "code_languages", "type": "array", "required": false, "description": "Code languages in pasted content" },
1968
+ { "key": "code_ratio", "type": "number", "required": false, "description": "Code ratio (0-100)" },
1969
+ { "key": "contains_invisible_chars", "type": "boolean", "required": false, "description": "Whether invisible Unicode characters detected" },
1970
+ { "key": "invisible_chars_score", "type": "number", "required": false, "description": "Invisible chars severity (0-100)" },
1971
+ { "key": "encoded_content_detected", "type": "boolean", "required": false, "description": "Whether encoded content detected" },
1972
+ { "key": "encoded_types", "type": "array", "required": false, "description": "Encoding types" },
1973
+ { "key": "encoded_count", "type": "number", "required": false, "description": "Encoded segment count" },
1974
+ { "key": "encoded_score", "type": "number", "required": false, "description": "Encoded injection severity (0-100)" },
1975
+ { "key": "keyword_matched", "type": "boolean", "required": false, "description": "Whether keywords matched" },
1976
+ { "key": "keyword_categories", "type": "array", "required": false, "description": "Keyword categories" },
1977
+ { "key": "keyword_count", "type": "number", "required": false, "description": "Keyword match count" },
1978
+ { "key": "session_pii_detected", "type": "boolean", "required": false, "description": "Whether PII was detected in any previous turn of the session" },
1979
+ { "key": "session_pii_types", "type": "array", "required": false, "description": "PII types detected across the session (accumulated)" },
1980
+ { "key": "session_secrets_detected", "type": "boolean", "required": false, "description": "Whether secrets were detected in any previous turn of the session" },
1981
+ { "key": "session_secret_types", "type": "array", "required": false, "description": "Secret types detected across the session (accumulated)" },
1982
+ { "key": "session_injection_detected", "type": "boolean", "required": false, "description": "Whether prompt injection was detected in any previous turn of the session" },
1983
+ { "key": "session_threat_turns", "type": "number", "required": false, "description": "Number of turns in the session where threats were detected" }
1984
+ ]
1985
+ },
1986
+ {
1987
+ "name": "upload_file",
1988
+ "description": "User uploads a file or document into an AI chat service",
1989
+ "context_attributes": [
1990
+ { "key": "content", "type": "string", "required": true, "description": "Extracted file text content (for scanning)" },
1991
+ { "key": "source", "type": "string", "required": true, "description": "Browser extension identifier" },
1992
+ { "key": "event", "type": "string", "required": true, "description": "Event type (always \'upload_file\')" },
1993
+ { "key": "user_email", "type": "string", "required": true, "description": "User identifier" },
1994
+ { "key": "target_app", "type": "string", "required": true, "description": "AI service: chatgpt, gemini, claude, copilot, custom" },
1995
+ { "key": "target_url", "type": "string", "required": false, "description": "Full URL of the AI chat service" },
1996
+ { "key": "file_name", "type": "string", "required": false, "description": "Original file name" },
1997
+ { "key": "file_type", "type": "string", "required": false, "description": "MIME type: application/pdf, text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, etc." },
1998
+ { "key": "file_size_bytes", "type": "number", "required": false, "description": "File size in bytes" },
1999
+ { "key": "file_extension", "type": "string", "required": false, "description": "File extension: pdf, docx, xlsx, csv, txt, py, js, etc." },
2000
+ { "key": "mip_label_id", "type": "string", "required": false, "description": "Microsoft Information Protection label GUID" },
2001
+ { "key": "mip_label_name", "type": "string", "required": false, "description": "MIP label display name: Public, General, Confidential, Highly Confidential" },
2002
+ { "key": "sensitivity_level", "type": "string", "required": false, "description": "Normalized sensitivity: public, internal, confidential, restricted" },
2003
+ { "key": "is_encrypted", "type": "boolean", "required": false, "description": "Whether file is encrypted via MIP protection" },
2004
+ { "key": "is_rights_managed", "type": "boolean", "required": false, "description": "Whether file has rights management (IRM/RMS) restrictions" },
2005
+ { "key": "threat_count", "type": "number", "required": true, "description": "Total threats detected" },
2006
+ { "key": "highest_severity", "type": "string", "required": true, "description": "Highest severity: critical, high, medium, low, none" },
2007
+ { "key": "threat_categories", "type": "array", "required": true, "description": "Threat category names" },
2008
+ { "key": "detected_threats", "type": "array", "required": true, "description": "Detection rule names that matched" },
2009
+ { "key": "max_threat_severity", "type": "number", "required": true, "description": "Numeric severity (0-4)" },
2010
+ { "key": "contains_secrets", "type": "boolean", "required": true, "description": "Whether secrets detected in file content" },
2011
+ { "key": "secret_types", "type": "array", "required": false, "description": "Secret types in file" },
2012
+ { "key": "secret_count", "type": "number", "required": false, "description": "Number of secrets" },
2013
+ { "key": "pii_detected", "type": "boolean", "required": false, "description": "Whether PII detected in file" },
2014
+ { "key": "pii_types", "type": "array", "required": false, "description": "PII types in file" },
2015
+ { "key": "pii_count", "type": "number", "required": false, "description": "PII match count" },
2016
+ { "key": "pii_confidence", "type": "number", "required": false, "description": "PII confidence (0-100)" },
2017
+ { "key": "violence_score", "type": "number", "required": true, "description": "Violence score (0-100)" },
2018
+ { "key": "weapons_score", "type": "number", "required": true, "description": "Weapons score (0-100)" },
2019
+ { "key": "hate_speech_score", "type": "number", "required": true, "description": "Hate speech score (0-100)" },
2020
+ { "key": "crime_score", "type": "number", "required": true, "description": "Crime score (0-100)" },
2021
+ { "key": "sexual_score", "type": "number", "required": true, "description": "Sexual score (0-100)" },
2022
+ { "key": "profanity_score", "type": "number", "required": true, "description": "Profanity score (0-100)" },
2023
+ { "key": "injection_score", "type": "number", "required": true, "description": "Injection score in file content (0-100)" },
2024
+ { "key": "jailbreak_score", "type": "number", "required": true, "description": "Jailbreak score (0-100)" },
2025
+ { "key": "contains_code", "type": "boolean", "required": false, "description": "Whether file contains source code" },
2026
+ { "key": "code_languages", "type": "array", "required": false, "description": "Code languages in file" },
2027
+ { "key": "code_ratio", "type": "number", "required": false, "description": "Code ratio (0-100)" },
2028
+ { "key": "phishing_detected", "type": "boolean", "required": false, "description": "Whether phishing URLs detected in file" },
2029
+ { "key": "contains_invisible_chars", "type": "boolean", "required": false, "description": "Whether invisible chars detected in file" },
2030
+ { "key": "invisible_chars_score", "type": "number", "required": false, "description": "Invisible chars severity (0-100)" },
2031
+ { "key": "encoded_content_detected", "type": "boolean", "required": false, "description": "Whether encoded content detected in file" },
2032
+ { "key": "encoded_types", "type": "array", "required": false, "description": "Encoding types in file" },
2033
+ { "key": "encoded_count", "type": "number", "required": false, "description": "Encoded segment count" },
2034
+ { "key": "encoded_score", "type": "number", "required": false, "description": "Encoded injection severity (0-100)" },
2035
+ { "key": "session_pii_detected", "type": "boolean", "required": false, "description": "Whether PII was detected in any previous turn of the session" },
2036
+ { "key": "session_pii_types", "type": "array", "required": false, "description": "PII types detected across the session (accumulated)" },
2037
+ { "key": "session_secrets_detected", "type": "boolean", "required": false, "description": "Whether secrets were detected in any previous turn of the session" },
2038
+ { "key": "session_secret_types", "type": "array", "required": false, "description": "Secret types detected across the session (accumulated)" },
2039
+ { "key": "session_injection_detected", "type": "boolean", "required": false, "description": "Whether prompt injection was detected in any previous turn of the session" },
2040
+ { "key": "session_threat_turns", "type": "number", "required": false, "description": "Number of turns in the session where threats were detected" }
2041
+ ]
2042
+ }
2043
+ ]
2044
+ };