@lannguyensi/harness 0.25.2 → 0.27.0

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 (87) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/cli/approve/risk.d.ts +43 -0
  3. package/dist/cli/approve/risk.js +126 -0
  4. package/dist/cli/approve/risk.js.map +1 -0
  5. package/dist/cli/audit.js +8 -2
  6. package/dist/cli/audit.js.map +1 -1
  7. package/dist/cli/doctor/format.js +24 -0
  8. package/dist/cli/doctor/format.js.map +1 -1
  9. package/dist/cli/doctor/index.js +26 -0
  10. package/dist/cli/doctor/index.js.map +1 -1
  11. package/dist/cli/doctor/types.d.ts +23 -0
  12. package/dist/cli/event-input.d.ts +28 -0
  13. package/dist/cli/event-input.js +73 -0
  14. package/dist/cli/event-input.js.map +1 -0
  15. package/dist/cli/explain-action.d.ts +20 -0
  16. package/dist/cli/explain-action.js +27 -0
  17. package/dist/cli/explain-action.js.map +1 -0
  18. package/dist/cli/explain-policy.d.ts +54 -0
  19. package/dist/cli/explain-policy.js +81 -0
  20. package/dist/cli/explain-policy.js.map +1 -0
  21. package/dist/cli/explain.js +4 -0
  22. package/dist/cli/explain.js.map +1 -1
  23. package/dist/cli/index.js +126 -4
  24. package/dist/cli/index.js.map +1 -1
  25. package/dist/cli/init/templates.d.ts +1 -1
  26. package/dist/cli/init/templates.js +98 -0
  27. package/dist/cli/init/templates.js.map +1 -1
  28. package/dist/cli/pack/hook-branch-protection.js +1 -1
  29. package/dist/cli/pack/hook-branch-protection.js.map +1 -1
  30. package/dist/cli/pack/hook-codex-pre-tool-use.js +1 -1
  31. package/dist/cli/pack/hook-codex-pre-tool-use.js.map +1 -1
  32. package/dist/cli/pack/hook-post-tool-use.js +1 -1
  33. package/dist/cli/pack/hook-post-tool-use.js.map +1 -1
  34. package/dist/cli/pack/hook-pre-tool-use.js +1 -1
  35. package/dist/cli/pack/hook-pre-tool-use.js.map +1 -1
  36. package/dist/cli/pack/hook-track-active-claim.js +1 -1
  37. package/dist/cli/pack/hook-track-active-claim.js.map +1 -1
  38. package/dist/cli/{pack/pause-check.d.ts → pause-check.d.ts} +1 -1
  39. package/dist/cli/{pack/pause-check.js → pause-check.js} +14 -11
  40. package/dist/cli/pause-check.js.map +1 -0
  41. package/dist/cli/policy/intercept.d.ts +15 -0
  42. package/dist/cli/policy/intercept.js +55 -1
  43. package/dist/cli/policy/intercept.js.map +1 -1
  44. package/dist/cli/resolve-env.d.ts +32 -0
  45. package/dist/cli/resolve-env.js +47 -0
  46. package/dist/cli/resolve-env.js.map +1 -0
  47. package/dist/cli/test-risk.d.ts +26 -0
  48. package/dist/cli/test-risk.js +34 -0
  49. package/dist/cli/test-risk.js.map +1 -0
  50. package/dist/runtime/action-envelope.d.ts +64 -0
  51. package/dist/runtime/action-envelope.js +46 -0
  52. package/dist/runtime/action-envelope.js.map +1 -0
  53. package/dist/runtime/environment-resolver.d.ts +36 -0
  54. package/dist/runtime/environment-resolver.js +138 -0
  55. package/dist/runtime/environment-resolver.js.map +1 -0
  56. package/dist/runtime/index.d.ts +6 -1
  57. package/dist/runtime/index.js +6 -1
  58. package/dist/runtime/index.js.map +1 -1
  59. package/dist/runtime/intercept.d.ts +60 -3
  60. package/dist/runtime/intercept.js +104 -6
  61. package/dist/runtime/intercept.js.map +1 -1
  62. package/dist/runtime/kube-context.d.ts +16 -0
  63. package/dist/runtime/kube-context.js +63 -0
  64. package/dist/runtime/kube-context.js.map +1 -0
  65. package/dist/runtime/ledger-record.d.ts +8 -0
  66. package/dist/runtime/ledger-record.js +2 -0
  67. package/dist/runtime/ledger-record.js.map +1 -1
  68. package/dist/runtime/risk-classifier.d.ts +38 -0
  69. package/dist/runtime/risk-classifier.js +148 -0
  70. package/dist/runtime/risk-classifier.js.map +1 -0
  71. package/dist/runtime/when-eval.d.ts +40 -0
  72. package/dist/runtime/when-eval.js +134 -0
  73. package/dist/runtime/when-eval.js.map +1 -0
  74. package/dist/schema/environments.d.ts +215 -0
  75. package/dist/schema/environments.js +101 -0
  76. package/dist/schema/environments.js.map +1 -0
  77. package/dist/schema/index.d.ts +419 -11
  78. package/dist/schema/index.js +8 -0
  79. package/dist/schema/index.js.map +1 -1
  80. package/dist/schema/policies.d.ts +152 -13
  81. package/dist/schema/policies.js +52 -1
  82. package/dist/schema/policies.js.map +1 -1
  83. package/dist/schema/risk.d.ts +131 -0
  84. package/dist/schema/risk.js +87 -0
  85. package/dist/schema/risk.js.map +1 -0
  86. package/package.json +1 -1
  87. package/dist/cli/pack/pause-check.js.map +0 -1
