@highflame/policy 2.2.3 → 2.2.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 (27) hide show
  1. package/_schemas/ai_gateway/templates/defaults/pii.cedar +164 -0
  2. package/_schemas/ai_gateway/templates/defaults/pii_advanced.cedar +465 -0
  3. package/_schemas/ai_gateway/templates/defaults/pii_model.cedar +90 -0
  4. package/_schemas/ai_gateway/templates/secrets.cedar +46 -0
  5. package/_schemas/ai_gateway/templates/templates.json +88 -11
  6. package/_schemas/guardrails/templates/defaults/pii.cedar +137 -28
  7. package/_schemas/guardrails/templates/defaults/pii_model.cedar +90 -0
  8. package/_schemas/guardrails/templates/profiles/advanced_detection/pii.cedar +433 -31
  9. package/_schemas/guardrails/templates/templates.json +158 -43
  10. package/_schemas/sentry/templates/defaults/clipboard.cedar +3 -18
  11. package/_schemas/sentry/templates/defaults/file_safety.cedar +2 -17
  12. package/_schemas/sentry/templates/defaults/pii.cedar +102 -96
  13. package/_schemas/sentry/templates/defaults/pii_advanced.cedar +465 -0
  14. package/_schemas/sentry/templates/defaults/pii_model.cedar +90 -0
  15. package/_schemas/sentry/templates/templates.json +68 -11
  16. package/dist/ai_gateway-defaults.gen.d.ts +1 -1
  17. package/dist/ai_gateway-defaults.gen.js +838 -59
  18. package/dist/ai_gateway-detectors.gen.js +18 -4
  19. package/dist/guardrails-defaults.gen.js +834 -226
  20. package/dist/overwatch-defaults.gen.js +703 -114
  21. package/dist/overwatch-detectors.gen.js +31 -1
  22. package/dist/sentry-defaults.gen.js +746 -138
  23. package/dist/sentry-detectors.gen.js +109 -2
  24. package/package.json +1 -1
  25. package/_schemas/ai_gateway/templates/pii_redaction.cedar +0 -94
  26. package/_schemas/guardrails/templates/profiles/chat_assistant/privacy.cedar +0 -35
  27. package/_schemas/guardrails/templates/profiles/data_pipeline/privacy.cedar +0 -63
@@ -530,99 +530,773 @@ when {
530
530
  context has mcp_server_verified && context.mcp_server_verified == false
531
531
  };
