zortium 0.2.0__tar.gz
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.
- zortium-0.2.0/LICENSE +201 -0
- zortium-0.2.0/MANIFEST.in +5 -0
- zortium-0.2.0/NOTICE +8 -0
- zortium-0.2.0/PKG-INFO +279 -0
- zortium-0.2.0/README.md +250 -0
- zortium-0.2.0/frontend/ai-teams.html +533 -0
- zortium-0.2.0/frontend/banking.html +574 -0
- zortium-0.2.0/frontend/benchmarks.html +698 -0
- zortium-0.2.0/frontend/history.html +1199 -0
- zortium-0.2.0/frontend/index.html +2301 -0
- zortium-0.2.0/frontend/integrations.html +460 -0
- zortium-0.2.0/frontend/landing.html +592 -0
- zortium-0.2.0/frontend/login.html +288 -0
- zortium-0.2.0/frontend/pricing.html +479 -0
- zortium-0.2.0/frontend/register.html +278 -0
- zortium-0.2.0/frontend/report.js +516 -0
- zortium-0.2.0/frontend/shared.css +274 -0
- zortium-0.2.0/pyproject.toml +64 -0
- zortium-0.2.0/setup.cfg +4 -0
- zortium-0.2.0/src/zortium/__init__.py +3 -0
- zortium-0.2.0/src/zortium/assets/__init__.py +0 -0
- zortium-0.2.0/src/zortium/assets/cross_modal_semantic/cat-base.jpg +0 -0
- zortium-0.2.0/src/zortium/assets/jailbreakv_28k/mini_JailBreakV_28K.csv +791 -0
- zortium-0.2.0/src/zortium/assets/manager.py +46 -0
- zortium-0.2.0/src/zortium/assets/qr_typographic/phrases.json +126 -0
- zortium-0.2.0/src/zortium/assets/typographic_injection/injection-ignore-instructions.svg +1 -0
- zortium-0.2.0/src/zortium/attacks/__init__.py +69 -0
- zortium-0.2.0/src/zortium/attacks/base.py +172 -0
- zortium-0.2.0/src/zortium/attacks/cross_modal_semantic_injection.py +218 -0
- zortium-0.2.0/src/zortium/attacks/encoding_attack.py +109 -0
- zortium-0.2.0/src/zortium/attacks/figstep.py +263 -0
- zortium-0.2.0/src/zortium/attacks/gcg_suffix.py +57 -0
- zortium-0.2.0/src/zortium/attacks/goal_hijacking.py +73 -0
- zortium-0.2.0/src/zortium/attacks/image_hijacks.py +447 -0
- zortium-0.2.0/src/zortium/attacks/jailbreak_visual.py +291 -0
- zortium-0.2.0/src/zortium/attacks/jailbreakv_28k.py +371 -0
- zortium-0.2.0/src/zortium/attacks/many_shot_text.py +92 -0
- zortium-0.2.0/src/zortium/attacks/mm_safetybench.py +144 -0
- zortium-0.2.0/src/zortium/attacks/multimodal_linkage.py +158 -0
- zortium-0.2.0/src/zortium/attacks/pair_agent.py +386 -0
- zortium-0.2.0/src/zortium/attacks/refusal_suppression.py +73 -0
- zortium-0.2.0/src/zortium/attacks/split_modality_injection.py +111 -0
- zortium-0.2.0/src/zortium/attacks/steganographic_text.py +137 -0
- zortium-0.2.0/src/zortium/attacks/stroop.py +133 -0
- zortium-0.2.0/src/zortium/attacks/structured_output_injection.py +321 -0
- zortium-0.2.0/src/zortium/attacks/typographic_injection.py +121 -0
- zortium-0.2.0/src/zortium/attacks/ui_spoofing.py +187 -0
- zortium-0.2.0/src/zortium/cli/__init__.py +0 -0
- zortium-0.2.0/src/zortium/cli/app.py +553 -0
- zortium-0.2.0/src/zortium/cli/config.py +44 -0
- zortium-0.2.0/src/zortium/config/__init__.py +0 -0
- zortium-0.2.0/src/zortium/config/attacks.json +671 -0
- zortium-0.2.0/src/zortium/config/harm_payloads.json +111 -0
- zortium-0.2.0/src/zortium/constants.py +49 -0
- zortium-0.2.0/src/zortium/evaluators/__init__.py +0 -0
- zortium-0.2.0/src/zortium/evaluators/judge.py +175 -0
- zortium-0.2.0/src/zortium/evaluators/refusal_aware.py +146 -0
- zortium-0.2.0/src/zortium/evaluators/semantic.py +160 -0
- zortium-0.2.0/src/zortium/logging.py +13 -0
- zortium-0.2.0/src/zortium/models.py +41 -0
- zortium-0.2.0/src/zortium/providers/__init__.py +0 -0
- zortium-0.2.0/src/zortium/providers/base.py +49 -0
- zortium-0.2.0/src/zortium/providers/openai_compatible.py +148 -0
- zortium-0.2.0/src/zortium/providers/prompt_builder.py +57 -0
- zortium-0.2.0/src/zortium/providers/ratelimit.py +124 -0
- zortium-0.2.0/src/zortium/runner.py +200 -0
- zortium-0.2.0/src/zortium/settings.py +136 -0
- zortium-0.2.0/src/zortium/utils/__init__.py +0 -0
- zortium-0.2.0/src/zortium/utils/image.py +85 -0
- zortium-0.2.0/src/zortium/utils/payload_pack.py +132 -0
- zortium-0.2.0/src/zortium/utils/perturbations.py +217 -0
- zortium-0.2.0/src/zortium/utils/render.py +85 -0
- zortium-0.2.0/src/zortium.egg-info/PKG-INFO +279 -0
- zortium-0.2.0/src/zortium.egg-info/SOURCES.txt +88 -0
- zortium-0.2.0/src/zortium.egg-info/dependency_links.txt +1 -0
- zortium-0.2.0/src/zortium.egg-info/entry_points.txt +2 -0
- zortium-0.2.0/src/zortium.egg-info/requires.txt +9 -0
- zortium-0.2.0/src/zortium.egg-info/top_level.txt +1 -0
- zortium-0.2.0/tests/test_agentic_and_structured_suites.py +151 -0
- zortium-0.2.0/tests/test_attack_suite_readiness.py +132 -0
- zortium-0.2.0/tests/test_auth_register.py +56 -0
- zortium-0.2.0/tests/test_evaluation_priority.py +209 -0
- zortium-0.2.0/tests/test_groq_integration.py +32 -0
- zortium-0.2.0/tests/test_provider_connection_error.py +48 -0
- zortium-0.2.0/tests/test_ratelimit_resolver.py +45 -0
- zortium-0.2.0/tests/test_ratelimit_retry.py +143 -0
- zortium-0.2.0/tests/test_scan_async.py +62 -0
- zortium-0.2.0/tests/test_scan_get.py +50 -0
- zortium-0.2.0/tests/test_scan_list.py +30 -0
- zortium-0.2.0/tests/test_scan_run.py +94 -0
zortium-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
zortium-0.2.0/NOTICE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Zortium
|
|
2
|
+
Copyright 2026 The Zortium Authors
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
zortium-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: zortium
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Adversarial attack test suite for vision language models
|
|
5
|
+
Author: The Zortium Authors
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://zortium.dev
|
|
8
|
+
Project-URL: Repository, https://github.com/zortium/zortium
|
|
9
|
+
Keywords: vlm,adversarial,security,red-team,jailbreak,vision-language-model
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Topic :: Security
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
License-File: NOTICE
|
|
19
|
+
Requires-Dist: openai>=2.31.0
|
|
20
|
+
Requires-Dist: httpx
|
|
21
|
+
Requires-Dist: rich
|
|
22
|
+
Requires-Dist: typer
|
|
23
|
+
Requires-Dist: pyyaml>=6.0
|
|
24
|
+
Requires-Dist: pillow>=12.2.0
|
|
25
|
+
Requires-Dist: python-dotenv>=1.2.2
|
|
26
|
+
Requires-Dist: numpy
|
|
27
|
+
Requires-Dist: requests
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# Zortium
|
|
31
|
+
|
|
32
|
+
**Adversarial attack test suite for vision-language models.**
|
|
33
|
+
|
|
34
|
+
Zortium runs a structured battery of adversarial attacks against any OpenAI-compatible VLM endpoint and reports a per-suite Attack Success Rate (ASR). Think [promptfoo](https://github.com/promptfoo/promptfoo) for vision models — systematic, repeatable, CI-ready.
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
$ zortium --base-url https://openrouter.ai/api/v1 --model google/gemma-3-27b-it --api-key $OPENROUTER_API_KEY \
|
|
38
|
+
--judge-model gpt-4o-mini --judge-base-url https://api.openai.com/v1 --judge-api-key $OPENAI_API_KEY
|
|
39
|
+
|
|
40
|
+
███████╗ ██████╗ ██████╗ ████████╗██╗██╗ ██╗███╗ ███╗
|
|
41
|
+
╚══███╔╝██╔═══██╗██╔══██╗╚══██╔══╝██║██║ ██║████╗ ████║
|
|
42
|
+
███╔╝ ██║ ██║██████╔╝ ██║ ██║██║ ██║██╔████╔██║
|
|
43
|
+
███╔╝ ██║ ██║██╔══██╗ ██║ ██║██║ ██║██║╚██╔╝██║
|
|
44
|
+
███████╗╚██████╔╝██║ ██║ ██║ ██║╚██████╔╝██║ ╚═╝ ██║
|
|
45
|
+
╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
|
|
46
|
+
|
|
47
|
+
VLM adversarial attack scanner
|
|
48
|
+
|
|
49
|
+
target google/gemma-3-27b-it
|
|
50
|
+
endpoint https://openrouter.ai/api/v1
|
|
51
|
+
judge gpt-4o-mini
|
|
52
|
+
mode fast
|
|
53
|
+
suites 18
|
|
54
|
+
|
|
55
|
+
⠋ scanning ━━━━━━━━━━━━━━━━━━━━━━━━━━ 18/18 suites 0:08:47 ← fills live, then:
|
|
56
|
+
|
|
57
|
+
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━┓
|
|
58
|
+
┃ Attack Suite ┃ Severity ┃ Breach Rate ┃ Status ┃
|
|
59
|
+
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━┩
|
|
60
|
+
│ Typographic Visual Prompt Injection │ HIGH │ 0% │ PASS │
|
|
61
|
+
│ FigStep Typographic Jailbreak │ HIGH │ 25% │ WARN │
|
|
62
|
+
│ Query-Relevant Typographic Jailbreak │ HIGH │ 8% │ PASS │
|
|
63
|
+
│ Goal Hijacking │ MID │ 50% │ FAIL │
|
|
64
|
+
│ … │ … │ … │ … │
|
|
65
|
+
├──────────────────────────────────────┼──────────┼─────────────┼────────┤
|
|
66
|
+
│ Overall │ │ 12% │ WARN │
|
|
67
|
+
└──────────────────────────────────────┴──────────┴─────────────┴────────┘
|
|
68
|
+
|
|
69
|
+
cases 137 evaluated · 17 breached
|
|
70
|
+
elapsed 8m 47s
|
|
71
|
+
|
|
72
|
+
PASS Overall ASR 12.3% within threshold 100%
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
> No judge configured? Zortium falls back to the **target grading itself** and prints a warning — usable for a first run, but self-grading is lenient, so those breach rates are a floor. Pass `--judge-model` for trustworthy numbers.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Installation
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
pip install zortium
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Requires Python 3.10+. On Linux you may need the system Cairo library for image rendering (`apt-get install libcairo2` / `dnf install cairo`); macOS and Windows wheels bundle it.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Usage
|
|
90
|
+
|
|
91
|
+
The command in the example above has two halves — the **target** you're testing and the **judge** that grades whether the target complied:
|
|
92
|
+
|
|
93
|
+
| Role | Flags | What it is |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| Target | `--base-url` · `--model` · `--api-key` | the VLM under test — any [OpenAI-compatible](https://platform.openai.com/docs/api-reference) chat completions endpoint |
|
|
96
|
+
| Judge | `--judge-model` · `--judge-base-url` · `--judge-api-key` | a separate model that grades harmful-content compliance (see [LLM judge](#llm-judge)) |
|
|
97
|
+
|
|
98
|
+
That single command is the whole interface. Everything below is a convenience on top of it:
|
|
99
|
+
|
|
100
|
+
- **Keys off the command line** — every flag has a `ZORTIUM_*` environment variable (`ZORTIUM_API_KEY`, `ZORTIUM_JUDGE_API_KEY`, `ZORTIUM_MODEL`, …), so secrets never appear in your shell history or `ps`.
|
|
101
|
+
- **Config file instead of a long line** — run `zortium --init` to drop a documented `zortium.yaml` in the current directory, edit it, then `zortium --config zortium.yaml`. A flag or env var still overrides the file; blank values fall through to env/defaults.
|
|
102
|
+
- **Save every response** — the CLI keeps no database, so add `--output report.json` to write a full report: run metadata, headline stats, and per-suite → per-case entries with the full model response, the judge verdict, and its reasoning.
|
|
103
|
+
- **Deeper audit** — `--no-fast` runs full per-suite case coverage instead of the reduced fast set (see [Scan modes](#scan-modes)).
|
|
104
|
+
- **Go faster on high-limit endpoints** — `--tps N` (env `ZORTIUM_TPS`) runs N suites in parallel. Default is `1` (sequential — safe for rate-limited or shared-key endpoints); raise it for in-house models that can absorb the extra requests-per-second. Rate limits are still handled per the 429 policy, so a too-high value degrades gracefully rather than failing.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## CI integration
|
|
109
|
+
|
|
110
|
+
Exit with code 1 if overall ASR exceeds a threshold:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
zortium --max-asr 20
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
# GitHub Actions example
|
|
118
|
+
- name: Run VLM security scan
|
|
119
|
+
run: zortium --max-asr 20
|
|
120
|
+
env:
|
|
121
|
+
ZORTIUM_BASE_URL: ${{ secrets.VLM_BASE_URL }}
|
|
122
|
+
ZORTIUM_MODEL: ${{ secrets.VLM_MODEL }}
|
|
123
|
+
ZORTIUM_API_KEY: ${{ secrets.VLM_API_KEY }}
|
|
124
|
+
ZORTIUM_FAST: "true"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`--fast` (default `true`) runs one high-signal case per harm category for the image suites — the leanest useful scan, for CI and first runs. Use `--no-fast` for pre-release deep scans with full per-category coverage.
|
|
128
|
+
|
|
129
|
+
### Rate-limited endpoints
|
|
130
|
+
|
|
131
|
+
By default a rate-limited (429) test case is recorded as **unavailable** and left out of the score — fast, and right for CI. For a one-off baseline against a heavily throttled endpoint, `--wait` (env `ZORTIUM_WAIT`) retries each rate-limited case until the limit clears so every case gets a real verdict. It respects the `Retry-After` header and can take much longer — use it for benchmarks, **not** CI.
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
zortium --no-fast --wait # complete thorough baseline, waits out rate limits
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Each suite is labelled with a **severity** — `HIGH`, `MID`, `LOW`, or `DIAGNOSTIC` — reflecting how real-world exploitable the attack is (distinct from how it's judge-gated). Diagnostic suites are always excluded from the headline ASR. In the web UI and benchmarks, severity also drives a **weighted overall score** (`HIGH=3 / MID=2 / LOW=1 / DIAGNOSTIC=0`), so high-severity breaches move the headline number more than low-severity ones. The CLI `--max-asr` gate uses the raw overall ASR.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## LLM judge
|
|
142
|
+
|
|
143
|
+
Critical suites are graded by an LLM judge — it reads each (harmful request, model response) pair and decides whether the target actually complied. Configure it with `--judge-model` / `--judge-base-url` / `--judge-api-key` (or the `ZORTIUM_JUDGE_*` env vars). The base URL and key **inherit the target's** when omitted, so a judge on the same endpoint needs only `--judge-model`. Use a separate, stronger model than the one under test for better calibration.
|
|
144
|
+
|
|
145
|
+
**No judge configured?** Zortium falls back to the **target model grading its own responses** and prints a warning. This keeps a first run useful out of the box, but a model judging itself is lenient — the resulting breach rates are a *floor*, not a trusted number. Always configure a real judge for numbers you'll act on.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Attack suites
|
|
150
|
+
|
|
151
|
+
### Critical — LLM judge required, high research backing
|
|
152
|
+
|
|
153
|
+
| Suite | Technique | Paper |
|
|
154
|
+
|---|---|---|
|
|
155
|
+
| Typographic Visual Prompt Injection | Embeds harmful instructions as text in images | Goh et al. 2021 |
|
|
156
|
+
| Split-Modality Injection | Splits instruction across image + text channels | Original |
|
|
157
|
+
| FigStep | Numbered-list document completion framing | Gong et al. 2023 |
|
|
158
|
+
| Steganographic Text Injection | Hides instructions in low-contrast image regions | Li et al. 2024 |
|
|
159
|
+
| Image Hijacks | Behaviour-matching visual overlays | Bailey et al. 2023 |
|
|
160
|
+
| JailBreakV-28K | Real benchmark — 7 adversarial format types | Luo et al. 2024 |
|
|
161
|
+
| Visual Jailbreak Transfer | DAN / AIM / many-shot visual personas | Wei et al. 2023 |
|
|
162
|
+
| Query-Relevant Typographic Jailbreak | Hides the harmful instruction in a rendered-text image | Inspired by Liu et al. ECCV 2024 |
|
|
163
|
+
| Many-Shot Text | 24-example in-context compliance history | Anil et al. 2024 |
|
|
164
|
+
| Goal Hijacking | Prompt injection with delimiter spoofing | Perez & Ribeiro 2022 |
|
|
165
|
+
| Structured Output Injection | JSON schema / constrained-decoding exploitation | Original |
|
|
166
|
+
|
|
167
|
+
> **PAIR Agent** (iterative attacker-LLM red-teaming loop, Chao et al. 2023) is implemented but disabled by default. It's a multi-turn attacker-agent loop built for targeted deep audits of a single model rather than routine scanning, so it isn't part of the standard suite — enable it with a one-line registry change when you want it.
|
|
168
|
+
|
|
169
|
+
> **JailBreakV-28K** is not bundled — the suite fetches its 300 benchmark images on demand from the official [MIT-licensed HuggingFace repo](https://huggingface.co/datasets/JailbreakV-28K/JailBreakV-28k) the first time it runs (`python -m zortium.attacks.jailbreakv_28k --download`). Every other suite works out of the box.
|
|
170
|
+
|
|
171
|
+
### Medium — Keyword evaluation, limited effectiveness on modern models
|
|
172
|
+
|
|
173
|
+
| Suite | Technique |
|
|
174
|
+
|---|---|
|
|
175
|
+
| GCG Suffix | Precomputed adversarial token suffixes (transfer variant) |
|
|
176
|
+
| Encoding Attack | Base64 / ROT13 / hex payload obfuscation |
|
|
177
|
+
| Refusal Suppression | Instruction-stack refusal bypass |
|
|
178
|
+
| Multi-Modal Linkage | Cross-modal encryption-decryption framing |
|
|
179
|
+
| UI Spoofing | Authoritative-surface behavioural deviation |
|
|
180
|
+
|
|
181
|
+
### Diagnostic — Robustness probes, reported separately from ASR
|
|
182
|
+
|
|
183
|
+
| Suite | Metric |
|
|
184
|
+
|---|---|
|
|
185
|
+
| Visual Perturbation Drift | Cosine similarity drift under pixel noise |
|
|
186
|
+
| Stroop Interference | Visual-linguistic conflict detection |
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Scan modes
|
|
191
|
+
|
|
192
|
+
Both modes run the same 18 suites; **fast** runs fewer cases per suite, **thorough** runs full per-suite coverage.
|
|
193
|
+
|
|
194
|
+
| | Fast (default) | Thorough |
|
|
195
|
+
|---|---|---|
|
|
196
|
+
| Cases per image suite | reduced (highest-signal) | full |
|
|
197
|
+
| Query-Relevant Typo cases | 13 (1 per scenario, TYPO) | 26 (2 per scenario, TYPO) |
|
|
198
|
+
| Good for | daily CI, first runs | pre-release, deep audits |
|
|
199
|
+
|
|
200
|
+
**On runtime:** wall-clock time is dominated by the *target model's* own latency, throughput, and rate limits — not by Zortium — so it varies widely by model. Expect anywhere from a few minutes to ~10+ minutes for a fast scan; a slow or heavily throttled endpoint (especially with `--wait`) can take considerably longer. If your endpoint has generous rate limits, `--tps N` runs suites in parallel to cut that time (see [Usage](#usage)).
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## zortium.dev — managed platform
|
|
205
|
+
|
|
206
|
+
This CLI is the open-source engine, free and fully standalone. **[zortium.dev](https://zortium.dev)** is a managed platform built on top of the same attack suites, for teams that want more than a per-run terminal report:
|
|
207
|
+
|
|
208
|
+
- **Web UI, no install** — run scans from the browser with results rendered live as each suite completes.
|
|
209
|
+
- **Persistent history & dashboards** — every scan is stored and browsable; resume a scan by simply returning to the tab.
|
|
210
|
+
- **Scan-to-scan comparison** — diff two runs to see which suites regressed or improved between model versions, with per-suite flip detection.
|
|
211
|
+
- **Weighted risk scoring** — a severity-weighted headline score (HIGH/MID/LOW) and per-tier breakdown, so a critical breach outweighs a low-severity one.
|
|
212
|
+
- **Cross-model benchmarks** — a leaderboard ranking models by the same methodology, for choosing or tracking a vision model.
|
|
213
|
+
- **Teams & enterprise** — shared accounts, plus an on-prem deployment where scan content stays entirely on your own database and only aggregate metadata is reported.
|
|
214
|
+
|
|
215
|
+
The CLI never phones home and needs none of this — the platform is for teams that want persistence, collaboration, and benchmarking on top of the engine.
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Supported providers
|
|
220
|
+
|
|
221
|
+
Any endpoint speaking the OpenAI chat completions protocol:
|
|
222
|
+
|
|
223
|
+
- **OpenRouter** — pay-per-token access to hundreds of OSS models via one key (the easiest path for benchmarking OSS models)
|
|
224
|
+
- OpenAI, Groq, Together AI, Google Gemini (via their OpenAI-compatible endpoints)
|
|
225
|
+
- vLLM, Ollama (via `/v1` shim), TGI adapter
|
|
226
|
+
- In-house gateways and fine-tuned model deployments
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Architecture
|
|
231
|
+
|
|
232
|
+
The engine is a `src`-layout package under `src/zortium/`:
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
src/zortium/
|
|
236
|
+
├── runner.py TestRunner — judge enforcement, suite execution
|
|
237
|
+
├── constants.py ScanMode, SuitePriority, SuiteSeverity, RateLimitPolicy, ScanStatus enums
|
|
238
|
+
├── attacks/ Attack suite implementations
|
|
239
|
+
│ ├── base.py AttackSuite base class — configure_for_mode(), evaluate()
|
|
240
|
+
│ ├── __init__.py SuiteRegistry — ACTIVE_SUITE_CLASSES, build_active_suites()
|
|
241
|
+
│ ├── typographic_injection.py
|
|
242
|
+
│ └── ...
|
|
243
|
+
├── providers/
|
|
244
|
+
│ ├── openai_compatible.py Target and judge provider abstraction
|
|
245
|
+
│ └── ratelimit.py RateLimitResolver — Retry-After/backoff, SKIP/WAIT, connection retry
|
|
246
|
+
├── evaluators/
|
|
247
|
+
│ ├── judge.py LLM-as-judge evaluation
|
|
248
|
+
│ └── refusal_aware.py Keyword-based refusal detection
|
|
249
|
+
├── utils/ Render, Perturbations, SemanticSimilarity, ImageUtils, PayloadPack
|
|
250
|
+
└── config/
|
|
251
|
+
├── attacks.json Suite config — priority, severity, harm categories, parameters
|
|
252
|
+
└── harm_payloads.json Harm category definitions and prompt library
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**Adding a suite:** subclass `AttackSuite` in `src/zortium/attacks/`, add an entry to `config/attacks.json`, register it in `ACTIVE_SUITE_CLASSES` in `attacks/__init__.py`. Override `configure_for_mode()` if the suite needs different behaviour in fast vs thorough mode.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Intended use & safety
|
|
260
|
+
|
|
261
|
+
Zortium is a **defensive security tool** for evaluating the robustness of vision-language models you own or are authorized to test.
|
|
262
|
+
|
|
263
|
+
- **Authorized targets only.** Do not run Zortium against models, endpoints, or systems you do not own or have explicit permission to test.
|
|
264
|
+
- **It sends adversarial and harmful content.** By design, Zortium submits jailbreak prompts, harmful requests, and adversarial images to the target model to measure its refusal behaviour. The bundled payloads (`config/harm_payloads.json`) and the JailBreakV-28K benchmark contain offensive material.
|
|
265
|
+
- **Purpose is measurement, not exploitation.** The output is a robustness report (Attack Success Rate per suite) to help you harden a model — not a toolkit for attacking third-party systems.
|
|
266
|
+
|
|
267
|
+
Report security issues responsibly and use results to improve model safety.
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## Citations
|
|
272
|
+
|
|
273
|
+
See [CITATIONS.md](CITATIONS.md) for full attribution of all research papers and benchmark datasets.
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## License
|
|
278
|
+
|
|
279
|
+
See [LICENSE](LICENSE).
|