@oscharko-dev/keiko-contracts 0.2.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 (227) hide show
  1. package/dist/.tsbuildinfo +1 -0
  2. package/dist/bff-wire.d.ts +661 -0
  3. package/dist/bff-wire.d.ts.map +1 -0
  4. package/dist/bff-wire.js +102 -0
  5. package/dist/bug-investigation-events.d.ts +92 -0
  6. package/dist/bug-investigation-events.d.ts.map +1 -0
  7. package/dist/bug-investigation-events.js +18 -0
  8. package/dist/coding-context.d.ts +76 -0
  9. package/dist/coding-context.d.ts.map +1 -0
  10. package/dist/coding-context.js +158 -0
  11. package/dist/connected-context.d.ts +174 -0
  12. package/dist/connected-context.d.ts.map +1 -0
  13. package/dist/connected-context.js +636 -0
  14. package/dist/conversation-budget.d.ts +37 -0
  15. package/dist/conversation-budget.d.ts.map +1 -0
  16. package/dist/conversation-budget.js +97 -0
  17. package/dist/editor-agent.d.ts +131 -0
  18. package/dist/editor-agent.d.ts.map +1 -0
  19. package/dist/editor-agent.js +197 -0
  20. package/dist/editor-completion.d.ts +62 -0
  21. package/dist/editor-completion.d.ts.map +1 -0
  22. package/dist/editor-completion.js +147 -0
  23. package/dist/editor-dirty-close.d.ts +17 -0
  24. package/dist/editor-dirty-close.d.ts.map +1 -0
  25. package/dist/editor-dirty-close.js +8 -0
  26. package/dist/editor-hot-exit.d.ts +18 -0
  27. package/dist/editor-hot-exit.d.ts.map +1 -0
  28. package/dist/editor-hot-exit.js +42 -0
  29. package/dist/editor-inline-completion.d.ts +70 -0
  30. package/dist/editor-inline-completion.d.ts.map +1 -0
  31. package/dist/editor-inline-completion.js +215 -0
  32. package/dist/editor-layout.d.ts +105 -0
  33. package/dist/editor-layout.d.ts.map +1 -0
  34. package/dist/editor-layout.js +479 -0
  35. package/dist/editor-patch-apply.d.ts +77 -0
  36. package/dist/editor-patch-apply.d.ts.map +1 -0
  37. package/dist/editor-patch-apply.js +122 -0
  38. package/dist/editor-session.d.ts +31 -0
  39. package/dist/editor-session.d.ts.map +1 -0
  40. package/dist/editor-session.js +75 -0
  41. package/dist/editor-test-generation.d.ts +104 -0
  42. package/dist/editor-test-generation.d.ts.map +1 -0
  43. package/dist/editor-test-generation.js +211 -0
  44. package/dist/evaluations.d.ts +75 -0
  45. package/dist/evaluations.d.ts.map +1 -0
  46. package/dist/evaluations.js +16 -0
  47. package/dist/evidence.d.ts +297 -0
  48. package/dist/evidence.d.ts.map +1 -0
  49. package/dist/evidence.js +9 -0
  50. package/dist/gateway.d.ts +129 -0
  51. package/dist/gateway.d.ts.map +1 -0
  52. package/dist/gateway.js +66 -0
  53. package/dist/harness.d.ts +274 -0
  54. package/dist/harness.d.ts.map +1 -0
  55. package/dist/harness.js +38 -0
  56. package/dist/index.d.ts +101 -0
  57. package/dist/index.d.ts.map +1 -0
  58. package/dist/index.js +83 -0
  59. package/dist/language-service.d.ts +145 -0
  60. package/dist/language-service.d.ts.map +1 -0
  61. package/dist/language-service.js +161 -0
  62. package/dist/local-knowledge-large-document-validation.d.ts +7 -0
  63. package/dist/local-knowledge-large-document-validation.d.ts.map +1 -0
  64. package/dist/local-knowledge-large-document-validation.js +161 -0
  65. package/dist/local-knowledge-large-document.d.ts +113 -0
  66. package/dist/local-knowledge-large-document.d.ts.map +1 -0
  67. package/dist/local-knowledge-large-document.js +142 -0
  68. package/dist/local-knowledge-paths.d.ts +3 -0
  69. package/dist/local-knowledge-paths.d.ts.map +1 -0
  70. package/dist/local-knowledge-paths.js +65 -0
  71. package/dist/local-knowledge-records.d.ts +190 -0
  72. package/dist/local-knowledge-records.d.ts.map +1 -0
  73. package/dist/local-knowledge-records.js +36 -0
  74. package/dist/local-knowledge-schema-validation.d.ts +19 -0
  75. package/dist/local-knowledge-schema-validation.d.ts.map +1 -0
  76. package/dist/local-knowledge-schema-validation.js +115 -0
  77. package/dist/local-knowledge-schema.d.ts +14 -0
  78. package/dist/local-knowledge-schema.d.ts.map +1 -0
  79. package/dist/local-knowledge-schema.js +715 -0
  80. package/dist/local-knowledge-validation.d.ts +20 -0
  81. package/dist/local-knowledge-validation.d.ts.map +1 -0
  82. package/dist/local-knowledge-validation.js +487 -0
  83. package/dist/local-knowledge.d.ts +158 -0
  84. package/dist/local-knowledge.d.ts.map +1 -0
  85. package/dist/local-knowledge.js +63 -0
  86. package/dist/memory-audit-events.d.ts +73 -0
  87. package/dist/memory-audit-events.d.ts.map +1 -0
  88. package/dist/memory-audit-events.js +44 -0
  89. package/dist/memory-audit-validation.d.ts +4 -0
  90. package/dist/memory-audit-validation.d.ts.map +1 -0
  91. package/dist/memory-audit-validation.js +151 -0
  92. package/dist/memory-barrel.d.ts +15 -0
  93. package/dist/memory-barrel.d.ts.map +1 -0
  94. package/dist/memory-barrel.js +20 -0
  95. package/dist/memory-internal.d.ts +26 -0
  96. package/dist/memory-internal.d.ts.map +1 -0
  97. package/dist/memory-internal.js +104 -0
  98. package/dist/memory-operations-validation.d.ts +12 -0
  99. package/dist/memory-operations-validation.d.ts.map +1 -0
  100. package/dist/memory-operations-validation.js +267 -0
  101. package/dist/memory-operations.d.ts +156 -0
  102. package/dist/memory-operations.d.ts.map +1 -0
  103. package/dist/memory-operations.js +29 -0
  104. package/dist/memory-record-validation.d.ts +10 -0
  105. package/dist/memory-record-validation.d.ts.map +1 -0
  106. package/dist/memory-record-validation.js +101 -0
  107. package/dist/memory-records.d.ts +66 -0
  108. package/dist/memory-records.d.ts.map +1 -0
  109. package/dist/memory-records.js +22 -0
  110. package/dist/memory-retrieval-validation.d.ts +6 -0
  111. package/dist/memory-retrieval-validation.d.ts.map +1 -0
  112. package/dist/memory-retrieval-validation.js +108 -0
  113. package/dist/memory-validation.d.ts +31 -0
  114. package/dist/memory-validation.d.ts.map +1 -0
  115. package/dist/memory-validation.js +318 -0
  116. package/dist/memory-workflow-port.d.ts +26 -0
  117. package/dist/memory-workflow-port.d.ts.map +1 -0
  118. package/dist/memory-workflow-port.js +13 -0
  119. package/dist/memory.d.ts +81 -0
  120. package/dist/memory.d.ts.map +1 -0
  121. package/dist/memory.js +104 -0
  122. package/dist/prompt-enhancer-analyzer.d.ts +7 -0
  123. package/dist/prompt-enhancer-analyzer.d.ts.map +1 -0
  124. package/dist/prompt-enhancer-analyzer.js +745 -0
  125. package/dist/prompt-enhancer-bff.d.ts +67 -0
  126. package/dist/prompt-enhancer-bff.d.ts.map +1 -0
  127. package/dist/prompt-enhancer-bff.js +156 -0
  128. package/dist/prompt-enhancer-critic.d.ts +46 -0
  129. package/dist/prompt-enhancer-critic.d.ts.map +1 -0
  130. package/dist/prompt-enhancer-critic.js +35 -0
  131. package/dist/prompt-enhancer-grounding.d.ts +19 -0
  132. package/dist/prompt-enhancer-grounding.d.ts.map +1 -0
  133. package/dist/prompt-enhancer-grounding.js +235 -0
  134. package/dist/prompt-enhancer-safety.d.ts +66 -0
  135. package/dist/prompt-enhancer-safety.d.ts.map +1 -0
  136. package/dist/prompt-enhancer-safety.js +446 -0
  137. package/dist/prompt-enhancer-validation.d.ts +28 -0
  138. package/dist/prompt-enhancer-validation.d.ts.map +1 -0
  139. package/dist/prompt-enhancer-validation.js +931 -0
  140. package/dist/prompt-enhancer.d.ts +184 -0
  141. package/dist/prompt-enhancer.d.ts.map +1 -0
  142. package/dist/prompt-enhancer.js +350 -0
  143. package/dist/qualityIntelligence/assertNever.d.ts +2 -0
  144. package/dist/qualityIntelligence/assertNever.d.ts.map +1 -0
  145. package/dist/qualityIntelligence/assertNever.js +7 -0
  146. package/dist/qualityIntelligence/auditSummary.d.ts +25 -0
  147. package/dist/qualityIntelligence/auditSummary.d.ts.map +1 -0
  148. package/dist/qualityIntelligence/auditSummary.js +7 -0
  149. package/dist/qualityIntelligence/bffWire.d.ts +356 -0
  150. package/dist/qualityIntelligence/bffWire.d.ts.map +1 -0
  151. package/dist/qualityIntelligence/bffWire.js +22 -0
  152. package/dist/qualityIntelligence/coverageMap.d.ts +21 -0
  153. package/dist/qualityIntelligence/coverageMap.d.ts.map +1 -0
  154. package/dist/qualityIntelligence/coverageMap.js +29 -0
  155. package/dist/qualityIntelligence/editableRevision.d.ts +21 -0
  156. package/dist/qualityIntelligence/editableRevision.d.ts.map +1 -0
  157. package/dist/qualityIntelligence/editableRevision.js +8 -0
  158. package/dist/qualityIntelligence/evidenceAtom.d.ts +35 -0
  159. package/dist/qualityIntelligence/evidenceAtom.d.ts.map +1 -0
  160. package/dist/qualityIntelligence/evidenceAtom.js +29 -0
  161. package/dist/qualityIntelligence/exportBundle.d.ts +28 -0
  162. package/dist/qualityIntelligence/exportBundle.d.ts.map +1 -0
  163. package/dist/qualityIntelligence/exportBundle.js +46 -0
  164. package/dist/qualityIntelligence/handoffEnvelope.d.ts +23 -0
  165. package/dist/qualityIntelligence/handoffEnvelope.d.ts.map +1 -0
  166. package/dist/qualityIntelligence/handoffEnvelope.js +8 -0
  167. package/dist/qualityIntelligence/ids.d.ts +58 -0
  168. package/dist/qualityIntelligence/ids.d.ts.map +1 -0
  169. package/dist/qualityIntelligence/ids.js +93 -0
  170. package/dist/qualityIntelligence/index.d.ts +29 -0
  171. package/dist/qualityIntelligence/index.d.ts.map +1 -0
  172. package/dist/qualityIntelligence/index.js +20 -0
  173. package/dist/qualityIntelligence/reviewRecord.d.ts +19 -0
  174. package/dist/qualityIntelligence/reviewRecord.d.ts.map +1 -0
  175. package/dist/qualityIntelligence/reviewRecord.js +20 -0
  176. package/dist/qualityIntelligence/runPlanAndEvents.d.ts +84 -0
  177. package/dist/qualityIntelligence/runPlanAndEvents.d.ts.map +1 -0
  178. package/dist/qualityIntelligence/runPlanAndEvents.js +51 -0
  179. package/dist/qualityIntelligence/sourceEnvelope.d.ts +77 -0
  180. package/dist/qualityIntelligence/sourceEnvelope.d.ts.map +1 -0
  181. package/dist/qualityIntelligence/sourceEnvelope.js +118 -0
  182. package/dist/qualityIntelligence/testCaseCandidate.d.ts +21 -0
  183. package/dist/qualityIntelligence/testCaseCandidate.d.ts.map +1 -0
  184. package/dist/qualityIntelligence/testCaseCandidate.js +21 -0
  185. package/dist/qualityIntelligence/testQualityRubric.d.ts +17 -0
  186. package/dist/qualityIntelligence/testQualityRubric.d.ts.map +1 -0
  187. package/dist/qualityIntelligence/testQualityRubric.js +32 -0
  188. package/dist/qualityIntelligence/validationFinding.d.ts +48 -0
  189. package/dist/qualityIntelligence/validationFinding.d.ts.map +1 -0
  190. package/dist/qualityIntelligence/validationFinding.js +36 -0
  191. package/dist/relationships-validation.d.ts +13 -0
  192. package/dist/relationships-validation.d.ts.map +1 -0
  193. package/dist/relationships-validation.js +422 -0
  194. package/dist/relationships.d.ts +79 -0
  195. package/dist/relationships.d.ts.map +1 -0
  196. package/dist/relationships.js +307 -0
  197. package/dist/text-safety.d.ts +7 -0
  198. package/dist/text-safety.d.ts.map +1 -0
  199. package/dist/text-safety.js +58 -0
  200. package/dist/tools.d.ts +153 -0
  201. package/dist/tools.d.ts.map +1 -0
  202. package/dist/tools.js +118 -0
  203. package/dist/unit-test-events.d.ts +87 -0
  204. package/dist/unit-test-events.d.ts.map +1 -0
  205. package/dist/unit-test-events.js +14 -0
  206. package/dist/verification-summary.d.ts +38 -0
  207. package/dist/verification-summary.d.ts.map +1 -0
  208. package/dist/verification-summary.js +5 -0
  209. package/dist/verification.d.ts +64 -0
  210. package/dist/verification.d.ts.map +1 -0
  211. package/dist/verification.js +13 -0
  212. package/dist/workflow-descriptor.d.ts +21 -0
  213. package/dist/workflow-descriptor.d.ts.map +1 -0
  214. package/dist/workflow-descriptor.js +8 -0
  215. package/dist/workflow-handoff.d.ts +69 -0
  216. package/dist/workflow-handoff.d.ts.map +1 -0
  217. package/dist/workflow-handoff.js +381 -0
  218. package/dist/workspace-descriptors.d.ts +21 -0
  219. package/dist/workspace-descriptors.d.ts.map +1 -0
  220. package/dist/workspace-descriptors.js +180 -0
  221. package/dist/workspace-ui.d.ts +119 -0
  222. package/dist/workspace-ui.d.ts.map +1 -0
  223. package/dist/workspace-ui.js +105 -0
  224. package/dist/workspace.d.ts +104 -0
  225. package/dist/workspace.d.ts.map +1 -0
  226. package/dist/workspace.js +27 -0
  227. package/package.json +71 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-enhancer-safety.d.ts","sourceRoot":"","sources":["../src/prompt-enhancer-safety.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,446 @@