532
532
  `;
533
- const AI_GATEWAY_DATA_PROTECTION_PII_REDACTION_CEDAR = `// =============================================================================
534
- // PII & Secrets Redaction
533
+ const AI_GATEWAY_DATA_PROTECTION_SECRETS_CEDAR = `// =============================================================================
534
+ // Secrets Detection
535
535
  // =============================================================================
536
- // Blocks AI Gateway operations when personally identifiable information or
537
- // secrets are detected in the content. Covers both LLM prompt processing
538
- // and MCP tool calls, plus a bulk-exposure catch-all.
536
+ // Blocks AI Gateway operations when secrets or credentials are detected in the
537
+ // content. Covers both LLM prompt processing and MCP tool calls. PII is handled
538
+ // by the canonical privacy.* templates (defaults/pii*.cedar).
539
539
  //
540
540
  // Context keys consumed:
541
- // - pii_detected: Bool
542
541
  // - secrets_detected: Bool
543
- // - pii_count: Long
544
542
  //
545
543
  // Compliance:
546
544
  // - OWASP LLM06
547
- // - GDPR, HIPAA (depending on data classification)
548
545
  //
549
546
  // Category: data-protection
550
547
  // Namespace: AIGateway
551
548
  // =============================================================================
552
549
 
553
- @id("data-protection.block-pii")
554
- @name("Block PII in prompts")
555
- @description("Blocks process_prompt when pii_detected is true.")
556
- @severity("high")
557
- @tags("category:data-protection,threat:pii,detection:rule,surface:process-prompt,owasp:llm06")
558
- @reject_message("Prompt blocked: personally identifiable information was detected — remove sensitive data and retry.")
550
+ @id("data-protection.block-secrets")
551
+ @name("Block secrets in prompts")
552
+ @description("Blocks process_prompt when secrets_detected is true.")
553
+ @severity("critical")
554
+ @tags("category:data-protection,threat:secrets,detection:rule,surface:process-prompt,owasp:llm06")
555
+ @reject_message("Prompt blocked: secrets or credentials were detected — remove sensitive data and retry.")
559
556
  forbid (
560
557
  principal,
561
558
  action == AIGateway::Action::"process_prompt",
562
559
  resource
563
560
  )
564
561
  when {
565
- context has pii_detected && context.pii_detected == true
562
+ context has secrets_detected && context.secrets_detected == true
566
563
  };
567
564
 
568
- @id("data-protection.block-secrets")
569
- @name("Block secrets in prompts")
570
- @description("Blocks process_prompt when secrets_detected is true.")
565
+ @id("data-protection.block-secrets-tools")
566
+ @name("Block secrets in tool calls")
567
+ @description("Blocks call_tool when secrets_detected is true.")
571
568
  @severity("critical")
572
- @tags("category:data-protection,threat:secrets,detection:rule,surface:process-prompt")
573
- @reject_message("Prompt blocked: secrets or credentials were detected remove sensitive data and retry.")
569
+ @tags("category:data-protection,threat:secrets,detection:rule,surface:call-tool,owasp:llm06")
570
+ @reject_message("Tool execution blocked: secrets or credentials were detected in tool arguments.")
574
571
  forbid (
575
572
  principal,
576
- action == AIGateway::Action::"process_prompt",
573
+ action == AIGateway::Action::"call_tool",
577
574
  resource
578
575
  )
579
576
  when {
580
577
  context has secrets_detected && context.secrets_detected == true
581
578
  };
579
+ `;
580
+ const AI_GATEWAY_PRIVACY_DEFAULTS_CEDAR = `// =============================================================================
581
+ // Structural PII (Tier 1)
582
+ // =============================================================================
583
+ // Blocks high-sensitivity identifiers that have a deterministic structure (SSNs, credit cards, IBANs, API keys) using fast regex pattern matching — high precision, low latency, few false positives. One forbid rule per identifier group.
584
+ //
585
+ // Sensitivity tiers and the structural (regex) / contextual (model) type
586
+ // vocabulary are defined canonically in schemas/_shared/pii_taxonomy.json and
587
+ // enforced by tools/lint-templates.
588
+ //
589
+ // Context keys consumed:
590
+ // - pii_types: Set<String> (union of structural lowercase + contextual uppercase types)
591
+ //
592
+ // Category: privacy
593
+ // Namespace: AIGateway
594
+ // =============================================================================
582
595
 
583
- @id("data-protection.block-pii-tools")
584
- @name("Block PII in tool calls")
585
- @description("Blocks call_tool when pii_detected is true.")
596
+ @id("privacy.block-pii-national-id")
597
+ @name("Block national ID numbers (structural)")
598
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a national ID (SSN, passport, or driver's license).")
586
599
  @severity("high")
587
- @tags("category:data-protection,threat:pii,detection:rule,surface:call-tool,owasp:llm06")
588
- @reject_message("Tool execution blocked: personally identifiable information was detected in tool arguments.")
600
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
601
+ @reject_message("Content blocked: national identifier (SSN, passport, or driver's license) patterns detected.")
589
602
  forbid (
590
603
  principal,
591
- action == AIGateway::Action::"call_tool",
604
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
592
605
  resource
593
606
  )
594
607
  when {
595
- context has pii_detected && context.pii_detected == true
608
+ context has pii_types &&
609
+ (
610
+ context.pii_types.contains("ssn") ||
611
+ context.pii_types.contains("passport") ||
612
+ context.pii_types.contains("national_id") ||
613
+ context.pii_types.contains("drivers_license")
614
+ )
596
615
  };
597
616
 
598
- @id("data-protection.block-secrets-tools")
599
- @name("Block secrets in tool calls")
600
- @description("Blocks call_tool when secrets_detected is true.")
617
+ @id("privacy.block-pii-credit-card")
618
+ @name("Block credit card numbers (structural)")
619
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a credit card number.")
601
620
  @severity("critical")
602
- @tags("category:data-protection,threat:secrets,detection:rule,surface:call-tool")
603
- @reject_message("Tool execution blocked: secrets or credentials were detected in tool arguments.")
621
+ @tags("category:privacy,threat:pii,detection:pattern,compliance:pci-dss,owasp:llm06")
622
+ @reject_message("Content blocked: credit card number patterns detected.")
604
623
  forbid (
605
624
  principal,
606
- action == AIGateway::Action::"call_tool",
625
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
607
626
  resource
608
627
  )
609
628
  when {
610
- context has secrets_detected && context.secrets_detected == true
629
+ context has pii_types && context.pii_types.contains("credit_card")
611
630
  };
612
631
 
613
- @id("data-protection.block-pii-bulk")
614
- @name("Block bulk PII exposure")
615
- @description("Blocks any action when pii_count >= 3.")
632
+ @id("privacy.block-pii-bank-account")
633
+ @name("Block bank account numbers (structural)")
634
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a bank account number (IBAN, SWIFT/BIC, or routing number).")
616
635
  @severity("critical")
617
- @tags("category:data-protection,threat:exfiltration,detection:aggregate,posture:catch-all")
618
- @reject_message("Request blocked: multiple PII matches were detected — possible data exfiltration.")
636
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
637
+ @reject_message("Content blocked: bank account (IBAN) number patterns detected.")
619
638
  forbid (
620
639
  principal,
621
- action,
640
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
641
+ resource
642
+ )
643
+ when {
644
+ context has pii_types &&
645
+ (
646
+ context.pii_types.contains("iban") ||
647
+ context.pii_types.contains("bank_account") ||
648
+ context.pii_types.contains("swift_bic") ||
649
+ context.pii_types.contains("aba_routing")
650
+ )
651
+ };
652
+
653
+ @id("privacy.block-pii-medical")
654
+ @name("Block medical identifiers (structural)")
655
+ @description("Blocks prompts, tool calls, and file reads/writes that contain medical data (record number, MBI, NPI, or blood type).")
656
+ @severity("medium")
657
+ @tags("category:privacy,threat:pii,detection:pattern,compliance:hipaa,owasp:llm06")
658
+ @reject_message("Content blocked: medical record identifier patterns detected.")
659
+ forbid (
660
+ principal,
661
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
662
+ resource
663
+ )
664
+ when {
665
+ context has pii_types &&
666
+ (
667
+ context.pii_types.contains("medical_record") ||
668
+ context.pii_types.contains("patient_record") ||
669
+ context.pii_types.contains("medicare_beneficiary_id") ||
670
+ context.pii_types.contains("npi") ||
671
+ context.pii_types.contains("medical_term") ||
672
+ context.pii_types.contains("blood_type")
673
+ )
674
+ };
675
+
676
+ @id("privacy.block-pii-tax-id")
677
+ @name("Block tax identifiers (structural)")
678
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a tax ID (ITIN, EIN, or PTIN).")
679
+ @severity("high")
680
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
681
+ @reject_message("Content blocked: tax identifier (ITIN or EIN) patterns detected.")
682
+ forbid (
683
+ principal,
684
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
622
685
  resource
623
686
  )
624
687
  when {
625
- context has pii_count && context.pii_count >= 3
688
+ context has pii_types &&
689
+ (
690
+ context.pii_types.contains("itin") ||
691
+ context.pii_types.contains("ein") ||
692
+ context.pii_types.contains("ptin")
693
+ )
694
+ };
695
+
696
+ @id("privacy.block-pii-credential")
697
+ @name("Block credentials (structural)")
698
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a credential or secret (API key, token, password hash, or private key).")
699
+ @severity("critical")
700
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
701
+ @reject_message("Content blocked: credential or API key patterns detected.")
702
+ forbid (
703
+ principal,
704
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
705
+ resource
706
+ )
707
+ when {
708
+ context has pii_types &&
709
+ (
710
+ context.pii_types.contains("aws_access_key") ||
711
+ context.pii_types.contains("api_key") ||
712
+ context.pii_types.contains("jwt_token") ||
713
+ context.pii_types.contains("encryption_key") ||
714
+ context.pii_types.contains("http_basic_auth") ||
715
+ context.pii_types.contains("gcp_credential") ||
716
+ context.pii_types.contains("gcp_api_key") ||
717
+ context.pii_types.contains("gcp_signed_policy") ||
718
+ context.pii_types.contains("session_cookie") ||
719
+ context.pii_types.contains("oauth_token") ||
720
+ context.pii_types.contains("tls_certificate") ||
721
+ context.pii_types.contains("password_hash") ||
722
+ context.pii_types.contains("csrf_token")
723
+ )
724
+ };
725
+
726
+ @id("privacy.block-pii-crypto")
727
+ @name("Block cryptocurrency addresses (structural)")
728
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a cryptocurrency wallet address.")
729
+ @severity("high")
730
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
731
+ @reject_message("Content blocked: cryptocurrency wallet address patterns detected.")
732
+ forbid (
733
+ principal,
734
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
735
+ resource
736
+ )
737
+ when {
738
+ context has pii_types &&
739
+ (
740
+ context.pii_types.contains("bitcoin_address") ||
741
+ context.pii_types.contains("ethereum_address")
742
+ )
743
+ };
744
+ `;
745
+ const AI_GATEWAY_PRIVACY_PII_MODEL_CEDAR = `// =============================================================================
746
+ // Contextual PII (Tier 2)
747
+ // =============================================================================
748
+ // Blocks the same high-sensitivity identifier groups inferred from surrounding context by the ML PII model — catches unstructured or novel PII the structural patterns miss (higher recall). Requires the pii_model detector.
749
+ //
750
+ // Sensitivity tiers and the structural (regex) / contextual (model) type
751
+ // vocabulary are defined canonically in schemas/_shared/pii_taxonomy.json and
752
+ // enforced by tools/lint-templates.
753
+ //
754
+ // Context keys consumed:
755
+ // - pii_types: Set<String> (union of structural lowercase + contextual uppercase types)
756
+ //
757
+ // Category: privacy
758
+ // Namespace: AIGateway
759
+ // =============================================================================
760
+
761
+ @id("privacy.block-pii-national-id-model")
762
+ @name("Block national ID numbers (contextual)")
763
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a national ID (SSN, passport, or driver's license).")
764
+ @severity("high")
765
+ @tags("category:privacy,threat:pii,detection:ml,owasp:llm06")
766
+ @reject_message("Content blocked: national identifier (SSN, passport, or driver's license) patterns detected.")
767
+ forbid (
768
+ principal,
769
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
770
+ resource
771
+ )
772
+ when {
773
+ context has pii_types && context.pii_types.contains("NATIONAL_ID")
774
+ };
775
+
776
+ @id("privacy.block-pii-credit-card-model")
777
+ @name("Block credit card numbers (contextual)")
778
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a credit card number.")
779
+ @severity("critical")
780
+ @tags("category:privacy,threat:pii,detection:ml,compliance:pci-dss,owasp:llm06")
781
+ @reject_message("Content blocked: credit card number patterns detected.")
782
+ forbid (
783
+ principal,
784
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
785
+ resource
786
+ )
787
+ when {
788
+ context has pii_types && context.pii_types.contains("CREDIT_CARD")
789
+ };
790
+
791
+ @id("privacy.block-pii-bank-account-model")
792
+ @name("Block bank account numbers (contextual)")
793
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a bank account number (IBAN, SWIFT/BIC, or routing number).")
794
+ @severity("critical")
795
+ @tags("category:privacy,threat:pii,detection:ml,owasp:llm06")
796
+ @reject_message("Content blocked: bank account (IBAN) number patterns detected.")
797
+ forbid (
798
+ principal,
799
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
800
+ resource
801
+ )
802
+ when {
803
+ context has pii_types && context.pii_types.contains("ACCOUNT_NUMBER")
804
+ };
805
+
806
+ @id("privacy.block-pii-medical-model")
807
+ @name("Block medical identifiers (contextual)")
808
+ @description("Blocks prompts, tool calls, and file reads/writes that contain medical data (record number, MBI, NPI, or blood type).")
809
+ @severity("medium")
810
+ @tags("category:privacy,threat:pii,detection:ml,compliance:hipaa,owasp:llm06")
811
+ @reject_message("Content blocked: medical record identifier patterns detected.")
812
+ forbid (
813
+ principal,
814
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
815
+ resource
816
+ )
817
+ when {
818
+ context has pii_types && context.pii_types.contains("MEDICAL")
819
+ };
820
+
821
+ @id("privacy.block-pii-credential-model")
822
+ @name("Block credentials (contextual)")
823
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a credential or secret (API key, token, password hash, or private key).")
824
+ @severity("critical")
825
+ @tags("category:privacy,threat:pii,detection:ml,owasp:llm06")
826
+ @reject_message("Content blocked: credential or API key patterns detected.")
827
+ forbid (
828
+ principal,
829
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
830
+ resource
831
+ )
832
+ when {
833
+ context has pii_types && context.pii_types.contains("CREDENTIAL")
834
+ };
835
+ `;
836
+ const AI_GATEWAY_PRIVACY_ADVANCED_PII_CEDAR = `// =============================================================================
837
+ // Comprehensive PII (Tier 3)
838
+ // =============================================================================
839
+ // Blocks every PII entity type — structural and contextual, sensitive and situational — one forbid rule per group so any individual type can be toggled off. High false-positive surface; opt-in.
840
+ //
841
+ // Sensitivity tiers and the structural (regex) / contextual (model) type
842
+ // vocabulary are defined canonically in schemas/_shared/pii_taxonomy.json and
843
+ // enforced by tools/lint-templates.
844
+ //
845
+ // Context keys consumed:
846
+ // - pii_types: Set<String> (union of structural lowercase + contextual uppercase types)
847
+ //
848
+ // Category: privacy
849
+ // Namespace: AIGateway
850
+ // =============================================================================
851
+
852
+ @id("privacy.block-pii-national-id-all")
853
+ @name("Block national ID numbers (comprehensive)")
854
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a national ID (SSN, passport, or driver's license).")
855
+ @severity("high")
856
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
857
+ @reject_message("Content blocked: national identifier (SSN, passport, or driver's license) patterns detected.")
858
+ forbid (
859
+ principal,
860
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
861
+ resource
862
+ )
863
+ when {
864
+ context has pii_types &&
865
+ (
866
+ context.pii_types.contains("ssn") ||
867
+ context.pii_types.contains("passport") ||
868
+ context.pii_types.contains("national_id") ||
869
+ context.pii_types.contains("drivers_license") ||
870
+ context.pii_types.contains("NATIONAL_ID")
871
+ )
872
+ };
873
+
874
+ @id("privacy.block-pii-credit-card-all")
875
+ @name("Block credit card numbers (comprehensive)")
876
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a credit card number.")
877
+ @severity("critical")
878
+ @tags("category:privacy,threat:pii,detection:pattern,compliance:pci-dss,owasp:llm06")
879
+ @reject_message("Content blocked: credit card number patterns detected.")
880
+ forbid (
881
+ principal,
882
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
883
+ resource
884
+ )
885
+ when {
886
+ context has pii_types &&
887
+ (
888
+ context.pii_types.contains("credit_card") ||
889
+ context.pii_types.contains("CREDIT_CARD")
890
+ )
891
+ };
892
+
893
+ @id("privacy.block-pii-bank-account-all")
894
+ @name("Block bank account numbers (comprehensive)")
895
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a bank account number (IBAN, SWIFT/BIC, or routing number).")
896
+ @severity("critical")
897
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
898
+ @reject_message("Content blocked: bank account (IBAN) number patterns detected.")
899
+ forbid (
900
+ principal,
901
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
902
+ resource
903
+ )
904
+ when {
905
+ context has pii_types &&
906
+ (
907
+ context.pii_types.contains("iban") ||
908
+ context.pii_types.contains("bank_account") ||
909
+ context.pii_types.contains("swift_bic") ||
910
+ context.pii_types.contains("aba_routing") ||
911
+ context.pii_types.contains("ACCOUNT_NUMBER")
912
+ )
913
+ };
914
+
915
+ @id("privacy.block-pii-medical-all")
916
+ @name("Block medical identifiers (comprehensive)")
917
+ @description("Blocks prompts, tool calls, and file reads/writes that contain medical data (record number, MBI, NPI, or blood type).")
918
+ @severity("medium")
919
+ @tags("category:privacy,threat:pii,detection:pattern,compliance:hipaa,owasp:llm06")
920
+ @reject_message("Content blocked: medical record identifier patterns detected.")
921
+ forbid (
922
+ principal,
923
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
924
+ resource
925
+ )
926
+ when {
927
+ context has pii_types &&
928
+ (
929
+ context.pii_types.contains("medical_record") ||
930
+ context.pii_types.contains("patient_record") ||
931
+ context.pii_types.contains("medicare_beneficiary_id") ||
932
+ context.pii_types.contains("npi") ||
933
+ context.pii_types.contains("medical_term") ||
934
+ context.pii_types.contains("blood_type") ||
935
+ context.pii_types.contains("MEDICAL")
936
+ )
937
+ };
938
+
939
+ @id("privacy.block-pii-tax-id-all")
940
+ @name("Block tax identifiers (comprehensive)")
941
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a tax ID (ITIN, EIN, or PTIN).")
942
+ @severity("high")
943
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
944
+ @reject_message("Content blocked: tax identifier (ITIN or EIN) patterns detected.")
945
+ forbid (
946
+ principal,
947
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
948
+ resource
949
+ )
950
+ when {
951
+ context has pii_types &&
952
+ (
953
+ context.pii_types.contains("itin") ||
954
+ context.pii_types.contains("ein") ||
955
+ context.pii_types.contains("ptin")
956
+ )
957
+ };
958
+
959
+ @id("privacy.block-pii-credential-all")
960
+ @name("Block credentials (comprehensive)")
961
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a credential or secret (API key, token, password hash, or private key).")
962
+ @severity("critical")
963
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
964
+ @reject_message("Content blocked: credential or API key patterns detected.")
965
+ forbid (
966
+ principal,
967
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
968
+ resource
969
+ )
970
+ when {
971
+ context has pii_types &&
972
+ (
973
+ context.pii_types.contains("aws_access_key") ||
974
+ context.pii_types.contains("api_key") ||
975
+ context.pii_types.contains("jwt_token") ||
976
+ context.pii_types.contains("encryption_key") ||
977
+ context.pii_types.contains("http_basic_auth") ||
978
+ context.pii_types.contains("gcp_credential") ||
979
+ context.pii_types.contains("gcp_api_key") ||
980
+ context.pii_types.contains("gcp_signed_policy") ||
981
+ context.pii_types.contains("session_cookie") ||
982
+ context.pii_types.contains("oauth_token") ||
983
+ context.pii_types.contains("tls_certificate") ||
984
+ context.pii_types.contains("password_hash") ||
985
+ context.pii_types.contains("csrf_token") ||
986
+ context.pii_types.contains("CREDENTIAL")
987
+ )
988
+ };
989
+
990
+ @id("privacy.block-pii-crypto-all")
991
+ @name("Block cryptocurrency addresses (comprehensive)")
992
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a cryptocurrency wallet address.")
993
+ @severity("high")
994
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
995
+ @reject_message("Content blocked: cryptocurrency wallet address patterns detected.")
996
+ forbid (
997
+ principal,
998
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
999
+ resource
1000
+ )
1001
+ when {
1002
+ context has pii_types &&
1003
+ (
1004
+ context.pii_types.contains("bitcoin_address") ||
1005
+ context.pii_types.contains("ethereum_address")
1006
+ )
1007
+ };
1008
+
1009
+ @id("privacy.block-pii-names-all")
1010
+ @name("Block personal names (comprehensive)")
1011
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a personal name.")
1012
+ @severity("low")
1013
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
1014
+ @reject_message("Content blocked: personal name patterns detected.")
1015
+ forbid (
1016
+ principal,
1017
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1018
+ resource
1019
+ )
1020
+ when {
1021
+ context has pii_types &&
1022
+ (
1023
+ context.pii_types.contains("person_name") ||
1024
+ context.pii_types.contains("PERSON")
1025
+ )
1026
+ };
1027
+
1028
+ @id("privacy.block-pii-email-all")
1029
+ @name("Block email addresses (comprehensive)")
1030
+ @description("Blocks prompts, tool calls, and file reads/writes that contain an email address.")
1031
+ @severity("medium")
1032
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
1033
+ @reject_message("Content blocked: email address patterns detected.")
1034
+ forbid (
1035
+ principal,
1036
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1037
+ resource
1038
+ )
1039
+ when {
1040
+ context has pii_types &&
1041
+ (
1042
+ context.pii_types.contains("email") ||
1043
+ context.pii_types.contains("EMAIL_ADDRESS")
1044
+ )
1045
+ };
1046
+
1047
+ @id("privacy.block-pii-phone-all")
1048
+ @name("Block phone numbers (comprehensive)")
1049
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a phone number.")
1050
+ @severity("medium")
1051
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
1052
+ @reject_message("Content blocked: phone number patterns detected.")
1053
+ forbid (
1054
+ principal,
1055
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1056
+ resource
1057
+ )
1058
+ when {
1059
+ context has pii_types &&
1060
+ (
1061
+ context.pii_types.contains("phone") ||
1062
+ context.pii_types.contains("PHONE_NUMBER")
1063
+ )
1064
+ };
1065
+
1066
+ @id("privacy.block-pii-datetime-all")
1067
+ @name("Block dates and times (comprehensive)")
1068
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a date or time (date of birth, timestamp, or card expiry).")
1069
+ @severity("medium")
1070
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
1071
+ @reject_message("Content blocked: date or time patterns detected.")
1072
+ forbid (
1073
+ principal,
1074
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1075
+ resource
1076
+ )
1077
+ when {
1078
+ context has pii_types &&
1079
+ (
1080
+ context.pii_types.contains("date_of_birth") ||
1081
+ context.pii_types.contains("date_time") ||
1082
+ context.pii_types.contains("time") ||
1083
+ context.pii_types.contains("card_expiry") ||
1084
+ context.pii_types.contains("DATE_TIME")
1085
+ )
1086
+ };
1087
+
1088
+ @id("privacy.block-pii-url-all")
1089
+ @name("Block URLs (comprehensive)")
1090
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a URL.")
1091
+ @severity("low")
1092
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
1093
+ @reject_message("Content blocked: URL patterns detected.")
1094
+ forbid (
1095
+ principal,
1096
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1097
+ resource
1098
+ )
1099
+ when {
1100
+ context has pii_types &&
1101
+ (
1102
+ context.pii_types.contains("url") ||
1103
+ context.pii_types.contains("URL")
1104
+ )
1105
+ };
1106
+
1107
+ @id("privacy.block-pii-location-all")
1108
+ @name("Block locations (comprehensive)")
1109
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a location (street address, postal code, or military address).")
1110
+ @severity("low")
1111
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
1112
+ @reject_message("Content blocked: street address or location patterns detected.")
1113
+ forbid (
1114
+ principal,
1115
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1116
+ resource
1117
+ )
1118
+ when {
1119
+ context has pii_types &&
1120
+ (
1121
+ context.pii_types.contains("street_address") ||
1122
+ context.pii_types.contains("zip_code") ||
1123
+ context.pii_types.contains("military_address") ||
1124
+ context.pii_types.contains("LOCATION")
1125
+ )
1126
+ };
1127
+
1128
+ @id("privacy.block-pii-organization-all")
1129
+ @name("Block organization names (comprehensive)")
1130
+ @description("Blocks prompts, tool calls, and file reads/writes that contain an organization name.")
1131
+ @severity("low")
1132
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
1133
+ @reject_message("Content blocked: organization name patterns detected.")
1134
+ forbid (
1135
+ principal,
1136
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1137
+ resource
1138
+ )
1139
+ when {
1140
+ context has pii_types &&
1141
+ (
1142
+ context.pii_types.contains("organization") ||
1143
+ context.pii_types.contains("ORGANIZATION")
1144
+ )
1145
+ };
1146
+
1147
+ @id("privacy.block-pii-occupation-all")
1148
+ @name("Block occupations (comprehensive)")
1149
+ @description("Blocks prompts, tool calls, and file reads/writes that contain an occupation.")
1150
+ @severity("low")
1151
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
1152
+ @reject_message("Content blocked: occupation patterns detected.")
1153
+ forbid (
1154
+ principal,
1155
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1156
+ resource
1157
+ )
1158
+ when {
1159
+ context has pii_types &&
1160
+ (
1161
+ context.pii_types.contains("occupation") ||
1162
+ context.pii_types.contains("OCCUPATION")
1163
+ )
1164
+ };
1165
+
1166
+ @id("privacy.block-pii-username-all")
1167
+ @name("Block usernames (comprehensive)")
1168
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a username.")
1169
+ @severity("low")
1170
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
1171
+ @reject_message("Content blocked: username patterns detected.")
1172
+ forbid (
1173
+ principal,
1174
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1175
+ resource
1176
+ )
1177
+ when {
1178
+ context has pii_types &&
1179
+ (
1180
+ context.pii_types.contains("username") ||
1181
+ context.pii_types.contains("USERNAME")
1182
+ )
1183
+ };
1184
+
1185
+ @id("privacy.block-pii-employee-customer-id-all")
1186
+ @name("Block employee or customer IDs (comprehensive)")
1187
+ @description("Blocks prompts, tool calls, and file reads/writes that contain an employee or customer ID.")
1188
+ @severity("medium")
1189
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
1190
+ @reject_message("Content blocked: employee or customer identifier patterns detected.")
1191
+ forbid (
1192
+ principal,
1193
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1194
+ resource
1195
+ )
1196
+ when {
1197
+ context has pii_types &&
1198
+ (
1199
+ context.pii_types.contains("employee_id") ||
1200
+ context.pii_types.contains("customer_id") ||
1201
+ context.pii_types.contains("EMPLOYEE_ID") ||
1202
+ context.pii_types.contains("CUSTOMER_ID")
1203
+ )
1204
+ };
1205
+
1206
+ @id("privacy.block-pii-device-id-all")
1207
+ @name("Block device and network identifiers (comprehensive)")
1208
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a device or network identifier (IP, MAC, IMEI, or UUID).")
1209
+ @severity("medium")
1210
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
1211
+ @reject_message("Content blocked: device or network identifier patterns detected.")
1212
+ forbid (
1213
+ principal,
1214
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1215
+ resource
1216
+ )
1217
+ when {
1218
+ context has pii_types &&
1219
+ (
1220
+ context.pii_types.contains("device_id") ||
1221
+ context.pii_types.contains("ip_address") ||
1222
+ context.pii_types.contains("ipv6_address") ||
1223
+ context.pii_types.contains("imei") ||
1224
+ context.pii_types.contains("device_serial") ||
1225
+ context.pii_types.contains("mac_address") ||
1226
+ context.pii_types.contains("user_agent") ||
1227
+ context.pii_types.contains("serial_number") ||
1228
+ context.pii_types.contains("uuid") ||
1229
+ context.pii_types.contains("DEVICE_ID")
1230
+ )
1231
+ };
1232
+
1233
+ @id("privacy.block-pii-vehicle-all")
1234
+ @name("Block vehicle identifiers (comprehensive)")
1235
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a vehicle identifier (VIN or license plate).")
1236
+ @severity("medium")
1237
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
1238
+ @reject_message("Content blocked: vehicle identifier (VIN or plate) patterns detected.")
1239
+ forbid (
1240
+ principal,
1241
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1242
+ resource
1243
+ )
1244
+ when {
1245
+ context has pii_types &&
1246
+ (
1247
+ context.pii_types.contains("vin") ||
1248
+ context.pii_types.contains("license_plate") ||
1249
+ context.pii_types.contains("VEHICLE_IDENTIFIER")
1250
+ )
1251
+ };
1252
+
1253
+ @id("privacy.block-pii-financial-all")
1254
+ @name("Block financial amounts (comprehensive)")
1255
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a financial amount or transaction ID.")
1256
+ @severity("medium")
1257
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
1258
+ @reject_message("Content blocked: salary or financial amount patterns detected.")
1259
+ forbid (
1260
+ principal,
1261
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1262
+ resource
1263
+ )
1264
+ when {
1265
+ context has pii_types &&
1266
+ (
1267
+ context.pii_types.contains("salary") ||
1268
+ context.pii_types.contains("financial_amount") ||
1269
+ context.pii_types.contains("transaction_id") ||
1270
+ context.pii_types.contains("FINANCIAL")
1271
+ )
1272
+ };
1273
+
1274
+ @id("privacy.block-pii-sensitive-attribute-all")
1275
+ @name("Block sensitive attributes (comprehensive)")
1276
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a sensitive personal attribute (ethnicity, religion, age, etc.).")
1277
+ @severity("high")
1278
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
1279
+ @reject_message("Content blocked: sensitive attribute (ethnicity, religion, etc.) patterns detected.")
1280
+ forbid (
1281
+ principal,
1282
+ action in [AIGateway::Action::"process_prompt", AIGateway::Action::"call_tool", AIGateway::Action::"read_file", AIGateway::Action::"write_file"],
1283
+ resource
1284
+ )
1285
+ when {
1286
+ context has pii_types &&
1287
+ (
1288
+ context.pii_types.contains("ethnicity") ||
1289
+ context.pii_types.contains("religion") ||
1290
+ context.pii_types.contains("sexual_orientation") ||
1291
+ context.pii_types.contains("political_affiliation") ||
1292
+ context.pii_types.contains("nationality") ||
1293
+ context.pii_types.contains("age") ||
1294
+ context.pii_types.contains("gender") ||
1295
+ context.pii_types.contains("marital_status") ||
1296
+ context.pii_types.contains("education_level") ||
1297
+ context.pii_types.contains("employment_status") ||
1298
+ context.pii_types.contains("SENSITIVE_ATTRIBUTE")
1299
+ )
626
1300
  };
627
1301
  `;
