@provos/ironcurtain 0.1.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 (160) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +311 -0
  3. package/dist/agent/index.d.ts +10 -0
  4. package/dist/agent/index.js +71 -0
  5. package/dist/agent/index.js.map +1 -0
  6. package/dist/agent/prompts.d.ts +5 -0
  7. package/dist/agent/prompts.js +26 -0
  8. package/dist/agent/prompts.js.map +1 -0
  9. package/dist/agent/tools.d.ts +13 -0
  10. package/dist/agent/tools.js +51 -0
  11. package/dist/agent/tools.js.map +1 -0
  12. package/dist/cli.d.ts +2 -0
  13. package/dist/cli.js +78 -0
  14. package/dist/cli.js.map +1 -0
  15. package/dist/config/constitution.md +16 -0
  16. package/dist/config/generated/compiled-policy.json +236 -0
  17. package/dist/config/generated/test-scenarios.json +765 -0
  18. package/dist/config/generated/tool-annotations.json +955 -0
  19. package/dist/config/index.d.ts +25 -0
  20. package/dist/config/index.js +151 -0
  21. package/dist/config/index.js.map +1 -0
  22. package/dist/config/mcp-servers.json +22 -0
  23. package/dist/config/model-provider.d.ts +49 -0
  24. package/dist/config/model-provider.js +78 -0
  25. package/dist/config/model-provider.js.map +1 -0
  26. package/dist/config/paths.d.ts +59 -0
  27. package/dist/config/paths.js +96 -0
  28. package/dist/config/paths.js.map +1 -0
  29. package/dist/config/types.d.ts +89 -0
  30. package/dist/config/types.js +2 -0
  31. package/dist/config/types.js.map +1 -0
  32. package/dist/config/user-config.d.ts +93 -0
  33. package/dist/config/user-config.js +309 -0
  34. package/dist/config/user-config.js.map +1 -0
  35. package/dist/hash.d.ts +17 -0
  36. package/dist/hash.js +34 -0
  37. package/dist/hash.js.map +1 -0
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.js +61 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/logger.d.ts +11 -0
  42. package/dist/logger.js +93 -0
  43. package/dist/logger.js.map +1 -0
  44. package/dist/pipeline/annotate.d.ts +9 -0
  45. package/dist/pipeline/annotate.js +136 -0
  46. package/dist/pipeline/annotate.js.map +1 -0
  47. package/dist/pipeline/compile.d.ts +23 -0
  48. package/dist/pipeline/compile.js +386 -0
  49. package/dist/pipeline/compile.js.map +1 -0
  50. package/dist/pipeline/constitution-compiler.d.ts +22 -0
  51. package/dist/pipeline/constitution-compiler.js +197 -0
  52. package/dist/pipeline/constitution-compiler.js.map +1 -0
  53. package/dist/pipeline/generate-with-repair.d.ts +22 -0
  54. package/dist/pipeline/generate-with-repair.js +64 -0
  55. package/dist/pipeline/generate-with-repair.js.map +1 -0
  56. package/dist/pipeline/handwritten-scenarios.d.ts +9 -0
  57. package/dist/pipeline/handwritten-scenarios.js +321 -0
  58. package/dist/pipeline/handwritten-scenarios.js.map +1 -0
  59. package/dist/pipeline/llm-logger.d.ts +42 -0
  60. package/dist/pipeline/llm-logger.js +78 -0
  61. package/dist/pipeline/llm-logger.js.map +1 -0
  62. package/dist/pipeline/pipeline-shared.d.ts +47 -0
  63. package/dist/pipeline/pipeline-shared.js +145 -0
  64. package/dist/pipeline/pipeline-shared.js.map +1 -0
  65. package/dist/pipeline/policy-verifier.d.ts +46 -0
  66. package/dist/pipeline/policy-verifier.js +277 -0
  67. package/dist/pipeline/policy-verifier.js.map +1 -0
  68. package/dist/pipeline/scenario-generator.d.ts +11 -0
  69. package/dist/pipeline/scenario-generator.js +128 -0
  70. package/dist/pipeline/scenario-generator.js.map +1 -0
  71. package/dist/pipeline/tool-annotator.d.ts +24 -0
  72. package/dist/pipeline/tool-annotator.js +201 -0
  73. package/dist/pipeline/tool-annotator.js.map +1 -0
  74. package/dist/pipeline/types.d.ts +122 -0
  75. package/dist/pipeline/types.js +10 -0
  76. package/dist/pipeline/types.js.map +1 -0
  77. package/dist/sandbox/index.d.ts +39 -0
  78. package/dist/sandbox/index.js +178 -0
  79. package/dist/sandbox/index.js.map +1 -0
  80. package/dist/session/agent-session.d.ts +83 -0
  81. package/dist/session/agent-session.js +382 -0
  82. package/dist/session/agent-session.js.map +1 -0
  83. package/dist/session/cli-transport.d.ts +61 -0
  84. package/dist/session/cli-transport.js +320 -0
  85. package/dist/session/cli-transport.js.map +1 -0
  86. package/dist/session/errors.d.ts +19 -0
  87. package/dist/session/errors.js +33 -0
  88. package/dist/session/errors.js.map +1 -0
  89. package/dist/session/index.d.ts +29 -0
  90. package/dist/session/index.js +104 -0
  91. package/dist/session/index.js.map +1 -0
  92. package/dist/session/message-compactor.d.ts +32 -0
  93. package/dist/session/message-compactor.js +81 -0
  94. package/dist/session/message-compactor.js.map +1 -0
  95. package/dist/session/prompts.d.ts +5 -0
  96. package/dist/session/prompts.js +62 -0
  97. package/dist/session/prompts.js.map +1 -0
  98. package/dist/session/resource-budget-tracker.d.ts +124 -0
  99. package/dist/session/resource-budget-tracker.js +327 -0
  100. package/dist/session/resource-budget-tracker.js.map +1 -0
  101. package/dist/session/step-loop-detector.d.ts +63 -0
  102. package/dist/session/step-loop-detector.js +136 -0
  103. package/dist/session/step-loop-detector.js.map +1 -0
  104. package/dist/session/transport.d.ts +24 -0
  105. package/dist/session/transport.js +2 -0
  106. package/dist/session/transport.js.map +1 -0
  107. package/dist/session/truncate-result.d.ts +35 -0
  108. package/dist/session/truncate-result.js +71 -0
  109. package/dist/session/truncate-result.js.map +1 -0
  110. package/dist/session/types.d.ts +220 -0
  111. package/dist/session/types.js +6 -0
  112. package/dist/session/types.js.map +1 -0
  113. package/dist/trusted-process/audit-log.d.ts +7 -0
  114. package/dist/trusted-process/audit-log.js +21 -0
  115. package/dist/trusted-process/audit-log.js.map +1 -0
  116. package/dist/trusted-process/call-circuit-breaker.d.ts +33 -0
  117. package/dist/trusted-process/call-circuit-breaker.js +61 -0
  118. package/dist/trusted-process/call-circuit-breaker.js.map +1 -0
  119. package/dist/trusted-process/escalation.d.ts +7 -0
  120. package/dist/trusted-process/escalation.js +38 -0
  121. package/dist/trusted-process/escalation.js.map +1 -0
  122. package/dist/trusted-process/index.d.ts +32 -0
  123. package/dist/trusted-process/index.js +151 -0
  124. package/dist/trusted-process/index.js.map +1 -0
  125. package/dist/trusted-process/mcp-client-manager.d.ts +25 -0
  126. package/dist/trusted-process/mcp-client-manager.js +90 -0
  127. package/dist/trusted-process/mcp-client-manager.js.map +1 -0
  128. package/dist/trusted-process/mcp-proxy-server.d.ts +24 -0
  129. package/dist/trusted-process/mcp-proxy-server.js +451 -0
  130. package/dist/trusted-process/mcp-proxy-server.js.map +1 -0
  131. package/dist/trusted-process/path-utils.d.ts +50 -0
  132. package/dist/trusted-process/path-utils.js +158 -0
  133. package/dist/trusted-process/path-utils.js.map +1 -0
  134. package/dist/trusted-process/policy-engine.d.ts +88 -0
  135. package/dist/trusted-process/policy-engine.js +523 -0
  136. package/dist/trusted-process/policy-engine.js.map +1 -0
  137. package/dist/trusted-process/policy-roots.d.ts +50 -0
  138. package/dist/trusted-process/policy-roots.js +67 -0
  139. package/dist/trusted-process/policy-roots.js.map +1 -0
  140. package/dist/trusted-process/policy-types.d.ts +6 -0
  141. package/dist/trusted-process/policy-types.js +2 -0
  142. package/dist/trusted-process/policy-types.js.map +1 -0
  143. package/dist/trusted-process/sandbox-integration.d.ts +92 -0
  144. package/dist/trusted-process/sandbox-integration.js +184 -0
  145. package/dist/trusted-process/sandbox-integration.js.map +1 -0
  146. package/dist/types/argument-roles.d.ts +112 -0
  147. package/dist/types/argument-roles.js +344 -0
  148. package/dist/types/argument-roles.js.map +1 -0
  149. package/dist/types/audit.d.ts +18 -0
  150. package/dist/types/audit.js +2 -0
  151. package/dist/types/audit.js.map +1 -0
  152. package/dist/types/mcp.d.ts +20 -0
  153. package/dist/types/mcp.js +2 -0
  154. package/dist/types/mcp.js.map +1 -0
  155. package/package.json +83 -0
  156. package/src/config/constitution.md +16 -0
  157. package/src/config/generated/compiled-policy.json +236 -0
  158. package/src/config/generated/test-scenarios.json +765 -0
  159. package/src/config/generated/tool-annotations.json +955 -0
  160. package/src/config/mcp-servers.json +22 -0