@@ -514,7 +514,7 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
514
514
  at_head?: boolean | undefined;
515
515
  }>;
516
516
  hook: z.ZodString;
517
- enforcement: z.ZodEnum<["block", "warn"]>;
517
+ enforcement: z.ZodEnum<["block", "warn", "require_approval"]>;
518
518
  producers: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
519
519
  kind: z.ZodLiteral<"bash">;
520
520
  command: z.ZodString;
@@ -568,6 +568,32 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
568
568
  required: string[];
569
569
  run: string[];
570
570
  }>>;
571
+ when: z.ZodOptional<z.ZodEffects<z.ZodObject<{
572
+ "risk.severity_at_least": z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
573
+ "risk.category_in": z.ZodOptional<z.ZodArray<z.ZodEnum<["destructive", "data_loss", "production_mutation", "credential_access", "secret_exfiltration", "network_exfiltration", "deployment_change", "infrastructure_change", "privilege_escalation", "irreversible_action", "mass_update"]>, "many">>;
574
+ "environment.name": z.ZodOptional<z.ZodEnum<["production", "staging", "dev", "local", "unknown"]>>;
575
+ "action.reversible": z.ZodOptional<z.ZodBoolean>;
576
+ }, "strict", z.ZodTypeAny, {
577
+ "risk.severity_at_least"?: "low" | "medium" | "high" | "critical" | undefined;
578
+ "risk.category_in"?: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[] | undefined;
579
+ "environment.name"?: "production" | "staging" | "dev" | "local" | "unknown" | undefined;
580
+ "action.reversible"?: boolean | undefined;
581
+ }, {
582
+ "risk.severity_at_least"?: "low" | "medium" | "high" | "critical" | undefined;
583
+ "risk.category_in"?: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[] | undefined;
584
+ "environment.name"?: "production" | "staging" | "dev" | "local" | "unknown" | undefined;
585
+ "action.reversible"?: boolean | undefined;
586
+ }>, {
587
+ "risk.severity_at_least"?: "low" | "medium" | "high" | "critical" | undefined;
588
+ "risk.category_in"?: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[] | undefined;
589
+ "environment.name"?: "production" | "staging" | "dev" | "local" | "unknown" | undefined;
590
+ "action.reversible"?: boolean | undefined;
591
+ }, {
592
+ "risk.severity_at_least"?: "low" | "medium" | "high" | "critical" | undefined;
593
+ "risk.category_in"?: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[] | undefined;
594
+ "environment.name"?: "production" | "staging" | "dev" | "local" | "unknown" | undefined;
595
+ "action.reversible"?: boolean | undefined;
596
+ }>>;
571
597
  }, "strict", z.ZodTypeAny, {
572
598
  name: string;
573
599
  description: string;
@@ -589,7 +615,7 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
589
615
  at_head?: boolean | undefined;
590
616
  };
591
617
  hook: string;
