@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
|
@@ -297,6 +297,14 @@ namespace AgentOps {
|
|
|
297
297
|
"agent_framework"?: String,
|
|
298
298
|
"agent_publisher"?: String,
|
|
299
299
|
|
|
300
|
+
// Supply-chain / package safety + aggregate threat severity (optional —
|
|
301
|
+
// ADR 0012 unified port). Projected by Shield's malicious-package and
|
|
302
|
+
// threat-severity detectors; every read is `has`-guarded in policy.
|
|
303
|
+
"malicious_package_detected"?: Boolean,
|
|
304
|
+
"package_install_detected"?: Boolean,
|
|
305
|
+
"package_check_status"?: String,
|
|
306
|
+
"max_threat_severity"?: Long,
|
|
307
|
+
|
|
300
308
|
};
|
|
301
309
|
|
|
302
310
|
/// Context for call_tool action (agentic tool execution)
|
|
@@ -493,6 +501,14 @@ namespace AgentOps {
|
|
|
493
501
|
// File & Path (optional)
|
|
494
502
|
"path"?: String,
|
|
495
503
|
|
|
504
|
+
// Supply-chain / package safety + aggregate threat severity (optional —
|
|
505
|
+
// ADR 0012 unified port). Projected by Shield's malicious-package and
|
|
506
|
+
// threat-severity detectors; every read is `has`-guarded in policy.
|
|
507
|
+
"malicious_package_detected"?: Boolean,
|
|
508
|
+
"package_install_detected"?: Boolean,
|
|
509
|
+
"package_check_status"?: String,
|
|
510
|
+
"max_threat_severity"?: Long,
|
|
511
|
+
|
|
496
512
|
};
|
|
497
513
|
|
|
498
514
|
/// Context for read_file action
|
|
@@ -825,6 +841,14 @@ namespace AgentOps {
|
|
|
825
841
|
"agent_framework"?: String,
|
|
826
842
|
"agent_publisher"?: String,
|
|
827
843
|
|
|
844
|
+
// Supply-chain / package safety + aggregate threat severity (optional —
|
|
845
|
+
// ADR 0012 unified port). Projected by Shield's malicious-package and
|
|
846
|
+
// threat-severity detectors; every read is `has`-guarded in policy.
|
|
847
|
+
"malicious_package_detected"?: Boolean,
|
|
848
|
+
"package_install_detected"?: Boolean,
|
|
849
|
+
"package_check_status"?: String,
|
|
850
|
+
"max_threat_severity"?: Long,
|
|
851
|
+
|
|
828
852
|
};
|
|
829
853
|
|
|
830
854
|
/// Context for provision_sandbox action (Forge sandbox-create envelope).
|
package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_cross_origin.cedar
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// A2A Security — Cross-Origin Trust Boundary Enforcement
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Detects and blocks confused-deputy attacks where an agent from one trust
|
|
5
|
+
// domain attempts to operate in another. Primary signal in A2A
|
|
6
|
+
// communication where independent agents cross separate trust domains.
|
|
7
|
+
//
|
|
8
|
+
// Shield cross-origin detector scores (discrete):
|
|
9
|
+
// 90 mixed localhost + external | 85 URL injection | 80 proxy/redirect
|
|
10
|
+
// 75 multi-origin tool configs | 70 mixed HTTP/HTTPS | 65 JSON multi-URL
|
|
11
|
+
// 60 generic multi-domain patterns
|
|
12
|
+
//
|
|
13
|
+
// Context keys consumed:
|
|
14
|
+
// - cross_origin_detected, cross_origin_score
|
|
15
|
+
// - agent_id, agent_trust_level
|
|
16
|
+
// - tool_is_sensitive
|
|
17
|
+
//
|
|
18
|
+
// Compliance:
|
|
19
|
+
// - OWASP LLM08, OWASP ASI03; NIST 800-53 AC-4
|
|
20
|
+
//
|
|
21
|
+
// Category: agent-identity
|
|
22
|
+
// Namespace: AgentOps
|
|
23
|
+
// =============================================================================
|
|
24
|
+
|
|
25
|
+
@id("agent-identity.a2a-block-cross-origin-critical")
|
|
26
|
+
@name("Block critical cross-origin from any agent")
|
|
27
|
+
@description("Blocks process_prompt and call_tool when cross_origin_detected is true and cross_origin_score >= 80.")
|
|
28
|
+
@severity("critical")
|
|
29
|
+
@tags("category:agent-identity,threat:supply-chain,detection:ml,owasp:llm08")
|
|
30
|
+
@reject_message("Request blocked: high-confidence cross-origin trust-boundary violation detected — confused-deputy attack.")
|
|
31
|
+
forbid (
|
|
32
|
+
principal is AgentOps::Agent,
|
|
33
|
+
action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool"],
|
|
34
|
+
resource
|
|
35
|
+
)
|
|
36
|
+
when {
|
|
37
|
+
context has agent_id && context.agent_id != "" &&
|
|
38
|
+
context has cross_origin_detected && context.cross_origin_detected == true &&
|
|
39
|
+
context has cross_origin_score && context.cross_origin_score >= 80
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
@id("agent-identity.a2a-block-cross-origin-unverified")
|
|
43
|
+
@name("Block cross-origin from unverified agents")
|
|
44
|
+
@description("Blocks process_prompt and call_tool when agent_trust_level is \"unverified\", cross_origin_detected is true, and cross_origin_score >= 60.")
|
|
45
|
+
@severity("high")
|
|
46
|
+
@tags("category:agent-identity,threat:supply-chain,scope:per-agent,detection:ml,owasp:asi03")
|
|
47
|
+
@reject_message("Request blocked: unverified agent attempted cross-origin activity — no trust attestation across trust domains.")
|
|
48
|
+
forbid (
|
|
49
|
+
principal is AgentOps::Agent,
|
|
50
|
+
action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool"],
|
|
51
|
+
resource
|
|
52
|
+
)
|
|
53
|
+
when {
|
|
54
|
+
context has agent_trust_level && context.agent_trust_level == "unverified" &&
|
|
55
|
+
context has cross_origin_detected && context.cross_origin_detected == true &&
|
|
56
|
+
context has cross_origin_score && context.cross_origin_score >= 60
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
@id("agent-identity.a2a-block-cross-origin-server-connect")
|
|
60
|
+
@name("Block cross-origin MCP server connections")
|
|
61
|
+
@description("Blocks connect_server when agent_trust_level is not \"first_party\", cross_origin_detected is true, and cross_origin_score >= 65.")
|
|
62
|
+
@severity("critical")
|
|
63
|
+
@tags("category:agent-identity,threat:supply-chain,scope:per-agent,detection:ml,surface:connect-server")
|
|
64
|
+
@reject_message("MCP server connection blocked: non-first-party agent crossed trust boundaries during connection — supply-chain risk.")
|
|
65
|
+
forbid (
|
|
66
|
+
principal is AgentOps::Agent,
|
|
67
|
+
action == AgentOps::Action::"connect_server",
|
|
68
|
+
resource
|
|
69
|
+
)
|
|
70
|
+
when {
|
|
71
|
+
context has agent_trust_level && context.agent_trust_level != "first_party" &&
|
|
72
|
+
context has cross_origin_detected && context.cross_origin_detected == true &&
|
|
73
|
+
context has cross_origin_score && context.cross_origin_score >= 65
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
@id("agent-identity.a2a-block-cross-origin-sensitive-tools")
|
|
77
|
+
@name("Block cross-origin on sensitive tools")
|
|
78
|
+
@description("Blocks call_tool when cross_origin_detected is true, cross_origin_score >= 60, and tool_is_sensitive is true.")
|
|
79
|
+
@severity("high")
|
|
80
|
+
@tags("category:agent-identity,threat:supply-chain,detection:ml,surface:call-tool,owasp:llm08")
|
|
81
|
+
@reject_message("Sensitive tool execution blocked: cross-origin signal present — sensitive tools amplify confused-deputy impact.")
|
|
82
|
+
forbid (
|
|
83
|
+
principal is AgentOps::Agent,
|
|
84
|
+
action == AgentOps::Action::"call_tool",
|
|
85
|
+
resource
|
|
86
|
+
)
|
|
87
|
+
when {
|
|
88
|
+
context has agent_id && context.agent_id != "" &&
|
|
89
|
+
context has cross_origin_detected && context.cross_origin_detected == true &&
|
|
90
|
+
context has cross_origin_score && context.cross_origin_score >= 60 &&
|
|
91
|
+
context has tool_is_sensitive && context.tool_is_sensitive == true
|
|
92
|
+
};
|
package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_escalation.cedar
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// A2A Security — Escalation Detection & Circuit Breakers
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Detects progressive capability escalation across agent turns. Lower
|
|
5
|
+
// circuit-breaker thresholds than the multi-agent profile because A2A
|
|
6
|
+
// communication spans separate trust domains with no shared orchestrator
|
|
7
|
+
// to reset session state.
|
|
8
|
+
//
|
|
9
|
+
// Context keys consumed:
|
|
10
|
+
// - agent_trust_level
|
|
11
|
+
// - session_max_injection_score, session_max_jailbreak_score: Long (0-100)
|
|
12
|
+
// - session_cumulative_risk_score: Long
|
|
13
|
+
// - session_threat_turns: Long
|
|
14
|
+
// - tool_is_sensitive: Bool
|
|
15
|
+
//
|
|
16
|
+
// Compliance:
|
|
17
|
+
// - OWASP LLM01 (multi-turn); MITRE ATLAS AML.T0051
|
|
18
|
+
// - NIST 800-53 SI-4, IR-4
|
|
19
|
+
//
|
|
20
|
+
// Category: agent-identity
|
|
21
|
+
// Namespace: AgentOps
|
|
22
|
+
// =============================================================================
|
|
23
|
+
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// Section 1: Session peak score monitoring
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
@id("agent-identity.a2a-block-session-injection-peak")
|
|
29
|
+
@name("Block agents at high session injection peak")
|
|
30
|
+
@description("Blocks call_tool and process_prompt when agent_trust_level is not \"first_party\" and session_max_injection_score >= 70.")
|
|
31
|
+
@severity("critical")
|
|
32
|
+
@tags("category:agent-identity,threat:injection,scope:per-agent,detection:aggregate,owasp:llm01")
|
|
33
|
+
@reject_message("Request blocked: this session previously crossed the injection peak threshold; non-first-party agents are restricted.")
|
|
34
|
+
forbid (
|
|
35
|
+
principal is AgentOps::Agent,
|
|
36
|
+
action in [AgentOps::Action::"call_tool", AgentOps::Action::"process_prompt"],
|
|
37
|
+
resource
|
|
38
|
+
)
|
|
39
|
+
when {
|
|
40
|
+
context has agent_trust_level && context.agent_trust_level != "first_party" &&
|
|
41
|
+
context has session_max_injection_score && context.session_max_injection_score >= 70
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
@id("agent-identity.a2a-block-session-jailbreak-peak")
|
|
45
|
+
@name("Block agents at high session jailbreak peak")
|
|
46
|
+
@description("Blocks process_prompt when agent_trust_level is not \"first_party\" and session_max_jailbreak_score >= 70.")
|
|
47
|
+
@severity("critical")
|
|
48
|
+
@tags("category:agent-identity,threat:jailbreak,scope:per-agent,detection:aggregate,owasp:llm02")
|
|
49
|
+
@reject_message("Request blocked: this session previously crossed the jailbreak peak threshold; non-first-party agents are restricted.")
|
|
50
|
+
forbid (
|
|
51
|
+
principal is AgentOps::Agent,
|
|
52
|
+
action == AgentOps::Action::"process_prompt",
|
|
53
|
+
resource
|
|
54
|
+
)
|
|
55
|
+
when {
|
|
56
|
+
context has agent_trust_level && context.agent_trust_level != "first_party" &&
|
|
57
|
+
context has session_max_jailbreak_score && context.session_max_jailbreak_score >= 70
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
// Section 2: Cumulative risk circuit breaker
|
|
62
|
+
// ---------------------------------------------------------------------------
|
|
63
|
+
|
|
64
|
+
@id("agent-identity.a2a-cumulative-risk-lockdown")
|
|
65
|
+
@name("Block non-first-party agents at cumulative risk")
|
|
66
|
+
@description("Blocks call_tool when agent_trust_level is not \"first_party\", session_cumulative_risk_score >= 151, and tool_is_sensitive is true.")
|
|
67
|
+
@severity("high")
|
|
68
|
+
@tags("category:agent-identity,scope:per-agent,detection:aggregate,surface:call-tool,posture:catch-all")
|
|
69
|
+
@reject_message("Tool execution blocked: cumulative session risk exceeded the A2A circuit-breaker threshold for sensitive tools.")
|
|
70
|
+
forbid (
|
|
71
|
+
principal is AgentOps::Agent,
|
|
72
|
+
action == AgentOps::Action::"call_tool",
|
|
73
|
+
resource
|
|
74
|
+
)
|
|
75
|
+
when {
|
|
76
|
+
context has agent_trust_level && context.agent_trust_level != "first_party" &&
|
|
77
|
+
context has session_cumulative_risk_score && context.session_cumulative_risk_score >= 151 &&
|
|
78
|
+
context has tool_is_sensitive && context.tool_is_sensitive == true
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
// Section 3: Threat turn escalation
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
|
|
85
|
+
@id("agent-identity.a2a-threat-turn-escalation")
|
|
86
|
+
@name("Block unverified agents after repeated threat turns")
|
|
87
|
+
@description("Blocks call_tool when agent_trust_level is \"unverified\" and session_threat_turns >= 3.")
|
|
88
|
+
@severity("critical")
|
|
89
|
+
@tags("category:agent-identity,scope:per-agent,detection:aggregate,surface:call-tool,posture:catch-all")
|
|
90
|
+
@reject_message("Tool execution blocked: 3+ threat turns in this session — unverified agents are locked out to stop adversarial probing.")
|
|
91
|
+
forbid (
|
|
92
|
+
principal is AgentOps::Agent,
|
|
93
|
+
action == AgentOps::Action::"call_tool",
|
|
94
|
+
resource
|
|
95
|
+
)
|
|
96
|
+
when {
|
|
97
|
+
context has agent_trust_level && context.agent_trust_level == "unverified" &&
|
|
98
|
+
context has session_threat_turns && context.session_threat_turns >= 3
|
|
99
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// A2A Security — Agent Identity Enforcement
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Enforces strict identity requirements for cross-system agent communication:
|
|
5
|
+
// blocks anonymous agents, requires framework registration for sensitive
|
|
6
|
+
// operations, restricts server connections, and unconditionally blocks the
|
|
7
|
+
// most dangerous combination — autonomous + unverified.
|
|
8
|
+
//
|
|
9
|
+
// Context keys consumed:
|
|
10
|
+
// - agent_id, agent_type, agent_trust_level, agent_framework
|
|
11
|
+
// - tool_is_sensitive: Bool
|
|
12
|
+
//
|
|
13
|
+
// Compliance:
|
|
14
|
+
// - OWASP ASI05 (Identity Spoofing); NIST 800-63
|
|
15
|
+
// - NIST 800-53 IA-2, IA-8
|
|
16
|
+
//
|
|
17
|
+
// Category: agent-identity
|
|
18
|
+
// Namespace: AgentOps
|
|
19
|
+
// =============================================================================
|
|
20
|
+
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
// Section 1: Anonymous agents
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
|
|
25
|
+
@id("agent-identity.a2a-block-anonymous-agents")
|
|
26
|
+
@name("Block anonymous agents from tools")
|
|
27
|
+
@description("Blocks call_tool when agent_id is empty, agent_type is non-empty, and agent_type is not \"human_proxy\".")
|
|
28
|
+
@severity("critical")
|
|
29
|
+
@tags("category:agent-identity,threat:spoofing,scope:per-agent,detection:rule,surface:call-tool,owasp:asi04")
|
|
30
|
+
@reject_message("Tool execution blocked: agent declares a type but no agent ID — improperly configured or spoofed identity.")
|
|
31
|
+
forbid (
|
|
32
|
+
principal is AgentOps::Agent,
|
|
33
|
+
action == AgentOps::Action::"call_tool",
|
|
34
|
+
resource
|
|
35
|
+
)
|
|
36
|
+
when {
|
|
37
|
+
context has agent_id && context.agent_id == "" &&
|
|
38
|
+
context has agent_type && context.agent_type != "" &&
|
|
39
|
+
context.agent_type != "human_proxy"
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
// Section 2: Framework registration
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
|
|
46
|
+
@id("agent-identity.a2a-block-unregistered-framework")
|
|
47
|
+
@name("Block unregistered frameworks from sensitive tools")
|
|
48
|
+
@description("Blocks call_tool when agent_framework is empty, agent_trust_level is \"unverified\", and tool_is_sensitive is true.")
|
|
49
|
+
@severity("high")
|
|
50
|
+
@tags("category:agent-identity,scope:per-agent,detection:rule,surface:call-tool")
|
|
51
|
+
@reject_message("Sensitive tool execution blocked: unverified agent with no registered framework — black-box integration cannot be trusted.")
|
|
52
|
+
forbid (
|
|
53
|
+
principal is AgentOps::Agent,
|
|
54
|
+
action == AgentOps::Action::"call_tool",
|
|
55
|
+
resource
|
|
56
|
+
)
|
|
57
|
+
when {
|
|
58
|
+
context has agent_framework && context.agent_framework == "" &&
|
|
59
|
+
context has agent_trust_level && context.agent_trust_level == "unverified" &&
|
|
60
|
+
context has tool_is_sensitive && context.tool_is_sensitive == true
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
// Section 3: MCP server connections
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
|
|
67
|
+
@id("agent-identity.a2a-block-unverified-server-connect")
|
|
68
|
+
@name("Block unverified agents from server connections")
|
|
69
|
+
@description("Blocks connect_server when agent_trust_level is \"unverified\" and agent_id is non-empty.")
|
|
70
|
+
@severity("high")
|
|
71
|
+
@tags("category:agent-identity,threat:supply-chain,scope:per-agent,detection:rule,surface:connect-server")
|
|
72
|
+
@reject_message("MCP server connection blocked: unverified agents cannot establish new server connections in A2A mode.")
|
|
73
|
+
forbid (
|
|
74
|
+
principal is AgentOps::Agent,
|
|
75
|
+
action == AgentOps::Action::"connect_server",
|
|
76
|
+
resource
|
|
77
|
+
)
|
|
78
|
+
when {
|
|
79
|
+
context has agent_trust_level && context.agent_trust_level == "unverified" &&
|
|
80
|
+
context has agent_id && context.agent_id != ""
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
// Section 4: Maximum-risk combination
|
|
85
|
+
// ---------------------------------------------------------------------------
|
|
86
|
+
|
|
87
|
+
@id("agent-identity.a2a-block-autonomous-unverified")
|
|
88
|
+
@name("Block autonomous unverified agents")
|
|
89
|
+
@description("Blocks call_tool when agent_type is \"autonomous\" and agent_trust_level is \"unverified\".")
|
|
90
|
+
@severity("critical")
|
|
91
|
+
@tags("category:agent-identity,scope:per-agent,detection:rule,surface:call-tool,owasp:asi04")
|
|
92
|
+
@reject_message("Tool execution blocked: autonomous + unverified is the maximum-risk agent configuration and is not permitted.")
|
|
93
|
+
forbid (
|
|
94
|
+
principal is AgentOps::Agent,
|
|
95
|
+
action == AgentOps::Action::"call_tool",
|
|
96
|
+
resource
|
|
97
|
+
)
|
|
98
|
+
when {
|
|
99
|
+
context has agent_type && context.agent_type == "autonomous" &&
|
|
100
|
+
context has agent_trust_level && context.agent_trust_level == "unverified"
|
|
101
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// A2A Security — Inter-Agent Injection Defence
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Detects and blocks prompt injection that travels between independent
|
|
5
|
+
// agents: indirect injection via tool outputs, multi-turn progressive
|
|
6
|
+
// attacks tracked by a GRU deep-context detector, and encoded-payload
|
|
7
|
+
// delivery (base64, hex, hash content).
|
|
8
|
+
//
|
|
9
|
+
// Context keys consumed:
|
|
10
|
+
// - agent_id, agent_trust_level
|
|
11
|
+
// - indirect_injection_score: Long (0-100)
|
|
12
|
+
// - tool_is_sensitive: Bool
|
|
13
|
+
// - multi_turn_detection: Bool
|
|
14
|
+
// - injection_deep_context_score, jailbreak_deep_context_score: Long
|
|
15
|
+
// - encoded_content_detected: Bool
|
|
16
|
+
// - encoded_score: Long
|
|
17
|
+
//
|
|
18
|
+
// Compliance:
|
|
19
|
+
// - OWASP LLM01 (indirect), OWASP ASI01
|
|
20
|
+
// - MITRE ATLAS AML.T0051; NIST 800-53 SI-10
|
|
21
|
+
//
|
|
22
|
+
// Category: agent-identity
|
|
23
|
+
// Namespace: AgentOps
|
|
24
|
+
// =============================================================================
|
|
25
|
+
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// Section 1: Indirect injection
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
|
|
30
|
+
@id("agent-identity.a2a-block-indirect-injection")
|
|
31
|
+
@name("Block indirect injection from agent tool calls")
|
|
32
|
+
@description("Blocks call_tool when agent_id is non-empty and indirect_injection_score >= 60.")
|
|
33
|
+
@severity("critical")
|
|
34
|
+
@tags("category:agent-identity,threat:indirect-injection,detection:ml,surface:call-tool,owasp:llm01")
|
|
35
|
+
@reject_message("Tool execution blocked: indirect prompt injection detected in agent-received content — primary A2A attack vector.")
|
|
36
|
+
forbid (
|
|
37
|
+
principal is AgentOps::Agent,
|
|
38
|
+
action == AgentOps::Action::"call_tool",
|
|
39
|
+
resource
|
|
40
|
+
)
|
|
41
|
+
when {
|
|
42
|
+
context has agent_id && context.agent_id != "" &&
|
|
43
|
+
context has indirect_injection_score && context.indirect_injection_score >= 60
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
@id("agent-identity.a2a-block-indirect-injection-sensitive")
|
|
47
|
+
@name("Block indirect injection on sensitive tools (A2A)")
|
|
48
|
+
@description("Blocks call_tool when agent_id is non-empty, indirect_injection_score >= 40, and tool_is_sensitive is true.")
|
|
49
|
+
@severity("critical")
|
|
50
|
+
@tags("category:agent-identity,threat:indirect-injection,detection:ml,surface:call-tool,owasp:asi01")
|
|
51
|
+
@reject_message("Sensitive tool execution blocked: moderate indirect-injection risk in agent content — sensitive tools amplify damage.")
|
|
52
|
+
forbid (
|
|
53
|
+
principal is AgentOps::Agent,
|
|
54
|
+
action == AgentOps::Action::"call_tool",
|
|
55
|
+
resource
|
|
56
|
+
)
|
|
57
|
+
when {
|
|
58
|
+
context has agent_id && context.agent_id != "" &&
|
|
59
|
+
context has indirect_injection_score && context.indirect_injection_score >= 40 &&
|
|
60
|
+
context has tool_is_sensitive && context.tool_is_sensitive == true
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// ---------------------------------------------------------------------------
|
|
64
|
+
// Section 2: Multi-turn progressive attacks
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
|
|
67
|
+
@id("agent-identity.a2a-block-deep-context-injection")
|
|
68
|
+
@name("Block multi-turn progressive injection")
|
|
69
|
+
@description("Blocks process_prompt when agent_trust_level is not \"first_party\", multi_turn_detection is true, and injection_deep_context_score >= 60.")
|
|
70
|
+
@severity("high")
|
|
71
|
+
@tags("category:agent-identity,threat:injection,detection:ml,surface:process-prompt,owasp:llm01")
|
|
72
|
+
@reject_message("Prompt blocked: multi-turn progressive injection detected by the deep-context model across conversation history.")
|
|
73
|
+
forbid (
|
|
74
|
+
principal is AgentOps::Agent,
|
|
75
|
+
action == AgentOps::Action::"process_prompt",
|
|
76
|
+
resource
|
|
77
|
+
)
|
|
78
|
+
when {
|
|
79
|
+
context has agent_trust_level && context.agent_trust_level != "first_party" &&
|
|
80
|
+
context has multi_turn_detection && context.multi_turn_detection == true &&
|
|
81
|
+
context has injection_deep_context_score && context.injection_deep_context_score >= 60
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
@id("agent-identity.a2a-block-deep-context-jailbreak")
|
|
85
|
+
@name("Block multi-turn progressive jailbreak")
|
|
86
|
+
@description("Blocks process_prompt when agent_trust_level is not \"first_party\", multi_turn_detection is true, and jailbreak_deep_context_score >= 60.")
|
|
87
|
+
@severity("high")
|
|
88
|
+
@tags("category:agent-identity,threat:jailbreak,detection:ml,surface:process-prompt,owasp:llm02")
|
|
89
|
+
@reject_message("Prompt blocked: multi-turn progressive jailbreak detected by the deep-context model across conversation history.")
|
|
90
|
+
forbid (
|
|
91
|
+
principal is AgentOps::Agent,
|
|
92
|
+
action == AgentOps::Action::"process_prompt",
|
|
93
|
+
resource
|
|
94
|
+
)
|
|
95
|
+
when {
|
|
96
|
+
context has agent_trust_level && context.agent_trust_level != "first_party" &&
|
|
97
|
+
context has multi_turn_detection && context.multi_turn_detection == true &&
|
|
98
|
+
context has jailbreak_deep_context_score && context.jailbreak_deep_context_score >= 60
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
// Section 3: Encoded payload delivery
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
|
|
105
|
+
@id("agent-identity.a2a-block-encoded-injection")
|
|
106
|
+
@name("Block encoded payload delivery between agents")
|
|
107
|
+
@description("Blocks process_prompt and call_tool when agent_id is non-empty, encoded_content_detected is true, and encoded_score >= 60.")
|
|
108
|
+
@severity("high")
|
|
109
|
+
@tags("category:agent-identity,threat:encoded-payload,detection:pattern,owasp:llm01")
|
|
110
|
+
@reject_message("Request blocked: encoded payload detected in agent communication — agents should exchange plaintext, not encoded content.")
|
|
111
|
+
forbid (
|
|
112
|
+
principal is AgentOps::Agent,
|
|
113
|
+
action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool"],
|
|
114
|
+
resource
|
|
115
|
+
)
|
|
116
|
+
when {
|
|
117
|
+
context has agent_id && context.agent_id != "" &&
|
|
118
|
+
context has encoded_content_detected && context.encoded_content_detected == true &&
|
|
119
|
+
context has encoded_score && context.encoded_score >= 60
|
|
120
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Agent-Specific Guardrails
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Per-agent security policies applied based on the agent identity. Different
|
|
5
|
+
// agents have different risk profiles — this template rule covers Claude
|
|
6
|
+
// (injection focus); customize the agent IDs for your deployment. PII is
|
|
7
|
+
// handled uniformly by the canonical privacy.* templates (defaults/pii*.cedar),
|
|
8
|
+
// not per-agent.
|
|
9
|
+
//
|
|
10
|
+
// Context keys consumed:
|
|
11
|
+
// - detected_threats: Set<String>
|
|
12
|
+
//
|
|
13
|
+
// Category: agent-identity
|
|
14
|
+
// Namespace: AgentOps
|
|
15
|
+
// =============================================================================
|
|
16
|
+
|
|
17
|
+
@id("agent-identity.claude-block-injection")
|
|
18
|
+
@name("Block injection on Claude agent")
|
|
19
|
+
@description("Blocks process_prompt for the Claude agent when detected_threats contains \"prompt_injection\".")
|
|
20
|
+
@severity("critical")
|
|
21
|
+
@tags("category:agent-identity,threat:injection,scope:per-agent,detection:rule,surface:process-prompt,owasp:llm01")
|
|
22
|
+
@reject_message("Prompt blocked: prompt injection detected for the Claude agent.")
|
|
23
|
+
forbid (
|
|
24
|
+
principal == AgentOps::Agent::"claude",
|
|
25
|
+
action == AgentOps::Action::"process_prompt",
|
|
26
|
+
resource
|
|
27
|
+
)
|
|
28
|
+
when {
|
|
29
|
+
context has detected_threats && context.detected_threats.contains("prompt_injection")
|
|
30
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Agent Identity & Trust (Default)
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Trust-based access control for AI agents authenticated via API key or JWT
|
|
5
|
+
// with agent claims. Uses identity context keys populated from Shield's
|
|
6
|
+
// authentication layer.
|
|
7
|
+
//
|
|
8
|
+
// Agent trust levels:
|
|
9
|
+
// - first_party: Your own agents (highest trust)
|
|
10
|
+
// - verified_third_party: Audited external agents (medium trust)
|
|
11
|
+
// - unverified: Unknown/untrusted agents (lowest trust)
|
|
12
|
+
//
|
|
13
|
+
// Agent types:
|
|
14
|
+
// - orchestrator, autonomous, tool_agent, human_proxy
|
|
15
|
+
//
|
|
16
|
+
// Context keys consumed:
|
|
17
|
+
// - agent_id, agent_type, agent_trust_level, agent_framework, agent_publisher
|
|
18
|
+
// - tool_name, tool_category, tool_is_sensitive, tool_risk_score
|
|
19
|
+
// - injection_score
|
|
20
|
+
// - session_threat_turns
|
|
21
|
+
//
|
|
22
|
+
// Category: agent-identity
|
|
23
|
+
// Namespace: AgentOps
|
|
24
|
+
// =============================================================================
|
|
25
|
+
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// Section 1: Trust-based tool access
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
|
|
30
|
+
@id("agent-identity.block-unverified-dangerous-tools")
|
|
31
|
+
@name("Block unverified agents from dangerous tools")
|
|
32
|
+
@description("Blocks call_tool when agent_trust_level is \"unverified\" and tool_category is \"dangerous\".")
|
|
33
|
+
@severity("critical")
|
|
34
|
+
@tags("category:agent-identity,scope:per-agent,detection:rule,surface:call-tool")
|
|
35
|
+
@reject_message("Tool execution blocked: unverified agents cannot execute dangerous tools.")
|
|
36
|
+
forbid (
|
|
37
|
+
principal is AgentOps::Agent,
|
|
38
|
+
action == AgentOps::Action::"call_tool",
|
|
39
|
+
resource
|
|
40
|
+
)
|
|
41
|
+
when {
|
|
42
|
+
context has agent_trust_level && context.agent_trust_level == "unverified" &&
|
|
43
|
+
context has tool_category && context.tool_category == "dangerous"
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
@id("agent-identity.block-unverified-shell")
|
|
47
|
+
@name("Block unverified agents from shell execution")
|
|
48
|
+
@description("Blocks call_tool when agent_trust_level is \"unverified\" and tool_name is a shell tool.")
|
|
49
|
+
@severity("critical")
|
|
50
|
+
@tags("category:agent-identity,threat:command-injection,scope:per-agent,detection:rule,surface:call-tool")
|
|
51
|
+
@reject_message("Tool execution blocked: shell and command execution require a verified agent.")
|
|
52
|
+
forbid (
|
|
53
|
+
principal is AgentOps::Agent,
|
|
54
|
+
action == AgentOps::Action::"call_tool",
|
|
55
|
+
resource
|
|
56
|
+
)
|
|
57
|
+
when {
|
|
58
|
+
context has agent_trust_level && context.agent_trust_level == "unverified" &&
|
|
59
|
+
context has tool_name &&
|
|
60
|
+
(
|
|
61
|
+
context.tool_name == "shell" ||
|
|
62
|
+
context.tool_name == "execute_command" ||
|
|
63
|
+
context.tool_name == "bash"
|
|
64
|
+
)
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
@id("agent-identity.block-unverified-sensitive-tools")
|
|
68
|
+
@name("Block unverified agents from sensitive tools")
|
|
69
|
+
@description("Blocks call_tool when agent_trust_level is \"unverified\", tool_is_sensitive is true, and tool_risk_score >= 61.")
|
|
70
|
+
@severity("high")
|
|
71
|
+
@tags("category:agent-identity,scope:per-agent,detection:aggregate,surface:call-tool")
|
|
72
|
+
@reject_message("Tool execution blocked: unverified agent attempted a sensitive tool with elevated risk.")
|
|
73
|
+
forbid (
|
|
74
|
+
principal is AgentOps::Agent,
|
|
75
|
+
action == AgentOps::Action::"call_tool",
|
|
76
|
+
resource
|
|
77
|
+
)
|
|
78
|
+
when {
|
|
79
|
+
context has agent_trust_level && context.agent_trust_level == "unverified" &&
|
|
80
|
+
context has tool_is_sensitive && context.tool_is_sensitive == true &&
|
|
81
|
+
context has tool_risk_score && context.tool_risk_score >= 61
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
// Section 2: Autonomous-agent restrictions
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
|
|
88
|
+
@id("agent-identity.block-autonomous-injection")
|
|
89
|
+
@name("Block injection on autonomous agents")
|
|
90
|
+
@description("Blocks process_prompt when agent_type is \"autonomous\" and injection_score >= 51.")
|
|
91
|
+
@severity("high")
|
|
92
|
+
@tags("category:agent-identity,threat:injection,detection:ml,surface:process-prompt,owasp:llm01")
|
|
93
|
+
@reject_message("Prompt blocked: lower injection threshold applies to autonomous agents and was exceeded.")
|
|
94
|
+
forbid (
|
|
95
|
+
principal is AgentOps::Agent,
|
|
96
|
+
action == AgentOps::Action::"process_prompt",
|
|
97
|
+
resource
|
|
98
|
+
)
|
|
99
|
+
when {
|
|
100
|
+
context has agent_type && context.agent_type == "autonomous" &&
|
|
101
|
+
context has injection_score && context.injection_score >= 51
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
// Section 3: Cross-turn enforcement
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
|
|
108
|
+
@id("agent-identity.block-unverified-after-threats")
|
|
109
|
+
@name("Block unverified agents after session threats")
|
|
110
|
+
@description("Blocks call_tool when agent_trust_level is \"unverified\" and session_threat_turns >= 1.")
|
|
111
|
+
@severity("critical")
|
|
112
|
+
@tags("category:agent-identity,scope:per-agent,detection:aggregate,surface:call-tool")
|
|
113
|
+
@reject_message("Tool execution blocked: prior turns in this session detected threats; unverified agents cannot continue.")
|
|
114
|
+
forbid (
|
|
115
|
+
principal is AgentOps::Agent,
|
|
116
|
+
action == AgentOps::Action::"call_tool",
|
|
117
|
+
resource
|
|
118
|
+
)
|
|
119
|
+
when {
|
|
120
|
+
context has agent_trust_level && context.agent_trust_level == "unverified" &&
|
|
121
|
+
context has session_threat_turns && context.session_threat_turns >= 1
|
|
122
|
+
};
|