llmverify 0.0.1 → 1.0.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 (147) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/LICENSE +24 -21
  3. package/README.md +833 -95
  4. package/dist/adapters/factory.d.ts +62 -0
  5. package/dist/adapters/factory.js +101 -0
  6. package/dist/adapters/index.d.ts +31 -0
  7. package/dist/adapters/index.js +51 -0
  8. package/dist/adapters/providers/anthropic.d.ts +22 -0
  9. package/dist/adapters/providers/anthropic.js +88 -0
  10. package/dist/adapters/providers/cohere.d.ts +22 -0
  11. package/dist/adapters/providers/cohere.js +80 -0
  12. package/dist/adapters/providers/custom.d.ts +53 -0
  13. package/dist/adapters/providers/custom.js +84 -0
  14. package/dist/adapters/providers/deepseek.d.ts +26 -0
  15. package/dist/adapters/providers/deepseek.js +78 -0
  16. package/dist/adapters/providers/google.d.ts +22 -0
  17. package/dist/adapters/providers/google.js +68 -0
  18. package/dist/adapters/providers/groq.d.ts +22 -0
  19. package/dist/adapters/providers/groq.js +78 -0
  20. package/dist/adapters/providers/local.d.ts +53 -0
  21. package/dist/adapters/providers/local.js +109 -0
  22. package/dist/adapters/providers/mistral.d.ts +22 -0
  23. package/dist/adapters/providers/mistral.js +74 -0
  24. package/dist/adapters/providers/openai.d.ts +22 -0
  25. package/dist/adapters/providers/openai.js +99 -0
  26. package/dist/adapters/types.d.ts +144 -0
  27. package/dist/adapters/types.js +58 -0
  28. package/dist/cli.d.ts +11 -0
  29. package/dist/cli.js +238 -0
  30. package/dist/compat/index.d.ts +272 -0
  31. package/dist/compat/index.js +282 -0
  32. package/dist/constants.d.ts +87 -0
  33. package/dist/constants.js +115 -0
  34. package/dist/csm6/baseline.d.ts +21 -0
  35. package/dist/csm6/baseline.js +120 -0
  36. package/dist/csm6/index.d.ts +9 -0
  37. package/dist/csm6/index.js +28 -0
  38. package/dist/csm6/security/harmful-content.d.ts +15 -0
  39. package/dist/csm6/security/harmful-content.js +180 -0
  40. package/dist/csm6/security/index.d.ts +12 -0
  41. package/dist/csm6/security/index.js +28 -0
  42. package/dist/csm6/security/pii-detection.d.ts +44 -0
  43. package/dist/csm6/security/pii-detection.js +433 -0
  44. package/dist/csm6/security/prompt-injection.d.ts +39 -0
  45. package/dist/csm6/security/prompt-injection.js +359 -0
  46. package/dist/engines/classification/compression.d.ts +53 -0
  47. package/dist/engines/classification/compression.js +167 -0
  48. package/dist/engines/classification/engine.d.ts +53 -0
  49. package/dist/engines/classification/engine.js +208 -0
  50. package/dist/engines/classification/hallucination.d.ts +54 -0
  51. package/dist/engines/classification/hallucination.js +189 -0
  52. package/dist/engines/classification/index.d.ts +31 -0
  53. package/dist/engines/classification/index.js +48 -0
  54. package/dist/engines/classification/instruction-eval.d.ts +28 -0
  55. package/dist/engines/classification/instruction-eval.js +189 -0
  56. package/dist/engines/classification/intent.d.ts +21 -0
  57. package/dist/engines/classification/intent.js +197 -0
  58. package/dist/engines/classification/json-repair.d.ts +28 -0
  59. package/dist/engines/classification/json-repair.js +214 -0
  60. package/dist/engines/classification/types.d.ts +232 -0
  61. package/dist/engines/classification/types.js +24 -0
  62. package/dist/engines/classification/utils.d.ts +53 -0
  63. package/dist/engines/classification/utils.js +154 -0
  64. package/dist/engines/consistency/index.d.ts +24 -0
  65. package/dist/engines/consistency/index.js +173 -0
  66. package/dist/engines/hallucination/claim-extractor.d.ts +14 -0
  67. package/dist/engines/hallucination/claim-extractor.js +179 -0
  68. package/dist/engines/hallucination/index.d.ts +23 -0
  69. package/dist/engines/hallucination/index.js +111 -0
  70. package/dist/engines/hallucination/risk-analyzer.d.ts +19 -0
  71. package/dist/engines/hallucination/risk-analyzer.js +86 -0
  72. package/dist/engines/index.d.ts +13 -0
  73. package/dist/engines/index.js +42 -0
  74. package/dist/engines/json-validator/index.d.ts +23 -0
  75. package/dist/engines/json-validator/index.js +181 -0
  76. package/dist/engines/risk-scoring/index.d.ts +23 -0
  77. package/dist/engines/risk-scoring/index.js +138 -0
  78. package/dist/engines/runtime/baseline.d.ts +69 -0
  79. package/dist/engines/runtime/baseline.js +124 -0
  80. package/dist/engines/runtime/fingerprint.d.ts +43 -0
  81. package/dist/engines/runtime/fingerprint.js +132 -0
  82. package/dist/engines/runtime/health-score.d.ts +46 -0
  83. package/dist/engines/runtime/health-score.js +157 -0
  84. package/dist/engines/runtime/index.d.ts +15 -0
  85. package/dist/engines/runtime/index.js +28 -0
  86. package/dist/engines/runtime/latency.d.ts +39 -0
  87. package/dist/engines/runtime/latency.js +98 -0
  88. package/dist/engines/runtime/structure.d.ts +36 -0
  89. package/dist/engines/runtime/structure.js +155 -0
  90. package/dist/engines/runtime/token-rate.d.ts +39 -0
  91. package/dist/engines/runtime/token-rate.js +101 -0
  92. package/dist/errors.d.ts +57 -0
  93. package/dist/errors.js +86 -0
  94. package/dist/index.d.ts +86 -0
  95. package/dist/index.js +192 -0
  96. package/dist/sentinel/duplicateQueryTest.d.ts +39 -0
  97. package/dist/sentinel/duplicateQueryTest.js +125 -0
  98. package/dist/sentinel/index.d.ts +26 -0
  99. package/dist/sentinel/index.js +35 -0
  100. package/dist/sentinel/shortReasoningTest.d.ts +38 -0
  101. package/dist/sentinel/shortReasoningTest.js +122 -0
  102. package/dist/sentinel/staticEchoTest.d.ts +38 -0
  103. package/dist/sentinel/staticEchoTest.js +109 -0
  104. package/dist/sentinel/structuredListTest.d.ts +38 -0
  105. package/dist/sentinel/structuredListTest.js +107 -0
  106. package/dist/sentinel/suite.d.ts +56 -0
  107. package/dist/sentinel/suite.js +93 -0
  108. package/dist/types/config.d.ts +67 -0
  109. package/dist/types/config.js +81 -0
  110. package/dist/types/index.d.ts +10 -0
  111. package/dist/types/index.js +27 -0
  112. package/dist/types/results.d.ts +151 -0
  113. package/dist/types/results.js +13 -0
  114. package/dist/types/runtime.d.ts +196 -0
  115. package/dist/types/runtime.js +24 -0
  116. package/dist/utils/index.d.ts +9 -0
  117. package/dist/utils/index.js +26 -0
  118. package/dist/utils/similarity.d.ts +29 -0
  119. package/dist/utils/similarity.js +107 -0
  120. package/dist/utils/text.d.ts +43 -0
  121. package/dist/utils/text.js +98 -0
  122. package/dist/verify.d.ts +41 -0
  123. package/dist/verify.js +204 -0
  124. package/dist/wrapper/index.d.ts +10 -0
  125. package/dist/wrapper/index.js +15 -0
  126. package/dist/wrapper/monitorLLM.d.ts +76 -0
  127. package/dist/wrapper/monitorLLM.js +186 -0
  128. package/docs/ALGORITHMS.md +429 -0
  129. package/docs/FOR-DEVELOPERS.md +562 -0
  130. package/docs/GETTING-STARTED.md +327 -0
  131. package/docs/LIMITATIONS.md +312 -0
  132. package/examples/basic.ts +32 -0
  133. package/examples/classification.ts +230 -0
  134. package/examples/express-middleware.ts +141 -0
  135. package/examples/langchain-like-api.ts +69 -0
  136. package/examples/model-adapters.ts +274 -0
  137. package/examples/nextjs-api.ts +70 -0
  138. package/examples/pii-detection.ts +77 -0
  139. package/examples/prompt-injection.ts +70 -0
  140. package/examples/runtime-monitoring.ts +208 -0
  141. package/examples/zod-like-api.ts +60 -0
  142. package/package.json +122 -35
  143. package/prompts/llmverify-assistants.md +86 -0
  144. package/recipes/ci-gate.ts +70 -0
  145. package/recipes/security-audit.ts +77 -0
  146. package/index.d.ts +0 -42
  147. package/index.js +0 -71
