flintai-cli 1.0.0__py3-none-any.whl

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. flintai/__init__.py +0 -0
  2. flintai/cli/__init__.py +0 -0
  3. flintai/cli/__main__.py +3 -0
  4. flintai/cli/builtin_config.json +911 -0
  5. flintai/cli/console.py +116 -0
  6. flintai/cli/eval_cli.py +891 -0
  7. flintai/cli/init_cli.py +144 -0
  8. flintai/cli/main.py +262 -0
  9. flintai/cli/rich_observer.py +89 -0
  10. flintai/cli/runner.py +305 -0
  11. flintai/cli/scan_cli.py +238 -0
  12. flintai/cli/utils.py +37 -0
  13. flintai/cli/version.py +1 -0
  14. flintai/data/detector_prompts/llm01_adversarial.txt +55 -0
  15. flintai/data/detector_prompts/llm01_fixed.txt +8 -0
  16. flintai/data/detector_prompts/llm02_adversarial.txt +75 -0
  17. flintai/data/detector_prompts/llm02_fixed.txt +8 -0
  18. flintai/data/detector_prompts/llm05_adversarial.txt +63 -0
  19. flintai/data/detector_prompts/llm05_fixed.txt +16 -0
  20. flintai/data/detector_prompts/llm06_adversarial.txt +135 -0
  21. flintai/data/detector_prompts/llm06_fixed.txt +15 -0
  22. flintai/data/detector_prompts/llm07_adversarial.txt +185 -0
  23. flintai/data/detector_prompts/llm07_fixed.txt +14 -0
  24. flintai/data/detector_prompts/llm09_adversarial.txt +77 -0
  25. flintai/data/detector_prompts/llm09_fixed.txt +15 -0
  26. flintai/data/llm01_prompt_injection.csv +6708 -0
  27. flintai/data/llm02_sensitive_information.csv +1069 -0
  28. flintai/data/llm05_unsafe_output.csv +3882 -0
  29. flintai/data/llm06_excessive_agency.csv +778 -0
  30. flintai/data/llm07_system_prompt_leakage.csv +971 -0
  31. flintai/data/llm09_hallucination-goals.csv +32419 -0
  32. flintai/data/llm09_hallucination.csv +599 -0
  33. flintai/data/pii_leakage.csv +706 -0
  34. flintai/data/secret_leakage.csv +1380 -0
  35. flintai/eval/__init__.py +0 -0
  36. flintai/eval/common/converter_anthropic.py +151 -0
  37. flintai/eval/common/converter_genai.py +169 -0
  38. flintai/eval/common/converter_openai.py +165 -0
  39. flintai/eval/common/log.py +96 -0
  40. flintai/eval/common/reference.py +25 -0
  41. flintai/eval/common/schema.py +192 -0
  42. flintai/eval/common/utils.py +74 -0
  43. flintai/eval/core/__init__.py +0 -0
  44. flintai/eval/core/detectors/__init__.py +1 -0
  45. flintai/eval/core/detectors/detector.py +25 -0
  46. flintai/eval/core/detectors/detector_garak.py +80 -0
  47. flintai/eval/core/detectors/detector_model.py +76 -0
  48. flintai/eval/core/detectors/detector_pii.py +64 -0
  49. flintai/eval/core/detectors/detector_secret.py +82 -0
  50. flintai/eval/core/detectors/detector_topic_guard.py +70 -0
  51. flintai/eval/core/detectors/detector_toxicity.py +70 -0
  52. flintai/eval/core/eval/__init__.py +0 -0
  53. flintai/eval/core/eval/eval_creator.py +197 -0
  54. flintai/eval/core/eval/evaluation.py +100 -0
  55. flintai/eval/core/eval/evaluation_adversarial.py +523 -0
  56. flintai/eval/core/eval/evaluation_garak_module.py +52 -0
  57. flintai/eval/core/eval/evaluation_garak_probe.py +274 -0
  58. flintai/eval/core/eval/evaluation_message_list.py +44 -0
  59. flintai/eval/core/eval/evaluation_multi.py +207 -0
  60. flintai/eval/core/eval/evaluation_single.py +79 -0
  61. flintai/eval/core/eval/evaluation_single_prompt.py +58 -0
  62. flintai/eval/core/eval/evaluation_topic_guard.py +318 -0
  63. flintai/eval/core/eval/metric_conciseness.py +181 -0
  64. flintai/eval/core/eval/metric_factual_accuracy.py +294 -0
  65. flintai/eval/core/eval/metric_instruction_adherence.py +180 -0
  66. flintai/eval/core/eval/metric_tone.py +183 -0
  67. flintai/eval/core/eval/metric_toxicity.py +147 -0
  68. flintai/eval/core/eval/observer.py +136 -0
  69. flintai/eval/core/eval/probe_adversarial.py +14 -0
  70. flintai/eval/core/message/__init__.py +0 -0
  71. flintai/eval/core/message/message_collection.py +37 -0
  72. flintai/eval/core/message/message_collection_csv.py +46 -0
  73. flintai/eval/core/message/message_collection_garak.py +52 -0
  74. flintai/eval/core/message/message_collection_memory.py +36 -0
  75. flintai/eval/core/models/__init__.py +0 -0
  76. flintai/eval/core/models/generator_model.py +88 -0
  77. flintai/eval/core/models/model.py +111 -0
  78. flintai/eval/core/models/model_adk.py +158 -0
  79. flintai/eval/core/models/model_anthropic.py +51 -0
  80. flintai/eval/core/models/model_anthropic_agent.py +92 -0
  81. flintai/eval/core/models/model_gemini.py +107 -0
  82. flintai/eval/core/models/model_generic_http.py +117 -0
  83. flintai/eval/core/models/model_huggingface.py +61 -0
  84. flintai/eval/core/models/model_langserve.py +94 -0
  85. flintai/eval/core/models/model_litellm.py +38 -0
  86. flintai/eval/core/models/model_ollama.py +50 -0
  87. flintai/eval/core/models/model_openai.py +35 -0
  88. flintai/eval/core/models/model_openai_agent.py +80 -0
  89. flintai/eval/core/models/model_openai_compatible.py +57 -0
  90. flintai/eval/core/models/model_retry.py +134 -0
  91. flintai/eval/core/models/model_sync_wrapper.py +35 -0
  92. flintai/eval/db/__init__.py +0 -0
  93. flintai/eval/db/base/__init__.py +0 -0
  94. flintai/eval/db/base/detectors/__init__.py +1 -0
  95. flintai/eval/db/base/detectors/detector_helpers.py +78 -0
  96. flintai/eval/db/base/detectors/detector_repository.py +91 -0
  97. flintai/eval/db/base/detectors/detector_types.py +77 -0
  98. flintai/eval/db/base/eval/__init__.py +1 -0
  99. flintai/eval/db/base/eval/eval_helpers.py +227 -0
  100. flintai/eval/db/base/eval/eval_repository.py +115 -0
  101. flintai/eval/db/base/eval/eval_run.py +139 -0
  102. flintai/eval/db/base/eval/eval_types.py +129 -0
  103. flintai/eval/db/base/eval/model_eval_repository.py +78 -0
  104. flintai/eval/db/base/eval/model_eval_run_repository.py +70 -0
  105. flintai/eval/db/base/eval/model_eval_run_result_repository.py +40 -0
  106. flintai/eval/db/base/eval/model_eval_run_result_types.py +21 -0
  107. flintai/eval/db/base/eval/model_eval_run_types.py +84 -0
  108. flintai/eval/db/base/eval/model_eval_types.py +71 -0
  109. flintai/eval/db/base/message/__init__.py +0 -0
  110. flintai/eval/db/base/message/message_collection_helpers.py +61 -0
  111. flintai/eval/db/base/message/message_collection_repository.py +92 -0
  112. flintai/eval/db/base/message/message_collection_types.py +89 -0
  113. flintai/eval/db/base/models/__init__.py +0 -0
  114. flintai/eval/db/base/models/model_helpers.py +172 -0
  115. flintai/eval/db/base/models/model_repository.py +95 -0
  116. flintai/eval/db/base/models/model_types.py +156 -0
  117. flintai/eval/db/json/__init__.py +0 -0
  118. flintai/eval/db/json/repository_json.py +603 -0
  119. flintai/scan/__init__.py +0 -0
  120. flintai/scan/agent_scanner.py +797 -0
  121. flintai/scan/config/agent_opengrep_rules.yaml +533 -0
  122. flintai/scan/config/agent_taxonomy.json +481 -0
  123. flintai/scan/config/agentic_cvss_mapping.yaml +136 -0
  124. flintai/scan/config/compliance_mappings.json +110 -0
  125. flintai/scan/config/triage_prompt.txt +335 -0
  126. flintai/scan/constants.py +15 -0
  127. flintai/scan/file_filter.py +156 -0
  128. flintai/scan/llm_provider.py +197 -0
  129. flintai/scan/opengrep_resolver.py +12 -0
  130. flintai/scan/reasoner.py +552 -0
  131. flintai/scan/schema.py +337 -0
  132. flintai/scan/scorer.py +371 -0
  133. flintai/scan/secret_anonymizer.py +72 -0
  134. flintai/scan/static_scanner.py +542 -0
  135. flintai/scan/taxonomy.py +75 -0
  136. flintai/scan/tool_dispatcher.py +754 -0
  137. flintai/scan/trace_logger.py +118 -0
  138. flintai/scan/trace_logger_file.py +143 -0
  139. flintai/scan/trace_logger_log.py +100 -0
  140. flintai/scan/triage.py +496 -0
  141. flintai/schema.py +58 -0
  142. flintai_cli-1.0.0.dist-info/METADATA +442 -0
  143. flintai_cli-1.0.0.dist-info/RECORD +147 -0
  144. flintai_cli-1.0.0.dist-info/WHEEL +5 -0
  145. flintai_cli-1.0.0.dist-info/entry_points.txt +2 -0
  146. flintai_cli-1.0.0.dist-info/licenses/LICENSE +210 -0
  147. flintai_cli-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,210 @@
