English Β· ν•œκ΅­μ–΄

URLGate geometric gateway mark

URLGate-Init-0.1-0.5M

Check an unfamiliar link before the first network request.

URLGate is a small, local first gate for external links. It gives an existing agent a fast URL check before the first network request, and ships with the harness and agent skill needed to put that check into practice.

URLGate is a URL-string risk classifier, not a live site verifier. It learned statistical byte patterns from labeled phishing and benign URLs. With no network request it cannot observe redirects, DNS, TLS, page content, domain age, compromise of a legitimate site, or current threat intelligence.

What you get Measured value
Parameters 490,945
ONNX model 1.99 MB
PhreshPhish official full AP 0.9700
PhreshPhish official full P@R=0.9 0.9383
Network requests during inspection 0
Deployment property What it means in practice
1.99 MB ONNX, 490,945 parameters Fits beside an existing agent without loading a security LLM
CPU inference supported; no GPU required Suitable as an always-on first stage in constrained or shared environments
No DNS, HTTP, reputation API, or telemetry The URL can be screened before it is contacted or disclosed externally
Model + policy harness + SKILL.md One download provides both the score and the instructions an agent needs to act on it

Model identity

  • Primary model: URLGate-Init-0.1-0.5M (version: 0.1), shipped as model.onnx
  • Origin: trained from scratch on the PhreshPhish URL-only training view; it is not a renamed URLBERT or PhishScout checkpoint
  • Architecture: custom byte-level residual dilated temporal CNN, 490,945 trainable parameters
  • Companion components: the policy harness and agent skill consume the primary model; URLBERT, PhishScout, and the hashing-linear model are evaluation baselines only

URLGate series

The model listing links the available models. Evaluation scope is documented in each model card.

Release Role Recommended status
URLGate-Init-0.1-0.5M URL-only first gate Default starting point; strongest URLGate result on the shared PhreshPhish protocol
URLGate-Static-0.1-Hybrid URL + non-executing HTML snapshot Optional second signal; not an accuracy upgrade over Init v0.1
Kanana-URLGate-Decide-3B Typed probability interface for review and policy Decision layer; not a replacement for the compact detector
URLGate-Init-0.1-0.5M-Legacy Earlier package layout Archived for reproducibility; do not start new integrations here

Where URLGate fits

untrusted URL from a message, document, search result, or tool
        β”‚
        β–Ό
URLGate: local URL-string inspection (zero network requests)
        β”‚
        β”œβ”€β”€ allow ──► continue through the system's normal security controls
        β”œβ”€β”€ warn  ──► ask for confirmation or call a slower reputation/content scanner
        └── block ──► do not fetch automatically; require an explicit review path

URLGate is meant to sit in front of an existing browser tool, downloader, citation fetcher, RAG ingestion job, or agent HTTP client. It is not a replacement for those systems' redirect handling, sandboxing, authentication, or content inspection.

Why this is different

URLGate is deliberately narrower than a browser security suite or a large security LLM:

  • Agent-first preflight: run it before the first HTTP request, not after page content has already been fetched.
  • Small enough to stay local: a 1.99 MB ONNX model with no tokenizer download, DNS lookup, reputation API, or telemetry.
  • Two-layer decision contract: the neural score produces model_policy; transparent guardrails can raise an ambiguous destination to warn without pretending to explain the model.
  • Base-rate-aware distribution, when requested: if a measured deployment phishing rate is supplied, an opt-in calibration layer returns {benign, phish} under that stated prior instead of presenting a balanced-training score as a universal probability.
  • Skill included: skills/url-gate-preflight/ tells a SKILL.md-compatible agent when to check, how to act on allow/warn/block, and what it must never claim.
  • Rare-event results shown: performance at a 0.05% phishing base rate is reported prominently instead of being hidden behind a balanced test score.
  • A clean simple baseline was not skipped: on the same leakage-controlled roles, the smaller ByteTCN improves 0.05% AP from 0.3408 to 0.4274 over a 1.05M-weight character hashing linear model.