628
1302
  const AI_GATEWAY_ORGANIZATION_PERMIT_LLM_DEFAULT_CEDAR = `// =============================================================================
@@ -654,7 +1328,8 @@ export const AI_GATEWAY_CATEGORIES = [
654
1328
  { id: 'semantic', name: 'Semantic Threat Detection', description: 'Detect and block prompt injection, jailbreak attempts, and high-severity AI security threats.' },
655
1329
  { id: 'tools', name: 'Tool Permissioning', description: 'Control access to MCP tools, enforce risk scoring, and manage per-tool permissions.' },
656
1330
  { id: 'agent-security', name: 'Agent Security', description: 'Detect tool poisoning, rug pull attacks, indirect prompt injection, and MCP supply chain threats.' },
657
- { id: 'data-protection', name: 'Data Protection', description: 'Prevent secrets and PII leakage in LLM chat completions and MCP operations.' },
1331
+ { id: 'data-protection', name: 'Data Protection', description: 'Prevent secrets leakage in LLM chat completions and MCP operations.' },
1332
+ { id: 'privacy', name: 'Privacy', description: 'Block personally identifiable information (PII) in LLM prompts and MCP tool calls.' },
658
1333
  { id: 'organization', name: 'Organization', description: 'Organization-wide baselines and default permit policies.' },
659
1334
  ];
660
1335
  // =============================================================================
@@ -732,13 +1407,40 @@ export const AI_GATEWAY_TEMPLATES = [
732
1407
  tags: ['category:tools', 'threat:supply-chain', 'posture:permit-default'],
733
1408
  },
734
1409
  {
735
- id: 'data-protection.pii-redaction',
736
- name: 'PII & Secrets Redaction',
737
- description: 'Block requests containing PII or secrets across LLM prompts and MCP tool calls.',
1410
+ id: 'data-protection.secrets',
1411
+ name: 'Secrets Detection',
1412
+ description: 'Block requests containing secrets or credentials across LLM prompts and MCP tool calls.',
738
1413
  category: 'data-protection',
739
- cedarText: AI_GATEWAY_DATA_PROTECTION_PII_REDACTION_CEDAR,
1414
+ cedarText: AI_GATEWAY_DATA_PROTECTION_SECRETS_CEDAR,
1415
+ severity: 'critical',
1416
+ tags: ['category:data-protection', 'threat:secrets', 'owasp:llm06'],
1417
+ },
1418
+ {
1419
+ id: 'privacy.defaults',
1420
+ name: 'Structural PII',
1421
+ description: 'Block well-formatted sensitive identifiers — SSNs, credit cards, IBANs, API keys — via fast deterministic pattern matching. High precision, low latency, few false positives; use as the always-on baseline.',
1422
+ category: 'privacy',
1423
+ cedarText: AI_GATEWAY_PRIVACY_DEFAULTS_CEDAR,
1424
+ severity: 'critical',
1425
+ tags: ['category:privacy', 'threat:pii', 'detection:pattern', 'compliance:pci-dss', 'compliance:hipaa'],
1426
+ },
1427
+ {
1428
+ id: 'privacy.pii-model',
1429
+ name: 'Contextual PII',
1430
+ description: 'Block the same sensitive identifiers when the ML model infers them from surrounding context — catches unstructured or novel PII the structural patterns miss. Higher recall; requires the pii_model detector.',
1431
+ category: 'privacy',
1432
+ cedarText: AI_GATEWAY_PRIVACY_PII_MODEL_CEDAR,
740
1433
  severity: 'critical',
741
- tags: ['category:data-protection', 'threat:pii', 'threat:secrets', 'threat:exfiltration', 'owasp:llm06'],
1434
+ tags: ['category:privacy', 'threat:pii', 'detection:ml', 'compliance:pci-dss', 'compliance:hipaa'],
1435
+ },
1436
+ {
1437
+ id: 'privacy.advanced-pii',
1438
+ name: 'Comprehensive PII',
1439
+ description: 'Block every PII type — structural and contextual, sensitive and situational. Situational entities (names, locations, dates, etc.) are real PII but appear in ordinary text, so this tier flags often; one forbid rule per entity lets you disable the ones you don\'t need. Opt-in for strict environments.',
1440
+ category: 'privacy',
1441
+ cedarText: AI_GATEWAY_PRIVACY_ADVANCED_PII_CEDAR,
1442
+ severity: 'critical',
1443
+ tags: ['category:privacy', 'threat:pii', 'detection:pattern', 'compliance:pci-dss', 'compliance:hipaa'],
742
1444
  },
743
1445
  {
744
1446
  id: 'organization.permit-llm-default',
@@ -777,7 +1479,12 @@ export const AI_GATEWAY_TEMPLATES_JSON = `{
777
1479
  {
778
1480
  "id": "data-protection",
779
1481
  "name": "Data Protection",
780
- "description": "Prevent secrets and PII leakage in LLM chat completions and MCP operations."
1482
+ "description": "Prevent secrets leakage in LLM chat completions and MCP operations."
1483
+ },
1484
+ {
1485
+ "id": "privacy",
1486
+ "name": "Privacy",
1487
+ "description": "Block personally identifiable information (PII) in LLM prompts and MCP tool calls."
781
1488
  },
782
1489
  {
783
1490
  "id": "organization",
@@ -815,7 +1522,13 @@ export const AI_GATEWAY_TEMPLATES_JSON = `{
815
1522
  "category": "semantic",
816
1523
  "file": "defaults/semantic.cedar",
817
1524
  "severity": "critical",
818
- "tags": ["category:semantic", "threat:injection", "threat:jailbreak", "owasp:llm01", "owasp:llm02"]
1525
+ "tags": [
1526
+ "category:semantic",
1527
+ "threat:injection",
1528
+ "threat:jailbreak",
1529
+ "owasp:llm01",
1530
+ "owasp:llm02"
1531
+ ]
819
1532
  },
820
1533
  {
821
1534
  "id": "tools.defaults",
@@ -824,7 +1537,12 @@ export const AI_GATEWAY_TEMPLATES_JSON = `{
824
1537
  "category": "tools",
825
1538
  "file": "defaults/tools.cedar",
826
1539
  "severity": "critical",
827
- "tags": ["category:tools", "threat:command-injection", "owasp:llm06", "owasp:asi02"]
1540
+ "tags": [
1541
+ "category:tools",
1542
+ "threat:command-injection",
1543
+ "owasp:llm06",
1544
+ "owasp:asi02"
1545
+ ]
828
1546
  },
829
1547
  {
830
1548
  "id": "agent-security.defaults",
@@ -833,7 +1551,15 @@ export const AI_GATEWAY_TEMPLATES_JSON = `{
833
1551
  "category": "agent-security",
834
1552
  "file": "defaults/agent_security.cedar",
835
1553
  "severity": "critical",
836
- "tags": ["category:agent-security", "threat:tool-poisoning", "threat:rug-pull", "threat:indirect-injection", "threat:supply-chain", "owasp:asi01", "owasp:asi04"]
1554
+ "tags": [
1555
+ "category:agent-security",
1556
+ "threat:tool-poisoning",
1557
+ "threat:rug-pull",
1558
+ "threat:indirect-injection",
1559
+ "threat:supply-chain",
1560
+ "owasp:asi01",
1561
+ "owasp:asi04"
1562
+ ]
837
1563
  },
838
1564
  {
839
1565
  "id": "tools.mcp-server-allowlist",
@@ -851,16 +1577,65 @@ export const AI_GATEWAY_TEMPLATES_JSON = `{
851
1577
  "category": "tools",
852
1578
  "file": "mcp_tool_permissions.cedar",
853
1579
  "severity": "critical",
854
- "tags": ["category:tools", "threat:supply-chain", "posture:permit-default"]
1580
+ "tags": [
1581
+ "category:tools",
1582
+ "threat:supply-chain",
1583
+ "posture:permit-default"
1584
+ ]
855
1585
  },
856
1586
  {
857
- "id": "data-protection.pii-redaction",
858
- "name": "PII & Secrets Redaction",
859
- "description": "Block requests containing PII or secrets across LLM prompts and MCP tool calls.",
1587
+ "id": "data-protection.secrets",
1588
+ "name": "Secrets Detection",
1589
+ "description": "Block requests containing secrets or credentials across LLM prompts and MCP tool calls.",
860
1590
  "category": "data-protection",
861
- "file": "pii_redaction.cedar",
1591
+ "file": "secrets.cedar",
1592
+ "severity": "critical",
1593
+ "tags": ["category:data-protection", "threat:secrets", "owasp:llm06"]
1594
+ },
1595
+ {
1596
+ "id": "privacy.defaults",
1597
+ "name": "Structural PII",
1598
+ "description": "Block well-formatted sensitive identifiers — SSNs, credit cards, IBANs, API keys — via fast deterministic pattern matching. High precision, low latency, few false positives; use as the always-on baseline.",
1599
+ "category": "privacy",
1600
+ "file": "defaults/pii.cedar",
1601
+ "severity": "critical",
1602
+ "tags": [
1603
+ "category:privacy",
1604
+ "threat:pii",
1605
+ "detection:pattern",
1606
+ "compliance:pci-dss",
1607
+ "compliance:hipaa"
1608
+ ]
1609
+ },
1610
+ {
1611
+ "id": "privacy.pii-model",
1612
+ "name": "Contextual PII",
1613
+ "description": "Block the same sensitive identifiers when the ML model infers them from surrounding context — catches unstructured or novel PII the structural patterns miss. Higher recall; requires the pii_model detector.",
1614
+ "category": "privacy",
1615
+ "file": "defaults/pii_model.cedar",
1616
+ "severity": "critical",
1617
+ "tags": [
1618
+ "category:privacy",
1619
+ "threat:pii",
1620
+ "detection:ml",
1621
+ "compliance:pci-dss",
1622
+ "compliance:hipaa"
1623
+ ]
1624
+ },
1625
+ {
1626
+ "id": "privacy.advanced-pii",
1627
+ "name": "Comprehensive PII",
1628
+ "description": "Block every PII type — structural and contextual, sensitive and situational. Situational entities (names, locations, dates, etc.) are real PII but appear in ordinary text, so this tier flags often; one forbid rule per entity lets you disable the ones you don't need. Opt-in for strict environments.",
1629
+ "category": "privacy",
1630
+ "file": "defaults/pii_advanced.cedar",
862
1631
  "severity": "critical",
863
- "tags": ["category:data-protection", "threat:pii", "threat:secrets", "threat:exfiltration", "owasp:llm06"]
1632
+ "tags": [
1633
+ "category:privacy",
1634
+ "threat:pii",
1635
+ "detection:pattern",
1636
+ "compliance:pci-dss",
1637
+ "compliance:hipaa"
1638
+ ]
864
1639
  },
865
1640
  {
866
1641
  "id": "organization.permit-llm-default",
@@ -869,7 +1644,11 @@ export const AI_GATEWAY_TEMPLATES_JSON = `{
869
1644
  "category": "organization",
870
1645
  "file": "llm_default_allow.cedar",
871
1646
  "severity": "low",
872
- "tags": ["category:organization", "surface:process-prompt", "posture:permit-default"]
1647
+ "tags": [
1648
+ "category:organization",
1649
+ "surface:process-prompt",
1650
+ "posture:permit-default"
1651
+ ]
873
1652
  }
874
1653
  ]
875
1654
  }