1
+ Software: Flint AI
2
+
3
+ Copyright (c) 2026 SB Technology, Inc. dba SandboxAQ
4
+
5
+ This software is licensed to you under the Apache 2.0 License as limited by
6
+ the "Commons Clause" license condition below. The "Commons Clause" license
7
+ condition has been modified from the original version to clarify that the
8
+ "Common Clause" license condition also applies to any derivatives of the
9
+ Software.
10
+
11
+
12
+ "Commons Clause" License Condition v1.0, as modified below
13
+
14
+ The Software is provided to you by the Licensor under the License, as defined
15
+ below, subject to the following condition.
16
+
17
+ Without limiting other conditions in the License, the grant of rights under the
18
+ License will not include, and the License does not grant to you, the right to
19
+ Sell the Software or any derivative of the Software.
20
+
21
+ For purposes of the foregoing, "Sell" means practicing any or all of the rights
22
+ granted to you under the License to provide to third parties, for a fee or
23
+ other consideration (including without limitation fees for hosting or
24
+ consulting/ support services related to the Software), a product or service
25
+ whose value derives, entirely or substantially, from the functionality of the
26
+ Software. Any license notice or attribution required by the License must also
27
+ include this Commons Clause License Condition notice.
28
+
29
+
30
+ Apache License Version 2.0, January 2004
31
+ http://www.apache.org/licenses/
32
+
33
+
34
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
35
+
36
+ 1. Definitions.
37
+
38
+ "License" shall mean the terms and conditions for use, reproduction, and
39
+ distribution as defined by Sections 1 through 9 of this document.
40
+
41
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright
42
+ owner that is granting the License.
43
+
44
+ "Legal Entity" shall mean the union of the acting entity and all other entities
45
+ that control, are controlled by, or are under common control with that entity.
46
+ For the purposes of this definition, "control" means (i) the power, direct or
47
+ indirect, to cause the direction or management of such entity, whether by
48
+ contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
49
+ outstanding shares, or (iii) beneficial ownership of such entity.
50
+
51
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
52
+ permissions granted by this License.
53
+
54
+ "Source" form shall mean the preferred form for making modifications, including
55
+ but not limited to software source code, documentation source, and
56
+ configuration files.
57
+
58
+ "Object" form shall mean any form resulting from mechanical transformation or
59
+ translation of a Source form, including but not limited to compiled object code,
60
+ generated documentation, and conversions to other media types.
61
+
62
+ "Work" shall mean the work of authorship, whether in Source or Object form, made
63
+ available under the License, as indicated by a copyright notice that is included
64
+ in or attached to the work.
65
+
66
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
67
+ is based on (or derived from) the Work and for which the editorial revisions,
68
+ annotations, elaborations, or other modifications represent, as a whole, an
69
+ original work of authorship. For the purposes of this License, Derivative Works
70
+ shall not include works that remain separable from, or merely link (or bind by
71
+ name) to the interfaces of, the Work and Derivative Works thereof.
72
+
73
+ "Contribution" shall mean any work of authorship, including the original version
74
+ of the Work and any modifications or additions thereto, that is intentionally
75
+ submitted to Licensor for inclusion in the Work by the copyright owner or by an
76
+ individual or Legal Entity authorized to submit on behalf of the copyright
77
+ owner. For the purposes of this definition, "submitted" means any form of
78
+ electronic, verbal, or written communication sent to the Licensor or its
79
+ representatives, including but not limited to communication on electronic
80
+ mailing lists, source code control systems, and issue tracking systems that are
81
+ managed by, or on behalf of, the Licensor for the purpose of discussing and
82
+ improving the Work, but excluding communication that is conspicuously marked or
83
+ otherwise designated in writing by the copyright owner as "Not a Contribution."
84
+
85
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
86
+ of whom a Contribution has been received by Licensor and subsequently
87
+ incorporated within the Work.
88
+
89
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
90
+ License, each Contributor hereby grants to You a perpetual, worldwide,
91
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
92
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
93
+ sublicense, and distribute the Work and such Derivative Works in Source or
94
+ Object form.
95
+
96
+ 3. Grant of Patent License. Subject to the terms and conditions of this
97
+ License, each Contributor hereby grants to You a perpetual, worldwide,
98
+ non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
99
+ section) patent license to make, have made, use, offer to sell, sell, import,
100
+ and otherwise transfer the Work, where such license applies only to those patent
101
+ claims licensable by such Contributor that are necessarily infringed by their
102
+ Contribution(s) alone or by combination of their Contribution(s) with the Work
103
+ to which such Contribution(s) was submitted. If You institute patent litigation
104
+ against any entity (including a cross-claim or counterclaim in a lawsuit)
105
+ alleging that the Work or a Contribution incorporated within the Work
106
+ constitutes direct or contributory patent infringement, then any patent licenses
107
+ granted to You under this License for that Work shall terminate as of the date
108
+ such litigation is filed.
109
+
110
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
111
+ Derivative Works thereof in any medium, with or without modifications, and in
112
+ Source or Object form, provided that You meet the following conditions:
113
+
114
+ (a) You must give any other recipients of the Work or Derivative Works a copy
115
+ of this License; and
116
+
117
+ (b) You must cause any modified files to carry prominent notices stating that
118
+ You changed the files; and
119
+
120
+ (c) You must retain, in the Source form of any Derivative Works that You
121
+ distribute, all copyright, patent, trademark, and attribution notices from the
122
+ Source form of the Work, excluding those notices that do not pertain to any part
123
+ of the Derivative Works; and
124
+
125
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then
126
+ any Derivative Works that You distribute must include a readable copy of the
127
+ attribution notices contained within such NOTICE file, excluding those notices
128
+ that do not pertain to any part of the Derivative Works, in at least one of the
129
+ following places: within a NOTICE text file distributed as part of the
130
+ Derivative Works; within the Source form or documentation, if provided along
131
+ with the Derivative Works; or, within a display generated by the Derivative
132
+ Works, if and wherever such third-party notices normally appear. The contents of
133
+ the NOTICE file are for informational purposes only and do not modify the
134
+ License. You may add Your own attribution notices within Derivative Works that
135
+ You distribute, alongside or as an addendum to the NOTICE text from the Work,
136
+ provided that such additional attribution notices cannot be construed as
137
+ modifying the License. You may add Your own copyright statement to Your
138
+ modifications and may provide additional or different license terms and
139
+ conditions for use, reproduction, or distribution of Your modifications, or for
140
+ any such Derivative Works as a whole, provided Your use, reproduction, and
141
+ distribution of the Work otherwise complies with the conditions stated in this
142
+ License.
143
+
144
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
145
+ Contribution intentionally submitted for inclusion in the Work by You to the
146
+ Licensor shall be under the terms and conditions of this License, without any
147
+ additional terms or conditions. Notwithstanding the above, nothing herein shall
148
+ supersede or modify the terms of any separate license agreement you may have
149
+ executed with Licensor regarding such Contributions.
150
+
151
+ 6. Trademarks. This License does not grant permission to use the trade names,
152
+ trademarks, service marks, or product names of the Licensor, except as required
153
+ for reasonable and customary use in describing the origin of the Work and
154
+ reproducing the content of the NOTICE file.
155
+
156
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
157
+ writing, Licensor provides the Work (and each Contributor provides its
158
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
159
+ KIND, either express or implied, including, without limitation, any warranties
160
+ or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
161
+ PARTICULAR PURPOSE. You are solely responsible for determining the
162
+ appropriateness of using or redistributing the Work and assume any risks
163
+ associated with Your exercise of permissions under this License.
164
+
165
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
166
+ tort (including negligence), contract, or otherwise, unless required by
167
+ applicable law (such as deliberate and grossly negligent acts) or agreed to in
168
+ writing, shall any Contributor be liable to You for damages, including any
169
+ direct, indirect, special, incidental, or consequential damages of any character
170
+ arising as a result of this License or out of the use or inability to use the
171
+ Work (including but not limited to damages for loss of goodwill, work stoppage,
172
+ computer failure or malfunction, or any and all other commercial damages or
173
+ losses), even if such Contributor has been advised of the possibility of such
174
+ damages.
175
+
176
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or
177
+ Derivative Works thereof, You may choose to offer, and charge a fee for,
178
+ acceptance of support, warranty, indemnity, or other liability obligations
179
+ and/or rights consistent with this License. However, in accepting such
180
+ obligations, You may act only on Your own behalf and on Your sole
181
+ responsibility, not on behalf of any other Contributor, and only if You agree to
182
+ indemnify, defend, and hold each Contributor harmless for any liability incurred
183
+ by, or claims asserted against, such Contributor by reason of your accepting any
184
+ such warranty or additional liability.
185
+
186
+ END OF TERMS AND CONDITIONS
187
+
188
+
189
+ APPENDIX: How to apply the Apache License to your work
190
+
191
+ To apply the Apache License to your work, attach the following boilerplate
192
+ notice, with the fields enclosed by brackets "[]" replaced with your own
193
+ identifying information. (Don't include the brackets!) The text should be
194
+ enclosed in the appropriate comment syntax for the file format. We also
195
+ recommend that a file or class name and description of purpose be included on
196
+ the same "printed page" as the copyright notice for easier identification
197
+ within third-party archives.
198
+
199
+ Copyright [yyyy] [name of copyright owner]
200
+
201
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
202
+ this file except in compliance with the License. You may obtain a copy of the
203
+ License at
204
+
205
+ http://www.apache.org/licenses/LICENSE-2.0
206
+
207
+ Unless required by applicable law or agreed to in writing, software distributed
208
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
209
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
210
+ specific language governing permissions and limitations under the License.
@@ -0,0 +1 @@
1
+ flintai