This is a fast first gate. It does not replace live reputation, redirect, TLS, DNS, or page-content analysis.

Quick start

pip install numpy onnxruntime
python inference.py 'https://example.com/'

If you have measured a deployment phishing rate, request the experimental prior-aware distribution explicitly:

python inference.py --base-rate 0.0005 'https://example.com/'

The command returns JSON:

{
  "url": "https://example.com/",
  "risk_score": 0.4163,
  "model_policy": "allow",
  "policy": "allow",
  "policy_reasons": [],
  "truncated": false,
  "observations": []
}

risk_score is a ranking signal, not a calibrated probability. allow means only that this local URL-string gate did not cross a threshold; it never means that a site is verified or safe.

Python

from inference import URLGate

gate = URLGate(".")
result = gate.inspect("https://example.com/")
print(result["policy"], result["risk_score"])

Add it to an existing agent

Create one URLGate instance when the process starts and reuse it for every external URL:

from inference import URLGate

url_gate = URLGate("/path/to/URLGate-Init-0.1-0.5M")

def before_external_request(url: str) -> dict:
    result = url_gate.inspect(url)
    if result["policy"] == "block":
        return {"action": "stop", "check": result}
    if result["policy"] == "warn":
        return {"action": "confirm_or_scan", "check": result}
    return {"action": "continue", "check": result}

Call this hook before the browser, HTTP client, downloader, citation resolver, or document loader receives the URL. Keep the returned check in the tool trace so a reviewer can see whether the model or a transparent guardrail raised the decision.

Agent skill

The model and the skill are shipped together so the first release does not require two separate downloads. The skill defines when the check runs, how allow/warn/block affect tool use, and which claims the agent must not make.

export URL_GATE_MODEL_DIR="$PWD"
python skills/url-gate-preflight/scripts/check_url.py \
  'https://example.com/' \
  'https://bit.ly/demo-link'

To install the skill for Codex, copy skills/url-gate-preflight/ into the local skills directory and keep URL_GATE_MODEL_DIR pointed at this model repository. The same SKILL.md can be adapted for other agents that support file-based skills.

Recommended integration order:

  1. Extract candidate URLs without opening them.
  2. Run the bundled checker on every external URL.
  3. Let allow continue only to the system's normal controls.
  4. Route warn to confirmation or a slower live scanner.
  5. Keep block out of automatic fetch paths and provide an explicit review route.

This separation is intentional: the model supplies a fast local signal, while the host system remains responsible for the final action policy.

Decision contract

Field Meaning
risk_score Raw sigmoid ranking score; not a probability or proof
model_policy Threshold-only model decision: allow, warn, or block
policy Final agent-facing decision after transparent guardrails
policy_reasons Guardrails that raised allow to at least warn
observations Visible URL-string properties; not causal model explanations
probability_distribution Optional estimate under the explicitly supplied phishing base rate

Version 0.1 guardrails never lower a model decision and never promote a URL to block. They raise allow to warn for parsing failure, hidden user information or @, Punycode hosts, known shorteners, and input truncation. This protects the action boundary without conflating rules with the learned score.

The optional distribution does not override policy. Omit --base-rate when prevalence is unknown; the harness will not invent one.

Official benchmark results

Evaluation uses PhreshPhish v1.0.1, a public phishing dataset and benchmark. This release is a URL-only adaptation; the paper's main baselines can also use HTML and therefore are not direct modality-matched comparisons.

Official full benchmark

The official full membership contains 90,262 benign and 28,476 phishing samples.

Model Parameters AP ↑ P@R=0.9 ↑ Comparison status
URLGate-Init-0.1-0.5M 0.49M 0.9700 0.9383 Clean local training/evaluation lineage
Character hashing linear 1.05M 0.9684 0.9235 Same clean train/validation roles
URLBERT Tiny v4 3.69M 0.8597 0.6122 Public weights; overlap with PhreshPhish unknown
PhishScout v2 not reported 0.3770 0.2502 Public artifact; training provenance incomplete
PhishScout v1 not reported 0.3171 0.2262 Public artifact; training provenance incomplete

