@highflame/policy 2.1.35 → 2.1.37
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/ai_gateway/context.json +431 -11
- package/_schemas/ai_gateway/schema.cedarschema +91 -11
- package/_schemas/ai_gateway/templates/defaults/agent_security.cedar +66 -43
- package/_schemas/ai_gateway/templates/defaults/baseline.cedar +9 -11
- package/_schemas/ai_gateway/templates/defaults/semantic.cedar +63 -40
- package/_schemas/ai_gateway/templates/defaults/tools.cedar +48 -36
- package/_schemas/ai_gateway/templates/llm_default_allow.cedar +9 -10
- package/_schemas/ai_gateway/templates/mcp_server_allowlist.cedar +22 -14
- package/_schemas/ai_gateway/templates/mcp_tool_permissions.cedar +29 -27
- package/_schemas/ai_gateway/templates/pii_redaction.cedar +38 -33
- package/_schemas/ai_gateway/templates/templates.json +52 -50
- package/_schemas/guardrails/context.json +12 -12
- package/_schemas/guardrails/schema.cedarschema +12 -12
- package/_schemas/guardrails/templates/defaults/agent_identity.cedar +60 -56
- package/_schemas/guardrails/templates/defaults/agentic_safety.cedar +83 -58
- package/_schemas/guardrails/templates/defaults/baseline.cedar +9 -12
- package/_schemas/guardrails/templates/defaults/injection.cedar +48 -36
- package/_schemas/guardrails/templates/defaults/pii.cedar +27 -20
- package/_schemas/guardrails/templates/defaults/secrets.cedar +39 -22
- package/_schemas/guardrails/templates/defaults/security_patterns.cedar +38 -25
- package/_schemas/guardrails/templates/defaults/semantic.cedar +47 -31
- package/_schemas/guardrails/templates/defaults/tool_risk.cedar +34 -26
- package/_schemas/guardrails/templates/defaults/toxicity.cedar +57 -47
- package/_schemas/guardrails/templates/mcp_tool_permissions.cedar +60 -43
- package/_schemas/guardrails/templates/profiles/a2a_security/cross_origin.cedar +29 -42
- package/_schemas/guardrails/templates/profiles/a2a_security/escalation_detection.cedar +43 -57
- package/_schemas/guardrails/templates/profiles/a2a_security/identity_enforcement.cedar +40 -57
- package/_schemas/guardrails/templates/profiles/a2a_security/inter_agent_injection.cedar +48 -62
- package/_schemas/guardrails/templates/profiles/a2a_security/supply_chain.cedar +40 -56
- package/_schemas/guardrails/templates/profiles/advanced_detection/pii.cedar +24 -34
- package/_schemas/guardrails/templates/profiles/advanced_detection/secrets.cedar +45 -37
- package/_schemas/guardrails/templates/profiles/advanced_detection/threat_severity.cedar +11 -16
- package/_schemas/guardrails/templates/profiles/chat_assistant/privacy.cedar +22 -9
- package/_schemas/guardrails/templates/profiles/chat_assistant/security.cedar +27 -15
- package/_schemas/guardrails/templates/profiles/chat_assistant/trust_safety.cedar +37 -22
- package/_schemas/guardrails/templates/profiles/code_agent/agentic_security.cedar +68 -47
- package/_schemas/guardrails/templates/profiles/code_agent/encoding.cedar +17 -21
- package/_schemas/guardrails/templates/profiles/code_agent/path_security.cedar +74 -73
- package/_schemas/guardrails/templates/profiles/code_agent/security.cedar +13 -9
- package/_schemas/guardrails/templates/profiles/code_agent/supply_chain.cedar +36 -58
- package/_schemas/guardrails/templates/profiles/data_pipeline/agentic_security.cedar +22 -15
- package/_schemas/guardrails/templates/profiles/data_pipeline/data_protection.cedar +52 -0
- package/_schemas/guardrails/templates/profiles/data_pipeline/privacy.cedar +41 -18
- package/_schemas/guardrails/templates/profiles/data_pipeline/security.cedar +18 -36
- package/_schemas/guardrails/templates/profiles/multi_agent/agent_safety.cedar +86 -79
- package/_schemas/guardrails/templates/profiles/multi_agent/agent_trust.cedar +73 -70
- package/_schemas/guardrails/templates/templates.json +198 -217
- package/_schemas/overwatch/context.json +14 -14
- package/_schemas/overwatch/schema.cedarschema +12 -12
- package/_schemas/sentry/context.json +11 -11
- package/_schemas/sentry/schema.cedarschema +11 -11
- package/_schemas/sentry/templates/defaults/baseline.cedar +8 -12
- package/_schemas/sentry/templates/defaults/clipboard.cedar +43 -42
- package/_schemas/sentry/templates/defaults/content_safety.cedar +38 -68
- package/_schemas/sentry/templates/defaults/file_safety.cedar +18 -26
- package/_schemas/sentry/templates/defaults/organization.cedar +10 -17
- package/_schemas/sentry/templates/defaults/pii.cedar +52 -73
- package/_schemas/sentry/templates/defaults/secrets.cedar +65 -58
- package/_schemas/sentry/templates/defaults/semantic.cedar +40 -59
- package/_schemas/sentry/templates/templates.json +53 -43
- package/dist/ai_gateway-context.gen.d.ts +18 -4
- package/dist/ai_gateway-context.gen.js +18 -4
- package/dist/ai_gateway-defaults.gen.d.ts +4 -1
- package/dist/ai_gateway-defaults.gen.js +398 -320
- package/dist/builder.d.ts +2 -1
- package/dist/builder.js +5 -2
- package/dist/guardrails-context.gen.d.ts +5 -5
- package/dist/guardrails-context.gen.js +5 -5
- package/dist/guardrails-defaults.gen.d.ts +4 -1
- package/dist/guardrails-defaults.gen.js +2130 -1903
- package/dist/overwatch-context.gen.d.ts +5 -5
- package/dist/overwatch-context.gen.js +5 -5
- package/dist/overwatch-defaults.gen.d.ts +4 -1
- package/dist/overwatch-defaults.gen.js +560 -566
- package/dist/sentry-context.gen.d.ts +3 -3
- package/dist/sentry-context.gen.js +3 -3
- package/dist/sentry-defaults.gen.d.ts +4 -1
- package/dist/sentry-defaults.gen.js +392 -453
- package/dist/service-schemas.gen.d.ts +4 -4
- package/dist/service-schemas.gen.js +249 -99
- package/package.json +1 -1
package/dist/builder.d.ts
CHANGED
|
@@ -49,7 +49,8 @@ export declare function isValidIdentifier(s: string): boolean;
|
|
|
49
49
|
export declare function sanitizeIdentifier(s: string, context: string): string;
|
|
50
50
|
/**
|
|
51
51
|
* Validate a raw condition string for potentially dangerous patterns.
|
|
52
|
-
*
|
|
52
|
+
* String literals are stripped first so `like` patterns such as "/etc/*"
|
|
53
|
+
* don't false-positive on the block-comment detector.
|
|
53
54
|
*/
|
|
54
55
|
export declare function isValidRawCondition(condition: string): boolean;
|
|
55
56
|
/**
|
package/dist/builder.js
CHANGED
|
@@ -71,12 +71,15 @@ export function sanitizeIdentifier(s, context) {
|
|
|
71
71
|
}
|
|
72
72
|
return sanitized;
|
|
73
73
|
}
|
|
74
|
+
const STRING_LITERAL_REGEX = /"(?:[^"\\]|\\.)*"/g;
|
|
74
75
|
/**
|
|
75
76
|
* Validate a raw condition string for potentially dangerous patterns.
|
|
76
|
-
*
|
|
77
|
+
* String literals are stripped first so `like` patterns such as "/etc/*"
|
|
78
|
+
* don't false-positive on the block-comment detector.
|
|
77
79
|
*/
|
|
78
80
|
export function isValidRawCondition(condition) {
|
|
79
|
-
|
|
81
|
+
const stripped = condition.replace(STRING_LITERAL_REGEX, '""');
|
|
82
|
+
return !DANGEROUS_PATTERN_REGEX.test(stripped);
|
|
80
83
|
}
|
|
81
84
|
/**
|
|
82
85
|
* Format an action string for Cedar policy text.
|
|
@@ -18,9 +18,7 @@ export declare const GuardrailsContextKey: {
|
|
|
18
18
|
readonly CommandInjectionScore: "command_injection_score";
|
|
19
19
|
readonly CommandInjectionType: "command_injection_type";
|
|
20
20
|
readonly ContainsCode: "contains_code";
|
|
21
|
-
readonly ContainsInvisibleChars: "contains_invisible_chars";
|
|
22
21
|
readonly ContainsNonAscii: "contains_non_ascii";
|
|
23
|
-
readonly ContainsSecrets: "contains_secrets";
|
|
24
22
|
readonly ContentSafetyBlocked: "content_safety_blocked";
|
|
25
23
|
readonly ContentSafetyScore: "content_safety_score";
|
|
26
24
|
readonly ContentTopics: "content_topics";
|
|
@@ -44,16 +42,17 @@ export declare const GuardrailsContextKey: {
|
|
|
44
42
|
readonly HighestSeverity: "highest_severity";
|
|
45
43
|
readonly IndirectInjectionScore: "indirect_injection_score";
|
|
46
44
|
readonly IndirectInjectionType: "indirect_injection_type";
|
|
47
|
-
readonly InjectionConfidence: "injection_confidence";
|
|
48
45
|
readonly InjectionDeepContextScore: "injection_deep_context_score";
|
|
49
46
|
readonly InjectionPulseScore: "injection_pulse_score";
|
|
47
|
+
readonly InjectionScore: "injection_score";
|
|
50
48
|
readonly InjectionType: "injection_type";
|
|
49
|
+
readonly InvisibleCharsDetected: "invisible_chars_detected";
|
|
51
50
|
readonly InvisibleCharsScore: "invisible_chars_score";
|
|
52
51
|
readonly IsEnglish: "is_english";
|
|
53
52
|
readonly IsLatinScript: "is_latin_script";
|
|
54
|
-
readonly JailbreakConfidence: "jailbreak_confidence";
|
|
55
53
|
readonly JailbreakDeepContextScore: "jailbreak_deep_context_score";
|
|
56
54
|
readonly JailbreakPulseScore: "jailbreak_pulse_score";
|
|
55
|
+
readonly JailbreakScore: "jailbreak_score";
|
|
57
56
|
readonly KeywordCategories: "keyword_categories";
|
|
58
57
|
readonly KeywordCount: "keyword_count";
|
|
59
58
|
readonly KeywordMatched: "keyword_matched";
|
|
@@ -74,9 +73,9 @@ export declare const GuardrailsContextKey: {
|
|
|
74
73
|
readonly PathTraversalType: "path_traversal_type";
|
|
75
74
|
readonly PatternType: "pattern_type";
|
|
76
75
|
readonly PhishingDetected: "phishing_detected";
|
|
77
|
-
readonly PiiConfidence: "pii_confidence";
|
|
78
76
|
readonly PiiCount: "pii_count";
|
|
79
77
|
readonly PiiDetected: "pii_detected";
|
|
78
|
+
readonly PiiScore: "pii_score";
|
|
80
79
|
readonly PiiTypes: "pii_types";
|
|
81
80
|
readonly ProfanityScore: "profanity_score";
|
|
82
81
|
readonly RequestId: "request_id";
|
|
@@ -86,6 +85,7 @@ export declare const GuardrailsContextKey: {
|
|
|
86
85
|
readonly ScriptConfidence: "script_confidence";
|
|
87
86
|
readonly SecretCount: "secret_count";
|
|
88
87
|
readonly SecretTypes: "secret_types";
|
|
88
|
+
readonly SecretsDetected: "secrets_detected";
|
|
89
89
|
readonly SentimentScore: "sentiment_score";
|
|
90
90
|
readonly SequenceRisk: "sequence_risk";
|
|
91
91
|
readonly SessionCommandInjection: "session_command_injection";
|
|
@@ -20,9 +20,7 @@ export const GuardrailsContextKey = {
|
|
|
20
20
|
CommandInjectionScore: 'command_injection_score',
|
|
21
21
|
CommandInjectionType: 'command_injection_type',
|
|
22
22
|
ContainsCode: 'contains_code',
|
|
23
|
-
ContainsInvisibleChars: 'contains_invisible_chars',
|
|
24
23
|
ContainsNonAscii: 'contains_non_ascii',
|
|
25
|
-
ContainsSecrets: 'contains_secrets',
|
|
26
24
|
ContentSafetyBlocked: 'content_safety_blocked',
|
|
27
25
|
ContentSafetyScore: 'content_safety_score',
|
|
28
26
|
ContentTopics: 'content_topics',
|
|
@@ -46,16 +44,17 @@ export const GuardrailsContextKey = {
|
|
|
46
44
|
HighestSeverity: 'highest_severity',
|
|
47
45
|
IndirectInjectionScore: 'indirect_injection_score',
|
|
48
46
|
IndirectInjectionType: 'indirect_injection_type',
|
|
49
|
-
InjectionConfidence: 'injection_confidence',
|
|
50
47
|
InjectionDeepContextScore: 'injection_deep_context_score',
|
|
51
48
|
InjectionPulseScore: 'injection_pulse_score',
|
|
49
|
+
InjectionScore: 'injection_score',
|
|
52
50
|
InjectionType: 'injection_type',
|
|
51
|
+
InvisibleCharsDetected: 'invisible_chars_detected',
|
|
53
52
|
InvisibleCharsScore: 'invisible_chars_score',
|
|
54
53
|
IsEnglish: 'is_english',
|
|
55
54
|
IsLatinScript: 'is_latin_script',
|
|
56
|
-
JailbreakConfidence: 'jailbreak_confidence',
|
|
57
55
|
JailbreakDeepContextScore: 'jailbreak_deep_context_score',
|
|
58
56
|
JailbreakPulseScore: 'jailbreak_pulse_score',
|
|
57
|
+
JailbreakScore: 'jailbreak_score',
|
|
59
58
|
KeywordCategories: 'keyword_categories',
|
|
60
59
|
KeywordCount: 'keyword_count',
|
|
61
60
|
KeywordMatched: 'keyword_matched',
|
|
@@ -76,9 +75,9 @@ export const GuardrailsContextKey = {
|
|
|
76
75
|
PathTraversalType: 'path_traversal_type',
|
|
77
76
|
PatternType: 'pattern_type',
|
|
78
77
|
PhishingDetected: 'phishing_detected',
|
|
79
|
-
PiiConfidence: 'pii_confidence',
|
|
80
78
|
PiiCount: 'pii_count',
|
|
81
79
|
PiiDetected: 'pii_detected',
|
|
80
|
+
PiiScore: 'pii_score',
|
|
82
81
|
PiiTypes: 'pii_types',
|
|
83
82
|
ProfanityScore: 'profanity_score',
|
|
84
83
|
RequestId: 'request_id',
|
|
@@ -88,6 +87,7 @@ export const GuardrailsContextKey = {
|
|
|
88
87
|
ScriptConfidence: 'script_confidence',
|
|
89
88
|
SecretCount: 'secret_count',
|
|
90
89
|
SecretTypes: 'secret_types',
|
|
90
|
+
SecretsDetected: 'secrets_detected',
|
|
91
91
|
SentimentScore: 'sentiment_score',
|
|
92
92
|
SequenceRisk: 'sequence_risk',
|
|
93
93
|
SessionCommandInjection: 'session_command_injection',
|
|
@@ -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' | '
|
|
5
|
+
export type GuardrailsCategory = 'security' | 'privacy' | 'data-protection' | 'trust-safety' | 'tools' | 'agent-security' | 'agent-identity' | 'organization';
|
|
6
6
|
/**
|
|
7
7
|
* Category metadata for UI display.
|
|
8
8
|
*/
|
|
@@ -50,6 +50,9 @@ export interface GuardrailsTemplate {
|
|
|
50
50
|
severity: string;
|
|
51
51
|
/** Tags for filtering */
|
|
52
52
|
tags: string[];
|
|
53
|
+
/** True when ensure-defaults should auto-seed this template at
|
|
54
|
+
* project creation. See schemas/*\/templates.json. Defaults to false. */
|
|
55
|
+
autoDeploy?: boolean;
|
|
53
56
|
}
|
|
54
57
|
export declare const GUARDRAILS_CATEGORIES: GuardrailsCategoryInfo[];
|
|
55
58
|
export declare const GUARDRAILS_DEFAULTS: GuardrailsDefaultPolicy[];
|