1
+ // Prompt Enhancer safety annotations and the deterministic validate-stage rule model
2
+ // (Epic #1307, Issue #1313; ADR-0044 §4/§5/§7).
3
+ //
4
+ // This module owns the machine-readable safety-annotation shapes and the STRUCTURAL half of the
5
+ // validate stage: a pure, deterministic assessment of whether an `EnhancedPrompt` upholds the safety
6
+ // invariants the enhancer must never relax — trusted/untrusted channel separation (AC1), untrusted
7
+ // content marked and unable to override instructions (AC2), no capability-grant / secret-disclosure
8
+ // claims, an explicit human-review + least-privilege posture for risky agentic tasks (AC5), and an
9
+ // output-validation expectation for structured outputs. The result is a wire-safe
10
+ // `PromptSafetyAssessment` the evidence model (#1313, keiko-evidence) and the server (#1314) can
11
+ // transmit, persist, and render.
12
+ //
13
+ // Split of responsibility (ADR-0044 §5 — redaction is distinct from validation): this leaf module
14
+ // performs the STRUCTURAL validation derivable from the prompt + analysis alone (presence of required
15
+ // safeguards, absence of authority-grant claims in the trusted sections). The AUTHORITATIVE text-level
16
+ // detection of prompt injection, secret-exfiltration, and manipulative content in untrusted input
17
+ // lives in `keiko-security` and is composed over this assessment by the gateway validate stage
18
+ // (`keiko-model-gateway/src/promptEnhancer/validate.ts`); the leaf-package rule (ADR-0019 direction 1)
19
+ // forbids importing it here. The findings vocabulary below is the shared closed set both layers emit.
20
+ //
21
+ // Determinism: pure. No IO, clock, crypto, or randomness. No raw user input is echoed — every finding
22
+ // `detail` is a fixed, content-free template. A generated prompt is data, never a capability grant
23
+ // (ADR-0044 §4): nothing here can encode or confer tool, secret, egress, or patch authority.
24
+ import { stripUnsafeFormatChars } from "./text-safety.js";
25
+ import { PROMPT_ENHANCER_SCHEMA_VERSION, validatePromptEnhancerIdString, } from "./prompt-enhancer.js";
26
+ export const PROMPT_SAFETY_RULE_IDS = [
27
+ "trusted-untrusted-separation",
28
+ "untrusted-content-marked",
29
+ "no-authority-grant",
30
+ "no-secret-or-system-prompt-disclosure",
31
+ "human-review-for-risky-actions",
32
+ "least-privilege-tool-access",
33
+ "output-validation-required",
34
+ "no-manipulative-or-injected-instructions",
35
+ ];
36
+ export const PROMPT_SAFETY_VIOLATION_CODES = [
37
+ "missing-channel-separation",
38
+ "missing-untrusted-marker",
39
+ "missing-authority-restriction",
40
+ "missing-secrecy-rule",
41
+ "missing-human-review",
42
+ "missing-least-privilege",
43
+ "missing-output-validation",
44
+ "capability-grant-claim",
45
+ "secret-request",
46
+ "system-prompt-disclosure",
47
+ "untrusted-instruction-override",
48
+ "manipulative-instruction",
49
+ "hidden-assumption",
50
+ ];
51
+ export const isPromptSafetyViolationCode = (value) => typeof value === "string" && PROMPT_SAFETY_VIOLATION_CODES.includes(value);
52
+ export const PROMPT_SAFETY_SEVERITIES = [
53
+ "info",
54
+ "warning",
55
+ "blocking",
56
+ ];
57
+ export const LEAST_PRIVILEGE_CONSTRAINTS = [
58
+ "no-tool-execution",
59
+ "no-file-write",
60
+ "no-network-egress",
61
+ "no-secret-access",
62
+ "require-human-approval",
63
+ ];
64
+ // The baseline deny-all posture every generated prompt carries (least privilege by default).
65
+ const BASELINE_LEAST_PRIVILEGE = [
66
+ "no-tool-execution",
67
+ "no-file-write",
68
+ "no-network-egress",
69
+ "no-secret-access",
70
+ ];
71
+ export const PROMPT_SAFETY_DECISIONS = [
72
+ "accepted",
73
+ "requires-human-review",
74
+ "rejected",
75
+ ];
76
+ export const PROMPT_SAFETY_VERIFICATION_STATUSES = [
77
+ "passed",
78
+ "passed-with-review",
79
+ "failed",
80
+ ];
81
+ // ─── Finding + assessment shapes ─────────────────────────────────────────────────────
82
+ const SAFETY_DETAIL_MAX_CHARS = 400;
83
+ // Fixed, content-free detail templates keyed by violation code. Stable strings so the audit trail and
84
+ // UI render consistent, never-echoing explanations.
85
+ export const PROMPT_SAFETY_VIOLATION_DETAILS = {
86
+ "missing-channel-separation": "The prompt does not instruct the model to treat the user Input section as data rather than instructions.",
87
+ "missing-untrusted-marker": "The grounding plan does not mark external and retrieved content as untrusted.",
88
+ "missing-authority-restriction": "The prompt does not state that it grants no tool, file, network, or secret authority.",
89
+ "missing-secrecy-rule": "The prompt does not forbid disclosing secrets, credentials, or system instructions.",
90
+ "missing-human-review": "A risky agentic prompt does not require explicit human approval before side-effecting actions.",
91
+ "missing-least-privilege": "A risky agentic prompt does not constrain the model to least-privilege, approval-gated actions.",
92
+ "missing-output-validation": "A structured-output prompt does not require the response to conform to the declared format.",
93
+ "capability-grant-claim": "A trusted section appears to grant the model tool, file, network, or secret authority.",
94
+ "secret-request": "Content requests secrets, credentials, environment values, or system instructions.",
95
+ "system-prompt-disclosure": "Content requests disclosure of the system or developer prompt.",
96
+ "untrusted-instruction-override": "Content attempts to override or ignore the trusted instructions.",
97
+ "manipulative-instruction": "Content uses manipulative framing or role reassignment to alter the model's behaviour.",
98
+ "hidden-assumption": "A trusted section introduces an unstated assumption not derived from the analysis.",
99
+ };
100
+ // ─── Pure predicates ─────────────────────────────────────────────────────────────────
101
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
102
+ const isMember = (value, allowed) => typeof value === "string" && allowed.includes(value);
103
+ const isBoundedSafeText = (value, max) => typeof value === "string" && value.length <= max && stripUnsafeFormatChars(value) === value;
104
+ const containsAll = (haystack, needles) => needles.every((needle) => haystack.includes(needle));
105
+ const containsAny = (haystack, needles) => needles.some((needle) => haystack.includes(needle));
106
+ // ─── Required-safeguard predicates over the trusted sections ──────────────────────────
107
+ // These confirm a generated prompt actually carries the safeguard. They match on robust concept
108
+ // keywords, not brittle exact strings, so wording can evolve while the safeguard stays detectable.
109
+ const marksInputAsData = (context) => {
110
+ const text = context.join(" \n ").toLowerCase();
111
+ return containsAll(text, ["input", "data"]) && containsAny(text, ["instruction", "directions"]);
112
+ };
113
+ const assertsNoAuthority = (safetyRules) => {
114
+ const text = safetyRules.join(" \n ").toLowerCase();
115
+ return (text.includes("not an authorization") ||
116
+ (text.includes("grant") && containsAny(text, ["no tool", "no secret", "no access"])));
117
+ };
118
+ const forbidsSecretDisclosure = (safetyRules) => {
119
+ const text = safetyRules.join(" \n ").toLowerCase();
120
+ return (containsAny(text, ["do not reveal", "never reveal", "do not disclose"]) &&
121
+ containsAny(text, ["secret", "credential", "system instruction", "system prompt"]));
122
+ };
123
+ const requiresHumanApprovalRule = (safetyRules) => {
124
+ const text = safetyRules.join(" \n ").toLowerCase();
125
+ return containsAny(text, ["human approval", "explicit approval", "explicit human"]);
126
+ };
127
+ // Distinct from the human-approval rule: the least-privilege constraint instructs the model not to
128
+ // *assume* tool/file/network authority in the first place. Matched on its own phrasing so the two
129
+ // safeguards are checked independently (a tampered prompt could drop one but keep the other).
130
+ const carriesLeastPrivilegeConstraint = (constraints, safetyRules) => {
131
+ const text = [...constraints, ...safetyRules].join(" \n ").toLowerCase();
132
+ return (text.includes("do not assume authority") ||
133
+ text.includes("least privilege") ||
134
+ text.includes("least-privilege"));
135
+ };
136
+ const requiresOutputConformance = (constraints, qualityCriteria) => {
137
+ const text = [...constraints, ...qualityCriteria].join(" \n ").toLowerCase();
138
+ return containsAny(text, ["required output format", "required format", "conform"]);
139
+ };
140
+ // ─── Prohibited-pattern predicates over the trusted sections (defense in depth, AC3) ──
141
+ // A correctly generated prompt never contains these in its TRUSTED sections; a forged or tampered
142
+ // candidate would. The authoritative detection over UNTRUSTED input lives in keiko-security.
143
+ const TRUSTED_AUTHORITY_GRANT_CUES = [
144
+ "grant yourself",
145
+ "give yourself access",
146
+ "you may run any",
147
+ "you are authorized to run",
148
+ "you can execute any",
149
+ ];
150
+ const TRUSTED_OVERRIDE_CUES = [
151
+ "ignore previous instructions",
152
+ "ignore all previous",
153
+ "disregard previous",
154
+ "disregard the above",
155
+ "ignore the above",
156
+ "ignore the safety rules",
157
+ ];
158
+ const TRUSTED_DISCLOSURE_CUES = [
159
+ "reveal the system prompt",
160
+ "print the system prompt",
161
+ "reveal your system prompt",
162
+ "disclose the system prompt",
163
+ ];
164
+ const TRUSTED_ASSUMPTION_PREFIX = "Assumption: ";
165
+ // ─── Human-review derivation ──────────────────────────────────────────────────────────
166
+ /**
167
+ * Derive whether a task is risky enough to require human review before any side-effecting action
168
+ * (AC5). Pure. A task is risky when it is agentic, requests tool/egress authority, or is critical.
169
+ */
170
+ export function requiresHumanReviewForAnalysis(analysis) {
171
+ return (analysis.criticality === "critical" ||
172
+ analysis.taskClass === "agentic-tool-use" ||
173
+ analysis.riskFlags.includes("tool-authority-requested") ||
174
+ analysis.riskFlags.includes("egress-requested"));
175
+ }
176
+ /**
177
+ * Reduce a finding set and the human-review flag to the decision + verification status. Pure. Shared
178
+ * by the structural assessor and the gateway validate stage (which adds security findings first).
179
+ */
180
+ export function summarizePromptSafety(findings, requiresHumanReview) {
181
+ if (findings.some((finding) => finding.severity === "blocking")) {
182
+ return { decision: "rejected", verificationStatus: "failed" };
183
+ }
184
+ if (requiresHumanReview) {
185
+ return { decision: "requires-human-review", verificationStatus: "passed-with-review" };
186
+ }
187
+ return { decision: "accepted", verificationStatus: "passed" };
188
+ }
189
+ /**
190
+ * Compute the least-privilege constraint set for a task. Pure. Always denies tool/file/egress/secret
191
+ * authority (least privilege by default); risky tasks additionally require human approval (AC5).
192
+ */
193
+ export function leastPrivilegeForAnalysis(analysis) {
194
+ return requiresHumanReviewForAnalysis(analysis)
195
+ ? [...BASELINE_LEAST_PRIVILEGE, "require-human-approval"]
196
+ : [...BASELINE_LEAST_PRIVILEGE];
197
+ }
198
+ function finding(code, ruleId, severity) {
199
+ return { code, ruleId, severity, detail: PROMPT_SAFETY_VIOLATION_DETAILS[code] };
200
+ }
201
+ // Baseline safeguards required of EVERY generated prompt (AC1/AC2, no-authority, no-disclosure).
202
+ function collectBaselineSafeguardFindings(prompt) {
203
+ const findings = [];
204
+ // AC2 — untrusted content must be marked. `untrustedContent` is pinned to `true` in the type, but a
205
+ // forged/cast object can violate it, so the runtime check is load-bearing.
206
+ if (prompt.groundingPlan.untrustedContent !== true) {
207
+ findings.push(finding("missing-untrusted-marker", "untrusted-content-marked", "blocking"));
208
+ }
209
+ // AC1 — the Input section must be labelled as data, not instructions.
210
+ if (!marksInputAsData(prompt.context)) {
211
+ findings.push(finding("missing-channel-separation", "trusted-untrusted-separation", "blocking"));
212
+ }
213
+ // ADR-0044 §4 — no authority grant.
214
+ if (!assertsNoAuthority(prompt.safetyRules)) {
215
+ findings.push(finding("missing-authority-restriction", "no-authority-grant", "blocking"));
216
+ }
217
+ // Scope — no secret / system-prompt disclosure.
218
+ if (!forbidsSecretDisclosure(prompt.safetyRules)) {
219
+ findings.push(finding("missing-secrecy-rule", "no-secret-or-system-prompt-disclosure", "blocking"));
220
+ }
221
+ return findings;
222
+ }
223
+ // Conditional safeguards: human review + least privilege for risky tasks (AC5), and an output-
224
+ // validation expectation for structured outputs.
225
+ function collectConditionalSafeguardFindings(prompt, requiresReview) {
226
+ const findings = [];
227
+ if (requiresReview && !requiresHumanApprovalRule(prompt.safetyRules)) {
228
+ findings.push(finding("missing-human-review", "human-review-for-risky-actions", "blocking"));
229
+ }
230
+ if (requiresReview && !carriesLeastPrivilegeConstraint(prompt.constraints, prompt.safetyRules)) {
231
+ findings.push(finding("missing-least-privilege", "least-privilege-tool-access", "blocking"));
232
+ }
233
+ if (prompt.outputSchema.structured &&
234
+ !requiresOutputConformance(prompt.constraints, prompt.qualityCriteria)) {
235
+ findings.push(finding("missing-output-validation", "output-validation-required", "warning"));
236
+ }
237
+ return findings;
238
+ }
239
+ function collectStructuralFindings(prompt, requiresReview) {
240
+ return [
241
+ ...collectBaselineSafeguardFindings(prompt),
242
+ ...collectConditionalSafeguardFindings(prompt, requiresReview),
243
+ ];
244
+ }
245
+ function trustedEntries(prompt) {
246
+ return [
247
+ prompt.role,
248
+ prompt.goal,
249
+ ...prompt.context,
250
+ ...prompt.taskDecomposition,
251
+ ...prompt.constraints,
252
+ ...prompt.groundingRules,
253
+ ...prompt.qualityCriteria,
254
+ ...prompt.uncertaintyHandling,
255
+ ...prompt.safetyRules,
256
+ ];
257
+ }
258
+ function collectHiddenAssumptionFindings(prompt, analysis) {
259
+ const allowed = new Set(analysis.missingContext
260
+ .filter((item) => item.kind === "assumption")
261
+ .map((item) => `${TRUSTED_ASSUMPTION_PREFIX}${item.statement}`));
262
+ const hasHiddenAssumption = trustedEntries(prompt)
263
+ .flatMap((entry) => entry.split(/\r?\n/u).map((line) => line.trim()))
264
+ .some((entry) => entry.startsWith(TRUSTED_ASSUMPTION_PREFIX) && !allowed.has(entry));
265
+ return hasHiddenAssumption
266
+ ? [finding("hidden-assumption", "no-manipulative-or-injected-instructions", "blocking")]
267
+ : [];
268
+ }
269
+ function collectProhibitedTrustedFindings(prompt, analysis) {
270
+ const trusted = [...trustedEntries(prompt)].join(" \n ").toLowerCase();
271
+ const findings = [];
272
+ if (containsAny(trusted, TRUSTED_AUTHORITY_GRANT_CUES)) {
273
+ findings.push(finding("capability-grant-claim", "no-authority-grant", "blocking"));
274
+ }
275
+ if (containsAny(trusted, TRUSTED_OVERRIDE_CUES)) {
276
+ findings.push(finding("untrusted-instruction-override", "no-manipulative-or-injected-instructions", "blocking"));
277
+ }
278
+ if (containsAny(trusted, TRUSTED_DISCLOSURE_CUES)) {
279
+ findings.push(finding("system-prompt-disclosure", "no-secret-or-system-prompt-disclosure", "blocking"));
280
+ }
281
+ findings.push(...collectHiddenAssumptionFindings(prompt, analysis));
282
+ return findings;
283
+ }
284
+ /**
285
+ * Deterministically assess the STRUCTURAL safety of an `EnhancedPrompt` against the validate-stage
286
+ * rule set. Pure. Confirms the required safeguards are present (AC1/AC2/AC5, no-authority,
287
+ * no-disclosure, output validation) and that the trusted sections carry no authority-grant, override,
288
+ * or disclosure claim (AC3 defense in depth). The authoritative text-level detection over untrusted
289
+ * input is layered on top by the gateway validate stage; this function never inspects raw input.
290
+ */
291
+ export function assessEnhancedPromptStructuralSafety(prompt, analysis) {
292
+ const requiresReview = requiresHumanReviewForAnalysis(analysis);
293
+ const findings = [
294
+ ...collectStructuralFindings(prompt, requiresReview),
295
+ ...collectProhibitedTrustedFindings(prompt, analysis),
296
+ ];
297
+ const { decision, verificationStatus } = summarizePromptSafety(findings, requiresReview);
298
+ return {
299
+ schemaVersion: PROMPT_ENHANCER_SCHEMA_VERSION,
300
+ promptId: prompt.promptId,
301
+ decision,
302
+ requiresHumanReview: requiresReview,
303
+ verificationStatus,
304
+ findings,
305
+ leastPrivilege: leastPrivilegeForAnalysis(analysis),
306
+ };
307
+ }
308
+ // ─── Wire validator ────────────────────────────────────────────────────────────────
309
+ const ASSESSMENT_KEYS = new Set([
310
+ "schemaVersion",
311
+ "promptId",
312
+ "decision",
313
+ "requiresHumanReview",
314
+ "verificationStatus",
315
+ "findings",
316
+ "leastPrivilege",
317
+ ]);
318
+ const FINDING_KEYS = new Set(["code", "ruleId", "severity", "detail"]);
319
+ const ASSESSMENT_FINDINGS_MAX = 256;
320
+ const VERIFICATION_BY_DECISION = {
321
+ accepted: "passed",
322
+ "requires-human-review": "passed-with-review",
323
+ rejected: "failed",
324
+ };
325
+ function validateFinding(value, index, errors) {
326
+ const label = `assessment.findings[${String(index)}]`;
327
+ if (!isRecord(value)) {
328
+ errors.push(`${label} must be an object`);
329
+ return false;
330
+ }
331
+ let ok = true;
332
+ if (Object.keys(value).some((key) => !FINDING_KEYS.has(key))) {
333
+ errors.push(`${label} must not contain unknown fields`);
334
+ ok = false;
335
+ }
336
+ if (!isPromptSafetyViolationCode(value.code)) {
337
+ errors.push(`${label}.code must be a known violation code`);
338
+ ok = false;
339
+ }
340
+ if (!isMember(value.ruleId, PROMPT_SAFETY_RULE_IDS)) {
341
+ errors.push(`${label}.ruleId must be a known safety rule id`);
342
+ ok = false;
343
+ }
344
+ const isBlocking = value.severity === "blocking";
345
+ if (!isMember(value.severity, PROMPT_SAFETY_SEVERITIES)) {
346
+ errors.push(`${label}.severity must be a known severity`);
347
+ ok = false;
348
+ }
349
+ if (!isBoundedSafeText(value.detail, SAFETY_DETAIL_MAX_CHARS)) {
350
+ errors.push(`${label}.detail must be a bounded, control-free string`);
351
+ ok = false;
352
+ }
353
+ return ok && isBlocking;
354
+ }
355
+ function validateAssessmentScalars(input, errors) {
356
+ if (Object.keys(input).some((key) => !ASSESSMENT_KEYS.has(key))) {
357
+ errors.push("assessment must not contain unknown fields");
358
+ }
359
+ if (input.schemaVersion !== PROMPT_ENHANCER_SCHEMA_VERSION) {
360
+ errors.push(`assessment.schemaVersion must be "${PROMPT_ENHANCER_SCHEMA_VERSION}"`);
361
+ }
362
+ const promptIdResult = validatePromptEnhancerIdString(input.promptId, "EnhancedPromptId");
363
+ if (!promptIdResult.ok)
364
+ errors.push(`assessment.promptId: ${promptIdResult.reason}`);
365
+ if (!isMember(input.decision, PROMPT_SAFETY_DECISIONS)) {
366
+ errors.push(`assessment.decision must be one of ${PROMPT_SAFETY_DECISIONS.join("|")}`);
367
+ }
368
+ if (typeof input.requiresHumanReview !== "boolean") {
369
+ errors.push("assessment.requiresHumanReview must be a boolean");
370
+ }
371
+ if (!isMember(input.verificationStatus, PROMPT_SAFETY_VERIFICATION_STATUSES)) {
372
+ errors.push(`assessment.verificationStatus must be one of ${PROMPT_SAFETY_VERIFICATION_STATUSES.join("|")}`);
373
+ }
374
+ }
375
+ // Validate the findings array; returns the number of well-formed blocking findings (or -1 when the
376
+ // array itself is malformed, so the caller can skip the blocking-count cross-checks).
377
+ function validateAssessmentFindings(input, errors) {
378
+ if (!Array.isArray(input.findings) || input.findings.length > ASSESSMENT_FINDINGS_MAX) {
379
+ errors.push(`assessment.findings must be an array of at most ${String(ASSESSMENT_FINDINGS_MAX)} entries`);
380
+ return -1;
381
+ }
382
+ let blockingCount = 0;
383
+ input.findings.forEach((entry, index) => {
384
+ if (validateFinding(entry, index, errors))
385
+ blockingCount += 1;
386
+ });
387
+ return blockingCount;
388
+ }
389
+ function isValidLeastPrivilege(value) {
390
+ return (Array.isArray(value) &&
391
+ value.every((entry) => isMember(entry, LEAST_PRIVILEGE_CONSTRAINTS)) &&
392
+ new Set(value).size === value.length);
393
+ }
394
+ function validateDecisionConsistency(input, blockingCount, errors) {
395
+ if (!isMember(input.decision, PROMPT_SAFETY_DECISIONS) || blockingCount < 0)
396
+ return;
397
+ if (input.verificationStatus !== VERIFICATION_BY_DECISION[input.decision]) {
398
+ errors.push("assessment.verificationStatus must match the decision");
399
+ }
400
+ if (input.decision === "rejected" && blockingCount === 0) {
401
+ errors.push("assessment.decision rejected requires at least one blocking finding");
402
+ }
403
+ if (input.decision !== "rejected" && blockingCount > 0) {
404
+ errors.push("assessment.decision must be rejected when a blocking finding is present");
405
+ }
406
+ }
407
+ function validateHumanReviewConstraint(input, leastPrivilegeOk, errors) {
408
+ if (input.decision === "accepted" && input.requiresHumanReview !== false) {
409
+ errors.push("assessment.decision accepted requires requiresHumanReview to be false");
410
+ }
411
+ if (input.decision === "requires-human-review" && input.requiresHumanReview !== true) {
412
+ errors.push("assessment.decision requires-human-review requires requiresHumanReview to be true");
413
+ }
414
+ if (input.requiresHumanReview === true &&
415
+ leastPrivilegeOk &&
416
+ !input.leastPrivilege.includes("require-human-approval")) {
417
+ errors.push("assessment.leastPrivilege must include require-human-approval when human review is required");
418
+ }
419
+ }
420
+ function validateAssessmentCrossFields(input, blockingCount, leastPrivilegeOk, errors) {
421
+ validateDecisionConsistency(input, blockingCount, errors);
422
+ validateHumanReviewConstraint(input, leastPrivilegeOk, errors);
423
+ }
424
+ /**
425
+ * Validate a `PromptSafetyAssessment`. Pure; returns a discriminated result and never throws. Checks
426
+ * structural well-formedness and the cross-field invariants that make the assessment trustworthy: the
427
+ * verification status matches the decision, a `rejected` decision carries at least one blocking
428
+ * finding, and a human-review requirement implies the `require-human-approval` least-privilege
429
+ * constraint.
430
+ */
431
+ export function validatePromptSafetyAssessment(input) {
432
+ if (!isRecord(input)) {
433
+ return { ok: false, errors: ["assessment must be an object"] };
434
+ }
435
+ const errors = [];
436
+ validateAssessmentScalars(input, errors);
437
+ const blockingCount = validateAssessmentFindings(input, errors);
438
+ const leastPrivilegeOk = isValidLeastPrivilege(input.leastPrivilege);
439
+ if (!leastPrivilegeOk) {
440
+ errors.push("assessment.leastPrivilege must be an array of unique least-privilege constraints");
441
+ }
442
+ validateAssessmentCrossFields(input, blockingCount, leastPrivilegeOk, errors);
443
+ if (errors.length > 0)
444
+ return { ok: false, errors };
445
+ return { ok: true, value: input };
446
+ }
@@ -0,0 +1,28 @@
1
+ import { type EnhancedPrompt, type GroundingPlan, type PromptEnhancementRequest, type PromptTaskAnalysis } from "./prompt-enhancer.js";
2
+ import { type PromptCandidateScorecard, type PromptCandidateSelection } from "./prompt-enhancer-critic.js";
3
+ export interface ValidationOk<T> {
4
+ readonly ok: true;
5
+ readonly value: T;
6
+ }
7
+ export interface ValidationFail {
8
+ readonly ok: false;
9
+ readonly errors: readonly string[];
10
+ }
11
+ export type PromptEnhancerValidation<T> = ValidationOk<T> | ValidationFail;
12
+ export declare const PROMPT_REQUEST_TEXT_MAX_CHARS: 100000;
13
+ export declare function validatePromptEnhancementRequest(input: unknown): PromptEnhancerValidation<PromptEnhancementRequest>;
14
+ export declare function validatePromptTaskAnalysis(input: unknown): PromptEnhancerValidation<PromptTaskAnalysis>;
15
+ export declare function validateGroundingPlan(input: unknown): PromptEnhancerValidation<GroundingPlan>;
16
+ export declare function validateEnhancedPrompt(input: unknown): PromptEnhancerValidation<EnhancedPrompt>;
17
+ /**
18
+ * Validate a `PromptCandidateScorecard`. Pure; returns a discriminated result and never throws.
19
+ */
20
+ export declare function validatePromptCandidateScorecard(input: unknown): PromptEnhancerValidation<PromptCandidateScorecard>;
21
+ /**
22
+ * Validate a `PromptCandidateSelection`. Pure; returns a discriminated result and never throws. Checks
23
+ * structural well-formedness and the cross-field invariants that make the result auditable: the winner
24
+ * is the first ranked entry, every ranked scorecard is well-formed, and the considered/consumed totals
25
+ * are non-negative integers within the declared bounds.
26
+ */
27
+ export declare function validatePromptCandidateSelection(input: unknown): PromptEnhancerValidation<PromptCandidateSelection>;
28
+ //# sourceMappingURL=prompt-enhancer-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-enhancer-validation.d.ts","sourceRoot":"","sources":["../src/prompt-enhancer-validation.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,aAAa,EAIlB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EA4BxB,MAAM,sBAAsB,CAAC;AAS9B,OAAO,EAGL,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAG9B,MAAM,6BAA6B,CAAC;AAOrC,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED,MAAM,MAAM,wBAAwB,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC;AAI3E,eAAO,MAAM,6BAA6B,QAAiC,CAAC;AAqK5E,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,OAAO,GACb,wBAAwB,CAAC,wBAAwB,CAAC,CA6BpD;AA0HD,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,GACb,wBAAwB,CAAC,kBAAkB,CAAC,CAoB9C;AAwUD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,wBAAwB,CAAC,aAAa,CAAC,CAK7F;AAsBD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,wBAAwB,CAAC,cAAc,CAAC,CAwB/F;AAuGD;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,OAAO,GACb,wBAAwB,CAAC,wBAAwB,CAAC,CAKpD;AA+UD;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,OAAO,GACb,wBAAwB,CAAC,wBAAwB,CAAC,CAoBpD"}