All values in this table were computed locally from the same PhreshPhish membership and P@R formula. The public artifacts are context baselines, not guaranteed independent test sets; they are not used to claim state of the art.

The same-lineage linear baseline is the stronger architecture check: at 0.05% prevalence its AP/P@R=0.9 are 0.3408/0.0229, versus 0.4274/0.0300 for ByteTCN. The gain is concentrated where false positives dominate, rather than in the already-saturated full-set AP.

Realistic low phishing base rates

PhreshPhish repeats the benign pool against sampled phishing sets. The reported value is the mean across the official repetitions.

Phishing rate Repetitions AP ↑ P@R=0.9 ↑
0.05% 586 0.4274 0.0300
0.10% 296 0.5089 0.0581
0.50% 59 0.7095 0.2024
1.00% 29 0.7843 0.3351
5.00% 5 0.9061 0.7133

The 0.05% row is the operational warning: even a strong ranking model has only 3.0% precision when forced to reach 90% recall at that base rate. Do not auto-block merely because a score looks high.

Frozen operating thresholds

Thresholds were selected once on a domain-disjoint temporal calibration set, never on the official test.

Policy Threshold Calibration target Official full precision Official full recall Official full FPR Precision at 0.05%
warn 0.937124 FPR ≀ 1% 0.9835 0.7772 0.00412 0.0858
block 0.996007 FPR ≀ 0.1% 0.9962 0.4638 0.000554 0.2929

The last column again shows why deployment prevalence matters. A threshold that looks precise on the full benchmark can generate many false alerts in a rare-event stream.

Experimental prevalence-aware distribution

We fitted Platt scaling on the frozen, temporal and domain-disjoint calibration role. Given a user-supplied target prevalence, the harness then applies a label-prior odds correction. The feature is off by default because it assumes that class-conditional score distributions remain stable and that the supplied prevalence is accurate.

The proper-score comparison below includes a deliberately hard baseline that always returns the true target prevalence and ignores the URL.

Phishing rate Constant-prior Brier ↓ URLGate Brier ↓ Constant-prior NLL ↓ URLGate NLL ↓
0.05% 0.000498 0.000426 0.004287 0.002156
0.10% 0.000995 0.000788 0.007880 0.003696
0.50% 0.004969 0.002999 0.031446 0.012127
1.00% 0.009892 0.005105 0.055965 0.019588
5.00% 0.047503 0.014901 0.198526 0.054494

On the official full distribution, the original raw score had lower Brier and NLL than the prior-adjusted estimate. That distribution shift is why the calibrated output remains experimental and opt-in. AP, P@R, and frozen action thresholds are unaffected.

External transfer check and architecture decision

The frozen ByteTCN was also evaluated without adaptation on all 235,795 URL rows of the UCI PhiUSIIL dataset. PhiUSIIL is CC BY 4.0 and accompanies the paper PhiUSIIL: A diverse security profile empowered phishing URL detection framework based on similarity index and incremental learning (DOI 10.1016/j.cose.2023.103545).

Rows Positive rate AP ROC-AUC P@R=0.9
235,795 0.4281 0.9068 0.8854 0.5682

This is an external transfer diagnostic, not an official PhiUSIIL leaderboard submission. The label balance, collection process, URL length and source artifacts differ substantially from PhreshPhish, so it must not be combined with the primary benchmark into one score.

Why ByteTCN remains the Init 0.1 primary

We also trained an independent 475,593-parameter local-global Transformer variant inspired by PLG-URLNet. It is a variant, not an exact author reproduction because the author implementation was unavailable. The table uses the exact same PhreshPhish formula and the same zero-adaptation PhiUSIIL check.

Architecture Seed Official AP Official P@R=0.9 0.05% AP 0.05% P@R=0.9 PhiUSIIL AP
ByteTCN primary 42 0.9700 0.9383 0.4274 0.0300 0.9068
PLG-inspired 0.48M 42 0.9767 0.9686 0.4796 0.0673 0.7978
PLG-inspired 0.48M 137 0.9760 0.9610 0.5111 0.0496 0.8385

