@highflame/policy 2.2.40 → 2.2.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_schemas/agent_ops/templates/ported/organization/organization_deny_baseline.cedar +2 -2
- package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_mcp_server_allowlist.cedar +24 -4
- package/_schemas/ai_gateway/context.json +300 -0
- package/_schemas/ai_gateway/detectors.json +928 -0
- package/_schemas/ai_gateway/schema.cedarschema +107 -3
- package/_schemas/ai_gateway/templates/mcp_server_allowlist.cedar +24 -4
- package/_schemas/guardrails/detectors.json +2193 -0
- package/_schemas/guardrails/templates/mcp_server_allowlist.cedar +24 -4
- package/_schemas/guardrails/templates/profiles/output_protection/credentials.cedar +35 -0
- package/_schemas/guardrails/templates/profiles/output_protection/data_leakage.cedar +63 -0
- package/_schemas/guardrails/templates/profiles/output_protection/harmful_content.cedar +58 -0
- package/_schemas/guardrails/templates/profiles/output_protection/injection_carried_back.cedar +39 -0
- package/_schemas/guardrails/templates/templates.json +107 -11
- package/_schemas/overwatch/context.json +65 -0
- package/_schemas/overwatch/detectors.json +1129 -0
- package/_schemas/overwatch/schema.cedarschema +90 -0
- package/_schemas/sentry/detectors.json +857 -0
- package/dist/agent_ops-defaults.gen.js +26 -6
- package/dist/ai_gateway-defaults.gen.js +24 -4
- package/dist/ai_gateway-detectors.gen.d.ts +1 -1
- package/dist/ai_gateway-detectors.gen.js +22 -8
- package/dist/ai_gateway-entities.gen.js +5 -1
- package/dist/guardrails-defaults.gen.js +366 -15
- package/dist/guardrails-detectors.gen.d.ts +1 -1
- package/dist/guardrails-detectors.gen.js +22 -8
- package/dist/overwatch-context.gen.d.ts +3 -1
- package/dist/overwatch-context.gen.js +4 -0
- package/dist/overwatch-defaults.gen.js +25 -5
- package/dist/overwatch-detectors.gen.d.ts +1 -1
- package/dist/overwatch-detectors.gen.js +38 -8
- package/dist/service-schemas.gen.d.ts +2 -2
- package/dist/service-schemas.gen.js +267 -8
- package/package.json +1 -1
|
@@ -74,7 +74,7 @@ entity FilePath in [Project];
|
|
|
74
74
|
// ACTIONS
|
|
75
75
|
// =============================================================================
|
|
76
76
|
|
|
77
|
-
// Call an MCP tool
|
|
77
|
+
// Call an MCP tool (tools/call). Enumeration is the `list` action.
|
|
78
78
|
// Threat focus: command injection, tool poisoning, rug pull, secrets, PII
|
|
79
79
|
action call_tool appliesTo {
|
|
80
80
|
principal: [User, MCP_Client],
|
|
@@ -274,6 +274,108 @@ action connect_server appliesTo {
|
|
|
274
274
|
},
|
|
275
275
|
};
|
|
276
276
|
|
|
277
|
+
// Enumerate a server's tools, prompts, or resources
|
|
278
|
+
// (tools/list, prompts/list, resources/list)
|
|
279
|
+
//
|
|
280
|
+
// Threat focus: tool poisoning and rug pull in the DESCRIPTIONS returned by
|
|
281
|
+
// enumeration — the text a host feeds the model when it assembles the
|
|
282
|
+
// session's tool schema, and the vector a rug-pull exploits between scans.
|
|
283
|
+
//
|
|
284
|
+
// Distinct from the actions it enumerates, and deliberately NOT default-locked
|
|
285
|
+
// (highflame-shield#515 / INV-AUTHZ-003). Listing is host plumbing: the model
|
|
286
|
+
// never decides to enumerate, the host does it to build the session. Folding
|
|
287
|
+
// it into call_tool / process_prompt / read_file made enumeration inherit
|
|
288
|
+
// their lock, and because a list names no tool, no conditioned grant
|
|
289
|
+
// (`context has tool_name && ...`) can ever match it — so an agent holding a
|
|
290
|
+
// correct grant for every tool it uses was still denied the enumeration step,
|
|
291
|
+
// and without tools/list it cannot call anything at all. The only grant that
|
|
292
|
+
// could match was an unconditioned one, which would have lifted the lock for
|
|
293
|
+
// every call as well. There is no way to express "may list, may not call"
|
|
294
|
+
// while a list and a call are the same action. See highflame-firehog#589.
|
|
295
|
+
//
|
|
296
|
+
// Authorization over WHAT may be enumerated is expressed through the list
|
|
297
|
+
// CONTENTS (the grant-derived list filter), not by denying the request.
|
|
298
|
+
action list appliesTo {
|
|
299
|
+
principal: [User, MCP_Client],
|
|
300
|
+
resource: [Server],
|
|
301
|
+
context: {
|
|
302
|
+
// Identity (AARM R6 / CAP-IDN-011) — projected from the principal's token; optional.
|
|
303
|
+
role?: String,
|
|
304
|
+
privilege_scope?: Set<String>,
|
|
305
|
+
|
|
306
|
+
// --- Content ---
|
|
307
|
+
// The enumerated item's description. Optional: a tool may declare none,
|
|
308
|
+
// and a policy must still evaluate when it does not.
|
|
309
|
+
content?: String,
|
|
310
|
+
mcp_server?: String,
|
|
311
|
+
|
|
312
|
+
// --- Enumerated item identity ---
|
|
313
|
+
// The list is scanned one item at a time, so the item being evaluated
|
|
314
|
+
// rides here while the resource stays the server being enumerated.
|
|
315
|
+
tool_name?: String,
|
|
316
|
+
tool_risk_score?: Long,
|
|
317
|
+
tool_category?: String, // "safe", "sensitive", "dangerous"
|
|
318
|
+
tool_is_sensitive?: Bool,
|
|
319
|
+
tool_is_builtin?: Bool,
|
|
320
|
+
tool_operation_classes?: Set<String>,
|
|
321
|
+
|
|
322
|
+
// --- Threat Detection ---
|
|
323
|
+
threat_count?: Long,
|
|
324
|
+
highest_severity?: String,
|
|
325
|
+
threat_categories?: Set<String>,
|
|
326
|
+
detected_threats?: Set<String>,
|
|
327
|
+
max_threat_severity?: Long,
|
|
328
|
+
|
|
329
|
+
// --- Agent Security (0-100) — the reason this action scans at all ---
|
|
330
|
+
tool_poisoning_score?: Long, // Hidden instructions in a tool description
|
|
331
|
+
tool_poisoning_detected?: Bool,
|
|
332
|
+
rug_pull_score?: Long, // Description drift after trust establishment
|
|
333
|
+
rug_pull_detected?: Bool,
|
|
334
|
+
indirect_injection_score?: Long,
|
|
335
|
+
|
|
336
|
+
// --- ML Detector Confidence Scores (0-100) ---
|
|
337
|
+
injection_score?: Long,
|
|
338
|
+
jailbreak_score?: Long,
|
|
339
|
+
|
|
340
|
+
// --- Secrets ---
|
|
341
|
+
secrets_detected?: Bool,
|
|
342
|
+
secret_types?: Set<String>,
|
|
343
|
+
secret_count?: Long,
|
|
344
|
+
|
|
345
|
+
// --- PII Detection ---
|
|
346
|
+
pii_detected?: Bool,
|
|
347
|
+
pii_types?: Set<String>,
|
|
348
|
+
pii_count?: Long,
|
|
349
|
+
pii_score?: Long,
|
|
350
|
+
|
|
351
|
+
// --- MCP Trust & Config Risk ---
|
|
352
|
+
mcp_server_verified?: Bool,
|
|
353
|
+
mcp_config_risk?: Bool,
|
|
354
|
+
mcp_risk_score?: Long,
|
|
355
|
+
|
|
356
|
+
// --- Session-Aware Threat Aggregation ---
|
|
357
|
+
session_threat_turns?: Long,
|
|
358
|
+
session_cumulative_risk_score?: Long,
|
|
359
|
+
session_injection_detected?: Bool,
|
|
360
|
+
session_command_injection?: Bool,
|
|
361
|
+
session_pii_detected?: Bool,
|
|
362
|
+
session_pii_types?: Set<String>,
|
|
363
|
+
session_secrets_detected?: Bool,
|
|
364
|
+
session_secret_types?: Set<String>,
|
|
365
|
+
session_max_injection_score?: Long,
|
|
366
|
+
session_max_jailbreak_score?: Long,
|
|
367
|
+
session_max_command_injection_score?: Long,
|
|
368
|
+
session_max_pii_score?: Long,
|
|
369
|
+
session_max_secret_score?: Long,
|
|
370
|
+
|
|
371
|
+
// Rate Limiting — gateway-metered, Shield-decided (ADR 0014)
|
|
372
|
+
rpm_remaining_pct?: Long,
|
|
373
|
+
rpm_exceeded?: Bool,
|
|
374
|
+
tpm_remaining_pct?: Long,
|
|
375
|
+
tpm_exceeded?: Bool,
|
|
376
|
+
},
|
|
377
|
+
};
|
|
378
|
+
|
|
277
379
|
// Shared content-inspection context.
|
|
278
380
|
//
|
|
279
381
|
// Prompts and responses are inspected by the same detector pipeline and so
|
|
@@ -361,7 +463,8 @@ type ContentInspectionContext = {
|
|
|
361
463
|
tpm_exceeded?: Bool,
|
|
362
464
|
};
|
|
363
465
|
|
|
364
|
-
// Process a prompt (MCP prompts/get or LLM chat completions)
|
|
466
|
+
// Process a prompt (MCP prompts/get or LLM chat completions).
|
|
467
|
+
// Enumeration (prompts/list) is the `list` action.
|
|
365
468
|
// Threat focus: injection, jailbreak, secrets, PII, content safety
|
|
366
469
|
action process_prompt appliesTo {
|
|
367
470
|
principal: [User, MCP_Client],
|
|
@@ -384,7 +487,8 @@ action process_response appliesTo {
|
|
|
384
487
|
context: ContentInspectionContext,
|
|
385
488
|
};
|
|
386
489
|
|
|
387
|
-
// Read an MCP resource (resources/read
|
|
490
|
+
// Read an MCP resource (resources/read). Enumeration (resources/list)
|
|
491
|
+
// is the `list` action.
|
|
388
492
|
// Threat focus: secrets exposure, PII exposure, sensitive paths
|
|
389
493
|
action read_file appliesTo {
|
|
390
494
|
principal: [User, MCP_Client],
|
|
@@ -2,8 +2,23 @@
|
|
|
2
2
|
// MCP Server Allowlist
|
|
3
3
|
// =============================================================================
|
|
4
4
|
// Restricts MCP server connections to a pre-approved list. Customize the
|
|
5
|
-
// `context.mcp_server` values
|
|
6
|
-
//
|
|
5
|
+
// `context.mcp_server` values to match the allowed servers for your
|
|
6
|
+
// environment — the SAME list appears in both rules and both must be edited.
|
|
7
|
+
//
|
|
8
|
+
// Both rules are conditional on the allowlist, and both are needed:
|
|
9
|
+
//
|
|
10
|
+
// permit ... when { allowlisted } grants access; Cedar is default-deny,
|
|
11
|
+
// so without this nothing allows the
|
|
12
|
+
// allowlisted servers either.
|
|
13
|
+
// forbid ... unless { allowlisted } claws back everything else, including
|
|
14
|
+
// when a broad Baseline Permit is loaded.
|
|
15
|
+
//
|
|
16
|
+
// The forbid MUST carry the negation. `forbid` always beats `permit` in Cedar,
|
|
17
|
+
// so an UNCONDITIONAL forbid denies the allowlisted servers too — which is
|
|
18
|
+
// what this template used to do (highflame-policy#186).
|
|
19
|
+
//
|
|
20
|
+
// The `context has mcp_server` guard stays inside both conditions: a request
|
|
21
|
+
// naming no server cannot be on the allowlist, so it is denied.
|
|
7
22
|
//
|
|
8
23
|
// Context keys consumed:
|
|
9
24
|
// - mcp_server: String
|
|
@@ -30,7 +45,7 @@ when {
|
|
|
30
45
|
|
|
31
46
|
@id("tools.deny-non-allowlisted-mcp")
|
|
32
47
|
@name("Block non-allowlisted MCP servers")
|
|
33
|
-
@description("Blocks connect_server
|
|
48
|
+
@description("Blocks connect_server unless mcp_server is in the allowlist.")
|
|
34
49
|
@severity("medium")
|
|
35
50
|
@tags("category:tools,surface:connect-server,scope:org-wide,posture:deny-default")
|
|
36
51
|
@reject_message("MCP server connection blocked: server is not on the allowlist.")
|
|
@@ -38,4 +53,9 @@ forbid (
|
|
|
38
53
|
principal,
|
|
39
54
|
action == AIGateway::Action::"connect_server",
|
|
40
55
|
resource
|
|
41
|
-
)
|
|
56
|
+
)
|
|
57
|
+
unless {
|
|
58
|
+
context has mcp_server &&
|
|
59
|
+
(context.mcp_server == "filesystem" ||
|
|
60
|
+
context.mcp_server == "playwright")
|
|
61
|
+
};
|