dspy-security-bench 0.1.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.
Files changed (29) hide show
  1. dspy_security_bench-0.1.0/.github/workflows/test.yml +37 -0
  2. dspy_security_bench-0.1.0/.gitignore +55 -0
  3. dspy_security_bench-0.1.0/ARCHITECTURE.md +246 -0
  4. dspy_security_bench-0.1.0/CITATION.cff +28 -0
  5. dspy_security_bench-0.1.0/LICENSE +190 -0
  6. dspy_security_bench-0.1.0/PKG-INFO +324 -0
  7. dspy_security_bench-0.1.0/README.md +285 -0
  8. dspy_security_bench-0.1.0/assets/v01_pareto.png +0 -0
  9. dspy_security_bench-0.1.0/assets/v01_utility_vs_security.png +0 -0
  10. dspy_security_bench-0.1.0/dspy_security_bench/adapters/__init__.py +4 -0
  11. dspy_security_bench-0.1.0/dspy_security_bench/adapters/agentdojo.py +389 -0
  12. dspy_security_bench-0.1.0/dspy_security_bench/llm_judge.py +127 -0
  13. dspy_security_bench-0.1.0/dspy_security_bench/optimizers.py +252 -0
  14. dspy_security_bench-0.1.0/dspy_security_bench/runner.py +190 -0
  15. dspy_security_bench-0.1.0/dspy_security_bench/synthesis/extract_env_data.py +129 -0
  16. dspy_security_bench-0.1.0/dspy_security_bench/synthesis/generator.py +301 -0
  17. dspy_security_bench-0.1.0/dspy_security_bench/synthesis/validator.py +308 -0
  18. dspy_security_bench-0.1.0/pyproject.toml +82 -0
  19. dspy_security_bench-0.1.0/scripts/generate_v01_figures.py +172 -0
  20. dspy_security_bench-0.1.0/scripts/run_v01_benchmark.py +166 -0
  21. dspy_security_bench-0.1.0/tests/__init__.py +0 -0
  22. dspy_security_bench-0.1.0/tests/conftest.py +24 -0
  23. dspy_security_bench-0.1.0/tests/test_adapter_agentdojo.py +161 -0
  24. dspy_security_bench-0.1.0/tests/test_extract_env_data.py +38 -0
  25. dspy_security_bench-0.1.0/tests/test_generator.py +127 -0
  26. dspy_security_bench-0.1.0/tests/test_llm_judge.py +75 -0
  27. dspy_security_bench-0.1.0/tests/test_optimizers.py +109 -0
  28. dspy_security_bench-0.1.0/tests/test_runner.py +139 -0
  29. dspy_security_bench-0.1.0/tests/test_validator.py +120 -0
