Tweek
Copyright 2025 Tommy Mancino / Tweek, LLC

This product includes software developed at Tweek, LLC.

=========================================================================

Third-Party Components
=========================================================================

This project uses the following third-party components. Their licenses
and copyright notices are reproduced below, as required by their
respective licenses.

-------------------------------------------------------------------------
ProtectAI DeBERTa-v3-base Prompt Injection v2
-------------------------------------------------------------------------

Source:  https://huggingface.co/protectai/deberta-v3-base-prompt-injection-v2
License: Apache License 2.0
Copyright (c) 2024 Protect AI, Inc.

A fine-tuned DeBERTa-v3-base model for binary prompt injection
classification. Used by Tweek as an on-device classifier for detecting
prompt injection attacks. The model is downloaded at user request via
`tweek model download` and stored locally at ~/.tweek/models/.

Tweek does not modify or redistribute the model weights. The model is
downloaded directly from HuggingFace by the end user.

Citation:
  @misc{deberta-v3-base-prompt-injection-v2,
    author = {ProtectAI.com},
    title  = {Fine-Tuned DeBERTa-v3-base for Prompt Injection Detection},
    year   = {2024},
    publisher = {HuggingFace},
    url    = {https://huggingface.co/protectai/deberta-v3-base-prompt-injection-v2},
  }

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

-------------------------------------------------------------------------
Microsoft DeBERTa-v3-base (upstream base model)
-------------------------------------------------------------------------

Source:  https://huggingface.co/microsoft/deberta-v3-base
License: MIT License
Copyright (c) Microsoft Corporation.

The ProtectAI prompt injection model above is fine-tuned from
Microsoft's DeBERTa-v3-base pre-trained language model.

Citation:
  @misc{he2021debertav3,
    title  = {DeBERTaV3: Improving DeBERTa using ELECTRA-Style
              Pre-Training with Gradient-Disentangled Embedding Sharing},
    author = {Pengcheng He and Jianfeng Gao and Weizhu Chen},
    year   = {2021},
    eprint = {2111.09543},
    archivePrefix = {arXiv},
    primaryClass  = {cs.CL},
  }

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-------------------------------------------------------------------------
ONNX Runtime
-------------------------------------------------------------------------

Source:  https://github.com/microsoft/onnxruntime
License: MIT License
Copyright (c) Microsoft Corporation.

Used as the inference engine for the local prompt injection classifier.
Installed as an optional dependency via `pip install tweek[local-models]`.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-------------------------------------------------------------------------
HuggingFace Tokenizers
-------------------------------------------------------------------------

Source:  https://github.com/huggingface/tokenizers
License: Apache License 2.0
Copyright (c) 2019 HuggingFace Inc.

Used for tokenizing input text before feeding to the local ONNX model.
Installed as an optional dependency via `pip install tweek[local-models]`.

Licensed under the Apache License, Version 2.0.

-------------------------------------------------------------------------
NumPy
-------------------------------------------------------------------------

Source:  https://github.com/numpy/numpy
License: BSD 3-Clause License
Copyright (c) 2005-2024, NumPy Developers.

Used for numerical operations in the local model inference pipeline
(softmax scoring, tensor manipulation). Installed as an optional
dependency via `pip install tweek[local-models]`.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

  1. Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution.

  3. Neither the name of the copyright holder nor the names of its
     contributors may be used to endorse or promote products derived
     from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

=========================================================================

Runtime Dependencies
=========================================================================

The following packages are installed via pip as runtime dependencies.
They are NOT bundled or vendored — each carries its own license in its
distribution. Listed here for transparency.

  click >=8.0             BSD-3-Clause    Pallets Projects
  pyyaml >=6.0            MIT             Kirill Simonov / YAML community
  rich >=13.0             MIT             Will McGugan
  keyring >=25.0          MIT             Jason R. Coombs

Optional dependencies (installed only when the user requests them):

  anthropic >=0.18.0      MIT             Anthropic, PBC
  openai >=1.0.0          MIT             OpenAI
  google-generativeai     Apache-2.0      Google LLC
  mcp >=1.0.0             MIT             Anthropic, PBC
  mitmproxy >=10.0        MIT             mitmproxy contributors
  secretstorage >=3.0     BSD-3-Clause    Dmitry Shachnev

=========================================================================
