@highflame/policy 2.1.3 → 2.1.5

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.
Files changed (43) hide show
  1. package/README.md +41 -0
  2. package/_schemas/guardrails/context.json +466 -76
  3. package/_schemas/guardrails/schema.cedarschema +39 -3
  4. package/_schemas/guardrails/templates/defaults/injection.cedar +6 -6
  5. package/_schemas/guardrails/templates/profiles/chat_assistant/security.cedar +2 -2
  6. package/_schemas/guardrails/templates/profiles/data_pipeline/security.cedar +1 -1
  7. package/_schemas/overwatch/context.json +443 -5
  8. package/_schemas/overwatch/schema.cedarschema +42 -4
  9. package/_schemas/palisade/context.json +1 -1
  10. package/_schemas/sentry/context.json +1165 -0
  11. package/_schemas/sentry/schema.cedarschema +388 -0
  12. package/_schemas/sentry/templates/defaults/baseline.cedar +24 -0
  13. package/_schemas/sentry/templates/defaults/content_safety.cedar +232 -0
  14. package/_schemas/sentry/templates/defaults/file_safety.cedar +174 -0
  15. package/_schemas/sentry/templates/defaults/organization.cedar +207 -0
  16. package/_schemas/sentry/templates/defaults/pii.cedar +229 -0
  17. package/_schemas/sentry/templates/defaults/semantic.cedar +167 -0
  18. package/_schemas/sentry/templates/templates.json +93 -0
  19. package/dist/builder.d.ts +32 -0
  20. package/dist/builder.js +6 -6
  21. package/dist/condition-groups.d.ts +69 -0
  22. package/dist/condition-groups.js +305 -0
  23. package/dist/guardrails-context.gen.d.ts +19 -2
  24. package/dist/guardrails-context.gen.js +19 -2
  25. package/dist/guardrails-defaults.gen.js +9 -9
  26. package/dist/index.d.ts +6 -1
  27. package/dist/index.js +6 -1
  28. package/dist/overwatch-context.gen.d.ts +17 -0
  29. package/dist/overwatch-context.gen.js +17 -0
  30. package/dist/sentry-context.gen.d.ts +76 -0
  31. package/dist/sentry-context.gen.js +77 -0
  32. package/dist/sentry-defaults.gen.d.ts +61 -0
  33. package/dist/sentry-defaults.gen.js +1235 -0
  34. package/dist/sentry-entities.gen.d.ts +11 -0
  35. package/dist/sentry-entities.gen.js +33 -0
  36. package/dist/service-schemas.gen.d.ts +12 -2
  37. package/dist/service-schemas.gen.js +861 -25
  38. package/dist/types.d.ts +6 -1
  39. package/dist/types.js +6 -1
  40. package/package.json +1 -1
  41. package/_schemas/guardrails/templates/profiles/chat_assistant.cedar +0 -85
  42. package/_schemas/guardrails/templates/profiles/code_agent.cedar +0 -125
  43. package/_schemas/guardrails/templates/profiles/data_pipeline.cedar +0 -111