The PLG-inspired variant improves the in-family PhreshPhish result but transfers worse to PhiUSIIL. Version 0.1 therefore keeps the repeatedly validated 1.99 MB ByteTCN as the deployed primary instead of selecting an architecture from a single favorable benchmark. The PLG results are preserved as an architecture ablation and are not bundled as the production model.

Data and split discipline

  • Dataset: phreshphish/phreshphish
  • Frozen dataset revision: eca603e0ecd4f698f8d4d226c088659e72681239
  • Training input: URL string only; HTML was never read
  • Train: 430,753 rows through 2025-07-31
  • Validation: 15,240 rows from 2025-08-01 through 2025-08-20
  • Calibration: 12,475 rows after 2025-08-20
  • Registrable-domain intersections among train, validation, and calibration: 0
  • Seed: 42

The complete public train/test files have zero SHA-256 overlap, zero raw-URL overlap, four normalized-URL overlaps, and substantial registrable-domain overlap. We therefore keep the official benchmark as the primary standardized result and also preserve an unseen-domain diagnostic rather than describing the entire public test as domain-disjoint.

Architecture and training

The model encodes UTF-8 bytes directly. Inputs longer than 256 bytes retain the first 192 and last 64 bytes and are marked truncated.

UTF-8 bytes
  β†’ 64-d embedding
  β†’ 128-channel convolutional stem
  β†’ 6 residual depthwise temporal blocks (dilations 1,2,4,8,16,32)
  β†’ masked mean + max pooling
  β†’ binary score

Training used PyTorch 2.5.1, BF16, batch size 1,024, and AdamW-style weight decay. Early stopping selected epoch 1 and stopped after epoch 3.

Repeated release validation

The frozen PyTorch checkpoint was evaluated four times on the same accelerator backend and once on a CPU backend. The four accelerator prediction files were byte-identical. CPU PyTorch differed slightly because of backend floating-point behavior.

The deployed ONNX artifact was then evaluated on all 168,060 test rows in three new CPU sessions with batch sizes 1,024, 2,048, and 4,096. All three ONNX score arrays were identical (max_abs_diff = 0.0). One raw ONNX sigmoid output exceeded 1 by one float32 ULP; the public harness clips scores to the documented [0, 1] range.

Deployment artifact result AP ↑ P@R=0.9 ↑
Official full 0.9700277 0.9383022
0.05% phishing 0.4274358 0.0300205
0.10% phishing 0.5089148 0.0580795
0.50% phishing 0.7094618 0.2023974
1.00% phishing 0.7842697 0.3350337
5.00% phishing 0.9061108 0.7133133

Across GPU PyTorch and CPU ONNX, the largest official metric difference was 9.12e-05; the deployment conclusions did not change, but bit-for-bit cross-backend equality is not claimed. The official formula also matched an independent transcription on 250 additional random, tied, and constant-score cases.

Full evidence, confidence intervals, domain slices, and overlap sensitivity are in docs/repeated_validation_report.md.

Reproduction checks

The public PhreshPhish notebook computes P@R=0.9 by reversing the precision-recall curve, interpolating it onto a 1,000-point recall grid, and selecting the grid point closest to 0.9. It also bootstraps the mean over official repetitions with 10,000 resamples.

pip install numpy scikit-learn
python evaluation/validate_formula.py

The independent transcription matched the notebook on five fixed, tie, and random cases:

  • P@R=0.9 maximum absolute difference: 0.0
  • Bootstrap CI maximum absolute difference: 0.0
  • Tolerance: 1e-12
  • Official membership counts: exact for the full and all five low-base-rate benchmarks

This proves reproduction of the published formula and benchmark membership, not reproduction of every number in the paper. The official repository does not publish the paper models' prediction files.

The exported ONNX graph was also checked against the frozen PyTorch checkpoint on reference URLs. Maximum absolute score difference: 1.43e-06.

Intended use

Good fits:

  • preflight checks before an agent opens an unfamiliar external URL;
  • local triage of URLs extracted from email, documents, or tool output;
  • a fast first stage before a slower reputation or content scanner;
  • research on compact URL-only phishing detection.

