@highflame/policy 2.1.5 → 2.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_schemas/guardrails/context.json +168 -0
- package/_schemas/guardrails/schema.cedarschema +40 -0
- package/_schemas/guardrails/templates/defaults/agent_identity.cedar +118 -0
- package/_schemas/guardrails/templates/defaults/agentic_safety.cedar +4 -4
- package/_schemas/guardrails/templates/defaults/injection.cedar +4 -4
- package/_schemas/guardrails/templates/defaults/secrets.cedar +2 -2
- package/_schemas/guardrails/templates/defaults/security_patterns.cedar +1 -1
- package/_schemas/guardrails/templates/defaults/semantic.cedar +10 -7
- package/_schemas/guardrails/templates/defaults/toxicity.cedar +3 -3
- package/_schemas/guardrails/templates/mcp_tool_permissions.cedar +7 -5
- package/_schemas/guardrails/templates/profiles/chat_assistant/privacy.cedar +1 -1
- package/_schemas/guardrails/templates/profiles/chat_assistant/security.cedar +2 -2
- package/_schemas/guardrails/templates/profiles/chat_assistant/trust_safety.cedar +2 -2
- package/_schemas/guardrails/templates/profiles/code_agent/agentic_security.cedar +3 -3
- package/_schemas/guardrails/templates/profiles/data_pipeline/agentic_security.cedar +1 -1
- package/_schemas/guardrails/templates/profiles/data_pipeline/privacy.cedar +2 -2
- package/_schemas/guardrails/templates/profiles/data_pipeline/security.cedar +2 -2
- package/_schemas/guardrails/templates/profiles/multi_agent/agent_safety.cedar +157 -0
- package/_schemas/guardrails/templates/profiles/multi_agent/agent_trust.cedar +140 -0
- package/_schemas/guardrails/templates/templates.json +40 -0
- package/dist/engine.d.ts +1 -1
- package/dist/engine.js +1 -1
- package/dist/guardrails-context.gen.d.ts +5 -0
- package/dist/guardrails-context.gen.js +5 -0
- package/dist/guardrails-defaults.gen.d.ts +1 -1
- package/dist/guardrails-defaults.gen.js +520 -32
- package/dist/service-schemas.gen.d.ts +1 -1
- package/dist/service-schemas.gen.js +73 -5
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
@tags("profile,chat-assistant,toxicity,trust-safety")
|
|
16
16
|
forbid (
|
|
17
17
|
principal,
|
|
18
|
-
action,
|
|
18
|
+
action == Guardrails::Action::"process_prompt",
|
|
19
19
|
resource
|
|
20
20
|
) when {
|
|
21
21
|
(context has violence_score && context.violence_score > 70) ||
|
|
@@ -31,7 +31,7 @@ forbid (
|
|
|
31
31
|
@tags("profile,chat-assistant,semantic,compliance")
|
|
32
32
|
forbid (
|
|
33
33
|
principal,
|
|
34
|
-
action,
|
|
34
|
+
action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool"],
|
|
35
35
|
resource
|
|
36
36
|
) when {
|
|
37
37
|
context has topic_confidence && context.topic_confidence > 70 &&
|
|
@@ -73,7 +73,7 @@ forbid (
|
|
|
73
73
|
@tags("profile,code-agent,agentic,exfiltration")
|
|
74
74
|
forbid (
|
|
75
75
|
principal,
|
|
76
|
-
action,
|
|
76
|
+
action == Guardrails::Action::"call_tool",
|
|
77
77
|
resource
|
|
78
78
|
) when {
|
|
79
79
|
context has suspicious_pattern && context.suspicious_pattern == true &&
|
|
@@ -89,7 +89,7 @@ forbid (
|
|
|
89
89
|
@tags("profile,code-agent,agentic,patterns")
|
|
90
90
|
forbid (
|
|
91
91
|
principal,
|
|
92
|
-
action,
|
|
92
|
+
action == Guardrails::Action::"call_tool",
|
|
93
93
|
resource
|
|
94
94
|
) when {
|
|
95
95
|
context has sequence_risk && context.sequence_risk > 75
|
|
@@ -102,7 +102,7 @@ forbid (
|
|
|
102
102
|
@tags("profile,code-agent,budget,cost-control")
|
|
103
103
|
forbid (
|
|
104
104
|
principal,
|
|
105
|
-
action,
|
|
105
|
+
action == Guardrails::Action::"call_tool",
|
|
106
106
|
resource
|
|
107
107
|
) when {
|
|
108
108
|
context has budget_exceeded && context.budget_exceeded == true
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
@tags("profile,data-pipeline,pii,privacy")
|
|
16
16
|
forbid (
|
|
17
17
|
principal,
|
|
18
|
-
action,
|
|
18
|
+
action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
|
|
19
19
|
resource
|
|
20
20
|
) when {
|
|
21
21
|
context has pii_detected && context.pii_detected == true
|
|
@@ -28,7 +28,7 @@ forbid (
|
|
|
28
28
|
@tags("profile,data-pipeline,pii,compliance")
|
|
29
29
|
forbid (
|
|
30
30
|
principal,
|
|
31
|
-
action,
|
|
31
|
+
action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
|
|
32
32
|
resource
|
|
33
33
|
) when {
|
|
34
34
|
context has pii_types &&
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
@tags("profile,data-pipeline,secrets,security")
|
|
16
16
|
forbid (
|
|
17
17
|
principal,
|
|
18
|
-
action,
|
|
18
|
+
action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool", Guardrails::Action::"read_file", Guardrails::Action::"write_file"],
|
|
19
19
|
resource
|
|
20
20
|
) when {
|
|
21
21
|
context has contains_secrets && context.contains_secrets == true
|
|
@@ -42,7 +42,7 @@ forbid (
|
|
|
42
42
|
@tags("profile,data-pipeline,injection,security")
|
|
43
43
|
forbid (
|
|
44
44
|
principal,
|
|
45
|
-
action,
|
|
45
|
+
action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool"],
|
|
46
46
|
resource
|
|
47
47
|
) when {
|
|
48
48
|
context has injection_confidence && context.injection_confidence > 65
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Multi-Agent Orchestration — Cross-Turn Agent Safety
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Session-aware policies that use cross-turn detection history combined with
|
|
5
|
+
// agent identity for defense-in-depth. These policies handle the scenario
|
|
6
|
+
// where one agent in a multi-agent session detects a threat, and subsequent
|
|
7
|
+
// agents in the same session must be restricted accordingly.
|
|
8
|
+
//
|
|
9
|
+
// Key insight: In multi-agent orchestration, Agent A may detect PII in turn 3,
|
|
10
|
+
// and Agent B (a different agent) arrives in turn 5 wanting to call http_post.
|
|
11
|
+
// Cross-turn session flags + agent trust level enable this policy:
|
|
12
|
+
// "If PII was seen AND this agent is unverified → block network tools."
|
|
13
|
+
//
|
|
14
|
+
// Context keys used:
|
|
15
|
+
// - agent_trust_level: String - Trust tier of the current agent
|
|
16
|
+
// - agent_type: String - Agent classification
|
|
17
|
+
// - session_pii_detected: Bool - PII seen in any prior turn
|
|
18
|
+
// - session_pii_types: Set<String> - PII types accumulated
|
|
19
|
+
// - session_secrets_detected: Bool - Secrets seen in any prior turn
|
|
20
|
+
// - session_injection_detected: Bool - Injection seen in any prior turn
|
|
21
|
+
// - session_command_injection: Bool - Command injection in any prior turn
|
|
22
|
+
// - session_threat_turns: Long - Count of turns with threats
|
|
23
|
+
// - session_cumulative_risk_score: Long - Total accumulated risk
|
|
24
|
+
// - tool_name: String - Tool being called
|
|
25
|
+
// - tool_is_sensitive: Bool - Whether tool is sensitive
|
|
26
|
+
// - suspicious_pattern: Bool - Whether exfiltration pattern detected
|
|
27
|
+
//
|
|
28
|
+
// Category: agent_identity
|
|
29
|
+
// Namespace: Guardrails
|
|
30
|
+
// =============================================================================
|
|
31
|
+
|
|
32
|
+
// -----------------------------------------------------------------------------
|
|
33
|
+
// PII Containment — Prevent Agent Data Leakage
|
|
34
|
+
// -----------------------------------------------------------------------------
|
|
35
|
+
|
|
36
|
+
@id("multi-agent-pii-block-network-tools")
|
|
37
|
+
@name("Block network tools after PII detection for non-first-party agents")
|
|
38
|
+
@description("If PII was detected in any prior turn, block non-first-party agents from calling network-facing tools. Prevents data exfiltration by untrusted agents in sessions containing sensitive data")
|
|
39
|
+
@severity("critical")
|
|
40
|
+
@tags("profile,multi-agent,pii,exfiltration,cross-turn,a2a")
|
|
41
|
+
forbid (
|
|
42
|
+
principal is Guardrails::Agent,
|
|
43
|
+
action == Guardrails::Action::"call_tool",
|
|
44
|
+
resource
|
|
45
|
+
) when {
|
|
46
|
+
context has agent_trust_level && context.agent_trust_level != "first_party" &&
|
|
47
|
+
context has session_pii_detected && context.session_pii_detected == true &&
|
|
48
|
+
context has tool_name &&
|
|
49
|
+
(context.tool_name == "http_post" ||
|
|
50
|
+
context.tool_name == "send_email" ||
|
|
51
|
+
context.tool_name == "http_request" ||
|
|
52
|
+
context.tool_name == "webhook")
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
@id("multi-agent-pii-block-unverified-file-write")
|
|
56
|
+
@name("Block unverified agents from writing files after PII detection")
|
|
57
|
+
@description("If PII was detected in the session, unverified agents cannot write files. Prevents PII persistence by untrusted agents")
|
|
58
|
+
@severity("high")
|
|
59
|
+
@tags("profile,multi-agent,pii,file-write,cross-turn,a2a")
|
|
60
|
+
forbid (
|
|
61
|
+
principal is Guardrails::Agent,
|
|
62
|
+
action == Guardrails::Action::"write_file",
|
|
63
|
+
resource
|
|
64
|
+
) when {
|
|
65
|
+
context has agent_trust_level && context.agent_trust_level == "unverified" &&
|
|
66
|
+
context has session_pii_detected && context.session_pii_detected == true
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// -----------------------------------------------------------------------------
|
|
70
|
+
// Secrets Containment — Lock Down After Credential Exposure
|
|
71
|
+
// -----------------------------------------------------------------------------
|
|
72
|
+
|
|
73
|
+
@id("multi-agent-secrets-lockdown")
|
|
74
|
+
@name("Lock down sensitive tools after secrets detection")
|
|
75
|
+
@description("If secrets (API keys, tokens) were detected in any prior turn, block all non-first-party agents from sensitive tool calls. Prevents credential exfiltration in compromised sessions")
|
|
76
|
+
@severity("critical")
|
|
77
|
+
@tags("profile,multi-agent,secrets,lockdown,cross-turn,a2a")
|
|
78
|
+
forbid (
|
|
79
|
+
principal is Guardrails::Agent,
|
|
80
|
+
action == Guardrails::Action::"call_tool",
|
|
81
|
+
resource
|
|
82
|
+
) when {
|
|
83
|
+
context has agent_trust_level && context.agent_trust_level != "first_party" &&
|
|
84
|
+
context has session_secrets_detected && context.session_secrets_detected == true &&
|
|
85
|
+
context has tool_is_sensitive && context.tool_is_sensitive == true
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// -----------------------------------------------------------------------------
|
|
89
|
+
// Injection Escalation — Tighten After Prior Attacks
|
|
90
|
+
// -----------------------------------------------------------------------------
|
|
91
|
+
|
|
92
|
+
@id("multi-agent-post-injection-lockdown")
|
|
93
|
+
@name("Restrict unverified agents after injection detection")
|
|
94
|
+
@description("If injection was detected in any prior turn, block unverified agents from all tool calls. An injection in a prior turn may have poisoned the context, making subsequent unverified agent actions high risk")
|
|
95
|
+
@severity("critical")
|
|
96
|
+
@tags("profile,multi-agent,injection,lockdown,cross-turn,a2a")
|
|
97
|
+
forbid (
|
|
98
|
+
principal is Guardrails::Agent,
|
|
99
|
+
action == Guardrails::Action::"call_tool",
|
|
100
|
+
resource
|
|
101
|
+
) when {
|
|
102
|
+
context has agent_trust_level && context.agent_trust_level == "unverified" &&
|
|
103
|
+
context has session_injection_detected && context.session_injection_detected == true
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
@id("multi-agent-post-command-injection-block-shell")
|
|
107
|
+
@name("Block all agent shell access after command injection")
|
|
108
|
+
@description("If command injection was detected in any prior turn, no agent (regardless of trust) can execute shell commands. Defense against persistent shell compromise")
|
|
109
|
+
@severity("critical")
|
|
110
|
+
@tags("profile,multi-agent,command-injection,shell,cross-turn,a2a")
|
|
111
|
+
forbid (
|
|
112
|
+
principal is Guardrails::Agent,
|
|
113
|
+
action == Guardrails::Action::"call_tool",
|
|
114
|
+
resource
|
|
115
|
+
) when {
|
|
116
|
+
context has session_command_injection && context.session_command_injection == true &&
|
|
117
|
+
context has tool_name &&
|
|
118
|
+
(context.tool_name == "shell" ||
|
|
119
|
+
context.tool_name == "execute_command" ||
|
|
120
|
+
context.tool_name == "bash")
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// -----------------------------------------------------------------------------
|
|
124
|
+
// Cumulative Risk — Session-Level Circuit Breaker
|
|
125
|
+
// -----------------------------------------------------------------------------
|
|
126
|
+
|
|
127
|
+
@id("multi-agent-high-cumulative-risk-restrict")
|
|
128
|
+
@name("Restrict non-first-party agents in high-risk sessions")
|
|
129
|
+
@description("When cumulative session risk exceeds 200, restrict non-first-party agents to safe tools only. Acts as a circuit breaker for sessions that have accumulated multiple risk signals across turns")
|
|
130
|
+
@severity("high")
|
|
131
|
+
@tags("profile,multi-agent,cumulative-risk,circuit-breaker,a2a")
|
|
132
|
+
forbid (
|
|
133
|
+
principal is Guardrails::Agent,
|
|
134
|
+
action == Guardrails::Action::"call_tool",
|
|
135
|
+
resource
|
|
136
|
+
) when {
|
|
137
|
+
context has agent_trust_level && context.agent_trust_level != "first_party" &&
|
|
138
|
+
context has session_cumulative_risk_score && context.session_cumulative_risk_score > 200 &&
|
|
139
|
+
context has tool_is_sensitive && context.tool_is_sensitive == true
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
@id("multi-agent-extreme-risk-full-lockdown")
|
|
143
|
+
@name("Full lockdown for unverified agents in extreme-risk sessions")
|
|
144
|
+
@description("When cumulative session risk exceeds 500 or more than 5 threat turns are detected, block ALL tool calls from unverified agents. Emergency circuit breaker for compromised sessions")
|
|
145
|
+
@severity("critical")
|
|
146
|
+
@tags("profile,multi-agent,extreme-risk,lockdown,a2a")
|
|
147
|
+
forbid (
|
|
148
|
+
principal is Guardrails::Agent,
|
|
149
|
+
action == Guardrails::Action::"call_tool",
|
|
150
|
+
resource
|
|
151
|
+
) when {
|
|
152
|
+
context has agent_trust_level && context.agent_trust_level == "unverified" &&
|
|
153
|
+
(
|
|
154
|
+
(context has session_cumulative_risk_score && context.session_cumulative_risk_score > 500) ||
|
|
155
|
+
(context has session_threat_turns && context.session_threat_turns > 5)
|
|
156
|
+
)
|
|
157
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Multi-Agent Orchestration — Agent Trust Policies
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Production-grade trust policies for multi-agent systems where an orchestrator
|
|
5
|
+
// coordinates sub-agents with varying trust levels. These policies enforce
|
|
6
|
+
// least-privilege access: each agent gets only the permissions its trust level
|
|
7
|
+
// and type warrant.
|
|
8
|
+
//
|
|
9
|
+
// Architecture supported:
|
|
10
|
+
// Orchestrator (first_party)
|
|
11
|
+
// ├── Research Agent (verified_third_party, autonomous)
|
|
12
|
+
// ├── Code Agent (first_party, tool_agent)
|
|
13
|
+
// └── External Plugin (unverified, tool_agent)
|
|
14
|
+
//
|
|
15
|
+
// Context keys used:
|
|
16
|
+
// - agent_id: String - Unique agent identifier
|
|
17
|
+
// - agent_type: String - orchestrator | autonomous | tool_agent | human_proxy
|
|
18
|
+
// - agent_trust_level: String - first_party | verified_third_party | unverified
|
|
19
|
+
// - agent_framework: String - Agent framework/SDK
|
|
20
|
+
// - agent_publisher: String - Publishing organization
|
|
21
|
+
// - tool_name: String - Tool being called
|
|
22
|
+
// - tool_category: String - safe | sensitive | dangerous
|
|
23
|
+
// - tool_risk_score: Long (0-100) - Computed risk score
|
|
24
|
+
// - tool_is_sensitive: Bool - Whether tool is sensitive
|
|
25
|
+
// - mcp_server_verified: Bool - Whether MCP server is verified
|
|
26
|
+
// - injection_confidence: Long (0-100) - Injection detection score
|
|
27
|
+
// - jailbreak_confidence: Long (0-100) - Jailbreak detection score
|
|
28
|
+
//
|
|
29
|
+
// Category: agent_identity
|
|
30
|
+
// Namespace: Guardrails
|
|
31
|
+
// =============================================================================
|
|
32
|
+
|
|
33
|
+
// -----------------------------------------------------------------------------
|
|
34
|
+
// Tiered Tool Access — The Core A2A Trust Model
|
|
35
|
+
// -----------------------------------------------------------------------------
|
|
36
|
+
|
|
37
|
+
@id("multi-agent-only-first-party-dangerous")
|
|
38
|
+
@name("Only first-party agents can use dangerous tools")
|
|
39
|
+
@description("Dangerous tools (shell, delete_file, run_sql) are restricted to first-party agents only. Third-party and unverified agents are blocked regardless of other signals")
|
|
40
|
+
@severity("critical")
|
|
41
|
+
@tags("profile,multi-agent,trust,tools,a2a")
|
|
42
|
+
forbid (
|
|
43
|
+
principal is Guardrails::Agent,
|
|
44
|
+
action == Guardrails::Action::"call_tool",
|
|
45
|
+
resource
|
|
46
|
+
) when {
|
|
47
|
+
context has agent_trust_level && context.agent_trust_level != "first_party" &&
|
|
48
|
+
context has tool_category && context.tool_category == "dangerous"
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
@id("multi-agent-block-unverified-sensitive")
|
|
52
|
+
@name("Block unverified agents from all sensitive tools")
|
|
53
|
+
@description("Unverified agents can only use tools classified as safe. Sensitive tools (write_file, http_post, send_email) require at least verified_third_party trust")
|
|
54
|
+
@severity("high")
|
|
55
|
+
@tags("profile,multi-agent,trust,tools,a2a")
|
|
56
|
+
forbid (
|
|
57
|
+
principal is Guardrails::Agent,
|
|
58
|
+
action == Guardrails::Action::"call_tool",
|
|
59
|
+
resource
|
|
60
|
+
) when {
|
|
61
|
+
context has agent_trust_level && context.agent_trust_level == "unverified" &&
|
|
62
|
+
context has tool_is_sensitive && context.tool_is_sensitive == true
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
@id("multi-agent-block-unverified-mcp")
|
|
66
|
+
@name("Block unverified agents from unverified MCP servers")
|
|
67
|
+
@description("Unverified agents cannot call tools from unverified MCP servers. Double-unverified (agent + server) presents unacceptable supply chain risk")
|
|
68
|
+
@severity("critical")
|
|
69
|
+
@tags("profile,multi-agent,trust,mcp,a2a")
|
|
70
|
+
forbid (
|
|
71
|
+
principal is Guardrails::Agent,
|
|
72
|
+
action == Guardrails::Action::"call_tool",
|
|
73
|
+
resource
|
|
74
|
+
) when {
|
|
75
|
+
context has agent_trust_level && context.agent_trust_level == "unverified" &&
|
|
76
|
+
context has mcp_server_verified && context.mcp_server_verified == false
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// -----------------------------------------------------------------------------
|
|
80
|
+
// Autonomous Agent Safeguards
|
|
81
|
+
// -----------------------------------------------------------------------------
|
|
82
|
+
|
|
83
|
+
@id("multi-agent-autonomous-tool-risk-cap")
|
|
84
|
+
@name("Cap tool risk for autonomous agents")
|
|
85
|
+
@description("Autonomous agents (no human in the loop) have a lower tool risk ceiling. Tools with risk > 70 require human oversight that autonomous agents lack")
|
|
86
|
+
@severity("high")
|
|
87
|
+
@tags("profile,multi-agent,autonomous,tools,a2a")
|
|
88
|
+
forbid (
|
|
89
|
+
principal is Guardrails::Agent,
|
|
90
|
+
action == Guardrails::Action::"call_tool",
|
|
91
|
+
resource
|
|
92
|
+
) when {
|
|
93
|
+
context has agent_type && context.agent_type == "autonomous" &&
|
|
94
|
+
context has tool_risk_score && context.tool_risk_score > 70
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
@id("multi-agent-autonomous-injection-defense")
|
|
98
|
+
@name("Enhanced injection defense for autonomous agents")
|
|
99
|
+
@description("Autonomous agents are high-value targets for injection. Lower the threshold to 50 (vs 80 standard) since there is no human to catch false negatives")
|
|
100
|
+
@severity("high")
|
|
101
|
+
@tags("profile,multi-agent,autonomous,injection,a2a")
|
|
102
|
+
forbid (
|
|
103
|
+
principal is Guardrails::Agent,
|
|
104
|
+
action == Guardrails::Action::"process_prompt",
|
|
105
|
+
resource
|
|
106
|
+
) when {
|
|
107
|
+
context has agent_type && context.agent_type == "autonomous" &&
|
|
108
|
+
context has injection_confidence && context.injection_confidence > 50
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
@id("multi-agent-autonomous-jailbreak-defense")
|
|
112
|
+
@name("Enhanced jailbreak defense for autonomous agents")
|
|
113
|
+
@description("Lower jailbreak threshold for autonomous agents. Without human review, we must be more conservative")
|
|
114
|
+
@severity("high")
|
|
115
|
+
@tags("profile,multi-agent,autonomous,jailbreak,a2a")
|
|
116
|
+
forbid (
|
|
117
|
+
principal is Guardrails::Agent,
|
|
118
|
+
action == Guardrails::Action::"process_prompt",
|
|
119
|
+
resource
|
|
120
|
+
) when {
|
|
121
|
+
context has agent_type && context.agent_type == "autonomous" &&
|
|
122
|
+
context has jailbreak_confidence && context.jailbreak_confidence > 50
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// -----------------------------------------------------------------------------
|
|
126
|
+
// MCP Server Connection Trust
|
|
127
|
+
// -----------------------------------------------------------------------------
|
|
128
|
+
|
|
129
|
+
@id("multi-agent-block-unverified-server-connect")
|
|
130
|
+
@name("Block unverified agents from connecting to MCP servers")
|
|
131
|
+
@description("Unverified agents cannot establish new MCP server connections. Limits blast radius of compromised or rogue agents")
|
|
132
|
+
@severity("high")
|
|
133
|
+
@tags("profile,multi-agent,trust,mcp,connect,a2a")
|
|
134
|
+
forbid (
|
|
135
|
+
principal is Guardrails::Agent,
|
|
136
|
+
action == Guardrails::Action::"connect_server",
|
|
137
|
+
resource
|
|
138
|
+
) when {
|
|
139
|
+
context has agent_trust_level && context.agent_trust_level == "unverified"
|
|
140
|
+
};
|
|
@@ -23,6 +23,11 @@
|
|
|
23
23
|
"name": "Agentic Security",
|
|
24
24
|
"description": "Detect tool abuse, data exfiltration patterns, infinite loops, and budget violations"
|
|
25
25
|
},
|
|
26
|
+
{
|
|
27
|
+
"id": "agent_identity",
|
|
28
|
+
"name": "Agent-to-Agent Security",
|
|
29
|
+
"description": "Trust-based access control for AI agents — tiered permissions by trust level, agent type restrictions, cross-turn session lockdowns for multi-agent orchestration"
|
|
30
|
+
},
|
|
26
31
|
{
|
|
27
32
|
"id": "organization",
|
|
28
33
|
"name": "Organization",
|
|
@@ -112,6 +117,15 @@
|
|
|
112
117
|
}
|
|
113
118
|
],
|
|
114
119
|
"templates": [
|
|
120
|
+
{
|
|
121
|
+
"id": "agent-identity-trust",
|
|
122
|
+
"name": "Agent Identity & Trust",
|
|
123
|
+
"description": "Trust-based access control for AI agents: block unverified agents from dangerous/sensitive tools, apply stricter thresholds for autonomous agents, restrict unverified agents after session threats",
|
|
124
|
+
"category": "agent_identity",
|
|
125
|
+
"file": "defaults/agent_identity.cedar",
|
|
126
|
+
"severity": "critical",
|
|
127
|
+
"tags": ["agent-identity", "trust", "a2a", "autonomous", "cross-turn"]
|
|
128
|
+
},
|
|
115
129
|
{
|
|
116
130
|
"id": "mcp-tool-permissions",
|
|
117
131
|
"name": "MCP Tool Permissions",
|
|
@@ -192,6 +206,24 @@
|
|
|
192
206
|
"file": "profiles/data_pipeline/agentic_security.cedar",
|
|
193
207
|
"severity": "critical",
|
|
194
208
|
"tags": ["profile", "data-pipeline", "exfiltration", "tools"]
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"id": "multi-agent-trust",
|
|
212
|
+
"name": "Multi-Agent Orchestration — Agent Trust",
|
|
213
|
+
"description": "Tiered trust policies for multi-agent systems: only first-party agents can use dangerous tools, unverified agents restricted to safe tools, autonomous agents have lower risk ceilings, MCP server connection trust enforcement",
|
|
214
|
+
"category": "agent_identity",
|
|
215
|
+
"file": "profiles/multi_agent/agent_trust.cedar",
|
|
216
|
+
"severity": "critical",
|
|
217
|
+
"tags": ["profile", "multi-agent", "trust", "a2a", "autonomous", "mcp"]
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"id": "multi-agent-safety",
|
|
221
|
+
"name": "Multi-Agent Orchestration — Cross-Turn Safety",
|
|
222
|
+
"description": "Session-aware agent safety policies: PII containment across agents, secrets lockdown, injection escalation response, cumulative risk circuit breakers for multi-agent sessions",
|
|
223
|
+
"category": "agent_identity",
|
|
224
|
+
"file": "profiles/multi_agent/agent_safety.cedar",
|
|
225
|
+
"severity": "critical",
|
|
226
|
+
"tags": ["profile", "multi-agent", "cross-turn", "a2a", "pii", "secrets", "injection", "circuit-breaker"]
|
|
195
227
|
}
|
|
196
228
|
],
|
|
197
229
|
"profiles": [
|
|
@@ -218,6 +250,14 @@
|
|
|
218
250
|
"severity": "critical",
|
|
219
251
|
"tags": ["data-pipeline", "pii", "secrets", "exfiltration"],
|
|
220
252
|
"template_ids": ["data-pipeline-privacy", "data-pipeline-security", "data-pipeline-agentic-security"]
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"id": "multi-agent",
|
|
256
|
+
"name": "Multi-Agent Orchestration",
|
|
257
|
+
"description": "Production-grade A2A guardrails for multi-agent systems — tiered trust access control, autonomous agent safeguards, cross-turn PII/secrets containment, injection escalation response, cumulative risk circuit breakers",
|
|
258
|
+
"severity": "critical",
|
|
259
|
+
"tags": ["multi-agent", "a2a", "trust", "cross-turn", "circuit-breaker"],
|
|
260
|
+
"template_ids": ["agent-identity-trust", "multi-agent-trust", "multi-agent-safety"]
|
|
221
261
|
}
|
|
222
262
|
]
|
|
223
263
|
}
|
package/dist/engine.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ActionType } from "./actions.gen.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const DEFAULT_LIMITS: {
|
|
12
12
|
/** Maximum number of keys in a context map */
|
|
13
|
-
readonly maxContextKeys:
|
|
13
|
+
readonly maxContextKeys: 200;
|
|
14
14
|
/** Maximum length of any string value (1MB) */
|
|
15
15
|
readonly maxStringLength: 1000000;
|
|
16
16
|
/** Maximum nesting depth for objects/arrays */
|
package/dist/engine.js
CHANGED
|
@@ -13,7 +13,7 @@ import * as cedar from "@cedar-policy/cedar-wasm/nodejs";
|
|
|
13
13
|
*/
|
|
14
14
|
export const DEFAULT_LIMITS = {
|
|
15
15
|
/** Maximum number of keys in a context map */
|
|
16
|
-
maxContextKeys:
|
|
16
|
+
maxContextKeys: 200,
|
|
17
17
|
/** Maximum length of any string value (1MB) */
|
|
18
18
|
maxStringLength: 1_000_000,
|
|
19
19
|
/** Maximum nesting depth for objects/arrays */
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
* Guardrails Cedar schema and are used at policy evaluation time.
|
|
6
6
|
*/
|
|
7
7
|
export declare const GuardrailsContextKey: {
|
|
8
|
+
readonly AgentFramework: "agent_framework";
|
|
9
|
+
readonly AgentId: "agent_id";
|
|
10
|
+
readonly AgentPublisher: "agent_publisher";
|
|
11
|
+
readonly AgentTrustLevel: "agent_trust_level";
|
|
12
|
+
readonly AgentType: "agent_type";
|
|
8
13
|
readonly BudgetExceeded: "budget_exceeded";
|
|
9
14
|
readonly BudgetRemainingPct: "budget_remaining_pct";
|
|
10
15
|
readonly CodeLanguages: "code_languages";
|
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
* Guardrails Cedar schema and are used at policy evaluation time.
|
|
8
8
|
*/
|
|
9
9
|
export const GuardrailsContextKey = {
|
|
10
|
+
AgentFramework: 'agent_framework',
|
|
11
|
+
AgentId: 'agent_id',
|
|
12
|
+
AgentPublisher: 'agent_publisher',
|
|
13
|
+
AgentTrustLevel: 'agent_trust_level',
|
|
14
|
+
AgentType: 'agent_type',
|
|
10
15
|
BudgetExceeded: 'budget_exceeded',
|
|
11
16
|
BudgetRemainingPct: 'budget_remaining_pct',
|
|
12
17
|
CodeLanguages: 'code_languages',
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Guardrails policy category identifiers.
|
|
3
3
|
* Maps to UI tab names in Studio.
|
|
4
4
|
*/
|
|
5
|
-
export type GuardrailsCategory = 'security' | 'privacy' | 'trust_safety' | 'agentic_security' | 'organization';
|
|
5
|
+
export type GuardrailsCategory = 'security' | 'privacy' | 'trust_safety' | 'agentic_security' | 'agent_identity' | 'organization';
|
|
6
6
|
/**
|
|
7
7
|
* Category metadata for UI display.
|
|
8
8
|
*/
|