592
- enforcement: "warn" | "block";
618
+ enforcement: "warn" | "block" | "require_approval";
593
619
  producers?: ({
594
620
  command: string;
595
621
  description: string;
@@ -609,6 +635,12 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
609
635
  required: string[];
610
636
  run: string[];
611
637
  } | undefined;
638
+ when?: {
639
+ "risk.severity_at_least"?: "low" | "medium" | "high" | "critical" | undefined;
640
+ "risk.category_in"?: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[] | undefined;
641
+ "environment.name"?: "production" | "staging" | "dev" | "local" | "unknown" | undefined;
642
+ "action.reversible"?: boolean | undefined;
643
+ } | undefined;
612
644
  }, {
613
645
  name: string;
614
646
  description: string;
@@ -630,7 +662,7 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
630
662
  at_head?: boolean | undefined;
631
663
  };
632
664
  hook: string;
633
- enforcement: "warn" | "block";
665
+ enforcement: "warn" | "block" | "require_approval";
634
666
  producers?: ({
635
667
  command: string;
636
668
  description: string;
@@ -650,6 +682,12 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
650
682
  required: string[];
651
683
  run: string[];
652
684
  } | undefined;
685
+ when?: {
686
+ "risk.severity_at_least"?: "low" | "medium" | "high" | "critical" | undefined;
687
+ "risk.category_in"?: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[] | undefined;
688
+ "environment.name"?: "production" | "staging" | "dev" | "local" | "unknown" | undefined;
689
+ "action.reversible"?: boolean | undefined;
690
+ } | undefined;
653
691
  }>, {
654
692
  name: string;
655
693
  description: string;
@@ -671,7 +709,7 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
671
709
  at_head?: boolean | undefined;
672
710
  };
673
711
  hook: string;
674
- enforcement: "warn" | "block";
712
+ enforcement: "warn" | "block" | "require_approval";
675
713
  producers?: ({
676
714
  command: string;
677
715
  description: string;
@@ -691,6 +729,12 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
691
729
  required: string[];
692
730
  run: string[];
693
731
  } | undefined;
732
+ when?: {
733
+ "risk.severity_at_least"?: "low" | "medium" | "high" | "critical" | undefined;
734
+ "risk.category_in"?: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[] | undefined;
735
+ "environment.name"?: "production" | "staging" | "dev" | "local" | "unknown" | undefined;
736
+ "action.reversible"?: boolean | undefined;
737
+ } | undefined;
694
738
  }, {
695
739
  name: string;
696
740
  description: string;
@@ -712,7 +756,7 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
712
756
  at_head?: boolean | undefined;
713
757
  };
714
758
  hook: string;
715
- enforcement: "warn" | "block";
759
+ enforcement: "warn" | "block" | "require_approval";
716
760
  producers?: ({
717
761
  command: string;
718
762
  description: string;
@@ -732,6 +776,12 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
732
776
  required: string[];
733
777
  run: string[];
734
778
  } | undefined;
779
+ when?: {
780
+ "risk.severity_at_least"?: "low" | "medium" | "high" | "critical" | undefined;
781
+ "risk.category_in"?: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[] | undefined;
782
+ "environment.name"?: "production" | "staging" | "dev" | "local" | "unknown" | undefined;
783
+ "action.reversible"?: boolean | undefined;
784
+ } | undefined;
735
785
  }>, "many">, {
736
786
  name: string;
737
787
  description: string;
@@ -753,7 +803,7 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
753
803
  at_head?: boolean | undefined;
754
804
  };
755
805
  hook: string;
756
- enforcement: "warn" | "block";
806
+ enforcement: "warn" | "block" | "require_approval";
757
807
  producers?: ({
758
808
  command: string;
759
809
  description: string;
@@ -773,6 +823,12 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
773
823
  required: string[];
774
824
  run: string[];
775
825
  } | undefined;
826
+ when?: {
827
+ "risk.severity_at_least"?: "low" | "medium" | "high" | "critical" | undefined;
828
+ "risk.category_in"?: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[] | undefined;
829
+ "environment.name"?: "production" | "staging" | "dev" | "local" | "unknown" | undefined;
830
+ "action.reversible"?: boolean | undefined;
831
+ } | undefined;
776
832
  }[], {
777
833
  name: string;
778
834
  description: string;
@@ -794,7 +850,7 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
794
850
  at_head?: boolean | undefined;
795
851
  };