Not suitable as:

  • proof that a URL is benign or malicious;
  • a replacement for browser isolation, sandboxing, or endpoint protection;
  • a detector for malicious page content hosted on an otherwise ordinary URL;
  • a live check of redirects, DNS, TLS, domain age, or threat intelligence;
  • the sole basis for irreversible blocking, account action, or legal conclusions.

Attackers can adapt strings adversarially, compromised legitimate domains can look benign, and shortened URLs hide their destination. The model will drift as campaigns change. Re-evaluate it on recent, organization-specific traffic before production use.

Limitations and safety

  • Init observes only the URL byte string. It cannot see redirects, DNS, TLS, page content, domain age, a newly compromised legitimate site, or current threat intelligence.
  • The 256-byte model budget retains a bounded head and tail; unusually long URLs are marked as truncated and the policy raises them for review.
  • Scores and frozen thresholds can shift across sources. The two-seed PLG ablation and PhiUSIIL diagnostic show that stronger in-family metrics do not guarantee stronger external transfer.
  • Rare-event precision remains limited even when AP is high. Never treat allow as a safety certificate or use this model as the sole reason to enter credentials, submit payment, open a download, or auto-block a user.
  • Use live reputation, redirect controls, sandboxing, Static/Dynamic inspection and explicit user confirmation as separate defense layers.

Repository contents

Path Purpose
model.onnx 1.99 MB deployment model
model_config.json Encoding, thresholds, labels, and lineage
inference.py Offline CLI and Python policy harness
skills/url-gate-preflight/ Agent skill and multi-URL checker
evaluation_metrics.json Full official results and low-base summaries
evaluation/ Formula implementation, validation evidence, and public baseline metrics
checkpoint_best.pt Frozen same-lineage PyTorch checkpoint
manifest.json File hashes and ONNX equivalence checks
docs/repeated_validation_report.md Repeated-backend, ONNX, formula, overlap, and domain-slice validation

Use it, measure it, and improve it

Useful community feedback is more than a download count. If you try URLGate, please record:

  • runtime version, thread count, and latency measured on the contributor's own test environment;
  • the traffic source and measured phishing base rate, without publishing private URLs;
  • AP and P@R=0.9 for labeled research data, plus false-positive rate at the deployed threshold;
  • whether the model was used alone or as the first stage before reputation or content analysis;
  • failure categories such as compromised legitimate domains, shorteners, internationalized domains, or campaign drift.

Before comparing a modification, keep the frozen benchmark membership and run the bundled formula check:

python evaluation/validate_formula.py

Good extensions include adapters for additional agent frameworks, reproducible CPU or edge benchmarks, recent time-split URL-only evaluations, and carefully licensed training data. Please do not publish private URLs, credentials, browsing histories, or claims of universal safety. A useful contribution states the data date, split rule, base rate, metric formula, hardware, and exact model revision.

If you build an integration, link back to the model revision you tested. That makes performance reports traceable as URL campaigns and future URLGate versions change.

License and attribution

Model weights, inference code, and the bundled skill are Apache-2.0. PhreshPhish data is distributed separately under its own CC BY 4.0 terms; the dataset is not redistributed in this repository.

The common URLGate mark was generated specifically for this project without input or reference images. Its provenance and CC0 dedication are recorded in assets/NOTICE.md.

If you use this model, please also cite the dataset paper:

@article{dalton2025phreshphish,
  title   = {PhreshPhish: A Real-World, High-Quality, Large-Scale Phishing Website Dataset and Benchmark},
  author  = {Thomas Dalton and Hemanth Gowda and Girish Rao and Sachin Pargi and Alireza Hadj Khodabakhshi and Joseph Rombs and Stephan Jou and Manish Marwah},
  year    = {2025},
  journal = {arXiv preprint arXiv:2507.10854}
}

Sources: dataset Β· paper Β· official benchmark code

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train orqan137/URLGate-Init-0.1-0.5M

Paper for orqan137/URLGate-Init-0.1-0.5M