@@ -0,0 +1,77 @@
1
+ // Code generated by highflame-policy-codegen. DO NOT EDIT.
2
+ // Source: schemas/sentry/context.json
3
+ /**
4
+ * Context attribute keys for Sentry Sentry browser security — monitors AI chat interactions and enforces data-protection, content-safety, and compliance policies.
5
+ *
6
+ * These constants correspond to the context attributes defined in the
7
+ * Sentry Cedar schema and are used at policy evaluation time.
8
+ */
9
+ export const SentryContextKey = {
10
+ CodeLanguages: 'code_languages',
11
+ CodeRatio: 'code_ratio',
12
+ ContainsCode: 'contains_code',
13
+ ContainsInvisibleChars: 'contains_invisible_chars',
14
+ ContainsSecrets: 'contains_secrets',
15
+ Content: 'content',
16
+ ContentTopics: 'content_topics',
17
+ CrimeScore: 'crime_score',
18
+ DetectedLanguage: 'detected_language',
19
+ DetectedScript: 'detected_script',
20
+ DetectedThreats: 'detected_threats',
21
+ EncodedContentDetected: 'encoded_content_detected',
22
+ EncodedCount: 'encoded_count',
23
+ EncodedScore: 'encoded_score',
24
+ EncodedTypes: 'encoded_types',
25
+ Event: 'event',
26
+ FactualityScore: 'factuality_score',
27
+ FileExtension: 'file_extension',
28
+ FileName: 'file_name',
29
+ FileSizeBytes: 'file_size_bytes',
30
+ FileType: 'file_type',
31
+ HallucinationScore: 'hallucination_score',
32
+ HateSpeechScore: 'hate_speech_score',
33
+ HighestSeverity: 'highest_severity',
34
+ InjectionScore: 'injection_score',
35
+ InvisibleCharsScore: 'invisible_chars_score',
36
+ IsEncrypted: 'is_encrypted',
37
+ IsEnglish: 'is_english',
38
+ IsLatinScript: 'is_latin_script',
39
+ IsRightsManaged: 'is_rights_managed',
40
+ JailbreakScore: 'jailbreak_score',
41
+ KeywordCategories: 'keyword_categories',
42
+ KeywordCount: 'keyword_count',
43
+ KeywordMatched: 'keyword_matched',
44
+ LanguageConfidence: 'language_confidence',
45
+ MaxThreatSeverity: 'max_threat_severity',
46
+ MipLabelId: 'mip_label_id',
47
+ MipLabelName: 'mip_label_name',
48
+ PasteLength: 'paste_length',
49
+ PasteSourceApp: 'paste_source_app',
50
+ PasteSourceUrl: 'paste_source_url',
51
+ PhishingDetected: 'phishing_detected',
52
+ PiiConfidence: 'pii_confidence',
53
+ PiiCount: 'pii_count',
54
+ PiiDetected: 'pii_detected',
55
+ PiiTypes: 'pii_types',
56
+ ProfanityScore: 'profanity_score',
57
+ ScriptConfidence: 'script_confidence',
58
+ SecretCount: 'secret_count',
59
+ SecretTypes: 'secret_types',
60
+ SensitivityLevel: 'sensitivity_level',
61
+ SessionInjectionDetected: 'session_injection_detected',
62
+ SessionPiiDetected: 'session_pii_detected',
63
+ SessionPiiTypes: 'session_pii_types',
64
+ SessionSecretTypes: 'session_secret_types',
65
+ SessionSecretsDetected: 'session_secrets_detected',
66
+ SessionThreatTurns: 'session_threat_turns',
67
+ SexualScore: 'sexual_score',
68
+ Source: 'source',
69
+ TargetApp: 'target_app',
70
+ TargetUrl: 'target_url',
71
+ ThreatCategories: 'threat_categories',
72
+ ThreatCount: 'threat_count',
73
+ TopicConfidence: 'topic_confidence',
74
+ UserEmail: 'user_email',
75
+ ViolenceScore: 'violence_score',
76
+ WeaponsScore: 'weapons_score',
77
+ };
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Sentry policy category identifiers.
3
+ * Maps to UI tab names in Studio.
4
+ */
5
+ export type SentryCategory = 'pii' | 'semantic' | 'content_safety' | 'file_safety' | 'organization';
6
+ /**
7
+ * Category metadata for UI display.
8
+ */
9
+ export interface SentryCategoryInfo {
10
+ id: SentryCategory;
11
+ name: string;
12
+ description: string;
13
+ }
14
+ /**
15
+ * A default policy that is auto-created for new projects.
16
+ */
17
+ export interface SentryDefaultPolicy {
18
+ /** Template identifier */
19
+ id: string;
20
+ /** Human-readable name */
21
+ name: string;
22
+ /** Description for UI display */
23
+ description: string;
24
+ /** Policy category */
25
+ category: SentryCategory;
26
+ /** Cedar policy text (source of truth) */
27
+ cedarText: string;
28
+ /** Severity level */
29
+ severity: string;
30
+ /** Tags for filtering */
31
+ tags: string[];
32
+ /** Whether this default should be activated immediately */
33
+ isActive: boolean;
34
+ }
35
+ /**
36
+ * A policy template available for users to create from.
37
+ */
38
+ export interface SentryTemplate {
39
+ /** Template identifier */
40
+ id: string;
41
+ /** Human-readable name */
42
+ name: string;
43
+ /** Description for UI display */
44
+ description: string;
45
+ /** Policy category */
46
+ category: SentryCategory;
47
+ /** Cedar policy text */
48
+ cedarText: string;
49
+ /** Severity level */
50
+ severity: string;
51
+ /** Tags for filtering */
52
+ tags: string[];
53
+ }
54
+ export declare const SENTRY_CATEGORIES: SentryCategoryInfo[];
55
+ export declare const SENTRY_DEFAULTS: SentryDefaultPolicy[];
56
+ export declare const SENTRY_TEMPLATES: SentryTemplate[];
57
+ /** Raw templates.json metadata for the Sentry service. */
58
+ export declare const SENTRY_TEMPLATES_JSON: string;
59
+ export declare function getSentryDefaultsByCategory(category: SentryCategory): SentryDefaultPolicy[];
60
+ export declare function getSentryTemplatesByCategory(category: SentryCategory): SentryTemplate[];
61
+ export declare function getSentryTemplateById(id: string): SentryTemplate | undefined;