796
852
  hook: string;
797
- enforcement: "warn" | "block";
853
+ enforcement: "warn" | "block" | "require_approval";
798
854
  producers?: ({
799
855
  command: string;
800
856
  description: string;
@@ -814,6 +870,12 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
814
870
  required: string[];
815
871
  run: string[];
816
872
  } | undefined;
873
+ when?: {
874
+ "risk.severity_at_least"?: "low" | "medium" | "high" | "critical" | undefined;
875
+ "risk.category_in"?: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[] | undefined;
876
+ "environment.name"?: "production" | "staging" | "dev" | "local" | "unknown" | undefined;
877
+ "action.reversible"?: boolean | undefined;
878
+ } | undefined;
817
879
  }[]>>;
818
880
  policy_packs: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodObject<{
819
881
  name: z.ZodString;
@@ -846,6 +908,222 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
846
908
  source?: string | undefined;
847
909
  config?: Record<string, unknown> | undefined;
848
910
  }[]>>;
911
+ risk: z.ZodDefault<z.ZodEffects<z.ZodObject<{
912
+ classifiers: z.ZodDefault<z.ZodArray<z.ZodObject<{
913
+ name: z.ZodString;
914
+ tool: z.ZodString;
915
+ patterns: z.ZodArray<z.ZodEffects<z.ZodObject<{
916
+ pattern: z.ZodString;
917
+ categories: z.ZodArray<z.ZodEnum<["destructive", "data_loss", "production_mutation", "credential_access", "secret_exfiltration", "network_exfiltration", "deployment_change", "infrastructure_change", "privilege_escalation", "irreversible_action", "mass_update"]>, "many">;
918
+ severity: z.ZodEnum<["low", "medium", "high", "critical"]>;
919
+ }, "strict", z.ZodTypeAny, {
920
+ pattern: string;
921
+ categories: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[];
922
+ severity: "low" | "medium" | "high" | "critical";
923
+ }, {
924
+ pattern: string;
925
+ categories: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[];
926
+ severity: "low" | "medium" | "high" | "critical";
927
+ }>, {
928
+ pattern: string;
929
+ categories: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[];
930
+ severity: "low" | "medium" | "high" | "critical";
931
+ }, {
932
+ pattern: string;
933
+ categories: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[];
934
+ severity: "low" | "medium" | "high" | "critical";
935
+ }>, "many">;
936
+ }, "strict", z.ZodTypeAny, {
937
+ patterns: {
938
+ pattern: string;
939
+ categories: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[];
940
+ severity: "low" | "medium" | "high" | "critical";
941
+ }[];
942
+ name: string;
943
+ tool: string;
944
+ }, {
945
+ patterns: {
946
+ pattern: string;
947
+ categories: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[];
948
+ severity: "low" | "medium" | "high" | "critical";
949
+ }[];
950
+ name: string;
951
+ tool: string;
952
+ }>, "many">>;
953
+ }, "strict", z.ZodTypeAny, {
954
+ classifiers: {
955
+ patterns: {
956
+ pattern: string;
957
+ categories: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[];
958
+ severity: "low" | "medium" | "high" | "critical";
959
+ }[];
960
+ name: string;
961
+ tool: string;
962
+ }[];
963
+ }, {
964
+ classifiers?: {
965
+ patterns: {
966
+ pattern: string;
967
+ categories: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[];
968
+ severity: "low" | "medium" | "high" | "critical";
969
+ }[];
970
+ name: string;
971
+ tool: string;
972
+ }[] | undefined;
973
+ }>, {
974
+ classifiers: {
975
+ patterns: {
976
+ pattern: string;
977
+ categories: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[];
978
+ severity: "low" | "medium" | "high" | "critical";
979
+ }[];
980
+ name: string;
981
+ tool: string;
982
+ }[];
983
+ }, {
984
+ classifiers?: {
985
+ patterns: {
986
+ pattern: string;
987
+ categories: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[];
988
+ severity: "low" | "medium" | "high" | "critical";
989
+ }[];
990
+ name: string;
991
+ tool: string;
992
+ }[] | undefined;
993
+ }>>;
994
+ environments: z.ZodDefault<z.ZodEffects<z.ZodObject<{
995
+ resolvers: z.ZodDefault<z.ZodArray<z.ZodObject<{
996
+ name: z.ZodString;
997
+ environment: z.ZodEnum<["production", "staging", "dev", "local"]>;
998
+ signals: z.ZodEffects<z.ZodObject<{
999
+ branch_patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1000
+ env_var_patterns: z.ZodOptional<z.ZodArray<z.ZodObject<{
1001
+ var: z.ZodString;
1002
+ patterns: z.ZodArray<z.ZodString, "many">;
1003
+ }, "strict", z.ZodTypeAny, {
1004
+ var: string;
1005
+ patterns: string[];
1006
+ }, {
1007
+ var: string;
1008
+ patterns: string[];
1009
+ }>, "many">>;
1010
+ kube_context_patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1011
+ kube_namespace_patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1012
+ }, "strict", z.ZodTypeAny, {
1013
+ branch_patterns?: string[] | undefined;
1014
+ env_var_patterns?: {
1015
+ var: string;
1016
+ patterns: string[];
1017
+ }[] | undefined;
1018
+ kube_context_patterns?: string[] | undefined;
1019
+ kube_namespace_patterns?: string[] | undefined;
1020
+ }, {
1021
+ branch_patterns?: string[] | undefined;
1022
+ env_var_patterns?: {
1023
+ var: string;
1024
+ patterns: string[];
1025
+ }[] | undefined;
1026
+ kube_context_patterns?: string[] | undefined;
1027
+ kube_namespace_patterns?: string[] | undefined;
1028
+ }>, {
1029
+ branch_patterns?: string[] | undefined;
1030
+ env_var_patterns?: {
1031
+ var: string;
1032
+ patterns: string[];
1033
+ }[] | undefined;
1034
+ kube_context_patterns?: string[] | undefined;
1035
+ kube_namespace_patterns?: string[] | undefined;
1036
+ }, {
1037
+ branch_patterns?: string[] | undefined;
1038
+ env_var_patterns?: {
1039
+ var: string;
1040
+ patterns: string[];
1041
+ }[] | undefined;
1042
+ kube_context_patterns?: string[] | undefined;
1043
+ kube_namespace_patterns?: string[] | undefined;
1044
+ }>;
1045
+ }, "strict", z.ZodTypeAny, {
1046
+ name: string;
1047
+ environment: "production" | "staging" | "dev" | "local";
1048
+ signals: {
1049
+ branch_patterns?: string[] | undefined;
1050
+ env_var_patterns?: {
1051
+ var: string;
1052
+ patterns: string[];
1053
+ }[] | undefined;
1054
+ kube_context_patterns?: string[] | undefined;
1055
+ kube_namespace_patterns?: string[] | undefined;
1056
+ };
1057
+ }, {
1058
+ name: string;
1059
+ environment: "production" | "staging" | "dev" | "local";
1060
+ signals: {
1061
+ branch_patterns?: string[] | undefined;
1062
+ env_var_patterns?: {
1063
+ var: string;
1064
+ patterns: string[];
1065
+ }[] | undefined;
1066
+ kube_context_patterns?: string[] | undefined;
1067
+ kube_namespace_patterns?: string[] | undefined;
1068
+ };
1069
+ }>, "many">>;
1070
+ }, "strict", z.ZodTypeAny, {
1071
+ resolvers: {
1072
+ name: string;
1073
+ environment: "production" | "staging" | "dev" | "local";
1074
+ signals: {
1075
+ branch_patterns?: string[] | undefined;
1076
+ env_var_patterns?: {
1077
+ var: string;
1078
+ patterns: string[];
1079
+ }[] | undefined;
1080
+ kube_context_patterns?: string[] | undefined;
1081
+ kube_namespace_patterns?: string[] | undefined;
1082
+ };
1083
+ }[];
1084
+ }, {
1085
+ resolvers?: {
1086
+ name: string;
1087
+ environment: "production" | "staging" | "dev" | "local";
1088
+ signals: {
1089
+ branch_patterns?: string[] | undefined;
1090
+ env_var_patterns?: {
1091
+ var: string;
1092
+ patterns: string[];
1093
+ }[] | undefined;
1094
+ kube_context_patterns?: string[] | undefined;
1095
+ kube_namespace_patterns?: string[] | undefined;
1096
+ };
1097
+ }[] | undefined;
1098
+ }>, {
1099
+ resolvers: {
1100
+ name: string;
1101
+ environment: "production" | "staging" | "dev" | "local";
1102
+ signals: {
1103
+ branch_patterns?: string[] | undefined;
1104
+ env_var_patterns?: {
1105
+ var: string;
1106
+ patterns: string[];
1107
+ }[] | undefined;
1108
+ kube_context_patterns?: string[] | undefined;
1109
+ kube_namespace_patterns?: string[] | undefined;
1110
+ };
1111
+ }[];
1112
+ }, {
1113
+ resolvers?: {
1114
+ name: string;
1115
+ environment: "production" | "staging" | "dev" | "local";
1116
+ signals: {
1117
+ branch_patterns?: string[] | undefined;
1118
+ env_var_patterns?: {
1119
+ var: string;
1120
+ patterns: string[];
1121
+ }[] | undefined;
1122
+ kube_context_patterns?: string[] | undefined;
1123
+ kube_namespace_patterns?: string[] | undefined;
1124
+ };
1125
+ }[] | undefined;
1126
+ }>>;
849
1127
  permission_profiles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
