@highflame/policy 2.2.31 → 2.2.32
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/context.json +1272 -439
- package/_schemas/agent_ops/schema.cedarschema +24 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_cross_origin.cedar +92 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_escalation.cedar +99 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_identity_enforcement.cedar +101 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_inter_agent_injection.cedar +120 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_claude_block_injection.cedar +30 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_defaults.cedar +122 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_multi_agent_safety.cedar +164 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_multi_agent_trust.cedar +143 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_security_data_pipeline.cedar +45 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_security_defaults.cedar +164 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_security_malicious_package.cedar +59 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_security_param_validation.cedar +119 -0
- package/_schemas/agent_ops/templates/ported/agent-security/agent_security_tool_risk.cedar +66 -0
- package/_schemas/agent_ops/templates/ported/code-security/agent_identity_a2a_supply_chain.cedar +101 -0
- package/_schemas/agent_ops/templates/ported/code-security/agent_security_code_agent.cedar +130 -0
- package/_schemas/agent_ops/templates/ported/code-security/agent_security_code_agent_supply_chain.cedar +116 -0
- package/_schemas/agent_ops/templates/ported/code-security/security_code_agent_encoding.cedar +51 -0
- package/_schemas/agent_ops/templates/ported/code-security/security_code_agent_path_security.cedar +149 -0
- package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_chat_assistant.cedar +58 -0
- package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_defaults.cedar +111 -0
- package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_semantic.cedar +78 -0
- package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_toxicity.cedar +71 -0
- package/_schemas/agent_ops/templates/ported/data-protection/data_protection_advanced_secrets.cedar +74 -0
- package/_schemas/agent_ops/templates/ported/data-protection/data_protection_code_block_write_secrets.cedar +26 -0
- package/_schemas/agent_ops/templates/ported/data-protection/data_protection_data_pipeline.cedar +52 -0
- package/_schemas/agent_ops/templates/ported/data-protection/data_protection_defaults.cedar +57 -0
- package/_schemas/agent_ops/templates/ported/data-protection/privacy_advanced_pii.cedar +465 -0
- package/_schemas/agent_ops/templates/ported/data-protection/privacy_defaults.cedar +164 -0
- package/_schemas/agent_ops/templates/ported/data-protection/privacy_pii_model.cedar +90 -0
- package/_schemas/agent_ops/templates/ported/organization/organization_deny_baseline.cedar +22 -0
- package/_schemas/agent_ops/templates/ported/organization/organization_team_permissions.cedar +38 -0
- package/_schemas/agent_ops/templates/ported/threat-detection/security_advanced_block_critical_severity.cedar +30 -0
- package/_schemas/agent_ops/templates/ported/threat-detection/security_chat_assistant.cedar +47 -0
- package/_schemas/agent_ops/templates/ported/threat-detection/security_data_pipeline_block_injection.cedar +31 -0
- package/_schemas/agent_ops/templates/ported/threat-detection/security_injection.cedar +82 -0
- package/_schemas/agent_ops/templates/ported/threat-detection/security_patterns.cedar +72 -0
- package/_schemas/agent_ops/templates/ported/threat-detection/semantic_defaults.cedar +155 -0
- package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_bash_operation_classes.cedar +142 -0
- package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_block_shell.cedar +40 -0
- package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_defaults.cedar +76 -0
- package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_mcp_server_allowlist.cedar +41 -0
- package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_mcp_tool_permissions.cedar +103 -0
- package/_schemas/agent_ops/templates/templates.json +752 -8
- package/_schemas/ai_gateway/context.json +2 -2
- package/_schemas/guardrails/context.json +2 -2
- package/_schemas/guardrails/templates/templates.json +6 -1
- package/_schemas/overwatch/context.json +3 -3
- package/dist/aarm-annotations.gen.js +1 -1
- package/dist/agent_ops-context.gen.d.ts +5 -1
- package/dist/agent_ops-context.gen.js +8 -0
- package/dist/agent_ops-defaults.gen.js +5168 -8
- package/dist/guardrails-defaults.gen.js +6 -1
- package/dist/overwatch-defaults.gen.js +109 -0
- package/dist/service-schemas.gen.d.ts +1 -1
- package/dist/service-schemas.gen.js +48 -12
- package/package.json +1 -1
|
@@ -4053,7 +4053,12 @@ export const GUARDRAILS_TEMPLATES_JSON = `{
|
|
|
4053
4053
|
"category": "tools",
|
|
4054
4054
|
"file": "mcp_server_allowlist.cedar",
|
|
4055
4055
|
"severity": "medium",
|
|
4056
|
-
"tags": [
|
|
4056
|
+
"tags": [
|
|
4057
|
+
"category:tools",
|
|
4058
|
+
"surface:connect-server",
|
|
4059
|
+
"scope:org-wide",
|
|
4060
|
+
"posture:deny-default"
|
|
4061
|
+
]
|
|
4057
4062
|
},
|
|
4058
4063
|
{
|
|
4059
4064
|
"id": "security.chat-assistant",
|
|
@@ -717,6 +717,88 @@ when {
|
|
|
717
717
|
)
|
|
718
718
|
};
|
|
719
719
|
`;
|
|
720
|
+
const OVERWATCH_TOOLS_SHELL_COMMAND_GOVERNANCE_CEDAR = `// =============================================================================
|
|
721
|
+
// Shell & Command Governance (Overwatch / Code Agents) — opt-in
|
|
722
|
+
// =============================================================================
|
|
723
|
+
// Graduated governance for shell/tool calls by a coding agent. Sits between
|
|
724
|
+
// tools.block-shell (blocks ALL shell) and tools.bash-operation-classes
|
|
725
|
+
// (blocks all network + all writes): this template blocks the unambiguously
|
|
726
|
+
// dangerous and lets ordinary dev commands through.
|
|
727
|
+
//
|
|
728
|
+
// SCOPE / KNOWN LIMITS (read before deploying):
|
|
729
|
+
// - Rule 1 is a TRIPWIRE for the literal \`curl | interpreter\` idiom. It is
|
|
730
|
+
// evaded by splitting download+exec across calls, or running a downloaded
|
|
731
|
+
// file by path (\`wget -O /tmp/x && /tmp/x\`). Robust download-then-run
|
|
732
|
+
// coverage is a detector gap — see highflame-shield#328 and the
|
|
733
|
+
// download->execute action_pattern follow-up. Do NOT treat Rule 1 as a
|
|
734
|
+
// complete control; the security value is in the tool_risk + behavioral
|
|
735
|
+
// rules below.
|
|
736
|
+
// - A rule on tool_operation_classes.contains("unknown") was deliberately
|
|
737
|
+
// REMOVED: measured 37% false-positive rate on real dev traffic (the
|
|
738
|
+
// bash_ast whitelist misses git/gh/npm/sleep/kill/venv-paths; #328).
|
|
739
|
+
//
|
|
740
|
+
// Context keys: tool_operation_classes (Set), tool_risk_score (Long 0-100),
|
|
741
|
+
// tool_category (String), tool_is_sensitive (Bool), suspicious_pattern
|
|
742
|
+
// (Bool), pattern_type (String). All optional — guarded with \`context has\`.
|
|
743
|
+
//
|
|
744
|
+
// Category: tools
|
|
745
|
+
// Namespace: Overwatch
|
|
746
|
+
// =============================================================================
|
|
747
|
+
|
|
748
|
+
@id("tools.block-download-execute")
|
|
749
|
+
@name("Block download-and-run shell commands")
|
|
750
|
+
@description("Blocks call_tool when a single shell command both reaches the network and executes code (the curl-pipe-interpreter shape).")
|
|
751
|
+
@severity("critical")
|
|
752
|
+
@tags("category:tools,threat:command-injection,detection:rule,surface:call-tool,owasp:asi02,mitre:t1059")
|
|
753
|
+
@reject_message("Tool execution blocked: a shell command both reaches the network and executes code (the download-and-run shape).")
|
|
754
|
+
forbid (principal, action == Overwatch::Action::"call_tool", resource)
|
|
755
|
+
when {
|
|
756
|
+
context has tool_operation_classes &&
|
|
757
|
+
context.tool_operation_classes.contains("network_access") &&
|
|
758
|
+
context.tool_operation_classes.contains("execute_enabling")
|
|
759
|
+
};
|
|
760
|
+
|
|
761
|
+
@id("tools.block-dangerous-tool")
|
|
762
|
+
@name("Block dangerous or high-risk tools")
|
|
763
|
+
@description("Blocks call_tool when tool_risk_score >= 86 or tool_category equals \\"dangerous\\".")
|
|
764
|
+
@severity("critical")
|
|
765
|
+
@tags("category:tools,detection:aggregate,surface:call-tool,owasp:llm06")
|
|
766
|
+
@reject_message("Tool execution blocked: the tool is classified dangerous or scored high risk.")
|
|
767
|
+
forbid (principal, action == Overwatch::Action::"call_tool", resource)
|
|
768
|
+
when {
|
|
769
|
+
(context has tool_risk_score && context.tool_risk_score >= 86) ||
|
|
770
|
+
(context has tool_category && context.tool_category == "dangerous")
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
@id("tools.block-sensitive-high-risk")
|
|
774
|
+
@name("Block sensitive tools at elevated risk")
|
|
775
|
+
@description("Blocks call_tool when tool_is_sensitive is true and tool_risk_score >= 71.")
|
|
776
|
+
@severity("high")
|
|
777
|
+
@tags("category:tools,detection:aggregate,surface:call-tool,owasp:llm06")
|
|
778
|
+
@reject_message("Tool execution blocked: a sensitive tool crossed the elevated-risk threshold.")
|
|
779
|
+
forbid (principal, action == Overwatch::Action::"call_tool", resource)
|
|
780
|
+
when {
|
|
781
|
+
context has tool_is_sensitive && context.tool_is_sensitive == true &&
|
|
782
|
+
context has tool_risk_score && context.tool_risk_score >= 71
|
|
783
|
+
};
|
|
784
|
+
|
|
785
|
+
@id("tools.block-exfiltration-pattern")
|
|
786
|
+
@name("Block data-exfiltration and destructive sequences")
|
|
787
|
+
@description("Blocks call_tool when the behavioral detector matches an exfiltration, credential-theft, or destructive action sequence.")
|
|
788
|
+
@severity("critical")
|
|
789
|
+
@tags("category:tools,threat:exfiltration,detection:pattern,surface:call-tool,owasp:llm02,mitre:t1005")
|
|
790
|
+
@reject_message("Tool execution blocked: the action sequence matches a data-exfiltration or destructive pattern.")
|
|
791
|
+
forbid (principal, action == Overwatch::Action::"call_tool", resource)
|
|
792
|
+
when {
|
|
793
|
+
context has suspicious_pattern && context.suspicious_pattern == true &&
|
|
794
|
+
context has pattern_type &&
|
|
795
|
+
(context.pattern_type == "data_exfiltration" ||
|
|
796
|
+
context.pattern_type == "secret_exfiltration" ||
|
|
797
|
+
context.pattern_type == "db_exfiltration" ||
|
|
798
|
+
context.pattern_type == "credential_theft" ||
|
|
799
|
+
context.pattern_type == "destructive_sequence")
|
|
800
|
+
};
|
|
801
|
+
`;
|
|
720
802
|
const OVERWATCH_PRIVACY_DEFAULTS_CEDAR = `// =============================================================================
|
|
721
803
|
// Structural PII (Tier 1)
|
|
722
804
|
// =============================================================================
|
|
@@ -1811,6 +1893,15 @@ export const OVERWATCH_TEMPLATES = [
|
|
|
1811
1893
|
severity: 'high',
|
|
1812
1894
|
tags: ['category:tools', 'threat:exfiltration', 'threat:command-injection', 'detection:rule', 'surface:call-tool', 'owasp:asi02', 'mitre:t1059', 'step-up'],
|
|
1813
1895
|
},
|
|
1896
|
+
{
|
|
1897
|
+
id: 'tools.shell-command-governance',
|
|
1898
|
+
name: 'Shell & Command Governance',
|
|
1899
|
+
description: 'Graduated shell/command governance for coding agents: blocks the download-and-run shape (network + execute), dangerous or high-risk tools, sensitive tools at elevated risk, and exfiltration/destructive action sequences — while letting ordinary dev commands through. Aligns with cookbook recipe aperture/05-tool-governance.',
|
|
1900
|
+
category: 'tools',
|
|
1901
|
+
cedarText: OVERWATCH_TOOLS_SHELL_COMMAND_GOVERNANCE_CEDAR,
|
|
1902
|
+
severity: 'critical',
|
|
1903
|
+
tags: ['category:tools', 'threat:command-injection', 'threat:exfiltration', 'detection:aggregate', 'surface:call-tool', 'owasp:asi02', 'owasp:llm06', 'mitre:t1059'],
|
|
1904
|
+
},
|
|
1814
1905
|
{
|
|
1815
1906
|
id: 'privacy.defaults',
|
|
1816
1907
|
name: 'Structural PII',
|
|
@@ -2062,6 +2153,24 @@ export const OVERWATCH_TEMPLATES_JSON = `{
|
|
|
2062
2153
|
"step-up"
|
|
2063
2154
|
]
|
|
2064
2155
|
},
|
|
2156
|
+
{
|
|
2157
|
+
"id": "tools.shell-command-governance",
|
|
2158
|
+
"name": "Shell & Command Governance",
|
|
2159
|
+
"description": "Graduated shell/command governance for coding agents: blocks the download-and-run shape (network + execute), dangerous or high-risk tools, sensitive tools at elevated risk, and exfiltration/destructive action sequences — while letting ordinary dev commands through. Aligns with cookbook recipe aperture/05-tool-governance.",
|
|
2160
|
+
"category": "tools",
|
|
2161
|
+
"file": "tools_shell_command_governance.cedar",
|
|
2162
|
+
"severity": "critical",
|
|
2163
|
+
"tags": [
|
|
2164
|
+
"category:tools",
|
|
2165
|
+
"threat:command-injection",
|
|
2166
|
+
"threat:exfiltration",
|
|
2167
|
+
"detection:aggregate",
|
|
2168
|
+
"surface:call-tool",
|
|
2169
|
+
"owasp:asi02",
|
|
2170
|
+
"owasp:llm06",
|
|
2171
|
+
"mitre:t1059"
|
|
2172
|
+
]
|
|
2173
|
+
},
|
|
2065
2174
|
{
|
|
2066
2175
|
"id": "privacy.defaults",
|
|
2067
2176
|
"name": "Structural PII",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Full Cedar schema for agent_ops, embedded at codegen time.
|
|
5
5
|
*/
|
|
6
|
-
export declare const AGENT_OPS_SCHEMA = "// =============================================================================\n// AgentOps Cedar Schema\n// =============================================================================\n// Unified schema for all agent guardrail policies. Covers every request path\n// where an AI agent touches the Highflame platform:\n// - LLM prompt/response (Guardrails path)\n// - IDE tool calls and file access (Overwatch path)\n// - MCP server connections (AI Gateway path)\n//\n// The context types are a superset of Guardrails, Overwatch, and AI Gateway\n// schemas. All extra fields are optional \u2014 Shield projects only what is present\n// in the request, Cedar ignores absent optional attributes.\n//\n// Service: highflame-shield (agent_ops product)\n// Namespace: AgentOps\n// =============================================================================\n\nnamespace AgentOps {\n // =========================================================================\n // Entity Types \u2014 ReBAC Hierarchy\n // =========================================================================\n // Entity hierarchy enables Cedar's `in` operator for policy scoping:\n // Account (org root)\n // \u2514\u2500\u2500 Project in [Account]\n // \u251C\u2500\u2500 App in [Project]\n // \u2502 \u2514\u2500\u2500 Session in [App, Agent]\n // \u2514\u2500\u2500 Agent in [Project]\n // \u2514\u2500\u2500 Session in [App, Agent]\n //\n // Policy scoping examples:\n // resource in AgentOps::Project::\"<uuid>\" \u2192 project-wide (all agents)\n // resource in AgentOps::Agent::\"<external_id>\" \u2192 named agent + its sessions\n // resource == AgentOps::Agent::\"<external_id>\" \u2192 named agent only (exact match)\n // resource in AgentOps::Account::\"<uuid>\" \u2192 org-wide\n // =========================================================================\n\n /// Account represents an organization (top-level tenant)\n entity Account;\n\n /// Project represents a project within an account\n entity Project in [Account];\n\n /// User represents a principal (human or service) making requests\n entity User;\n\n /// Agent represents an AI agent (Claude, Cursor, Copilot, MCP client, etc.)\n /// Used as both principal (who is acting) and resource (policy scoping target).\n /// Agent + sessions: resource in AgentOps::Agent::\"<external_id>\" (hierarchy match)\n /// Agent only: resource == AgentOps::Agent::\"<external_id>\" (exact match)\n entity Agent in [Project];\n\n /// App represents a protected application (guardrails-enabled LLM app)\n entity App in [Project];\n\n /// Session represents an agentic conversation session with state tracking.\n /// Sessions can belong to either an App or an Agent.\n entity Session in [App, Agent];\n\n // =========================================================================\n // Actions\n // =========================================================================\n\n /// Process user prompts and AI responses for security threats and content violations\n action \"process_prompt\" appliesTo {\n principal: [User, Agent],\n resource: [App, Agent, Session],\n context: ProcessPromptContext\n };\n\n /// Execute tool calls (shell, file operations, MCP tools)\n action \"call_tool\" appliesTo {\n principal: [User, Agent],\n resource: [Agent, Session],\n context: CallToolContext\n };\n\n /// Read file operations\n action \"read_file\" appliesTo {\n principal: [User, Agent],\n resource: [Agent, Session],\n context: FileReadContext\n };\n\n /// Write file operations\n action \"write_file\" appliesTo {\n principal: [User, Agent],\n resource: [Agent, Session],\n context: FileWriteContext\n };\n\n /// Connect to an MCP server\n action \"connect_server\" appliesTo {\n principal: [User, Agent],\n resource: [Agent, Session],\n context: ConnectServerContext\n };\n\n /// Provision a sandbox for the acting identity (Forge OS-layer envelope).\n /// The MANDATORY authorization gate for sandbox creation (ADR 0019 D1):\n /// Forge evaluates this action's AgentOps bundle at create-time; no decision\n /// means no sandbox. Context carries the requested capability envelope\n /// (writable paths, egress, exec allowlist, curated mechanism toggles,\n /// isolation tier). Raw syscalls are NEVER expressed here \u2014 the enforcement\n /// generators own the mechanism\u2192syscall translation (ADR 0017 D1).\n action \"provision_sandbox\" appliesTo {\n principal: [User, Agent],\n resource: [Agent, Session],\n context: ProvisionSandboxContext\n };\n\n // =========================================================================\n // Context Types (Action-Specific)\n // =========================================================================\n\n /// Context for process_prompt action (user prompts & AI responses)\n type ProcessPromptContext = {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n \"role\"?: String,\n \"privilege_scope\"?: Set<String>,\n \"identity_type\"?: String, // Principal identity class: \"human\" | \"agent\" | \"service\" | \"mcp_server\"\n \"principal\"?: String, // Stable principal identifier (e.g. ZeroID / WIMSE URI or user id)\n // Core metadata (required)\n \"request_id\": String,\n \"timestamp\": Long,\n \"direction\": String, // \"input\" | \"output\"\n \"content_type\": String, // \"prompt\" | \"response\" | \"tool_call\" | \"file\"\n \"detector_count\": Long,\n\n // IDE / workspace context (optional \u2014 present for Overwatch/code-agent traffic)\n \"source\"?: String, // Traffic origin: \"ide\" | \"cli\" | \"api\" | \"browser\"\n \"event\"?: String, // Event type: \"prompt\" | \"tool_call\" | \"file_read\" | ...\n \"user_email\"?: String, // Human operator email (IDE sessions)\n \"cwd\"?: String, // Current working directory\n \"workspace_root\"?: String, // IDE workspace root path\n\n // Model context (optional \u2014 present for AI Gateway traffic)\n \"model_name\"?: String, // LLM model name: \"claude-3-5-sonnet\", \"gpt-4o\", ...\n \"model_provider\"?: String, // Model provider: \"anthropic\" | \"openai\" | \"google\" | ...\n\n // Security - Injection & Jailbreak (optional)\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 \"injection_type\"?: String, // \"prompt\" | \"sql\" | \"command\" | \"none\"\n \"indirect_injection_score\"?: Long, // Indirect injection via tool outputs (0-100)\n\n // Privacy - Secrets (optional)\n \"secrets_detected\"?: Boolean,\n \"secret_count\"?: Long,\n \"secret_types\"?: Set<String>, // [\"aws_access_key\", \"github_token\", ...]\n\n // Privacy - PII (optional)\n \"pii_detected\"?: Boolean,\n \"pii_count\"?: Long,\n \"pii_types\"?: Set<String>, // [\"email\", \"phone\", \"ssn\", \"credit_card\", ...]\n \"pii_score\"?: Long, // PII ML classifier confidence (0-100)\n\n // Aggregated threat summary (optional \u2014 populated by aggregation detectors)\n \"highest_severity\"?: String, // \"critical\" | \"high\" | \"medium\" | \"low\" | \"none\"\n \"threat_count\"?: Long,\n \"threat_categories\"?: Set<String>,\n \"detected_threats\"?: Set<String>,\n\n // Trust & Safety - Toxicity (optional)\n \"violence_score\"?: Long, // 0-100\n \"hate_speech_score\"?: Long, // 0-100\n \"sexual_score\"?: Long, // 0-100\n \"weapons_score\"?: Long, // 0-100\n \"crime_score\"?: Long, // 0-100\n \"profanity_score\"?: Long, // 0-100\n\n // Semantic - Topic Classification (optional)\n \"content_topics\"?: Set<String>, // [\"controlled_substances\", \"weapons_manufacturing\", ...]\n \"topic_confidence\"?: Long, // 0-100\n\n // Security - Invisible Character Detection (optional)\n \"invisible_chars_detected\"?: Boolean,\n \"invisible_chars_score\"?: Long, // 0-100\n\n // Security - Pattern Detection (optional)\n \"command_injection_detected\"?: Boolean,\n \"command_injection_type\"?: String, // \"reverse_shell\" | \"privilege_escalation\" | ...\n \"command_injection_score\"?: Long, // 0-100\n \"path_traversal_detected\"?: Boolean,\n \"path_traversal_severity\"?: String, // \"critical\" | \"high\" | \"medium\" | \"low\" | \"none\"\n \"path_traversal_type\"?: String,\n \"sql_injection_detected\"?: Boolean,\n \"sql_injection_type\"?: String, // \"tautology\" | \"union_based\" | \"destructive\" | ...\n \"sql_injection_score\"?: Long, // 0-100\n\n // Security - Cross-Origin Escalation (optional)\n \"cross_origin_detected\"?: Boolean,\n \"cross_origin_type\"?: String, // \"cross_origin_tool\" | \"cross_origin_server\" | \"none\"\n \"cross_origin_score\"?: Long, // 0-100\n\n // Security - Encoded Injection (optional)\n \"encoded_content_detected\"?: Boolean,\n \"encoded_types\"?: Set<String>, // [\"base64\", \"hex\", \"unicode\", \"url\", ...]\n \"encoded_count\"?: Long,\n \"encoded_score\"?: Long, // 0-100\n\n // Language & Script Detection (optional)\n \"detected_language\"?: String, // ISO language code\n \"is_english\"?: Boolean,\n \"language_confidence\"?: Long, // 0-100\n \"detected_script\"?: String, // \"latin\" | \"cyrillic\" | \"arabic\" | \"unknown\" | ...\n \"is_latin_script\"?: Boolean,\n \"script_confidence\"?: Long, // 0-100\n\n // Content Analysis (optional)\n \"hallucination_score\"?: Long,\n \"factuality_score\"?: Long, // 0-100\n \"sentiment_score\"?: Long,\n \"contains_code\"?: Boolean,\n \"code_languages\"?: Set<String>,\n \"code_ratio\"?: Long, // 0-100\n \"keyword_matched\"?: Boolean,\n \"keyword_categories\"?: Set<String>,\n \"keyword_count\"?: Long,\n \"contains_non_ascii\"?: Boolean,\n \"phishing_detected\"?: Boolean,\n \"content_safety_score\"?: Long, // 0-100\n \"content_safety_blocked\"?: Boolean,\n\n // Agentic - Multi-Turn Context (optional)\n \"conversation_turn\"?: Long,\n \"multi_turn_detection\"?: Boolean,\n\n // Session Detection History \u2014 cross-turn sticky flags (optional)\n \"session_pii_detected\"?: Boolean,\n \"session_pii_types\"?: Set<String>,\n \"session_secrets_detected\"?: Boolean,\n \"session_secret_types\"?: Set<String>,\n \"session_injection_detected\"?: Boolean,\n \"session_command_injection\"?: Boolean,\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 \"session_original_request\"?: String,\n \"session_max_sensitivity\"?: String,\n\n // Origin Surface \u2014 REQUIRED (ADR 0012 D14.2). Projected by Shield from the\n // ingress product; never user-supplied. The \"Applies to\" narrowing target:\n // policies test it with an ordinary condition (context.surface == \"ai_gateway\")\n // \u2014 no `has` guard needed precisely because it is required. Values are the\n // product identifiers: \"guardrails\" | \"overwatch\" | \"ai_gateway\" (\"sentry\"\n // joins at ADR 0012 D17 phase 2). A policy with no surface condition applies\n // to every surface, including ones added later (inclusive default).\n \"surface\": String,\n\n // Data-Flow Labels \u2014 per-value information-flow facts (ADR 0020, optional).\n // All optional: guard every access with `has` \u2014 an absent-attribute read is\n // a Cedar evaluation error and an errored forbid is silently skipped (fail-open).\n \"flow_confidentiality\"?: String, // \"public\" | \"internal\" | \"confidential\" | \"restricted\" | \"unknown\"\n \"flow_integrity\"?: String, // \"trusted\" | \"untrusted\" | \"mixed\" | \"unknown\"\n \"flow_data_types\"?: Set<String>, // \"pii\" | \"secrets\" | \"source_code\" | \"financial\" | \"health\" | ...\n \"flow_compartments\"?: Set<String>, // \"tenant:*\" | \"customer:*\" | \"project:*\"\n \"flow_resolution_status\"?: String, // \"known\" | \"inferred\" | \"unknown\" | \"conflicted\"\n \"flow_origins\"?: Set<String>, // \"mcp_tool_result\" | \"model\" | \"file\" | \"database\" | \"user\"\n \"flow_sink\"?: String, // \"external_model\" | \"local_model\" | \"external_mcp\" | \"trusted_mcp\" | \"user_secure_output\" | \"public_network\" | \"file\"\n \"flow_sink_is_external\"?: Boolean,\n \"flow_sink_effects\"?: Set<String>, // \"network.send\" | \"financial.transfer\" | \"filesystem.write\" | ...\n \"principal_clearances\"?: Set<String>, // ADR 0020 D8 \u2014 clearances AuthN mints for the principal\n \"principal_compartments\"?: Set<String>, // ADR 0020 D8 \u2014 compartments the principal is admitted to\n\n // Usage Budget \u2014 multi-window token & cost enforcement (optional)\n \"budget_remaining_pct\"?: Long,\n \"budget_exceeded\"?: Boolean,\n \"budget_cost_micros_this_turn\"?: Long,\n \"budget_model\"?: String,\n \"budget_tokens_pct_session\"?: Long,\n \"budget_tokens_pct_daily\"?: Long,\n \"budget_tokens_pct_monthly\"?: Long,\n \"budget_cost_pct_daily\"?: Long,\n \"budget_cost_pct_monthly\"?: Long,\n \"budget_exceeded_session\"?: Boolean,\n \"budget_exceeded_daily\"?: Boolean,\n \"budget_exceeded_monthly\"?: Boolean,\n\n // Rate Limiting \u2014 gateway-metered, Shield-decided (ADR 0014)\n \"rpm_remaining_pct\"?: Long,\n \"rpm_exceeded\"?: Boolean,\n \"tpm_remaining_pct\"?: Long,\n \"tpm_exceeded\"?: Boolean,\n\n // Agent Identity \u2014 authenticated agent principal metadata (optional)\n \"agent_id\"?: String,\n \"agent_type\"?: String, // \"orchestrator\" | \"autonomous\" | \"tool_agent\" | \"human_proxy\"\n \"agent_trust_level\"?: String, // \"first_party\" | \"verified_third_party\" | \"unverified\"\n \"agent_framework\"?: String,\n \"agent_publisher\"?: String,\n\n };\n\n /// Context for call_tool action (agentic tool execution)\n type CallToolContext = {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n \"role\"?: String,\n \"privilege_scope\"?: Set<String>,\n \"identity_type\"?: String,\n \"principal\"?: String,\n // Core metadata (required)\n \"request_id\": String,\n \"timestamp\": Long,\n\n // IDE / workspace context (optional)\n \"source\"?: String,\n \"event\"?: String,\n \"user_email\"?: String,\n \"cwd\"?: String,\n \"workspace_root\"?: String,\n\n // Tool Risk (optional)\n \"tool_name\"?: String,\n \"tool_risk_score\"?: Long, // 0-100\n \"tool_is_sensitive\"?: Boolean,\n \"tool_category\"?: String, // \"safe\" | \"sensitive\" | \"dangerous\"\n \"tool_is_builtin\"?: Boolean,\n\n // AARM R3 (CAP-ENF-007) \u2014 Action Parameter Validation\n \"action_params\"?: {\n \"amount\"?: Long,\n \"count\"?: Long,\n \"command\"?: String,\n \"path\"?: String,\n \"url\"?: String,\n \"recipient\"?: String,\n \"target\"?: String,\n \"query\"?: String,\n },\n \"param_type_violation\"?: Boolean,\n \"param_type_violations\"?: Set<String>,\n\n // MCP context (optional)\n \"mcp_server\"?: String,\n \"mcp_tool\"?: String,\n \"mcp_server_verified\"?: Boolean,\n\n // Agentic - Behavioral Patterns (optional)\n \"suspicious_pattern\"?: Boolean,\n \"pattern_type\"?: String, // \"data_exfiltration\" | \"secret_exfiltration\" | ...\n \"sequence_risk\"?: Long, // 0-100\n\n // Agentic - Loop Detection (optional)\n \"loop_detected\"?: Boolean,\n \"loop_count\"?: Long,\n \"loop_tool\"?: String,\n\n // Security checks on tool arguments (optional)\n \"secrets_detected\"?: Boolean,\n \"secret_count\"?: Long,\n \"secret_types\"?: Set<String>,\n \"pii_detected\"?: Boolean,\n \"pii_types\"?: Set<String>,\n \"pii_count\"?: Long,\n \"pii_score\"?: Long,\n \"injection_score\"?: Long,\n \"injection_pulse_score\"?: Long,\n \"injection_deep_context_score\"?: Long,\n \"indirect_injection_score\"?: Long,\n \"indirect_injection_type\"?: String, // Type of indirect injection detected\n\n // Semantic - Topic Classification (optional)\n \"content_topics\"?: Set<String>, // [\"controlled_substances\", \"weapons_manufacturing\", ...]\n \"topic_confidence\"?: Long, // 0-100\n\n // Security - Pattern Detection (optional)\n \"command_injection_detected\"?: Boolean,\n \"command_injection_type\"?: String,\n \"command_injection_score\"?: Long,\n \"path_traversal_detected\"?: Boolean,\n \"path_traversal_severity\"?: String,\n \"path_traversal_type\"?: String,\n \"sql_injection_detected\"?: Boolean,\n \"sql_injection_type\"?: String,\n \"sql_injection_score\"?: Long,\n\n // Security - Cross-Origin Escalation (optional)\n \"cross_origin_detected\"?: Boolean,\n \"cross_origin_type\"?: String,\n \"cross_origin_score\"?: Long,\n\n // Security - Invisible Character Detection (optional)\n \"invisible_chars_detected\"?: Boolean,\n \"invisible_chars_score\"?: Long,\n\n // Security - Encoded Injection (optional)\n \"encoded_content_detected\"?: Boolean,\n \"encoded_types\"?: Set<String>,\n \"encoded_count\"?: Long,\n \"encoded_score\"?: Long,\n\n // Agentic - Agent Security (optional)\n \"tool_poisoning_detected\"?: Boolean,\n \"tool_poisoning_score\"?: Long,\n \"tool_poisoning_type\"?: String,\n \"rug_pull_detected\"?: Boolean,\n \"rug_pull_score\"?: Long,\n \"rug_pull_type\"?: String,\n\n // Agentic - MCP Risk (optional)\n \"mcp_config_risk\"?: Boolean,\n \"mcp_risk_type\"?: String,\n \"mcp_risk_score\"?: Long,\n\n // Tool Operation Classifier (optional)\n \"tool_operation_classes\"?: Set<String>,\n\n // Agentic - Multi-Turn Context (optional)\n \"conversation_turn\"?: Long,\n \"multi_turn_detection\"?: Boolean,\n\n // Session Detection History \u2014 cross-turn sticky flags (optional)\n \"session_pii_detected\"?: Boolean,\n \"session_pii_types\"?: Set<String>,\n \"session_secrets_detected\"?: Boolean,\n \"session_secret_types\"?: Set<String>,\n \"session_injection_detected\"?: Boolean,\n \"session_command_injection\"?: Boolean,\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 \"session_original_request\"?: String,\n \"session_max_sensitivity\"?: String,\n\n // Origin Surface \u2014 REQUIRED (ADR 0012 D14.2). Projected by Shield from the\n // ingress product; never user-supplied. The \"Applies to\" narrowing target:\n // policies test it with an ordinary condition (context.surface == \"ai_gateway\")\n // \u2014 no `has` guard needed precisely because it is required. Values are the\n // product identifiers: \"guardrails\" | \"overwatch\" | \"ai_gateway\" (\"sentry\"\n // joins at ADR 0012 D17 phase 2). A policy with no surface condition applies\n // to every surface, including ones added later (inclusive default).\n \"surface\": String,\n\n // Data-Flow Labels \u2014 per-value information-flow facts (ADR 0020, optional).\n // All optional: guard every access with `has` \u2014 an absent-attribute read is\n // a Cedar evaluation error and an errored forbid is silently skipped (fail-open).\n \"flow_confidentiality\"?: String, // \"public\" | \"internal\" | \"confidential\" | \"restricted\" | \"unknown\"\n \"flow_integrity\"?: String, // \"trusted\" | \"untrusted\" | \"mixed\" | \"unknown\"\n \"flow_data_types\"?: Set<String>, // \"pii\" | \"secrets\" | \"source_code\" | \"financial\" | \"health\" | ...\n \"flow_compartments\"?: Set<String>, // \"tenant:*\" | \"customer:*\" | \"project:*\"\n \"flow_resolution_status\"?: String, // \"known\" | \"inferred\" | \"unknown\" | \"conflicted\"\n \"flow_origins\"?: Set<String>, // \"mcp_tool_result\" | \"model\" | \"file\" | \"database\" | \"user\"\n \"flow_sink\"?: String, // \"external_model\" | \"local_model\" | \"external_mcp\" | \"trusted_mcp\" | \"user_secure_output\" | \"public_network\" | \"file\"\n \"flow_sink_is_external\"?: Boolean,\n \"flow_sink_effects\"?: Set<String>, // \"network.send\" | \"financial.transfer\" | \"filesystem.write\" | ...\n \"principal_clearances\"?: Set<String>, // ADR 0020 D8 \u2014 clearances AuthN mints for the principal\n \"principal_compartments\"?: Set<String>, // ADR 0020 D8 \u2014 compartments the principal is admitted to\n\n // Usage Budget (optional)\n \"budget_remaining_pct\"?: Long,\n \"budget_exceeded\"?: Boolean,\n \"budget_cost_micros_this_turn\"?: Long,\n \"budget_model\"?: String,\n \"budget_tokens_pct_session\"?: Long,\n \"budget_tokens_pct_daily\"?: Long,\n \"budget_tokens_pct_monthly\"?: Long,\n \"budget_cost_pct_daily\"?: Long,\n \"budget_cost_pct_monthly\"?: Long,\n \"budget_exceeded_session\"?: Boolean,\n \"budget_exceeded_daily\"?: Boolean,\n \"budget_exceeded_monthly\"?: Boolean,\n\n // Rate Limiting \u2014 gateway-metered, Shield-decided (ADR 0014)\n \"rpm_remaining_pct\"?: Long,\n \"rpm_exceeded\"?: Boolean,\n \"tpm_remaining_pct\"?: Long,\n \"tpm_exceeded\"?: Boolean,\n\n // Aggregated threat summary (optional)\n \"highest_severity\"?: String,\n \"threat_count\"?: Long,\n \"detected_threats\"?: Set<String>,\n\n // Agent Identity (optional)\n \"agent_id\"?: String,\n \"agent_type\"?: String,\n \"agent_trust_level\"?: String,\n \"agent_framework\"?: String,\n \"agent_publisher\"?: String,\n\n // File & Path (optional)\n \"path\"?: String,\n\n };\n\n /// Context for read_file action\n type FileReadContext = {\n // Identity (optional)\n \"role\"?: String,\n \"privilege_scope\"?: Set<String>,\n \"identity_type\"?: String,\n \"principal\"?: String,\n // Core metadata (required)\n \"request_id\": String,\n \"timestamp\": Long,\n\n // IDE / workspace context (optional)\n \"source\"?: String,\n \"event\"?: String,\n \"user_email\"?: String,\n \"cwd\"?: String,\n \"workspace_root\"?: String,\n\n // File path (optional)\n \"path\"?: String,\n\n // Security checks on file content (optional)\n \"secrets_detected\"?: Boolean,\n \"secret_count\"?: Long,\n \"secret_types\"?: Set<String>,\n \"pii_detected\"?: Boolean,\n \"pii_types\"?: Set<String>,\n\n // Security - Path Traversal (optional)\n \"path_traversal_detected\"?: Boolean,\n \"path_traversal_severity\"?: String,\n \"path_traversal_type\"?: String,\n\n // Aggregated threat summary (optional)\n \"highest_severity\"?: String,\n \"threat_count\"?: Long,\n \"detected_threats\"?: Set<String>,\n\n // Session Detection History (optional)\n \"session_pii_detected\"?: Boolean,\n \"session_pii_types\"?: Set<String>,\n \"session_secrets_detected\"?: Boolean,\n \"session_secret_types\"?: Set<String>,\n \"session_injection_detected\"?: Boolean,\n \"session_command_injection\"?: Boolean,\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 \"session_original_request\"?: String,\n \"session_max_sensitivity\"?: String,\n\n // Origin Surface \u2014 REQUIRED (ADR 0012 D14.2). Projected by Shield from the\n // ingress product; never user-supplied. The \"Applies to\" narrowing target:\n // policies test it with an ordinary condition (context.surface == \"ai_gateway\")\n // \u2014 no `has` guard needed precisely because it is required. Values are the\n // product identifiers: \"guardrails\" | \"overwatch\" | \"ai_gateway\" (\"sentry\"\n // joins at ADR 0012 D17 phase 2). A policy with no surface condition applies\n // to every surface, including ones added later (inclusive default).\n \"surface\": String,\n\n // Data-Flow Labels \u2014 per-value information-flow facts (ADR 0020, optional).\n // All optional: guard every access with `has` \u2014 an absent-attribute read is\n // a Cedar evaluation error and an errored forbid is silently skipped (fail-open).\n \"flow_confidentiality\"?: String, // \"public\" | \"internal\" | \"confidential\" | \"restricted\" | \"unknown\"\n \"flow_integrity\"?: String, // \"trusted\" | \"untrusted\" | \"mixed\" | \"unknown\"\n \"flow_data_types\"?: Set<String>, // \"pii\" | \"secrets\" | \"source_code\" | \"financial\" | \"health\" | ...\n \"flow_compartments\"?: Set<String>, // \"tenant:*\" | \"customer:*\" | \"project:*\"\n \"flow_resolution_status\"?: String, // \"known\" | \"inferred\" | \"unknown\" | \"conflicted\"\n \"flow_origins\"?: Set<String>, // \"mcp_tool_result\" | \"model\" | \"file\" | \"database\" | \"user\"\n \"flow_sink\"?: String, // \"external_model\" | \"local_model\" | \"external_mcp\" | \"trusted_mcp\" | \"user_secure_output\" | \"public_network\" | \"file\"\n \"flow_sink_is_external\"?: Boolean,\n \"flow_sink_effects\"?: Set<String>, // \"network.send\" | \"financial.transfer\" | \"filesystem.write\" | ...\n \"principal_clearances\"?: Set<String>, // ADR 0020 D8 \u2014 clearances AuthN mints for the principal\n \"principal_compartments\"?: Set<String>, // ADR 0020 D8 \u2014 compartments the principal is admitted to\n\n // Usage Budget (optional)\n \"budget_remaining_pct\"?: Long,\n \"budget_exceeded\"?: Boolean,\n \"budget_cost_micros_this_turn\"?: Long,\n \"budget_model\"?: String,\n \"budget_tokens_pct_session\"?: Long,\n \"budget_tokens_pct_daily\"?: Long,\n \"budget_tokens_pct_monthly\"?: Long,\n \"budget_cost_pct_daily\"?: Long,\n \"budget_cost_pct_monthly\"?: Long,\n \"budget_exceeded_session\"?: Boolean,\n \"budget_exceeded_daily\"?: Boolean,\n \"budget_exceeded_monthly\"?: Boolean,\n\n // Rate Limiting \u2014 gateway-metered, Shield-decided (ADR 0014)\n \"rpm_remaining_pct\"?: Long,\n \"rpm_exceeded\"?: Boolean,\n \"tpm_remaining_pct\"?: Long,\n \"tpm_exceeded\"?: Boolean,\n\n // Agent Identity (optional)\n \"agent_id\"?: String,\n \"agent_type\"?: String,\n \"agent_trust_level\"?: String,\n \"agent_framework\"?: String,\n \"agent_publisher\"?: String,\n\n };\n\n /// Context for write_file action\n type FileWriteContext = {\n // Identity (optional)\n \"role\"?: String,\n \"privilege_scope\"?: Set<String>,\n \"identity_type\"?: String,\n \"principal\"?: String,\n // Core metadata (required)\n \"request_id\": String,\n \"timestamp\": Long,\n\n // IDE / workspace context (optional)\n \"source\"?: String,\n \"event\"?: String,\n \"user_email\"?: String,\n \"cwd\"?: String,\n \"workspace_root\"?: String,\n\n // File path (optional)\n \"path\"?: String,\n\n // Security - Invisible Character Detection in write content (optional)\n \"invisible_chars_detected\"?: Boolean,\n \"invisible_chars_score\"?: Long,\n\n // Security checks on content being written (optional)\n \"secrets_detected\"?: Boolean,\n \"secret_count\"?: Long,\n \"secret_types\"?: Set<String>,\n \"pii_detected\"?: Boolean,\n \"pii_types\"?: Set<String>,\n\n // Security - Path Traversal (optional)\n \"path_traversal_detected\"?: Boolean,\n \"path_traversal_severity\"?: String,\n \"path_traversal_type\"?: String,\n\n // Aggregated threat summary (optional)\n \"highest_severity\"?: String,\n \"threat_count\"?: Long,\n \"detected_threats\"?: Set<String>,\n\n // Session Detection History (optional)\n \"session_pii_detected\"?: Boolean,\n \"session_pii_types\"?: Set<String>,\n \"session_secrets_detected\"?: Boolean,\n \"session_secret_types\"?: Set<String>,\n \"session_injection_detected\"?: Boolean,\n \"session_command_injection\"?: Boolean,\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 \"session_original_request\"?: String,\n \"session_max_sensitivity\"?: String,\n\n // Origin Surface \u2014 REQUIRED (ADR 0012 D14.2). Projected by Shield from the\n // ingress product; never user-supplied. The \"Applies to\" narrowing target:\n // policies test it with an ordinary condition (context.surface == \"ai_gateway\")\n // \u2014 no `has` guard needed precisely because it is required. Values are the\n // product identifiers: \"guardrails\" | \"overwatch\" | \"ai_gateway\" (\"sentry\"\n // joins at ADR 0012 D17 phase 2). A policy with no surface condition applies\n // to every surface, including ones added later (inclusive default).\n \"surface\": String,\n\n // Data-Flow Labels \u2014 per-value information-flow facts (ADR 0020, optional).\n // All optional: guard every access with `has` \u2014 an absent-attribute read is\n // a Cedar evaluation error and an errored forbid is silently skipped (fail-open).\n \"flow_confidentiality\"?: String, // \"public\" | \"internal\" | \"confidential\" | \"restricted\" | \"unknown\"\n \"flow_integrity\"?: String, // \"trusted\" | \"untrusted\" | \"mixed\" | \"unknown\"\n \"flow_data_types\"?: Set<String>, // \"pii\" | \"secrets\" | \"source_code\" | \"financial\" | \"health\" | ...\n \"flow_compartments\"?: Set<String>, // \"tenant:*\" | \"customer:*\" | \"project:*\"\n \"flow_resolution_status\"?: String, // \"known\" | \"inferred\" | \"unknown\" | \"conflicted\"\n \"flow_origins\"?: Set<String>, // \"mcp_tool_result\" | \"model\" | \"file\" | \"database\" | \"user\"\n \"flow_sink\"?: String, // \"external_model\" | \"local_model\" | \"external_mcp\" | \"trusted_mcp\" | \"user_secure_output\" | \"public_network\" | \"file\"\n \"flow_sink_is_external\"?: Boolean,\n \"flow_sink_effects\"?: Set<String>, // \"network.send\" | \"financial.transfer\" | \"filesystem.write\" | ...\n \"principal_clearances\"?: Set<String>, // ADR 0020 D8 \u2014 clearances AuthN mints for the principal\n \"principal_compartments\"?: Set<String>, // ADR 0020 D8 \u2014 compartments the principal is admitted to\n\n // Usage Budget (optional)\n \"budget_remaining_pct\"?: Long,\n \"budget_exceeded\"?: Boolean,\n \"budget_cost_micros_this_turn\"?: Long,\n \"budget_model\"?: String,\n \"budget_tokens_pct_session\"?: Long,\n \"budget_tokens_pct_daily\"?: Long,\n \"budget_tokens_pct_monthly\"?: Long,\n \"budget_cost_pct_daily\"?: Long,\n \"budget_cost_pct_monthly\"?: Long,\n \"budget_exceeded_session\"?: Boolean,\n \"budget_exceeded_daily\"?: Boolean,\n \"budget_exceeded_monthly\"?: Boolean,\n\n // Rate Limiting \u2014 gateway-metered, Shield-decided (ADR 0014)\n \"rpm_remaining_pct\"?: Long,\n \"rpm_exceeded\"?: Boolean,\n \"tpm_remaining_pct\"?: Long,\n \"tpm_exceeded\"?: Boolean,\n\n // Agent Identity (optional)\n \"agent_id\"?: String,\n \"agent_type\"?: String,\n \"agent_trust_level\"?: String,\n \"agent_framework\"?: String,\n \"agent_publisher\"?: String,\n\n };\n\n /// Context for connect_server action (MCP server connections)\n type ConnectServerContext = {\n // Identity (optional)\n \"role\"?: String,\n \"privilege_scope\"?: Set<String>,\n \"identity_type\"?: String,\n \"principal\"?: String,\n // Core metadata (required)\n \"request_id\": String,\n \"timestamp\": Long,\n\n // IDE / workspace context (optional)\n \"source\"?: String,\n \"event\"?: String,\n \"user_email\"?: String,\n \"cwd\"?: String,\n \"workspace_root\"?: String,\n\n // MCP context (optional)\n \"mcp_server\"?: String,\n \"mcp_server_verified\"?: Boolean,\n\n // Agentic - Agent Security (optional)\n \"tool_poisoning_detected\"?: Boolean,\n \"tool_poisoning_score\"?: Long,\n \"tool_poisoning_type\"?: String,\n\n // Agentic - MCP Risk (optional)\n \"mcp_config_risk\"?: Boolean,\n \"mcp_risk_type\"?: String,\n \"mcp_risk_score\"?: Long,\n\n // Security - Cross-Origin Escalation (optional)\n \"cross_origin_detected\"?: Boolean,\n \"cross_origin_type\"?: String,\n \"cross_origin_score\"?: Long,\n\n // Aggregated threat summary (optional)\n \"highest_severity\"?: String,\n \"threat_count\"?: Long,\n \"detected_threats\"?: Set<String>,\n\n // Session Detection History (optional)\n \"session_pii_detected\"?: Boolean,\n \"session_pii_types\"?: Set<String>,\n \"session_secrets_detected\"?: Boolean,\n \"session_secret_types\"?: Set<String>,\n \"session_injection_detected\"?: Boolean,\n \"session_command_injection\"?: Boolean,\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 \"session_original_request\"?: String,\n \"session_max_sensitivity\"?: String,\n\n // Origin Surface \u2014 REQUIRED (ADR 0012 D14.2). Projected by Shield from the\n // ingress product; never user-supplied. The \"Applies to\" narrowing target:\n // policies test it with an ordinary condition (context.surface == \"ai_gateway\")\n // \u2014 no `has` guard needed precisely because it is required. Values are the\n // product identifiers: \"guardrails\" | \"overwatch\" | \"ai_gateway\" (\"sentry\"\n // joins at ADR 0012 D17 phase 2). A policy with no surface condition applies\n // to every surface, including ones added later (inclusive default).\n \"surface\": String,\n\n // Data-Flow Labels \u2014 per-value information-flow facts (ADR 0020, optional).\n // All optional: guard every access with `has` \u2014 an absent-attribute read is\n // a Cedar evaluation error and an errored forbid is silently skipped (fail-open).\n \"flow_confidentiality\"?: String, // \"public\" | \"internal\" | \"confidential\" | \"restricted\" | \"unknown\"\n \"flow_integrity\"?: String, // \"trusted\" | \"untrusted\" | \"mixed\" | \"unknown\"\n \"flow_data_types\"?: Set<String>, // \"pii\" | \"secrets\" | \"source_code\" | \"financial\" | \"health\" | ...\n \"flow_compartments\"?: Set<String>, // \"tenant:*\" | \"customer:*\" | \"project:*\"\n \"flow_resolution_status\"?: String, // \"known\" | \"inferred\" | \"unknown\" | \"conflicted\"\n \"flow_origins\"?: Set<String>, // \"mcp_tool_result\" | \"model\" | \"file\" | \"database\" | \"user\"\n \"flow_sink\"?: String, // \"external_model\" | \"local_model\" | \"external_mcp\" | \"trusted_mcp\" | \"user_secure_output\" | \"public_network\" | \"file\"\n \"flow_sink_is_external\"?: Boolean,\n \"flow_sink_effects\"?: Set<String>, // \"network.send\" | \"financial.transfer\" | \"filesystem.write\" | ...\n \"principal_clearances\"?: Set<String>, // ADR 0020 D8 \u2014 clearances AuthN mints for the principal\n \"principal_compartments\"?: Set<String>, // ADR 0020 D8 \u2014 compartments the principal is admitted to\n\n // Usage Budget (optional)\n \"budget_remaining_pct\"?: Long,\n \"budget_exceeded\"?: Boolean,\n \"budget_cost_micros_this_turn\"?: Long,\n \"budget_model\"?: String,\n \"budget_tokens_pct_session\"?: Long,\n \"budget_tokens_pct_daily\"?: Long,\n \"budget_tokens_pct_monthly\"?: Long,\n \"budget_cost_pct_daily\"?: Long,\n \"budget_cost_pct_monthly\"?: Long,\n \"budget_exceeded_session\"?: Boolean,\n \"budget_exceeded_daily\"?: Boolean,\n \"budget_exceeded_monthly\"?: Boolean,\n\n // Rate Limiting \u2014 gateway-metered, Shield-decided (ADR 0014)\n \"rpm_remaining_pct\"?: Long,\n \"rpm_exceeded\"?: Boolean,\n \"tpm_remaining_pct\"?: Long,\n \"tpm_exceeded\"?: Boolean,\n\n // Agent Identity (optional)\n \"agent_id\"?: String,\n \"agent_type\"?: String,\n \"agent_trust_level\"?: String,\n \"agent_framework\"?: String,\n \"agent_publisher\"?: String,\n\n };\n\n /// Context for provision_sandbox action (Forge sandbox-create envelope).\n ///\n /// Every capability field below is OPTIONAL and describes the envelope the\n /// sandbox is being asked to provision with \u2014 Forge synthesizes it from the\n /// create request attenuated by the token's scope ceiling (ADR 0019 D1),\n /// then asks Cedar whether this identity may provision it. Profile templates\n /// `permit` provision_sandbox only when the requested envelope stays within\n /// the profile ceiling, and `forbid` any escalation beyond it.\n ///\n /// FAIL-OPEN WARNING (ADR 0019 D3): because these attributes are optional,\n /// accessing an absent one is a Cedar *evaluation error*, and an errored\n /// `forbid` is silently skipped \u2014 which fails OPEN. Every rule touching a\n /// field here MUST guard it first with `has` (e.g.\n /// `context has mechanism_capabilities && context.mechanism_capabilities.contains(\"sys:ptrace\")`).\n type ProvisionSandboxContext = {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n \"role\"?: String,\n \"privilege_scope\"?: Set<String>,\n \"identity_type\"?: String, // Principal identity class: \"human\" | \"agent\" | \"service\" | \"mcp_server\"\n \"principal\"?: String, // Stable principal identifier (ZeroID / WIMSE URI or user id)\n \"agent_trust_level\"?: String, // \"untrusted\" | \"low\" | \"verified\" | \"trusted\"\n\n // Core metadata (required)\n \"request_id\": String,\n \"timestamp\": Long,\n\n // Requested isolation tier (required) \u2014 the OS-isolation tier the\n // sandbox will run at, as the lowercased Forge IsolationTier name (ADR\n // 0016 D1). Ordinal, weakest\u2192strongest: \"none\" (trusted-local) < \"os\"\n // (bwrap/seatbelt) < \"kernel\" (gVisor) < \"hardware\" (micro-VM + TEE).\n // Templates assert a floor via set membership (e.g. a KERNEL floor =\n // {\"kernel\",\"hardware\"}); Forge owns the ordering.\n \"isolation_tier\": String,\n\n // Requested capability envelope (all optional \u2014 has-guard mandatory).\n \"writable_paths\"?: Set<String>, // Writable path prefixes, e.g. {\"/scratch\"}\n // Master egress switch. Forge MUST set this true whenever ANY egress is\n // requested (i.e. whenever egress_hosts is non-empty), so a \"no network\"\n // profile can gate on this single boolean. egress_hosts then narrows the\n // host allowlist for profiles that DO permit egress.\n \"network_egress\"?: Boolean,\n \"egress_hosts\"?: Set<String>, // Host allowlist for egress, e.g. {\"pypi.org\"}\n \"exec_allowlist\"?: Set<String>, // Executables the sandbox may run, e.g. {\"python\", \"python3\"}\n // Curated mechanism toggles (ADR 0017 D1.3) \u2014 authorization facts only;\n // NEVER raw syscalls. Allowed members: \"sys:ptrace\", \"sys:bpf\",\n // \"sys:raw_socket\", \"dev:gpu\", \"virt:nested\".\n \"mechanism_capabilities\"?: Set<String>,\n };\n}\n";
|
|
6
|
+
export declare const AGENT_OPS_SCHEMA = "// =============================================================================\n// AgentOps Cedar Schema\n// =============================================================================\n// Unified schema for all agent guardrail policies. Covers every request path\n// where an AI agent touches the Highflame platform:\n// - LLM prompt/response (Guardrails path)\n// - IDE tool calls and file access (Overwatch path)\n// - MCP server connections (AI Gateway path)\n//\n// The context types are a superset of Guardrails, Overwatch, and AI Gateway\n// schemas. All extra fields are optional \u2014 Shield projects only what is present\n// in the request, Cedar ignores absent optional attributes.\n//\n// Service: highflame-shield (agent_ops product)\n// Namespace: AgentOps\n// =============================================================================\n\nnamespace AgentOps {\n // =========================================================================\n // Entity Types \u2014 ReBAC Hierarchy\n // =========================================================================\n // Entity hierarchy enables Cedar's `in` operator for policy scoping:\n // Account (org root)\n // \u2514\u2500\u2500 Project in [Account]\n // \u251C\u2500\u2500 App in [Project]\n // \u2502 \u2514\u2500\u2500 Session in [App, Agent]\n // \u2514\u2500\u2500 Agent in [Project]\n // \u2514\u2500\u2500 Session in [App, Agent]\n //\n // Policy scoping examples:\n // resource in AgentOps::Project::\"<uuid>\" \u2192 project-wide (all agents)\n // resource in AgentOps::Agent::\"<external_id>\" \u2192 named agent + its sessions\n // resource == AgentOps::Agent::\"<external_id>\" \u2192 named agent only (exact match)\n // resource in AgentOps::Account::\"<uuid>\" \u2192 org-wide\n // =========================================================================\n\n /// Account represents an organization (top-level tenant)\n entity Account;\n\n /// Project represents a project within an account\n entity Project in [Account];\n\n /// User represents a principal (human or service) making requests\n entity User;\n\n /// Agent represents an AI agent (Claude, Cursor, Copilot, MCP client, etc.)\n /// Used as both principal (who is acting) and resource (policy scoping target).\n /// Agent + sessions: resource in AgentOps::Agent::\"<external_id>\" (hierarchy match)\n /// Agent only: resource == AgentOps::Agent::\"<external_id>\" (exact match)\n entity Agent in [Project];\n\n /// App represents a protected application (guardrails-enabled LLM app)\n entity App in [Project];\n\n /// Session represents an agentic conversation session with state tracking.\n /// Sessions can belong to either an App or an Agent.\n entity Session in [App, Agent];\n\n // =========================================================================\n // Actions\n // =========================================================================\n\n /// Process user prompts and AI responses for security threats and content violations\n action \"process_prompt\" appliesTo {\n principal: [User, Agent],\n resource: [App, Agent, Session],\n context: ProcessPromptContext\n };\n\n /// Execute tool calls (shell, file operations, MCP tools)\n action \"call_tool\" appliesTo {\n principal: [User, Agent],\n resource: [Agent, Session],\n context: CallToolContext\n };\n\n /// Read file operations\n action \"read_file\" appliesTo {\n principal: [User, Agent],\n resource: [Agent, Session],\n context: FileReadContext\n };\n\n /// Write file operations\n action \"write_file\" appliesTo {\n principal: [User, Agent],\n resource: [Agent, Session],\n context: FileWriteContext\n };\n\n /// Connect to an MCP server\n action \"connect_server\" appliesTo {\n principal: [User, Agent],\n resource: [Agent, Session],\n context: ConnectServerContext\n };\n\n /// Provision a sandbox for the acting identity (Forge OS-layer envelope).\n /// The MANDATORY authorization gate for sandbox creation (ADR 0019 D1):\n /// Forge evaluates this action's AgentOps bundle at create-time; no decision\n /// means no sandbox. Context carries the requested capability envelope\n /// (writable paths, egress, exec allowlist, curated mechanism toggles,\n /// isolation tier). Raw syscalls are NEVER expressed here \u2014 the enforcement\n /// generators own the mechanism\u2192syscall translation (ADR 0017 D1).\n action \"provision_sandbox\" appliesTo {\n principal: [User, Agent],\n resource: [Agent, Session],\n context: ProvisionSandboxContext\n };\n\n // =========================================================================\n // Context Types (Action-Specific)\n // =========================================================================\n\n /// Context for process_prompt action (user prompts & AI responses)\n type ProcessPromptContext = {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n \"role\"?: String,\n \"privilege_scope\"?: Set<String>,\n \"identity_type\"?: String, // Principal identity class: \"human\" | \"agent\" | \"service\" | \"mcp_server\"\n \"principal\"?: String, // Stable principal identifier (e.g. ZeroID / WIMSE URI or user id)\n // Core metadata (required)\n \"request_id\": String,\n \"timestamp\": Long,\n \"direction\": String, // \"input\" | \"output\"\n \"content_type\": String, // \"prompt\" | \"response\" | \"tool_call\" | \"file\"\n \"detector_count\": Long,\n\n // IDE / workspace context (optional \u2014 present for Overwatch/code-agent traffic)\n \"source\"?: String, // Traffic origin: \"ide\" | \"cli\" | \"api\" | \"browser\"\n \"event\"?: String, // Event type: \"prompt\" | \"tool_call\" | \"file_read\" | ...\n \"user_email\"?: String, // Human operator email (IDE sessions)\n \"cwd\"?: String, // Current working directory\n \"workspace_root\"?: String, // IDE workspace root path\n\n // Model context (optional \u2014 present for AI Gateway traffic)\n \"model_name\"?: String, // LLM model name: \"claude-3-5-sonnet\", \"gpt-4o\", ...\n \"model_provider\"?: String, // Model provider: \"anthropic\" | \"openai\" | \"google\" | ...\n\n // Security - Injection & Jailbreak (optional)\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 \"injection_type\"?: String, // \"prompt\" | \"sql\" | \"command\" | \"none\"\n \"indirect_injection_score\"?: Long, // Indirect injection via tool outputs (0-100)\n\n // Privacy - Secrets (optional)\n \"secrets_detected\"?: Boolean,\n \"secret_count\"?: Long,\n \"secret_types\"?: Set<String>, // [\"aws_access_key\", \"github_token\", ...]\n\n // Privacy - PII (optional)\n \"pii_detected\"?: Boolean,\n \"pii_count\"?: Long,\n \"pii_types\"?: Set<String>, // [\"email\", \"phone\", \"ssn\", \"credit_card\", ...]\n \"pii_score\"?: Long, // PII ML classifier confidence (0-100)\n\n // Aggregated threat summary (optional \u2014 populated by aggregation detectors)\n \"highest_severity\"?: String, // \"critical\" | \"high\" | \"medium\" | \"low\" | \"none\"\n \"threat_count\"?: Long,\n \"threat_categories\"?: Set<String>,\n \"detected_threats\"?: Set<String>,\n\n // Trust & Safety - Toxicity (optional)\n \"violence_score\"?: Long, // 0-100\n \"hate_speech_score\"?: Long, // 0-100\n \"sexual_score\"?: Long, // 0-100\n \"weapons_score\"?: Long, // 0-100\n \"crime_score\"?: Long, // 0-100\n \"profanity_score\"?: Long, // 0-100\n\n // Semantic - Topic Classification (optional)\n \"content_topics\"?: Set<String>, // [\"controlled_substances\", \"weapons_manufacturing\", ...]\n \"topic_confidence\"?: Long, // 0-100\n\n // Security - Invisible Character Detection (optional)\n \"invisible_chars_detected\"?: Boolean,\n \"invisible_chars_score\"?: Long, // 0-100\n\n // Security - Pattern Detection (optional)\n \"command_injection_detected\"?: Boolean,\n \"command_injection_type\"?: String, // \"reverse_shell\" | \"privilege_escalation\" | ...\n \"command_injection_score\"?: Long, // 0-100\n \"path_traversal_detected\"?: Boolean,\n \"path_traversal_severity\"?: String, // \"critical\" | \"high\" | \"medium\" | \"low\" | \"none\"\n \"path_traversal_type\"?: String,\n \"sql_injection_detected\"?: Boolean,\n \"sql_injection_type\"?: String, // \"tautology\" | \"union_based\" | \"destructive\" | ...\n \"sql_injection_score\"?: Long, // 0-100\n\n // Security - Cross-Origin Escalation (optional)\n \"cross_origin_detected\"?: Boolean,\n \"cross_origin_type\"?: String, // \"cross_origin_tool\" | \"cross_origin_server\" | \"none\"\n \"cross_origin_score\"?: Long, // 0-100\n\n // Security - Encoded Injection (optional)\n \"encoded_content_detected\"?: Boolean,\n \"encoded_types\"?: Set<String>, // [\"base64\", \"hex\", \"unicode\", \"url\", ...]\n \"encoded_count\"?: Long,\n \"encoded_score\"?: Long, // 0-100\n\n // Language & Script Detection (optional)\n \"detected_language\"?: String, // ISO language code\n \"is_english\"?: Boolean,\n \"language_confidence\"?: Long, // 0-100\n \"detected_script\"?: String, // \"latin\" | \"cyrillic\" | \"arabic\" | \"unknown\" | ...\n \"is_latin_script\"?: Boolean,\n \"script_confidence\"?: Long, // 0-100\n\n // Content Analysis (optional)\n \"hallucination_score\"?: Long,\n \"factuality_score\"?: Long, // 0-100\n \"sentiment_score\"?: Long,\n \"contains_code\"?: Boolean,\n \"code_languages\"?: Set<String>,\n \"code_ratio\"?: Long, // 0-100\n \"keyword_matched\"?: Boolean,\n \"keyword_categories\"?: Set<String>,\n \"keyword_count\"?: Long,\n \"contains_non_ascii\"?: Boolean,\n \"phishing_detected\"?: Boolean,\n \"content_safety_score\"?: Long, // 0-100\n \"content_safety_blocked\"?: Boolean,\n\n // Agentic - Multi-Turn Context (optional)\n \"conversation_turn\"?: Long,\n \"multi_turn_detection\"?: Boolean,\n\n // Session Detection History \u2014 cross-turn sticky flags (optional)\n \"session_pii_detected\"?: Boolean,\n \"session_pii_types\"?: Set<String>,\n \"session_secrets_detected\"?: Boolean,\n \"session_secret_types\"?: Set<String>,\n \"session_injection_detected\"?: Boolean,\n \"session_command_injection\"?: Boolean,\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 \"session_original_request\"?: String,\n \"session_max_sensitivity\"?: String,\n\n // Origin Surface \u2014 REQUIRED (ADR 0012 D14.2). Projected by Shield from the\n // ingress product; never user-supplied. The \"Applies to\" narrowing target:\n // policies test it with an ordinary condition (context.surface == \"ai_gateway\")\n // \u2014 no `has` guard needed precisely because it is required. Values are the\n // product identifiers: \"guardrails\" | \"overwatch\" | \"ai_gateway\" (\"sentry\"\n // joins at ADR 0012 D17 phase 2). A policy with no surface condition applies\n // to every surface, including ones added later (inclusive default).\n \"surface\": String,\n\n // Data-Flow Labels \u2014 per-value information-flow facts (ADR 0020, optional).\n // All optional: guard every access with `has` \u2014 an absent-attribute read is\n // a Cedar evaluation error and an errored forbid is silently skipped (fail-open).\n \"flow_confidentiality\"?: String, // \"public\" | \"internal\" | \"confidential\" | \"restricted\" | \"unknown\"\n \"flow_integrity\"?: String, // \"trusted\" | \"untrusted\" | \"mixed\" | \"unknown\"\n \"flow_data_types\"?: Set<String>, // \"pii\" | \"secrets\" | \"source_code\" | \"financial\" | \"health\" | ...\n \"flow_compartments\"?: Set<String>, // \"tenant:*\" | \"customer:*\" | \"project:*\"\n \"flow_resolution_status\"?: String, // \"known\" | \"inferred\" | \"unknown\" | \"conflicted\"\n \"flow_origins\"?: Set<String>, // \"mcp_tool_result\" | \"model\" | \"file\" | \"database\" | \"user\"\n \"flow_sink\"?: String, // \"external_model\" | \"local_model\" | \"external_mcp\" | \"trusted_mcp\" | \"user_secure_output\" | \"public_network\" | \"file\"\n \"flow_sink_is_external\"?: Boolean,\n \"flow_sink_effects\"?: Set<String>, // \"network.send\" | \"financial.transfer\" | \"filesystem.write\" | ...\n \"principal_clearances\"?: Set<String>, // ADR 0020 D8 \u2014 clearances AuthN mints for the principal\n \"principal_compartments\"?: Set<String>, // ADR 0020 D8 \u2014 compartments the principal is admitted to\n\n // Usage Budget \u2014 multi-window token & cost enforcement (optional)\n \"budget_remaining_pct\"?: Long,\n \"budget_exceeded\"?: Boolean,\n \"budget_cost_micros_this_turn\"?: Long,\n \"budget_model\"?: String,\n \"budget_tokens_pct_session\"?: Long,\n \"budget_tokens_pct_daily\"?: Long,\n \"budget_tokens_pct_monthly\"?: Long,\n \"budget_cost_pct_daily\"?: Long,\n \"budget_cost_pct_monthly\"?: Long,\n \"budget_exceeded_session\"?: Boolean,\n \"budget_exceeded_daily\"?: Boolean,\n \"budget_exceeded_monthly\"?: Boolean,\n\n // Rate Limiting \u2014 gateway-metered, Shield-decided (ADR 0014)\n \"rpm_remaining_pct\"?: Long,\n \"rpm_exceeded\"?: Boolean,\n \"tpm_remaining_pct\"?: Long,\n \"tpm_exceeded\"?: Boolean,\n\n // Agent Identity \u2014 authenticated agent principal metadata (optional)\n \"agent_id\"?: String,\n \"agent_type\"?: String, // \"orchestrator\" | \"autonomous\" | \"tool_agent\" | \"human_proxy\"\n \"agent_trust_level\"?: String, // \"first_party\" | \"verified_third_party\" | \"unverified\"\n \"agent_framework\"?: String,\n \"agent_publisher\"?: String,\n\n // Supply-chain / package safety + aggregate threat severity (optional \u2014\n // ADR 0012 unified port). Projected by Shield's malicious-package and\n // threat-severity detectors; every read is `has`-guarded in policy.\n \"malicious_package_detected\"?: Boolean,\n \"package_install_detected\"?: Boolean,\n \"package_check_status\"?: String,\n \"max_threat_severity\"?: Long,\n\n };\n\n /// Context for call_tool action (agentic tool execution)\n type CallToolContext = {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n \"role\"?: String,\n \"privilege_scope\"?: Set<String>,\n \"identity_type\"?: String,\n \"principal\"?: String,\n // Core metadata (required)\n \"request_id\": String,\n \"timestamp\": Long,\n\n // IDE / workspace context (optional)\n \"source\"?: String,\n \"event\"?: String,\n \"user_email\"?: String,\n \"cwd\"?: String,\n \"workspace_root\"?: String,\n\n // Tool Risk (optional)\n \"tool_name\"?: String,\n \"tool_risk_score\"?: Long, // 0-100\n \"tool_is_sensitive\"?: Boolean,\n \"tool_category\"?: String, // \"safe\" | \"sensitive\" | \"dangerous\"\n \"tool_is_builtin\"?: Boolean,\n\n // AARM R3 (CAP-ENF-007) \u2014 Action Parameter Validation\n \"action_params\"?: {\n \"amount\"?: Long,\n \"count\"?: Long,\n \"command\"?: String,\n \"path\"?: String,\n \"url\"?: String,\n \"recipient\"?: String,\n \"target\"?: String,\n \"query\"?: String,\n },\n \"param_type_violation\"?: Boolean,\n \"param_type_violations\"?: Set<String>,\n\n // MCP context (optional)\n \"mcp_server\"?: String,\n \"mcp_tool\"?: String,\n \"mcp_server_verified\"?: Boolean,\n\n // Agentic - Behavioral Patterns (optional)\n \"suspicious_pattern\"?: Boolean,\n \"pattern_type\"?: String, // \"data_exfiltration\" | \"secret_exfiltration\" | ...\n \"sequence_risk\"?: Long, // 0-100\n\n // Agentic - Loop Detection (optional)\n \"loop_detected\"?: Boolean,\n \"loop_count\"?: Long,\n \"loop_tool\"?: String,\n\n // Security checks on tool arguments (optional)\n \"secrets_detected\"?: Boolean,\n \"secret_count\"?: Long,\n \"secret_types\"?: Set<String>,\n \"pii_detected\"?: Boolean,\n \"pii_types\"?: Set<String>,\n \"pii_count\"?: Long,\n \"pii_score\"?: Long,\n \"injection_score\"?: Long,\n \"injection_pulse_score\"?: Long,\n \"injection_deep_context_score\"?: Long,\n \"indirect_injection_score\"?: Long,\n \"indirect_injection_type\"?: String, // Type of indirect injection detected\n\n // Semantic - Topic Classification (optional)\n \"content_topics\"?: Set<String>, // [\"controlled_substances\", \"weapons_manufacturing\", ...]\n \"topic_confidence\"?: Long, // 0-100\n\n // Security - Pattern Detection (optional)\n \"command_injection_detected\"?: Boolean,\n \"command_injection_type\"?: String,\n \"command_injection_score\"?: Long,\n \"path_traversal_detected\"?: Boolean,\n \"path_traversal_severity\"?: String,\n \"path_traversal_type\"?: String,\n \"sql_injection_detected\"?: Boolean,\n \"sql_injection_type\"?: String,\n \"sql_injection_score\"?: Long,\n\n // Security - Cross-Origin Escalation (optional)\n \"cross_origin_detected\"?: Boolean,\n \"cross_origin_type\"?: String,\n \"cross_origin_score\"?: Long,\n\n // Security - Invisible Character Detection (optional)\n \"invisible_chars_detected\"?: Boolean,\n \"invisible_chars_score\"?: Long,\n\n // Security - Encoded Injection (optional)\n \"encoded_content_detected\"?: Boolean,\n \"encoded_types\"?: Set<String>,\n \"encoded_count\"?: Long,\n \"encoded_score\"?: Long,\n\n // Agentic - Agent Security (optional)\n \"tool_poisoning_detected\"?: Boolean,\n \"tool_poisoning_score\"?: Long,\n \"tool_poisoning_type\"?: String,\n \"rug_pull_detected\"?: Boolean,\n \"rug_pull_score\"?: Long,\n \"rug_pull_type\"?: String,\n\n // Agentic - MCP Risk (optional)\n \"mcp_config_risk\"?: Boolean,\n \"mcp_risk_type\"?: String,\n \"mcp_risk_score\"?: Long,\n\n // Tool Operation Classifier (optional)\n \"tool_operation_classes\"?: Set<String>,\n\n // Agentic - Multi-Turn Context (optional)\n \"conversation_turn\"?: Long,\n \"multi_turn_detection\"?: Boolean,\n\n // Session Detection History \u2014 cross-turn sticky flags (optional)\n \"session_pii_detected\"?: Boolean,\n \"session_pii_types\"?: Set<String>,\n \"session_secrets_detected\"?: Boolean,\n \"session_secret_types\"?: Set<String>,\n \"session_injection_detected\"?: Boolean,\n \"session_command_injection\"?: Boolean,\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 \"session_original_request\"?: String,\n \"session_max_sensitivity\"?: String,\n\n // Origin Surface \u2014 REQUIRED (ADR 0012 D14.2). Projected by Shield from the\n // ingress product; never user-supplied. The \"Applies to\" narrowing target:\n // policies test it with an ordinary condition (context.surface == \"ai_gateway\")\n // \u2014 no `has` guard needed precisely because it is required. Values are the\n // product identifiers: \"guardrails\" | \"overwatch\" | \"ai_gateway\" (\"sentry\"\n // joins at ADR 0012 D17 phase 2). A policy with no surface condition applies\n // to every surface, including ones added later (inclusive default).\n \"surface\": String,\n\n // Data-Flow Labels \u2014 per-value information-flow facts (ADR 0020, optional).\n // All optional: guard every access with `has` \u2014 an absent-attribute read is\n // a Cedar evaluation error and an errored forbid is silently skipped (fail-open).\n \"flow_confidentiality\"?: String, // \"public\" | \"internal\" | \"confidential\" | \"restricted\" | \"unknown\"\n \"flow_integrity\"?: String, // \"trusted\" | \"untrusted\" | \"mixed\" | \"unknown\"\n \"flow_data_types\"?: Set<String>, // \"pii\" | \"secrets\" | \"source_code\" | \"financial\" | \"health\" | ...\n \"flow_compartments\"?: Set<String>, // \"tenant:*\" | \"customer:*\" | \"project:*\"\n \"flow_resolution_status\"?: String, // \"known\" | \"inferred\" | \"unknown\" | \"conflicted\"\n \"flow_origins\"?: Set<String>, // \"mcp_tool_result\" | \"model\" | \"file\" | \"database\" | \"user\"\n \"flow_sink\"?: String, // \"external_model\" | \"local_model\" | \"external_mcp\" | \"trusted_mcp\" | \"user_secure_output\" | \"public_network\" | \"file\"\n \"flow_sink_is_external\"?: Boolean,\n \"flow_sink_effects\"?: Set<String>, // \"network.send\" | \"financial.transfer\" | \"filesystem.write\" | ...\n \"principal_clearances\"?: Set<String>, // ADR 0020 D8 \u2014 clearances AuthN mints for the principal\n \"principal_compartments\"?: Set<String>, // ADR 0020 D8 \u2014 compartments the principal is admitted to\n\n // Usage Budget (optional)\n \"budget_remaining_pct\"?: Long,\n \"budget_exceeded\"?: Boolean,\n \"budget_cost_micros_this_turn\"?: Long,\n \"budget_model\"?: String,\n \"budget_tokens_pct_session\"?: Long,\n \"budget_tokens_pct_daily\"?: Long,\n \"budget_tokens_pct_monthly\"?: Long,\n \"budget_cost_pct_daily\"?: Long,\n \"budget_cost_pct_monthly\"?: Long,\n \"budget_exceeded_session\"?: Boolean,\n \"budget_exceeded_daily\"?: Boolean,\n \"budget_exceeded_monthly\"?: Boolean,\n\n // Rate Limiting \u2014 gateway-metered, Shield-decided (ADR 0014)\n \"rpm_remaining_pct\"?: Long,\n \"rpm_exceeded\"?: Boolean,\n \"tpm_remaining_pct\"?: Long,\n \"tpm_exceeded\"?: Boolean,\n\n // Aggregated threat summary (optional)\n \"highest_severity\"?: String,\n \"threat_count\"?: Long,\n \"detected_threats\"?: Set<String>,\n\n // Agent Identity (optional)\n \"agent_id\"?: String,\n \"agent_type\"?: String,\n \"agent_trust_level\"?: String,\n \"agent_framework\"?: String,\n \"agent_publisher\"?: String,\n\n // File & Path (optional)\n \"path\"?: String,\n\n // Supply-chain / package safety + aggregate threat severity (optional \u2014\n // ADR 0012 unified port). Projected by Shield's malicious-package and\n // threat-severity detectors; every read is `has`-guarded in policy.\n \"malicious_package_detected\"?: Boolean,\n \"package_install_detected\"?: Boolean,\n \"package_check_status\"?: String,\n \"max_threat_severity\"?: Long,\n\n };\n\n /// Context for read_file action\n type FileReadContext = {\n // Identity (optional)\n \"role\"?: String,\n \"privilege_scope\"?: Set<String>,\n \"identity_type\"?: String,\n \"principal\"?: String,\n // Core metadata (required)\n \"request_id\": String,\n \"timestamp\": Long,\n\n // IDE / workspace context (optional)\n \"source\"?: String,\n \"event\"?: String,\n \"user_email\"?: String,\n \"cwd\"?: String,\n \"workspace_root\"?: String,\n\n // File path (optional)\n \"path\"?: String,\n\n // Security checks on file content (optional)\n \"secrets_detected\"?: Boolean,\n \"secret_count\"?: Long,\n \"secret_types\"?: Set<String>,\n \"pii_detected\"?: Boolean,\n \"pii_types\"?: Set<String>,\n\n // Security - Path Traversal (optional)\n \"path_traversal_detected\"?: Boolean,\n \"path_traversal_severity\"?: String,\n \"path_traversal_type\"?: String,\n\n // Aggregated threat summary (optional)\n \"highest_severity\"?: String,\n \"threat_count\"?: Long,\n \"detected_threats\"?: Set<String>,\n\n // Session Detection History (optional)\n \"session_pii_detected\"?: Boolean,\n \"session_pii_types\"?: Set<String>,\n \"session_secrets_detected\"?: Boolean,\n \"session_secret_types\"?: Set<String>,\n \"session_injection_detected\"?: Boolean,\n \"session_command_injection\"?: Boolean,\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 \"session_original_request\"?: String,\n \"session_max_sensitivity\"?: String,\n\n // Origin Surface \u2014 REQUIRED (ADR 0012 D14.2). Projected by Shield from the\n // ingress product; never user-supplied. The \"Applies to\" narrowing target:\n // policies test it with an ordinary condition (context.surface == \"ai_gateway\")\n // \u2014 no `has` guard needed precisely because it is required. Values are the\n // product identifiers: \"guardrails\" | \"overwatch\" | \"ai_gateway\" (\"sentry\"\n // joins at ADR 0012 D17 phase 2). A policy with no surface condition applies\n // to every surface, including ones added later (inclusive default).\n \"surface\": String,\n\n // Data-Flow Labels \u2014 per-value information-flow facts (ADR 0020, optional).\n // All optional: guard every access with `has` \u2014 an absent-attribute read is\n // a Cedar evaluation error and an errored forbid is silently skipped (fail-open).\n \"flow_confidentiality\"?: String, // \"public\" | \"internal\" | \"confidential\" | \"restricted\" | \"unknown\"\n \"flow_integrity\"?: String, // \"trusted\" | \"untrusted\" | \"mixed\" | \"unknown\"\n \"flow_data_types\"?: Set<String>, // \"pii\" | \"secrets\" | \"source_code\" | \"financial\" | \"health\" | ...\n \"flow_compartments\"?: Set<String>, // \"tenant:*\" | \"customer:*\" | \"project:*\"\n \"flow_resolution_status\"?: String, // \"known\" | \"inferred\" | \"unknown\" | \"conflicted\"\n \"flow_origins\"?: Set<String>, // \"mcp_tool_result\" | \"model\" | \"file\" | \"database\" | \"user\"\n \"flow_sink\"?: String, // \"external_model\" | \"local_model\" | \"external_mcp\" | \"trusted_mcp\" | \"user_secure_output\" | \"public_network\" | \"file\"\n \"flow_sink_is_external\"?: Boolean,\n \"flow_sink_effects\"?: Set<String>, // \"network.send\" | \"financial.transfer\" | \"filesystem.write\" | ...\n \"principal_clearances\"?: Set<String>, // ADR 0020 D8 \u2014 clearances AuthN mints for the principal\n \"principal_compartments\"?: Set<String>, // ADR 0020 D8 \u2014 compartments the principal is admitted to\n\n // Usage Budget (optional)\n \"budget_remaining_pct\"?: Long,\n \"budget_exceeded\"?: Boolean,\n \"budget_cost_micros_this_turn\"?: Long,\n \"budget_model\"?: String,\n \"budget_tokens_pct_session\"?: Long,\n \"budget_tokens_pct_daily\"?: Long,\n \"budget_tokens_pct_monthly\"?: Long,\n \"budget_cost_pct_daily\"?: Long,\n \"budget_cost_pct_monthly\"?: Long,\n \"budget_exceeded_session\"?: Boolean,\n \"budget_exceeded_daily\"?: Boolean,\n \"budget_exceeded_monthly\"?: Boolean,\n\n // Rate Limiting \u2014 gateway-metered, Shield-decided (ADR 0014)\n \"rpm_remaining_pct\"?: Long,\n \"rpm_exceeded\"?: Boolean,\n \"tpm_remaining_pct\"?: Long,\n \"tpm_exceeded\"?: Boolean,\n\n // Agent Identity (optional)\n \"agent_id\"?: String,\n \"agent_type\"?: String,\n \"agent_trust_level\"?: String,\n \"agent_framework\"?: String,\n \"agent_publisher\"?: String,\n\n };\n\n /// Context for write_file action\n type FileWriteContext = {\n // Identity (optional)\n \"role\"?: String,\n \"privilege_scope\"?: Set<String>,\n \"identity_type\"?: String,\n \"principal\"?: String,\n // Core metadata (required)\n \"request_id\": String,\n \"timestamp\": Long,\n\n // IDE / workspace context (optional)\n \"source\"?: String,\n \"event\"?: String,\n \"user_email\"?: String,\n \"cwd\"?: String,\n \"workspace_root\"?: String,\n\n // File path (optional)\n \"path\"?: String,\n\n // Security - Invisible Character Detection in write content (optional)\n \"invisible_chars_detected\"?: Boolean,\n \"invisible_chars_score\"?: Long,\n\n // Security checks on content being written (optional)\n \"secrets_detected\"?: Boolean,\n \"secret_count\"?: Long,\n \"secret_types\"?: Set<String>,\n \"pii_detected\"?: Boolean,\n \"pii_types\"?: Set<String>,\n\n // Security - Path Traversal (optional)\n \"path_traversal_detected\"?: Boolean,\n \"path_traversal_severity\"?: String,\n \"path_traversal_type\"?: String,\n\n // Aggregated threat summary (optional)\n \"highest_severity\"?: String,\n \"threat_count\"?: Long,\n \"detected_threats\"?: Set<String>,\n\n // Session Detection History (optional)\n \"session_pii_detected\"?: Boolean,\n \"session_pii_types\"?: Set<String>,\n \"session_secrets_detected\"?: Boolean,\n \"session_secret_types\"?: Set<String>,\n \"session_injection_detected\"?: Boolean,\n \"session_command_injection\"?: Boolean,\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 \"session_original_request\"?: String,\n \"session_max_sensitivity\"?: String,\n\n // Origin Surface \u2014 REQUIRED (ADR 0012 D14.2). Projected by Shield from the\n // ingress product; never user-supplied. The \"Applies to\" narrowing target:\n // policies test it with an ordinary condition (context.surface == \"ai_gateway\")\n // \u2014 no `has` guard needed precisely because it is required. Values are the\n // product identifiers: \"guardrails\" | \"overwatch\" | \"ai_gateway\" (\"sentry\"\n // joins at ADR 0012 D17 phase 2). A policy with no surface condition applies\n // to every surface, including ones added later (inclusive default).\n \"surface\": String,\n\n // Data-Flow Labels \u2014 per-value information-flow facts (ADR 0020, optional).\n // All optional: guard every access with `has` \u2014 an absent-attribute read is\n // a Cedar evaluation error and an errored forbid is silently skipped (fail-open).\n \"flow_confidentiality\"?: String, // \"public\" | \"internal\" | \"confidential\" | \"restricted\" | \"unknown\"\n \"flow_integrity\"?: String, // \"trusted\" | \"untrusted\" | \"mixed\" | \"unknown\"\n \"flow_data_types\"?: Set<String>, // \"pii\" | \"secrets\" | \"source_code\" | \"financial\" | \"health\" | ...\n \"flow_compartments\"?: Set<String>, // \"tenant:*\" | \"customer:*\" | \"project:*\"\n \"flow_resolution_status\"?: String, // \"known\" | \"inferred\" | \"unknown\" | \"conflicted\"\n \"flow_origins\"?: Set<String>, // \"mcp_tool_result\" | \"model\" | \"file\" | \"database\" | \"user\"\n \"flow_sink\"?: String, // \"external_model\" | \"local_model\" | \"external_mcp\" | \"trusted_mcp\" | \"user_secure_output\" | \"public_network\" | \"file\"\n \"flow_sink_is_external\"?: Boolean,\n \"flow_sink_effects\"?: Set<String>, // \"network.send\" | \"financial.transfer\" | \"filesystem.write\" | ...\n \"principal_clearances\"?: Set<String>, // ADR 0020 D8 \u2014 clearances AuthN mints for the principal\n \"principal_compartments\"?: Set<String>, // ADR 0020 D8 \u2014 compartments the principal is admitted to\n\n // Usage Budget (optional)\n \"budget_remaining_pct\"?: Long,\n \"budget_exceeded\"?: Boolean,\n \"budget_cost_micros_this_turn\"?: Long,\n \"budget_model\"?: String,\n \"budget_tokens_pct_session\"?: Long,\n \"budget_tokens_pct_daily\"?: Long,\n \"budget_tokens_pct_monthly\"?: Long,\n \"budget_cost_pct_daily\"?: Long,\n \"budget_cost_pct_monthly\"?: Long,\n \"budget_exceeded_session\"?: Boolean,\n \"budget_exceeded_daily\"?: Boolean,\n \"budget_exceeded_monthly\"?: Boolean,\n\n // Rate Limiting \u2014 gateway-metered, Shield-decided (ADR 0014)\n \"rpm_remaining_pct\"?: Long,\n \"rpm_exceeded\"?: Boolean,\n \"tpm_remaining_pct\"?: Long,\n \"tpm_exceeded\"?: Boolean,\n\n // Agent Identity (optional)\n \"agent_id\"?: String,\n \"agent_type\"?: String,\n \"agent_trust_level\"?: String,\n \"agent_framework\"?: String,\n \"agent_publisher\"?: String,\n\n };\n\n /// Context for connect_server action (MCP server connections)\n type ConnectServerContext = {\n // Identity (optional)\n \"role\"?: String,\n \"privilege_scope\"?: Set<String>,\n \"identity_type\"?: String,\n \"principal\"?: String,\n // Core metadata (required)\n \"request_id\": String,\n \"timestamp\": Long,\n\n // IDE / workspace context (optional)\n \"source\"?: String,\n \"event\"?: String,\n \"user_email\"?: String,\n \"cwd\"?: String,\n \"workspace_root\"?: String,\n\n // MCP context (optional)\n \"mcp_server\"?: String,\n \"mcp_server_verified\"?: Boolean,\n\n // Agentic - Agent Security (optional)\n \"tool_poisoning_detected\"?: Boolean,\n \"tool_poisoning_score\"?: Long,\n \"tool_poisoning_type\"?: String,\n\n // Agentic - MCP Risk (optional)\n \"mcp_config_risk\"?: Boolean,\n \"mcp_risk_type\"?: String,\n \"mcp_risk_score\"?: Long,\n\n // Security - Cross-Origin Escalation (optional)\n \"cross_origin_detected\"?: Boolean,\n \"cross_origin_type\"?: String,\n \"cross_origin_score\"?: Long,\n\n // Aggregated threat summary (optional)\n \"highest_severity\"?: String,\n \"threat_count\"?: Long,\n \"detected_threats\"?: Set<String>,\n\n // Session Detection History (optional)\n \"session_pii_detected\"?: Boolean,\n \"session_pii_types\"?: Set<String>,\n \"session_secrets_detected\"?: Boolean,\n \"session_secret_types\"?: Set<String>,\n \"session_injection_detected\"?: Boolean,\n \"session_command_injection\"?: Boolean,\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 \"session_original_request\"?: String,\n \"session_max_sensitivity\"?: String,\n\n // Origin Surface \u2014 REQUIRED (ADR 0012 D14.2). Projected by Shield from the\n // ingress product; never user-supplied. The \"Applies to\" narrowing target:\n // policies test it with an ordinary condition (context.surface == \"ai_gateway\")\n // \u2014 no `has` guard needed precisely because it is required. Values are the\n // product identifiers: \"guardrails\" | \"overwatch\" | \"ai_gateway\" (\"sentry\"\n // joins at ADR 0012 D17 phase 2). A policy with no surface condition applies\n // to every surface, including ones added later (inclusive default).\n \"surface\": String,\n\n // Data-Flow Labels \u2014 per-value information-flow facts (ADR 0020, optional).\n // All optional: guard every access with `has` \u2014 an absent-attribute read is\n // a Cedar evaluation error and an errored forbid is silently skipped (fail-open).\n \"flow_confidentiality\"?: String, // \"public\" | \"internal\" | \"confidential\" | \"restricted\" | \"unknown\"\n \"flow_integrity\"?: String, // \"trusted\" | \"untrusted\" | \"mixed\" | \"unknown\"\n \"flow_data_types\"?: Set<String>, // \"pii\" | \"secrets\" | \"source_code\" | \"financial\" | \"health\" | ...\n \"flow_compartments\"?: Set<String>, // \"tenant:*\" | \"customer:*\" | \"project:*\"\n \"flow_resolution_status\"?: String, // \"known\" | \"inferred\" | \"unknown\" | \"conflicted\"\n \"flow_origins\"?: Set<String>, // \"mcp_tool_result\" | \"model\" | \"file\" | \"database\" | \"user\"\n \"flow_sink\"?: String, // \"external_model\" | \"local_model\" | \"external_mcp\" | \"trusted_mcp\" | \"user_secure_output\" | \"public_network\" | \"file\"\n \"flow_sink_is_external\"?: Boolean,\n \"flow_sink_effects\"?: Set<String>, // \"network.send\" | \"financial.transfer\" | \"filesystem.write\" | ...\n \"principal_clearances\"?: Set<String>, // ADR 0020 D8 \u2014 clearances AuthN mints for the principal\n \"principal_compartments\"?: Set<String>, // ADR 0020 D8 \u2014 compartments the principal is admitted to\n\n // Usage Budget (optional)\n \"budget_remaining_pct\"?: Long,\n \"budget_exceeded\"?: Boolean,\n \"budget_cost_micros_this_turn\"?: Long,\n \"budget_model\"?: String,\n \"budget_tokens_pct_session\"?: Long,\n \"budget_tokens_pct_daily\"?: Long,\n \"budget_tokens_pct_monthly\"?: Long,\n \"budget_cost_pct_daily\"?: Long,\n \"budget_cost_pct_monthly\"?: Long,\n \"budget_exceeded_session\"?: Boolean,\n \"budget_exceeded_daily\"?: Boolean,\n \"budget_exceeded_monthly\"?: Boolean,\n\n // Rate Limiting \u2014 gateway-metered, Shield-decided (ADR 0014)\n \"rpm_remaining_pct\"?: Long,\n \"rpm_exceeded\"?: Boolean,\n \"tpm_remaining_pct\"?: Long,\n \"tpm_exceeded\"?: Boolean,\n\n // Agent Identity (optional)\n \"agent_id\"?: String,\n \"agent_type\"?: String,\n \"agent_trust_level\"?: String,\n \"agent_framework\"?: String,\n \"agent_publisher\"?: String,\n\n // Supply-chain / package safety + aggregate threat severity (optional \u2014\n // ADR 0012 unified port). Projected by Shield's malicious-package and\n // threat-severity detectors; every read is `has`-guarded in policy.\n \"malicious_package_detected\"?: Boolean,\n \"package_install_detected\"?: Boolean,\n \"package_check_status\"?: String,\n \"max_threat_severity\"?: Long,\n\n };\n\n /// Context for provision_sandbox action (Forge sandbox-create envelope).\n ///\n /// Every capability field below is OPTIONAL and describes the envelope the\n /// sandbox is being asked to provision with \u2014 Forge synthesizes it from the\n /// create request attenuated by the token's scope ceiling (ADR 0019 D1),\n /// then asks Cedar whether this identity may provision it. Profile templates\n /// `permit` provision_sandbox only when the requested envelope stays within\n /// the profile ceiling, and `forbid` any escalation beyond it.\n ///\n /// FAIL-OPEN WARNING (ADR 0019 D3): because these attributes are optional,\n /// accessing an absent one is a Cedar *evaluation error*, and an errored\n /// `forbid` is silently skipped \u2014 which fails OPEN. Every rule touching a\n /// field here MUST guard it first with `has` (e.g.\n /// `context has mechanism_capabilities && context.mechanism_capabilities.contains(\"sys:ptrace\")`).\n type ProvisionSandboxContext = {\n // Identity (AARM R6 / CAP-IDN-011) \u2014 projected from the principal's token; optional.\n \"role\"?: String,\n \"privilege_scope\"?: Set<String>,\n \"identity_type\"?: String, // Principal identity class: \"human\" | \"agent\" | \"service\" | \"mcp_server\"\n \"principal\"?: String, // Stable principal identifier (ZeroID / WIMSE URI or user id)\n \"agent_trust_level\"?: String, // \"untrusted\" | \"low\" | \"verified\" | \"trusted\"\n\n // Core metadata (required)\n \"request_id\": String,\n \"timestamp\": Long,\n\n // Requested isolation tier (required) \u2014 the OS-isolation tier the\n // sandbox will run at, as the lowercased Forge IsolationTier name (ADR\n // 0016 D1). Ordinal, weakest\u2192strongest: \"none\" (trusted-local) < \"os\"\n // (bwrap/seatbelt) < \"kernel\" (gVisor) < \"hardware\" (micro-VM + TEE).\n // Templates assert a floor via set membership (e.g. a KERNEL floor =\n // {\"kernel\",\"hardware\"}); Forge owns the ordering.\n \"isolation_tier\": String,\n\n // Requested capability envelope (all optional \u2014 has-guard mandatory).\n \"writable_paths\"?: Set<String>, // Writable path prefixes, e.g. {\"/scratch\"}\n // Master egress switch. Forge MUST set this true whenever ANY egress is\n // requested (i.e. whenever egress_hosts is non-empty), so a \"no network\"\n // profile can gate on this single boolean. egress_hosts then narrows the\n // host allowlist for profiles that DO permit egress.\n \"network_egress\"?: Boolean,\n \"egress_hosts\"?: Set<String>, // Host allowlist for egress, e.g. {\"pypi.org\"}\n \"exec_allowlist\"?: Set<String>, // Executables the sandbox may run, e.g. {\"python\", \"python3\"}\n // Curated mechanism toggles (ADR 0017 D1.3) \u2014 authorization facts only;\n // NEVER raw syscalls. Allowed members: \"sys:ptrace\", \"sys:bpf\",\n // \"sys:raw_socket\", \"dev:gpu\", \"virt:nested\".\n \"mechanism_capabilities\"?: Set<String>,\n };\n}\n";
|
|
7
7
|
/**
|
|
8
8
|
* AiGateway Cedar schema
|
|
9
9
|
*
|
|
@@ -315,6 +315,14 @@ namespace AgentOps {
|
|
|
315
315
|
"agent_framework"?: String,
|
|
316
316
|
"agent_publisher"?: String,
|
|
317
317
|
|
|
318
|
+
// Supply-chain / package safety + aggregate threat severity (optional —
|
|
319
|
+
// ADR 0012 unified port). Projected by Shield's malicious-package and
|
|
320
|
+
// threat-severity detectors; every read is \`has\`-guarded in policy.
|
|
321
|
+
"malicious_package_detected"?: Boolean,
|
|
322
|
+
"package_install_detected"?: Boolean,
|
|
323
|
+
"package_check_status"?: String,
|
|
324
|
+
"max_threat_severity"?: Long,
|
|
325
|
+
|
|
318
326
|
};
|
|
319
327
|
|
|
320
328
|
/// Context for call_tool action (agentic tool execution)
|
|
@@ -511,6 +519,14 @@ namespace AgentOps {
|
|
|
511
519
|
// File & Path (optional)
|
|
512
520
|
"path"?: String,
|
|
513
521
|
|
|
522
|
+
// Supply-chain / package safety + aggregate threat severity (optional —
|
|
523
|
+
// ADR 0012 unified port). Projected by Shield's malicious-package and
|
|
524
|
+
// threat-severity detectors; every read is \`has\`-guarded in policy.
|
|
525
|
+
"malicious_package_detected"?: Boolean,
|
|
526
|
+
"package_install_detected"?: Boolean,
|
|
527
|
+
"package_check_status"?: String,
|
|
528
|
+
"max_threat_severity"?: Long,
|
|
529
|
+
|
|
514
530
|
};
|
|
515
531
|
|
|
516
532
|
/// Context for read_file action
|
|
@@ -843,6 +859,14 @@ namespace AgentOps {
|
|
|
843
859
|
"agent_framework"?: String,
|
|
844
860
|
"agent_publisher"?: String,
|
|
845
861
|
|
|
862
|
+
// Supply-chain / package safety + aggregate threat severity (optional —
|
|
863
|
+
// ADR 0012 unified port). Projected by Shield's malicious-package and
|
|
864
|
+
// threat-severity detectors; every read is \`has\`-guarded in policy.
|
|
865
|
+
"malicious_package_detected"?: Boolean,
|
|
866
|
+
"package_install_detected"?: Boolean,
|
|
867
|
+
"package_check_status"?: String,
|
|
868
|
+
"max_threat_severity"?: Long,
|
|
869
|
+
|
|
846
870
|
};
|
|
847
871
|
|
|
848
872
|
/// Context for provision_sandbox action (Forge sandbox-create envelope).
|
|
@@ -3187,7 +3211,11 @@ export const AGENT_OPS_CONTEXT = {
|
|
|
3187
3211
|
{ "key": "flow_sink_effects", "type": "array", "required": false, "description": "Side effects the destination can exercise (ADR 0020), e.g. \'network.send\', \'financial.transfer\', \'filesystem.write\'. Enables \'untrusted content MUST NOT reach a financial.transfer sink\'. Set<String>." },
|
|
3188
3212
|
{ "key": "principal_clearances", "type": "array", "required": false, "description": "Clearances AuthN/ZeroID mints for the principal (ADR 0020 D8), e.g. \'restricted\', \'pii\'. Coarse scopes gate the capability; clearances gate which protected data that capability may touch. Set<String>." },
|
|
3189
3213
|
{ "key": "principal_compartments", "type": "array", "required": false, "description": "Compartments the principal is admitted to (ADR 0020 D8), e.g. \'tenant:acme\', \'customer:123\'. A flow into a compartment the principal lacks is deniable independent of confidentiality tier. Set<String>." },
|
|
3190
|
-
{ "key": "surface", "type": "string", "required": true, "description": "Origin surface of the request (ADR 0012 D14.2) — REQUIRED; projected by Shield from the ingress product, never user-supplied. Values are the product identifiers: \'guardrails\', \'overwatch\', \'ai_gateway\' (\'sentry\' joins at D17 phase 2). The \'Applies to\' narrowing target: test with an ordinary condition (context.surface == \'ai_gateway\'); no \'has\' guard needed because it is required. A policy with no surface condition applies to every surface, including ones added later." }
|
|
3214
|
+
{ "key": "surface", "type": "string", "required": true, "description": "Origin surface of the request (ADR 0012 D14.2) — REQUIRED; projected by Shield from the ingress product, never user-supplied. Values are the product identifiers: \'guardrails\', \'overwatch\', \'ai_gateway\' (\'sentry\' joins at D17 phase 2). The \'Applies to\' narrowing target: test with an ordinary condition (context.surface == \'ai_gateway\'); no \'has\' guard needed because it is required. A policy with no surface condition applies to every surface, including ones added later." },
|
|
3215
|
+
{ "key": "malicious_package_detected", "type": "boolean", "required": false, "description": "Whether a referenced package carries a known-malicious osv.dev (MAL-) advisory." },
|
|
3216
|
+
{ "key": "package_install_detected", "type": "boolean", "required": false, "description": "Whether the request installs or downloads a package (pip/npm/cargo/etc.)." },
|
|
3217
|
+
{ "key": "package_check_status", "type": "string", "required": false, "description": "Malicious-package lookup status: empty (ok) or degraded (OSV unavailable, fail-open)." },
|
|
3218
|
+
{ "key": "max_threat_severity", "type": "number", "required": false, "description": "Aggregate max threat severity across detectors (0=none,1=low,2=medium,3=high,4=critical)." }
|
|
3191
3219
|
]
|
|
3192
3220
|
},
|
|
3193
3221
|
{
|
|
@@ -3206,7 +3234,7 @@ export const AGENT_OPS_CONTEXT = {
|
|
|
3206
3234
|
{ "key": "cwd", "type": "string", "required": false, "description": "Current working directory" },
|
|
3207
3235
|
{ "key": "workspace_root", "type": "string", "required": false, "description": "IDE workspace root path" },
|
|
3208
3236
|
{ "key": "tool_name", "type": "string", "required": false, "description": "Name of the tool being called (e.g., \'shell\', \'write_file\', \'http_post\')" },
|
|
3209
|
-
{ "key": "tool_risk_score", "type": "number", "required": false, "description": "Computed risk score for this tool call (0-100)." },
|
|
3237
|
+
{ "key": "tool_risk_score", "type": "number", "required": false, "description": "Computed risk score for this tool call (0-100). Typical condition: tool_risk_score >= 86 (>= 71 for sensitive tools)." },
|
|
3210
3238
|
{ "key": "tool_is_sensitive", "type": "boolean", "required": false, "description": "Whether the tool is classified as sensitive" },
|
|
3211
3239
|
{ "key": "tool_category", "type": "string", "required": false, "description": "Tool classification: \'safe\', \'sensitive\', or \'dangerous\'" },
|
|
3212
3240
|
{ "key": "tool_is_builtin", "type": "boolean", "required": false, "description": "Whether the tool is a built-in tool (vs MCP external tool)" },
|
|
@@ -3262,7 +3290,7 @@ export const AGENT_OPS_CONTEXT = {
|
|
|
3262
3290
|
{ "key": "encoded_types", "type": "array", "required": false, "description": "Array of encoding types detected in tool arguments" },
|
|
3263
3291
|
{ "key": "encoded_count", "type": "number", "required": false, "description": "Number of encoded segments found in tool arguments" },
|
|
3264
3292
|
{ "key": "encoded_score", "type": "number", "required": false, "description": "Risk score for encoded injection in tool arguments (0-100)." },
|
|
3265
|
-
{ "key": "tool_operation_classes", "type": "array", "required": false, "description": "All operation classes observed in the tool call: \'readonly\', \'write_enabling\', \'execute_enabling\', \'network_access\', \'unknown\'" },
|
|
3293
|
+
{ "key": "tool_operation_classes", "type": "array", "required": false, "description": "All operation classes observed in the tool call, emitted by the AST command classifiers. Subset of: \'readonly\', \'write_enabling\', \'execute_enabling\', \'network_access\', \'unknown\'. A single command can carry several classes; combine with contains() to match shapes — e.g. tool_operation_classes.contains(\"network_access\") && tool_operation_classes.contains(\"execute_enabling\") catches download-and-run (curl | sh). \'unknown\' appears when any unrecognized or variable-expanded command was seen and should be treated as deny-worthy." },
|
|
3266
3294
|
{ "key": "path", "type": "string", "required": false, "description": "File path targeted by the tool call" },
|
|
3267
3295
|
{ "key": "conversation_turn", "type": "number", "required": false, "description": "Current conversation turn number" },
|
|
3268
3296
|
{ "key": "multi_turn_detection", "type": "boolean", "required": false, "description": "Whether multi-turn injection patterns were detected across tool calls" },
|
|
@@ -3306,7 +3334,11 @@ export const AGENT_OPS_CONTEXT = {
|
|
|
3306
3334
|
{ "key": "flow_sink_effects", "type": "array", "required": false, "description": "Side effects the destination can exercise (ADR 0020), e.g. \'network.send\', \'financial.transfer\', \'filesystem.write\'. Enables \'untrusted content MUST NOT reach a financial.transfer sink\'. Set<String>." },
|
|
3307
3335
|
{ "key": "principal_clearances", "type": "array", "required": false, "description": "Clearances AuthN/ZeroID mints for the principal (ADR 0020 D8), e.g. \'restricted\', \'pii\'. Coarse scopes gate the capability; clearances gate which protected data that capability may touch. Set<String>." },
|
|
3308
3336
|
{ "key": "principal_compartments", "type": "array", "required": false, "description": "Compartments the principal is admitted to (ADR 0020 D8), e.g. \'tenant:acme\', \'customer:123\'. A flow into a compartment the principal lacks is deniable independent of confidentiality tier. Set<String>." },
|
|
3309
|
-
{ "key": "surface", "type": "string", "required": true, "description": "Origin surface of the request (ADR 0012 D14.2) — REQUIRED; projected by Shield from the ingress product, never user-supplied. Values are the product identifiers: \'guardrails\', \'overwatch\', \'ai_gateway\' (\'sentry\' joins at D17 phase 2). The \'Applies to\' narrowing target: test with an ordinary condition (context.surface == \'ai_gateway\'); no \'has\' guard needed because it is required. A policy with no surface condition applies to every surface, including ones added later." }
|
|
3337
|
+
{ "key": "surface", "type": "string", "required": true, "description": "Origin surface of the request (ADR 0012 D14.2) — REQUIRED; projected by Shield from the ingress product, never user-supplied. Values are the product identifiers: \'guardrails\', \'overwatch\', \'ai_gateway\' (\'sentry\' joins at D17 phase 2). The \'Applies to\' narrowing target: test with an ordinary condition (context.surface == \'ai_gateway\'); no \'has\' guard needed because it is required. A policy with no surface condition applies to every surface, including ones added later." },
|
|
3338
|
+
{ "key": "malicious_package_detected", "type": "boolean", "required": false, "description": "Whether a referenced package carries a known-malicious osv.dev (MAL-) advisory." },
|
|
3339
|
+
{ "key": "package_install_detected", "type": "boolean", "required": false, "description": "Whether the request installs or downloads a package (pip/npm/cargo/etc.)." },
|
|
3340
|
+
{ "key": "package_check_status", "type": "string", "required": false, "description": "Malicious-package lookup status: empty (ok) or degraded (OSV unavailable, fail-open)." },
|
|
3341
|
+
{ "key": "max_threat_severity", "type": "number", "required": false, "description": "Aggregate max threat severity across detectors (0=none,1=low,2=medium,3=high,4=critical)." }
|
|
3310
3342
|
]
|
|
3311
3343
|
},
|
|
3312
3344
|
{
|
|
@@ -3511,7 +3543,11 @@ export const AGENT_OPS_CONTEXT = {
|
|
|
3511
3543
|
{ "key": "flow_sink_effects", "type": "array", "required": false, "description": "Side effects the destination can exercise (ADR 0020), e.g. \'network.send\', \'financial.transfer\', \'filesystem.write\'. Enables \'untrusted content MUST NOT reach a financial.transfer sink\'. Set<String>." },
|
|
3512
3544
|
{ "key": "principal_clearances", "type": "array", "required": false, "description": "Clearances AuthN/ZeroID mints for the principal (ADR 0020 D8), e.g. \'restricted\', \'pii\'. Coarse scopes gate the capability; clearances gate which protected data that capability may touch. Set<String>." },
|
|
3513
3545
|
{ "key": "principal_compartments", "type": "array", "required": false, "description": "Compartments the principal is admitted to (ADR 0020 D8), e.g. \'tenant:acme\', \'customer:123\'. A flow into a compartment the principal lacks is deniable independent of confidentiality tier. Set<String>." },
|
|
3514
|
-
{ "key": "surface", "type": "string", "required": true, "description": "Origin surface of the request (ADR 0012 D14.2) — REQUIRED; projected by Shield from the ingress product, never user-supplied. Values are the product identifiers: \'guardrails\', \'overwatch\', \'ai_gateway\' (\'sentry\' joins at D17 phase 2). The \'Applies to\' narrowing target: test with an ordinary condition (context.surface == \'ai_gateway\'); no \'has\' guard needed because it is required. A policy with no surface condition applies to every surface, including ones added later." }
|
|
3546
|
+
{ "key": "surface", "type": "string", "required": true, "description": "Origin surface of the request (ADR 0012 D14.2) — REQUIRED; projected by Shield from the ingress product, never user-supplied. Values are the product identifiers: \'guardrails\', \'overwatch\', \'ai_gateway\' (\'sentry\' joins at D17 phase 2). The \'Applies to\' narrowing target: test with an ordinary condition (context.surface == \'ai_gateway\'); no \'has\' guard needed because it is required. A policy with no surface condition applies to every surface, including ones added later." },
|
|
3547
|
+
{ "key": "malicious_package_detected", "type": "boolean", "required": false, "description": "Whether a referenced package carries a known-malicious osv.dev (MAL-) advisory." },
|
|
3548
|
+
{ "key": "package_install_detected", "type": "boolean", "required": false, "description": "Whether the request installs or downloads a package (pip/npm/cargo/etc.)." },
|
|
3549
|
+
{ "key": "package_check_status", "type": "string", "required": false, "description": "Malicious-package lookup status: empty (ok) or degraded (OSV unavailable, fail-open)." },
|
|
3550
|
+
{ "key": "max_threat_severity", "type": "number", "required": false, "description": "Aggregate max threat severity across detectors (0=none,1=low,2=medium,3=high,4=critical)." }
|
|
3515
3551
|
]
|
|
3516
3552
|
},
|
|
3517
3553
|
{
|
|
@@ -3572,11 +3608,11 @@ export const AI_GATEWAY_CONTEXT = {
|
|
|
3572
3608
|
{ "key": "rug_pull_score", "type": "number", "required": false, "description": "Rug pull risk score (0-100)" },
|
|
3573
3609
|
{ "key": "rug_pull_detected", "type": "boolean", "required": false, "description": "Rug pull detected flag" },
|
|
3574
3610
|
{ "key": "indirect_injection_score", "type": "number", "required": false, "description": "Indirect injection score (0-100)" },
|
|
3575
|
-
{ "key": "tool_risk_score", "type": "number", "required": false, "description": "Computed tool risk (0-100)" },
|
|
3611
|
+
{ "key": "tool_risk_score", "type": "number", "required": false, "description": "Computed tool risk (0-100). Typical condition: tool_risk_score >= 86 (>= 71 for sensitive tools)" },
|
|
3576
3612
|
{ "key": "tool_category", "type": "string", "required": false, "description": "Tool category: safe/sensitive/dangerous" },
|
|
3577
3613
|
{ "key": "tool_is_sensitive", "type": "boolean", "required": false, "description": "Tool sensitivity flag" },
|
|
3578
3614
|
{ "key": "tool_is_builtin", "type": "boolean", "required": false, "description": "Built-in tool flag" },
|
|
3579
|
-
{ "key": "tool_operation_classes", "type": "array", "required": false, "description": "All operation classes observed in the tool call. Subset of: \'readonly\', \'write_enabling\', \'execute_enabling\', \'network_access\', \'unknown\'. \'unknown\' appears when any unrecognized or variable-expanded command was seen." },
|
|
3615
|
+
{ "key": "tool_operation_classes", "type": "array", "required": false, "description": "All operation classes observed in the tool call, emitted by the AST command classifiers. Subset of: \'readonly\', \'write_enabling\', \'execute_enabling\', \'network_access\', \'unknown\'. A single command can carry several classes; combine with contains() to match shapes — e.g. tool_operation_classes.contains(\"network_access\") && tool_operation_classes.contains(\"execute_enabling\") catches download-and-run (curl | sh). \'unknown\' appears when any unrecognized or variable-expanded command was seen and should be treated as deny-worthy." },
|
|
3580
3616
|
{ "key": "mcp_server_verified", "type": "boolean", "required": false, "description": "Whether server is from verified registry" },
|
|
3581
3617
|
{ "key": "violence_score", "type": "number", "required": false, "description": "Violence content score (0-100)" },
|
|
3582
3618
|
{ "key": "weapons_score", "type": "number", "required": false, "description": "Weapons content score (0-100)" },
|
|
@@ -3937,7 +3973,7 @@ export const GUARDRAILS_CONTEXT = {
|
|
|
3937
3973
|
{ "key": "request_id", "type": "string", "required": true, "description": "Unique identifier for this request" },
|
|
3938
3974
|
{ "key": "timestamp", "type": "number", "required": true, "description": "Unix timestamp in milliseconds" },
|
|
3939
3975
|
{ "key": "tool_name", "type": "string", "required": false, "description": "Name of the tool being called (e.g., \'shell\', \'write_file\', \'http_post\'). Use this to block specific dangerous tools" },
|
|
3940
|
-
{ "key": "tool_risk_score", "type": "number", "required": false, "description": "Computed risk score for this tool call (0-100). Considers tool sensitivity, argument patterns, and MCP verification status. Typical
|
|
3976
|
+
{ "key": "tool_risk_score", "type": "number", "required": false, "description": "Computed risk score for this tool call (0-100). Considers tool sensitivity, argument patterns, and MCP verification status. Typical condition: tool_risk_score >= 86 (used by the Tool Risk template; >= 71 for sensitive tools)." },
|
|
3941
3977
|
{ "key": "tool_is_sensitive", "type": "boolean", "required": false, "description": "Whether the tool is classified as sensitive (shell, file operations, network access, etc.)" },
|
|
3942
3978
|
{ "key": "tool_category", "type": "string", "required": false, "description": "Tool classification: \'safe\', \'sensitive\', or \'dangerous\'. Based on tool type and argument patterns" },
|
|
3943
3979
|
{ "key": "tool_is_builtin", "type": "boolean", "required": false, "description": "Whether the tool is a built-in tool (vs MCP external tool). Built-in tools are generally more trusted" },
|
|
@@ -3987,7 +4023,7 @@ export const GUARDRAILS_CONTEXT = {
|
|
|
3987
4023
|
{ "key": "mcp_config_risk", "type": "boolean", "required": false, "description": "Whether MCP configuration risk was detected (inline code execution, suspicious URLs, cross-origin issues)" },
|
|
3988
4024
|
{ "key": "mcp_risk_type", "type": "string", "required": false, "description": "Type of MCP risk: \'inline_execution\', \'suspicious_url\', or \'cross_origin\'" },
|
|
3989
4025
|
{ "key": "mcp_risk_score", "type": "number", "required": false, "description": "Risk score for MCP configuration issues (0-100). Typical threshold: >=70 for blocks" },
|
|
3990
|
-
{ "key": "tool_operation_classes", "type": "array", "required": false, "description": "All operation classes observed in the tool call. Subset of: \'readonly\', \'write_enabling\', \'execute_enabling\', \'network_access\', \'unknown\'. \'unknown\' appears when any unrecognized or variable-expanded command was seen." },
|
|
4026
|
+
{ "key": "tool_operation_classes", "type": "array", "required": false, "description": "All operation classes observed in the tool call, emitted by the AST command classifiers. Subset of: \'readonly\', \'write_enabling\', \'execute_enabling\', \'network_access\', \'unknown\'. A single command can carry several classes; combine with contains() to match shapes — e.g. tool_operation_classes.contains(\"network_access\") && tool_operation_classes.contains(\"execute_enabling\") catches download-and-run (curl | sh). \'unknown\' appears when any unrecognized or variable-expanded command was seen and should be treated as deny-worthy." },
|
|
3991
4027
|
{ "key": "cross_origin_detected", "type": "boolean", "required": false, "description": "Whether cross-origin escalation patterns were detected in tool calls crossing trust boundaries" },
|
|
3992
4028
|
{ "key": "cross_origin_type", "type": "string", "required": false, "description": "Type of cross-origin escalation detected in tool call" },
|
|
3993
4029
|
{ "key": "cross_origin_score", "type": "number", "required": false, "description": "Risk score for cross-origin escalation in tool calls (0-100)" },
|
|
@@ -4295,7 +4331,7 @@ export const OVERWATCH_CONTEXT = {
|
|
|
4295
4331
|
{ "key": "rug_pull_score", "type": "number", "required": false, "description": "Tool behavioral drift score (0-100) — deviation from established tool behavior patterns" },
|
|
4296
4332
|
{ "key": "rug_pull_detected", "type": "boolean", "required": false, "description": "Whether a rug pull attack was explicitly detected" },
|
|
4297
4333
|
{ "key": "indirect_injection_score", "type": "number", "required": false, "description": "Indirect prompt injection risk score (0-100) — injection via tool outputs" },
|
|
4298
|
-
{ "key": "tool_risk_score", "type": "number", "required": false, "description": "Computed tool risk score (0-100) combining tool type, arguments, and context" },
|
|
4334
|
+
{ "key": "tool_risk_score", "type": "number", "required": false, "description": "Computed tool risk score (0-100) combining tool type, arguments, and context. Typical condition: tool_risk_score >= 86 (>= 71 for sensitive tools)" },
|
|
4299
4335
|
{ "key": "tool_category", "type": "string", "required": false, "description": "Tool risk classification: safe, sensitive, dangerous" },
|
|
4300
4336
|
{ "key": "tool_is_sensitive", "type": "boolean", "required": false, "description": "Whether the tool is classified as sensitive (shell, file write, network)" },
|
|
4301
4337
|
{ "key": "tool_is_builtin", "type": "boolean", "required": false, "description": "Whether the tool is a built-in IDE tool (true) or MCP tool (false)" },
|
|
@@ -4303,10 +4339,10 @@ export const OVERWATCH_CONTEXT = {
|
|
|
4303
4339
|
{ "key": "loop_count", "type": "number", "required": false, "description": "Number of consecutive calls to the same tool" },
|
|
4304
4340
|
{ "key": "loop_tool", "type": "string", "required": false, "description": "The tool name involved in the detected loop" },
|
|
4305
4341
|
{ "key": "suspicious_pattern", "type": "boolean", "required": false, "description": "Whether a suspicious action sequence was detected (exfiltration, theft, destructive)" },
|
|
4306
|
-
{ "key": "pattern_type", "type": "string", "required": false, "description": "Type of suspicious pattern: data_exfiltration, secret_exfiltration, credential_theft, destructive_sequence" },
|
|
4342
|
+
{ "key": "pattern_type", "type": "string", "required": false, "description": "Type of suspicious pattern: data_exfiltration, secret_exfiltration, db_exfiltration, credential_theft, destructive_sequence" },
|
|
4307
4343
|
{ "key": "sequence_risk", "type": "number", "required": false, "description": "Behavioral sequence risk score (0-100)" },
|
|
4308
4344
|
{ "key": "mcp_server_verified", "type": "boolean", "required": false, "description": "Whether the MCP server is from a verified registry" },
|
|
4309
|
-
{ "key": "tool_operation_classes", "type": "array", "required": false, "description": "All operation classes observed in the tool call. Subset of: \'readonly\', \'write_enabling\', \'execute_enabling\', \'network_access\', \'unknown\'. \'unknown\' appears when any unrecognized or variable-expanded command was seen." },
|
|
4345
|
+
{ "key": "tool_operation_classes", "type": "array", "required": false, "description": "All operation classes observed in the tool call, emitted by the AST command classifiers. Subset of: \'readonly\', \'write_enabling\', \'execute_enabling\', \'network_access\', \'unknown\'. A single command can carry several classes; combine with contains() to match shapes — e.g. tool_operation_classes.contains(\"network_access\") && tool_operation_classes.contains(\"execute_enabling\") catches download-and-run (curl | sh). Used by the Bash Operation Classes template. \'unknown\' appears when any unrecognized or variable-expanded command was seen and should be treated as deny-worthy." },
|
|
4310
4346
|
{ "key": "package_install_detected", "type": "boolean", "required": false, "description": "True iff a package install/download command was recognized in the tool call arguments." },
|
|
4311
4347
|
{ "key": "malicious_package_detected", "type": "boolean", "required": false, "description": "True iff any referenced package has a known-malicious (MAL-) OSV advisory." },
|
|
4312
4348
|
{ "key": "malicious_package_score", "type": "number", "required": false, "description": "100 when a malicious package was detected, 0 otherwise." },
|