Metadata-Version: 2.5
Name: adolos
Version: 0.1.0
Summary: Small, local AI models that detect phishing web pages.
Project-URL: Homepage, https://adolos.dev
Project-URL: Adolos Small, https://huggingface.co/adolosresearch/adolos-small-10m
Project-URL: Adolos Base, https://huggingface.co/adolosresearch/adolos-base-92m
Author: Rodrigo Simon
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: classifier,cybersecurity,onnx,phishing,phishing-detection,security
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Security
Requires-Python: >=3.10
Requires-Dist: huggingface-hub>=0.20
Requires-Dist: numpy>=1.21
Requires-Dist: onnxruntime>=1.16
Requires-Dist: selectolax~=1.0.2
Requires-Dist: tokenizers>=0.15
Provides-Extra: test
Requires-Dist: onnx>=1.15; extra == 'test'
Requires-Dist: pytest>=7; extra == 'test'
Description-Content-Type: text/markdown

# Adolos

Small AI models that detect phishing web pages. They run on your own computer: pages are never sent anywhere.

```bash
pip install adolos
```

```python
import adolos

with open("page.html", encoding="utf-8", errors="replace") as f:
    html = f.read()

result = adolos.check("https://example.com/login", html)
print(result.level, result.probability)   # e.g. "no_warning" 0.0003
```

The first call downloads the model from Hugging Face (9.7 MB for Small) and caches it.

## Models

| Model | Parameters | Download (int8) | Phishing caught at 0.1 % false alarms* |
|---|---|---|---|
| `small` (default) | 8.5M | 9.7 MB | 59.6 % |
| `base` | 91.7M | 94 MB | 86.1 % |

\* On the PhreshPhish v1.0.1 test set. Full results, benchmarks, credits and details are in the model cards:
[Adolos Small](https://huggingface.co/adolosresearch/adolos-small-10m) ·
[Adolos Base](https://huggingface.co/adolosresearch/adolos-base-92m).

## Usage

Adolos scores pages you already have (from a crawler, email pipeline, proxy…). Pass the URL and the HTML:

```python
from adolos import Detector

detector = Detector("base")             # load once, reuse
result = detector.check(url, html)

result.probability   # 0..1
result.level         # "no_warning", "warning" or "block"
result.flagged       # True for "warning" or "block"
```

Use the page's final URL, after redirects: the model reads it too. The HTML should be what the server sent; JavaScript is not run.

### Levels

Each model has two thresholds, set on validation data:

| Level | Meaning |
|---|---|
| `block` | Probability above the block threshold (about 0.1 % false alarms) |
| `warning` | Probability above the warning threshold (about 1 % false alarms) |
| `no_warning` | Below both |

They're available as `detector.block_threshold` and `detector.warning_threshold`. You can also apply your own on `result.probability`.

### Command line

```bash
adolos --html saved_page.html https://example.com/login
adolos --model base --json --html saved_page.html https://example.com/login
```

### Options

```python
Detector(
    model="small",        # "small" or "base"
    precision="int8",     # "int8" or "fp32"
    revision=None,        # Hugging Face commit; defaults to the one this version was tested with
    cache_dir=None,       # where to cache downloads
    local_dir=None,       # load the files from a folder instead of downloading
    providers=None,       # ONNX Runtime execution providers (default: CPU)
)
```

For research and debugging, `detector.page_to_text(url, html)` returns the exact text the model reads, and `detector.score_text(text)` scores it.

## Limitations

- **No detector catches everything.** At 0.1 % false alarms, Base still misses about 14 % of phishing pages. Use Adolos as an extra layer, not instead of browser and email protections.
- **JavaScript is not run.** Pages that build their content with JavaScript are judged on the HTML the server sends.
- The code and models are provided as is, without warranty (see LICENSE).

## License and credits

Code and models: Apache-2.0, by Rodrigo Simon ([adolos.dev](https://adolos.dev)).

The models were trained on [PhreshPhish](https://huggingface.co/datasets/phreshphish/phreshphish) v1.0.1
(Dalton et al., *PhreshPhish: A Real-World, High-Quality, Large-Scale Phishing Website Dataset and Benchmark*,
[arXiv:2507.10854](https://arxiv.org/abs/2507.10854)), licensed under
[CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). The pages were converted to text and combined with
Adolos's own data of legitimate sites. This package does not include the dataset or any page content.
Adolos is not affiliated with the PhreshPhish authors.