@@ -0,0 +1,236 @@
1
+ {
2
+ "generatedAt": "2026-02-20T02:55:50.311Z",
3
+ "constitutionHash": "5529d55909f1adf3a51937f8abb306cef5e4eaab4f14c48117c6daa49242f1c0",
4
+ "inputHash": "33bb2eb4ac3b19995b8bab173fb3a3b948bebcdfbfdf9972583b9186ff960832-repair",
5
+ "rules": [
6
+ {
7
+ "name": "allow-downloads-read-write-delete",
8
+ "description": "Allow full read/write/delete access within the permitted Downloads folder.",
9
+ "principle": "The constitution explicitly grants full read/write/delete access to the Downloads folder.",
10
+ "if": {
11
+ "paths": {
12
+ "roles": [
13
+ "read-path",
14
+ "write-path",
15
+ "delete-path"
16
+ ],
17
+ "within": "/mnt/c/Users/provo/Downloads"
18
+ }
19
+ },
20
+ "then": "allow",
21
+ "reason": "The constitution explicitly grants full read/write/delete access to the Downloads folder at /mnt/c/Users/provo/Downloads."
22
+ },
23
+ {
24
+ "name": "allow-user-documents-read",
25
+ "description": "Allow read access within the user's Documents folder.",
26
+ "principle": "The constitution explicitly grants read access to the user's Documents folder.",
27
+ "if": {
28
+ "paths": {
29
+ "roles": [
30
+ "read-path"
31
+ ],
32
+ "within": "/home/provos/Documents"
33
+ }
34
+ },
35
+ "then": "allow",
36
+ "reason": "The constitution explicitly grants read access to the user's Documents folder."
37
+ },
38
+ {
39
+ "name": "deny-write-delete-user-documents",
40
+ "description": "Deny write or delete operations within the Documents folder.",
41
+ "principle": "No destruction / Least privilege: the constitution only permits reading documents in the Documents folder.",
42
+ "if": {
43
+ "paths": {
44
+ "roles": [
45
+ "write-path",
46
+ "delete-path"
47
+ ],
48
+ "within": "/home/provos/Documents"
49
+ }
50
+ },
51
+ "then": "deny",
52
+ "reason": "The constitution only permits reading documents in the Documents folder; writes and deletes are not granted."
53
+ },
54
+ {
55
+ "name": "deny-delete-path-outside-downloads",
56
+ "description": "Deny any tool invocation that carries a delete-path role argument pointing outside the Downloads folder (catches move_file source from unpermitted areas).",
57
+ "principle": "No destruction: delete operations outside the sandbox and Downloads folder are never permitted.",
58
+ "if": {
59
+ "roles": [
60
+ "delete-path"
61
+ ]
62
+ },
63
+ "then": "deny",
64
+ "reason": "The delete-path role outside the permitted Downloads folder (handled above) represents an unpermitted destructive operation that must be denied."
65
+ },
66
+ {
67
+ "name": "allow-git-readonly-operations",
68
+ "description": "Allow read-only git operations without human approval.",
69
+ "principle": "Least privilege: the constitution explicitly permits read-only git operations within the sandbox.",
70
+ "if": {
71
+ "server": [
72
+ "git"
73
+ ],
74
+ "tool": [
75
+ "git_status",
76
+ "git_diff",
77
+ "git_log",
78
+ "git_show",
79
+ "git_blame"
80
+ ]
81
+ },
82
+ "then": "allow",
83
+ "reason": "The constitution explicitly permits these read-only git operations without human approval."
84
+ },
85
+ {
86
+ "name": "allow-git-add-commit",
87
+ "description": "Allow git staging and committing without human approval.",
88
+ "principle": "Least privilege: the constitution explicitly permits git add and commit within the sandbox.",
89
+ "if": {
90
+ "server": [
91
+ "git"
92
+ ],
93
+ "tool": [
94
+ "git_add",
95
+ "git_commit"
96
+ ]
97
+ },
98
+ "then": "allow",
99
+ "reason": "The constitution explicitly permits git add and commit without human approval."
100
+ },
101
+ {
102
+ "name": "allow-git-informational-no-sideeffects",
103
+ "description": "Allow git tools with no side effects unconditionally.",
104
+ "principle": "Least privilege: informational tools without side effects pose no risk.",
105
+ "if": {
106
+ "server": [
107
+ "git"
108
+ ],
109
+ "tool": [
110
+ "git_wrapup_instructions",
111
+ "git_clear_working_dir"
112
+ ],
113
+ "sideEffects": false
114
+ },
115
+ "then": "allow",
116
+ "reason": "These git tools have no side effects and are safe to run without human approval."
117
+ },
118
+ {
119
+ "name": "allow-filesystem-list-allowed-directories",
120
+ "description": "Allow listing allowed directories unconditionally as it has no side effects.",
121
+ "principle": "Least privilege: this tool exposes no sensitive data and has no side effects.",
122
+ "if": {
123
+ "server": [
124
+ "filesystem"
125
+ ],
126
+ "tool": [
127
+ "list_allowed_directories"
128
+ ],
129
+ "sideEffects": false
130
+ },
131
+ "then": "allow",
132
+ "reason": "Listing allowed directories has no side effects and is safe to permit unconditionally."
133
+ },
134
+ {
135
+ "name": "escalate-git-remote-contacting",
136
+ "description": "Require human approval before any remote-contacting git operation.",
137
+ "principle": "Human oversight: the constitution requires explicit human approval before remote-contacting git operations.",
138
+ "if": {
139
+ "server": [
140
+ "git"
141
+ ],
142
+ "tool": [
143
+ "git_push",
144
+ "git_pull",
145
+ "git_fetch",
146
+ "git_clone"
147
+ ]
148
+ },
149
+ "then": "escalate",
150
+ "reason": "The constitution requires explicit human approval before any remote-contacting git operation."
151
+ },
152
+ {
153
+ "name": "escalate-git-history-rewriting",
154
+ "description": "Require human approval before any history-rewriting git operation.",
155
+ "principle": "Human oversight: the constitution requires explicit human approval before history-rewriting operations.",
156
+ "if": {
157
+ "server": [
158
+ "git"
159
+ ],
160
+ "tool": [
161
+ "git_reset",
162
+ "git_rebase",
163
+ "git_merge",
164
+ "git_cherry_pick"
165
+ ]
166
+ },
167
+ "then": "escalate",
168
+ "reason": "The constitution requires explicit human approval before any history-rewriting git operation."
169
+ },
170
+ {
171
+ "name": "escalate-git-branch",
172
+ "description": "Require human approval for all git branch operations to cover deletion and force scenarios.",
173
+ "principle": "Human oversight: the constitution requires explicit human approval before branch deletion or force operations.",
174
+ "if": {
175
+ "server": [
176
+ "git"
177
+ ],
178
+ "tool": [
179
+ "git_branch"
180
+ ]
181
+ },
182
+ "then": "escalate",
183
+ "reason": "The constitution requires explicit human approval before branch deletion or force operations; escalating all git_branch calls ensures coverage."
184
+ },
185
+ {
186
+ "name": "escalate-git-other-operations",
187
+ "description": "Escalate any other git operation not explicitly allowed to ensure human oversight.",
188
+ "principle": "Human oversight: any git operation outside the explicitly allowed list requires human approval.",
189
+ "if": {
190
+ "server": [
191
+ "git"
192
+ ]
193
+ },
194
+ "then": "escalate",
195
+ "reason": "Any git operation not in the explicitly allowed list requires human oversight per the constitution."
196
+ },
197
+ {
198
+ "name": "escalate-write-path-outside-permitted",
199
+ "description": "Escalate write operations to paths outside permitted zones for human approval.",
200
+ "principle": "Human oversight: writes to unpermitted locations are not explicitly forbidden but require human judgment.",
201
+ "if": {
202
+ "roles": [
203
+ "write-path"
204
+ ],
205
+ "server": [
206
+ "filesystem"
207
+ ]
208
+ },
209
+ "then": "escalate",
210
+ "reason": "Write operations to paths not in any explicitly permitted zone require human approval rather than outright denial, as the constitution does not categorically forbid them."
211
+ },
212
+ {
213
+ "name": "escalate-filesystem-read-outside-permitted",
214
+ "description": "Escalate read access to paths outside permitted zones for human approval.",
215
+ "principle": "Human oversight: reads outside the Downloads, Documents, or sandbox require human approval.",
216
+ "if": {
217
+ "roles": [
218
+ "read-path"
219
+ ],
220
+ "server": [
221
+ "filesystem"
222
+ ]
223
+ },
224
+ "then": "escalate",
225
+ "reason": "Read access to paths outside the Downloads folder, Documents folder, or sandbox requires human approval."
226
+ },
227
+ {
228
+ "name": "escalate-any-remaining",
229
+ "description": "Escalate all remaining operations not explicitly handled above.",
230
+ "principle": "Human oversight: any unclassified operation is routed to a human for approval.",
231
+ "if": {},
232
+ "then": "escalate",
233
+ "reason": "All operations not explicitly allowed or denied above are routed to a human to ensure no implicit permissions exist."
234
+ }
235
+ ]
236
+ }