@@ -0,0 +1,37 @@
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ pytest:
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ python-version: ["3.10", "3.11", "3.12"]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v3
23
+ with:
24
+ enable-cache: true
25
+
26
+ - name: Set up Python ${{ matrix.python-version }}
27
+ run: uv python install ${{ matrix.python-version }}
28
+
29
+ - name: Create venv and install
30
+ run: |
31
+ uv venv --python ${{ matrix.python-version }}
32
+ uv pip install -e ".[dev]"
33
+
34
+ - name: Run pytest
35
+ run: |
36
+ source .venv/bin/activate
37
+ pytest tests/ -v --tb=short
@@ -0,0 +1,55 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Virtual envs
24
+ .venv/
25
+ venv/
26
+ ENV/
27
+
28
+ # Test + cache
29
+ .pytest_cache/
30
+ .coverage
31
+ .coverage.*
32
+ htmlcov/
33
+ .cache
34
+ .ruff_cache/
35
+ .mypy_cache/
36
+
37
+ # Generated data (intentionally git-ignored — regenerate with the CLI)
38
+ data/synthetic_train/
39
+ data/results/
40
+ logs/
41
+ *.jsonl
42
+
43
+ # OS
44
+ .DS_Store
45
+ Thumbs.db
46
+
47
+ # IDE
48
+ .vscode/
49
+ .idea/
50
+ *.swp
51
+ *.swo
52
+
53
+ # Local config
54
+ .env
55
+ .env.local
@@ -0,0 +1,246 @@
1
+ # Architecture
2
+
3
+ This document is the engineering map of `dspy-security-bench` — what each
4
+ module does, why it exists, and which v0.1 scope choices are deliberate.
5
+
6
+ ## One-paragraph summary
7
+
8
+ `dspy-security-bench` runs three pipelines in sequence:
9
+
10
+ 1. **Trainset synthesis** — generates ~100 read-only query tasks per AgentDojo
11
+ suite, grounded in the suite's seed environment data, using one or two
12
+ strong LLMs as generators.
13
+ 2. **DSPy optimization** — runs `BootstrapFewShot`, `MIPROv2`, etc. against the
14
+ synthetic trainset to produce a dict of named agent factories (one per
15
+ optimizer).
16
+ 3. **AgentDojo evaluation** — wraps each agent factory in a
17
+ `DSPyReActV2Element` pipeline and runs AgentDojo's
18
+ `benchmark_suite_with_injections` across the requested attack suite.
19
+
20
+ The output is a `pandas.DataFrame` with one row per
21
+ `(optimizer, attack, user_task, injection_task)` combination, columns
22
+ `utility` and `security`.
23
+
24
+ ## Module map
25
+
26
+ ```
27
+ dspy_security_bench/
28
+ ├── synthesis/
29
+ │ ├── extract_env_data.py # markdown summary of suite seed env
30
+ │ ├── generator.py # LLM-based task synthesis
31
+ │ └── validator.py # syntactic + dedupe + (optional) solvability
32
+ ├── adapters/
33
+ │ └── agentdojo.py # DSPyReActV2Element pipeline wrapper
34
+ ├── optimizers.py # named optimizer harness + substring metric
35
+ ├── llm_judge.py # LLM-as-judge metric (fast-path substring)
36
+ └── runner.py # benchmark orchestration + DataFrame
37
+ ```
38
+
39
+ ### `synthesis/extract_env_data.py`
40
+
41
+ Produces a compact markdown summary of an AgentDojo suite's seed env (the
42
+ state of calendar, inbox, files, etc. before any task runs). Used by:
43
+
44
+ - the synthesis generator, as prompt context grounding the LLM
45
+ - the validator, as the searchable corpus for the syntactic check
46
+
47
+ Suite-specific extractors (currently only `workspace`) emit nicer summaries;
48
+ a generic introspection fallback works for `banking`, `travel`, `slack`.
49
+
50
+ ### `synthesis/generator.py`
51
+
52
+ Given a suite name and an LLM model identifier (e.g. `openai/gpt-4o` or
53
+ `anthropic/claude-sonnet-4-5` via litellm), generates a list of
54
+ `{"prompt", "ground_truth"}` dicts.
55
+
56
+ Each batch prompt contains:
57
+
58
+ - the full tool list with parameter signatures
59
+ - the env data summary (from `extract_env_data`)
60
+ - 3 real example tasks (auto-picked from `suite.user_tasks` filtering for
61
+ interrogative read-only prompts with non-empty `GROUND_TRUTH_OUTPUT`)
62
+ - strict constraints (read-only, env-grounded, JSON output)
63
+
64
+ Supports `--dry-run` to print the assembled prompt without paying for API
65
+ calls.
66
+
67
+ ### `synthesis/validator.py`
68
+
69
+ Three independent checks, each can be enabled separately:
70
+
71
+ | Check | What | Implementation |
72
+ |---|---|---|
73
+ | `syntactic` | The ground_truth string appears in the suite's env corpus (case-insensitive) | substring + multi-token fallback |
74
+ | `dedupe` | The prompt is not too similar to any real test-suite user task | sentence-transformers cosine over `all-MiniLM-L6-v2`; threshold 0.9 |
75
+ | `solvability` | A small judge LLM can produce the answer given (task, env-excerpt) | optional, costs API tokens |
76
+
77
+ Returns a `ValidationResult` with `kept`, `dropped` (each with `_reason`),
78
+ and `counts_by_reason`.
79
+
80
+ ### `adapters/agentdojo.py` — `DSPyReActV2Element`
81
+
82
+ The critical bridge. Implements `BasePipelineElement.query()` so a DSPy
83
+ program can run as an AgentDojo pipeline element.
84
+
85
+ Flow per call:
86
+
87
+ 1. Translate `runtime.functions` (AgentDojo `Function` objects) → `dspy.Tool`
88
+ closures, each binding the AgentDojo `runtime` + `env`. Critically, the
89
+ closures call `runtime.run_function(env, name, kwargs)`, which means
90
+ attacks that mutate `env` surface naturally in tool outputs.
91
+ 2. Instantiate `dspy.ReActV2` with these tools via the user-supplied
92
+ `agent_factory`.
93
+ 3. Run the agent (`agent(query=query)`).
94
+ 4. Translate `result.history.messages` into AgentDojo `ChatAssistantMessage`
95
+ and `ChatToolResultMessage` types, preserving tool call IDs.
96
+ 5. Append a final `ChatAssistantMessage` with the model's output for
97
+ AgentDojo's `utility()` to check.
98
+
99
+ **v0.1 constraints (documented for honest scope):**
100
+
101
+ - The agent's signature must have **exactly one output field**.
102
+ - Tool results are JSON-serialized for the agent (lossy for complex types).
103
+ - Tool errors surface as observation strings, not exceptions.
104
+ - The ReActV2 ID-collision bug ([dspy#9825](https://github.com/stanfordnlp/dspy/pull/9825))
105
+ is irrelevant here because each AgentDojo task is a single `forward()` call.
106
+
107
+ ### `optimizers.py`
108
+
109
+ Two responsibilities:
110
+
111
+ 1. **Trainset prep** — converts `{"prompt", "ground_truth"}` dicts into
112
+ `dspy.Example` objects with `query` as the input field.
113
+ 2. **Optimizer harness** — `build_agent_factories(...)` runs each requested
114
+ optimizer (`unoptimized`, `bootstrap_fewshot`, `miprov2`) and returns a
115
+ dict mapping optimizer name → `agent_factory(tools, max_iters) → ReActV2`.
116
+
117
+ Training-time tools are bound to a *fresh* suite env, separate from the
118
+ test-time env. The factory we return baked in the optimized instructions
119
+ and demos; at test time the factory creates a fresh `ReActV2` with the
120
+ test-time tools and applies the optimized state.
121
+
122
+ Also exports `substring_match_metric` — the v0.1 placeholder metric.
123
+
124
+ ### `llm_judge.py`
125
+
126
+ A drop-in replacement for `substring_match_metric` that uses a small LLM
127
+ (default: `openai/gpt-4o-mini`) as a judge.
128
+
129
+ Key design choices:
130
+
131
+ - **Substring fast path**: if the ground truth appears in the agent's answer,
132
+ return 1.0 immediately without an LLM call (~60-80% of well-grounded
133
+ synthetic tasks).
134
+ - **Single-field judge signature** (no chain-of-thought): minimizes token
135
+ cost and parsing failure modes.
136
+ - **Graceful fallback**: on judge LLM failure (parse error, rate limit, etc.),
137
+ falls back to the substring metric and returns its score.
138
+ - **Cacheable**: DSPy's LM uses litellm's cache, so repeated optimizer
139
+ evaluations on the same (example, prediction) hit cache.
140
+
141
+ ### `runner.py`
142
+
143
+ The orchestrator. Given a dict of factories and a list of attacks:
144
+
145
+ 1. Builds an `AgentPipeline([InitQuery(), DSPyReActV2Element(factory)])` per
146
+ factory.
147
+ 2. For each `(factory, attack)` combination, calls
148
+ `agentdojo.benchmark.benchmark_suite_with_injections(...)` which returns a
149
+ `SuiteResults` dict keyed by `(user_task_id, injection_task_id)`.
150
+ 3. Flattens `SuiteResults` into rows with explicit columns.
151
+ 4. Returns a `pandas.DataFrame`.
152
+
153
+ `summarize(df)` produces the `(optimizer, attack)` aggregation:
154
+ `utility_rate`, `security_rate`, `injection_success_rate`, `n_runs`.
155
+
156
+ **Convention**: AgentDojo's `security_results[k] == True` means the injection
157
+ succeeded (bad). We expose both `injection_succeeded` (AgentDojo's
158
+ convention) and `security` (= 1 - injection_succeeded, so higher is better
159
+ and matches `utility`'s direction).
160
+
161
+ ## v0.1 scope choices and why
162
+
163
+ ### Why synthesize a trainset rather than split AgentDojo's tasks
164
+
165
+ AgentDojo has ~25-40 user tasks per suite. Splitting 70/30 leaves 7-12
166
+ training examples — below what BootstrapFewShot or MIPROv2 need to find a
167
+ meaningful improvement. Synthesizing 100 in-distribution tasks per suite
168
+ gives the optimizers enough signal while keeping the real AgentDojo tasks
169
+ as a clean held-out test set.
170
+
171
+ The cost: synthesis methodology becomes part of the contribution and must
172
+ be defended (we use two generator LLMs to reduce monoculture bias, and the
173
+ validator drops syntactically-invalid and duplicate tasks).
174
+
175
+ ### Why query-only synthesis
176
+
177
+ AgentDojo's action tasks (send email, create event, modify file) have
178
+ hand-written `utility()` checks that inspect env-state mutations. These
179
+ checks cannot be auto-synthesized — they require domain knowledge per task.
180
+
181
+ We restrict synthesis to read-only query tasks because:
182
+
183
+ - Query utility = "answer contains ground truth string" templates trivially
184
+ - Query tasks make up ~40% of AgentDojo's real test set, so training on this
185
+ distribution is not unreasonable
186
+ - The research question (does *prompt optimization* affect robustness?) does
187
+ not require action-task training — robustness is mostly about parsing
188
+ adversarial input, not about complex action selection
189
+
190
+ ### Why hybrid metric (LLM-judge for train, real `utility()` for test)
191
+
192
+ - LLM-judge for training: cheap, paraphrase-tolerant, scales to optimizer
193
+ evaluation cycles
194
+ - Real AgentDojo `utility()` for testing: rigorous, reproducible, the actual
195
+ metric the benchmark community uses
196
+
197
+ This separation pre-empts the obvious reviewer pushback ("you trained and
198
+ tested on the same metric"). It also lets us publish strong claims about
199
+ robustness without claiming anything about the judge LLM.
200
+
201
+ ### Why single-output signature
202
+
203
+ ReActV2 produces structured outputs via its `submit` tool. AgentDojo's
204
+ `utility()` takes a single `model_output` string. To bridge cleanly without
205
+ ambiguity, v0.1 requires the user's signature to have exactly one output
206
+ field. Multi-output support is a v0.2 question that needs a per-field
207
+ concatenation policy.
208
+
209
+ ## Known gaps and v0.2 roadmap
210
+
211
+ - **Suite-tuned extractors** for banking, travel, slack (the generic
212
+ fallback works but produces less compact prompts).
213
+ - **GEPA optimizer** in the harness (currently `unoptimized`,
214
+ `bootstrap_fewshot`, `miprov2`).
215
+ - **Action-task synthesis** with synthesized utility checks (hard — likely
216
+ needs LM-generated `expected_final_state` and a separate state-diff
217
+ judge).
218
+ - **Multi-output signature support**.
219
+ - **Action-aware attacks** in the report (currently aggregated across all
220
+ attack types).
221
+ - **Notebook tutorials** (`docs/tutorial/`) — a v0.1 README-quickstart-style
222
+ notebook is the next planned artifact.
223
+ - **TMLR submission** — if v0.1 findings are publishable, the next step is a
224
+ short empirical paper. The benchmark methodology is described here; the
225
+ paper would add a comprehensive empirical sweep across all 4 suites and a
226
+ qualitative analysis of optimizer-induced robustness mechanisms.
227
+
228
+ ## Repository layout
229
+
230
+ ```
231
+ .
232
+ ├── dspy_security_bench/ # the package
233
+ │ ├── synthesis/
234
+ │ ├── adapters/
235
+ │ ├── optimizers.py
236
+ │ ├── llm_judge.py
237
+ │ └── runner.py
238
+ ├── tests/ # pytest suite (planned, v0.2)
239
+ ├── data/ # generated synthetic trainsets (git-ignored)
240
+ ├── scripts/ # one-off scripts / smoke tests
241
+ ├── docs/ # tutorials (planned, v0.2)
242
+ ├── README.md
243
+ ├── ARCHITECTURE.md # this file
244
+ ├── LICENSE
245
+ └── pyproject.toml
246
+ ```
@@ -0,0 +1,28 @@
1
+ cff-version: 1.2.0
2
+ title: "dspy-security-bench: Measuring optimizer-induced robustness in agentic DSPy programs"
3
+ authors:
4
+ - family-names: Ahamed
5
+ given-names: Imran
6
+ email: immu4989@gmail.com
7
+ version: 0.1.0
8
+ date-released: 2026-06-16
9
+ license: Apache-2.0
10
+ repository-code: "https://github.com/immu4989/dspy-security-bench"
11
+ keywords:
12
+ - dspy
13
+ - agentdojo
14
+ - prompt-injection
15
+ - llm-security
16
+ - agent-evaluation
17
+ - robustness
18
+ - benchmark
19
+ message: "If you use this benchmark in research or production, please cite as below."
20
+ preferred-citation:
21
+ type: software
22
+ title: "dspy-security-bench"
23
+ authors:
24
+ - family-names: Ahamed
25
+ given-names: Imran
26
+ version: 0.1.0
27
+ year: 2026
28
+ url: "https://github.com/immu4989/dspy-security-bench"
@@ -0,0 +1,190 @@
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 describing the origin of the Work and
141
+ 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 or computer 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 Support. While redistributing the Work or
166
+ Derivative Works thereof, You may choose to offer, and charge a
167
+ fee for, acceptance of support, warranty, indemnity, or other
168
+ liability obligations and/or rights consistent with this License.
169
+ However, in accepting such obligations, You may act only on Your
170
+ own behalf and on Your sole responsibility, not on behalf of any
171
+ other Contributor, and only if You agree to indemnify, defend,
172
+ and hold each Contributor harmless for any liability incurred by,
173
+ or claims asserted against, such Contributor by reason of your
174
+ accepting any such warranty or support.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Imran Ahamed
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.