package/CHANGELOG.md ADDED
@@ -0,0 +1,33 @@
1
+ # Changelog
2
+
3
+ All notable changes to llmverify will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.0] - 2025-12-02
9
+
10
+ ### Added
11
+ - Initial release of llmverify
12
+ - CSM6 Baseline Profile implementation
13
+ - Hallucination risk indicator engine
14
+ - Consistency checking engine
15
+ - JSON validation engine
16
+ - Prompt injection detection (OWASP LLM-01 aligned)
17
+ - PII detection (email, phone, SSN, credit cards, API keys)
18
+ - Harmful content detection
19
+ - CLI tool with text and JSON output
20
+ - Privacy guarantees (100% local processing in free tier)
21
+ - Confidence intervals on all scores
22
+ - Explicit limitations in all results
23
+
24
+ ### Security
25
+ - Zero network traffic in free tier
26
+ - No telemetry in free tier
27
+ - Privacy validation enforced at runtime
28
+
29
+ ### Documentation
30
+ - Complete README with examples
31
+ - Privacy guarantee documentation
32
+ - Accuracy statement and limitations
33
+ - CSM6 framework documentation
package/LICENSE CHANGED
@@ -1,21 +1,24 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Haiec
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 KingCaliber Labs
4
+
5
+ Contributors:
6
+ - Haiec (original author)
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.