850
1128
  description: z.ZodOptional<z.ZodString>;
851
1129
  actions: z.ZodDefault<z.ZodObject<{
@@ -2297,7 +2575,7 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
2297
2575
  at_head?: boolean | undefined;
2298
2576
  };
2299
2577
  hook: string;
2300
- enforcement: "warn" | "block";
2578
+ enforcement: "warn" | "block" | "require_approval";
2301
2579
  producers?: ({
2302
2580
  command: string;
2303
2581
  description: string;
@@ -2317,6 +2595,12 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
2317
2595
  required: string[];
2318
2596
  run: string[];
2319
2597
  } | undefined;
2598
+ when?: {
2599
+ "risk.severity_at_least"?: "low" | "medium" | "high" | "critical" | undefined;
2600
+ "risk.category_in"?: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[] | undefined;
2601
+ "environment.name"?: "production" | "staging" | "dev" | "local" | "unknown" | undefined;
2602
+ "action.reversible"?: boolean | undefined;
2603
+ } | undefined;
2320
2604
  }[];
2321
2605
  policy_packs: {
2322
2606
  name: string;
@@ -2325,6 +2609,32 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
2325
2609
  config: Record<string, unknown>;
2326
2610
  description?: string | undefined;
2327
2611
  }[];
2612
+ risk: {
2613
+ classifiers: {
2614
+ patterns: {
2615
+ pattern: string;
2616
+ categories: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[];
2617
+ severity: "low" | "medium" | "high" | "critical";
2618
+ }[];
2619
+ name: string;
2620
+ tool: string;
2621
+ }[];
2622
+ };
2623
+ environments: {
2624
+ resolvers: {
2625
+ name: string;
2626
+ environment: "production" | "staging" | "dev" | "local";
2627
+ signals: {
2628
+ branch_patterns?: string[] | undefined;
2629
+ env_var_patterns?: {
2630
+ var: string;
2631
+ patterns: string[];
2632
+ }[] | undefined;
2633
+ kube_context_patterns?: string[] | undefined;
2634
+ kube_namespace_patterns?: string[] | undefined;
2635
+ };
2636
+ }[];
2637
+ };
2328
2638
  permission_profiles: Record<string, {
2329
2639
  actions: {
2330
2640
  push?: {
@@ -2560,7 +2870,7 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
2560
2870
  at_head?: boolean | undefined;
2561
2871
  };
2562
2872
  hook: string;
2563
- enforcement: "warn" | "block";
2873
+ enforcement: "warn" | "block" | "require_approval";
2564
2874
  producers?: ({
2565
2875
  command: string;
2566
2876
  description: string;
@@ -2580,6 +2890,12 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
2580
2890
  required: string[];
2581
2891
  run: string[];
2582
2892
  } | undefined;
2893
+ when?: {
2894
+ "risk.severity_at_least"?: "low" | "medium" | "high" | "critical" | undefined;
2895
+ "risk.category_in"?: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[] | undefined;
2896
+ "environment.name"?: "production" | "staging" | "dev" | "local" | "unknown" | undefined;
2897
+ "action.reversible"?: boolean | undefined;
2898
+ } | undefined;
2583
2899
  }[] | undefined;
2584
2900
  policy_packs?: {
2585
2901
  name: string;
@@ -2588,6 +2904,32 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
2588
2904
  source?: string | undefined;
2589
2905
  config?: Record<string, unknown> | undefined;
2590
2906
  }[] | undefined;
2907
+ risk?: {
2908
+ classifiers?: {
2909
+ patterns: {
2910
+ pattern: string;
2911
+ categories: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[];
2912
+ severity: "low" | "medium" | "high" | "critical";
2913
+ }[];
2914
+ name: string;
2915
+ tool: string;
2916
+ }[] | undefined;
2917
+ } | undefined;
2918
+ environments?: {
2919
+ resolvers?: {
2920
+ name: string;
2921
+ environment: "production" | "staging" | "dev" | "local";
2922
+ signals: {
2923
+ branch_patterns?: string[] | undefined;
2924
+ env_var_patterns?: {
2925
+ var: string;
2926
+ patterns: string[];
2927
+ }[] | undefined;
2928
+ kube_context_patterns?: string[] | undefined;
2929
+ kube_namespace_patterns?: string[] | undefined;
2930
+ };
2931
+ }[] | undefined;
2932
+ } | undefined;
2591
2933
  permission_profiles?: Record<string, {
2592
2934
  description?: string | undefined;
2593
2935
  actions?: {
@@ -2823,7 +3165,7 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
2823
3165
  at_head?: boolean | undefined;
2824
3166
  };
2825
3167
  hook: string;
2826
- enforcement: "warn" | "block";
3168
+ enforcement: "warn" | "block" | "require_approval";
2827
3169
  producers?: ({
2828
3170
  command: string;
2829
3171
  description: string;
@@ -2843,6 +3185,12 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
2843
3185
  required: string[];
2844
3186
  run: string[];
2845
3187
  } | undefined;
3188
+ when?: {
3189
+ "risk.severity_at_least"?: "low" | "medium" | "high" | "critical" | undefined;
3190
+ "risk.category_in"?: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[] | undefined;
3191
+ "environment.name"?: "production" | "staging" | "dev" | "local" | "unknown" | undefined;
3192
+ "action.reversible"?: boolean | undefined;
3193
+ } | undefined;
2846
3194
  }[];
2847
3195
  policy_packs: {
2848
3196
  name: string;
@@ -2851,6 +3199,32 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
2851
3199
  config: Record<string, unknown>;
2852
3200
  description?: string | undefined;
2853
3201
  }[];
3202
+ risk: {
3203
+ classifiers: {
3204
+ patterns: {
3205
+ pattern: string;
3206
+ categories: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[];
3207
+ severity: "low" | "medium" | "high" | "critical";
3208
+ }[];
3209
+ name: string;
3210
+ tool: string;
3211
+ }[];
3212
+ };
3213
+ environments: {
3214
+ resolvers: {
3215
+ name: string;
3216
+ environment: "production" | "staging" | "dev" | "local";
3217
+ signals: {
3218
+ branch_patterns?: string[] | undefined;
3219
+ env_var_patterns?: {
3220
+ var: string;
3221
+ patterns: string[];
3222
+ }[] | undefined;
3223
+ kube_context_patterns?: string[] | undefined;
3224
+ kube_namespace_patterns?: string[] | undefined;
3225
+ };
3226
+ }[];
3227
+ };
2854
3228
  permission_profiles: Record<string, {
2855
3229
  actions: {
2856
3230
  push?: {
@@ -3086,7 +3460,7 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
3086
3460
  at_head?: boolean | undefined;
3087
3461
  };
3088
3462
  hook: string;
3089
- enforcement: "warn" | "block";
3463
+ enforcement: "warn" | "block" | "require_approval";
3090
3464
  producers?: ({
3091
3465
  command: string;
3092
3466
  description: string;
@@ -3106,6 +3480,12 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
3106
3480
  required: string[];
3107
3481
  run: string[];
3108
3482
  } | undefined;
3483
+ when?: {
3484
+ "risk.severity_at_least"?: "low" | "medium" | "high" | "critical" | undefined;
3485
+ "risk.category_in"?: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[] | undefined;
3486
+ "environment.name"?: "production" | "staging" | "dev" | "local" | "unknown" | undefined;
3487
+ "action.reversible"?: boolean | undefined;
3488
+ } | undefined;
3109
3489
  }[] | undefined;
3110
3490
  policy_packs?: {
3111
3491
  name: string;
@@ -3114,6 +3494,32 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
3114
3494
  source?: string | undefined;
3115
3495
  config?: Record<string, unknown> | undefined;
3116
3496
  }[] | undefined;
3497
+ risk?: {
3498
+ classifiers?: {
3499
+ patterns: {
3500
+ pattern: string;
3501
+ categories: ("destructive" | "data_loss" | "production_mutation" | "credential_access" | "secret_exfiltration" | "network_exfiltration" | "deployment_change" | "infrastructure_change" | "privilege_escalation" | "irreversible_action" | "mass_update")[];
3502
+ severity: "low" | "medium" | "high" | "critical";
3503
+ }[];
3504
+ name: string;
3505
+ tool: string;
3506
+ }[] | undefined;
3507
+ } | undefined;
3508
+ environments?: {
3509
+ resolvers?: {
3510
+ name: string;
3511
+ environment: "production" | "staging" | "dev" | "local";
3512
+ signals: {
3513
+ branch_patterns?: string[] | undefined;
3514
+ env_var_patterns?: {
3515
+ var: string;
3516
+ patterns: string[];
3517
+ }[] | undefined;
3518
+ kube_context_patterns?: string[] | undefined;
3519
+ kube_namespace_patterns?: string[] | undefined;
3520
+ };
3521
+ }[] | undefined;
3522
+ } | undefined;
3117
3523
  permission_profiles?: Record<string, {
3118
3524
  description?: string | undefined;
3119
3525
  actions?: {
@@ -3267,6 +3673,8 @@ export * from "./hooks.js";
3267
3673
  export * from "./permission-profiles.js";
3268
3674
  export * from "./policies.js";
3269
3675
  export * from "./policy-packs.js";
3676
+ export * from "./risk.js";
3677
+ export * from "./environments.js";
3270
3678
  export * from "./workflows.js";
3271
3679
  export * from "./audit.js";
3272
3680
  export * from "./extract.js";
@@ -1,10 +1,12 @@
1
1
  import { z } from "zod";
2
+ import { EnvironmentsSchema } from "./environments.js";
2
3
  import { GroundingSchema } from "./grounding.js";
3
4
  import { HooksSchema } from "./hooks.js";
4
5
  import { MemorySchema } from "./memory.js";
5
6
  import { PoliciesSchema } from "./policies.js";
6
7
  import { PermissionProfilesSchema } from "./permission-profiles.js";
7
8
  import { PolicyPacksSchema } from "./policy-packs.js";
9
+ import { RiskSchema } from "./risk.js";
8
10
  import { ToolsSchema } from "./tools.js";
9
11
  import { AuditSchema } from "./audit.js";
10
12
  import { ReviewTemplatesSchema, WorkflowsSchema } from "./workflows.js";
@@ -18,6 +20,10 @@ export const ManifestSchema = z
18
20
  hooks: HooksSchema.default([]),
19
21
  policies: PoliciesSchema.default([]),
20
22
  policy_packs: PolicyPacksSchema.default([]),
23
+ // Phase 7 Risk Gate inputs — schema vocabulary only, no runtime
24
+ // surface reads them yet. See docs/risk-gate.md.
25
+ risk: RiskSchema.default({}),
26
+ environments: EnvironmentsSchema.default({}),
21
27
  permission_profiles: PermissionProfilesSchema.default({}),
22
28
  workflows: WorkflowsSchema.default([]),
23
29
  review_templates: ReviewTemplatesSchema.default({}),
@@ -75,6 +81,8 @@ export * from "./hooks.js";
75
81
  export * from "./permission-profiles.js";
76
82
  export * from "./policies.js";
77
83
  export * from "./policy-packs.js";
84
+ export * from "./risk.js";
85
+ export * from "./environments.js";
78
86
  export * from "./workflows.js";
79
87
  export * from "./audit.js";
80
88
  export * from "./extract.js";