LLM Guard Malicious URLs scanner explained

The Malicious URLs scanner flags suspicious links in model output using a CodeBERT classifier. This page explains what it scores, how thresholds and pairing checks change results, and how to run it while the archived project is replaced.

On this page

What the LLM Guard Malicious URLs scanner does in model output

If your LLM Guard deployment returns links to users, the Malicious URLs output scanner is the control that scores those links before they reach the user. It takes each URL in a model response, runs it through a CodeBERT model, and returns a verdict by comparing the score against a configured threshold. The scanner is one of the 20 output scanners LLM Guard documents, so it can be enabled alongside the others in the same output pipeline. Confirm the exact threshold parameter name and its default value in the LLM Guard documentation and in your pinned version, because the project's archive means no newer changes will arrive.

During the wind-down period, keep this scanner running while the deployment still serves users, since it continues to score links in responses without changes to your application. Treat its verdicts as one signal, not a complete answer. The model was trained for classification, so it can miss newly registered domains, benign-looking paths on compromised hosts, and links that only become malicious after a redirect. Its model files also come from an archived project, so you cannot count on updates to the classifier as attacker patterns change.

Add a second control when links from model output are opened automatically, when your users work in high-risk settings, or when the scanner's verdicts cannot be explained to an auditor. Typical companions are a URL reachability check that resolves and follows redirects before display, and a threat intelligence feed that checks domains and hashes against current indicators. Plan these before decommissioning, and ask your security team to define which decision each control owns, so a single false negative does not reach users unchecked.

What the scanner scores and what it cannot see

The Malicious URLs scanner makes one judgment per link: a model score compared against a threshold. Everything around that judgment, including whether the link resolves, who owns the domain, and whether it appears on a threat list, sits outside the scanner, so plan for those gaps before relying on it.

URLs extracted from output

The scanner first finds the URLs in the model's response text and scores each one separately. Links that the extraction step does not recognize, such as some encoded, split or unusually formatted forms, may never reach the classifier. Confirm the exact extraction rules in the LLM Guard documentation and test them with the link formats your users and models actually produce.

LLM Guard docs

Per-link classifier score

Each extracted URL receives a score from the CodeBERT-based classifier, which estimates how likely the link is to be malicious based on its text. The score reflects the characters of the URL, not the content of the page behind it. Record the score for a sample of benign and known-bad links so you understand the model's output range before choosing a cutoff.

Threshold comparison

A flagged link is one whose score meets or exceeds the threshold you configure. Lower thresholds catch more suspicious links and produce more false positives on legitimate, unusual domains. Set the value from your own labeled test set, and document the chosen number and the reason for it so reviewers can challenge it later.

Action on a flagged response

When a link is flagged, the scanner reports the result and the calling application decides what happens next. It may block the whole response, strip the link, or pass it with a warning. Decide this policy in advance, make sure the application honors the scanner's verdict, and log both the flagged URL and the action taken.

No live reachability or reputation lookup

The scanner does not visit the URL, resolve its DNS, check its TLS certificate, or query a reputation or threat feed. A parked, newly registered, or compromised domain with ordinary-looking text can pass unflagged. Pair the scanner with reachability checks or a threat intelligence source if links from model output can be clicked by users.

Dependence on model behavior for new domains

The classifier learned patterns from its training data, so its accuracy on newly registered domains, obfuscated hostnames, and lookalike domains depends on how closely those resemble what it has seen. Treat it as one signal among several, and test it with current phishing and typosquatting examples from your own threat sources. Confirm the model's training scope with the LLM Guard documentation and its model card.

How a model response passes through the scanner and your link controls

The flow starts when the application receives a model response and sends it to the LLM Guard output scanning step, which extracts the URLs and scores each one with the Malicious URLs scanner against its threshold. A flagged response is blocked or redacted before anything else happens. Clean links can then pass through an optional reachability check or a threat feed lookup, and the application logs the final decision. The trust boundary sits between the LLM Guard API server and the downstream checks, so teams can see which component made each call.

Output scanning path from model response to logged delivery decision.

Threshold and pairing options and when each fits

This table compares the Malicious URLs scanner settings and the controls you can pair with it, from threshold tuning to threat feed lookups. Read each row as a decision: the risk it addresses, the operating cost it adds, and what to confirm in the LLM Guard configuration reference before you rely on it. Since the project is archived, treat every row as a point of review for an existing deployment rather than a basis for a new rollout.

OptionRisk it addressesOperational costConfirm before use
Threshold setting (default)Sets how confident the CodeBERT classifier must be before a link is flagged as maliciousLow to set, but needs test samples to judge false positives and missesThe default value and its exact meaning in the configuration reference for your installed version
Threshold tuned lowerFlags more borderline links, catching more suspicious outputMore blocked legitimate responses and reviewer workWhether the scanner's score is a probability and how your version applies the cutoff
Threshold tuned higherReduces blocking of ordinary links in outputHigher chance that a malicious link passes unflaggedMeasured miss rate on your own sample of malicious and benign URLs
Block the responseStops a flagged link from reaching the user at allUsers see refused answers, and support tickets rise during tuningHow the scanner's verdict is returned to your application so you can enforce the block
Log the verdict onlyBuilds evidence on real traffic before enforcementLog storage and someone must review the recordsWhere scanner results are written and whether your logging pipeline keeps them
Scanner aloneCatches many suspicious links with no extra network callsLowest runtime cost, but no check on whether a link is live or listedThe classifier's coverage of link types in your traffic, such as shortened or newly registered domains
Add URL reachability checksIdentifies dead, parked or redirecting links that a model may inventExtra outbound requests, latency, and rules for DNS and redirectsEgress policy allows the checks, and how redirects and timeouts are handled in your code
Add threat feed lookupMatches links against known malicious domains from a curated sourceFeed licensing, refresh schedule and an on-call process for false matchesFeed terms, update frequency and whether the feed can be used in your deployment
Allowlist internal domainsPrevents blocking of company links, documentation and toolsOngoing list maintenance and the risk that an allowlisted domain is compromisedWhether the scanner supports an allowlist, or whether you must filter before the scanner runs

How to set up the scanner in an existing LLM Guard deployment

This sequence lets a team that already runs LLM Guard add the Malicious URLs output scanner in a controlled way, with a pinned release, a loaded model, a chosen threshold and a labeled test set that shows what it flags before it is trusted in production.

  1. Confirm the Python version against the release requirement

    Check that the Python interpreter used by the LLM Guard service is 3.10 or newer and below 3.13, which is the requirement stated for the last PyPI release, 0.3.16. Run python --version in the same virtual environment the API server uses, not in the shell of the person doing the work. If the interpreter falls outside that range, stop here and resolve the runtime first, because the install will either fail or pull dependencies that were never tested together. Done means the version string is recorded in the change ticket.

  2. Install and pin the LLM Guard release in use

    Record the installed LLM Guard version with pip show llm-guard and compare it with the existing requirements file. Pin the exact version, currently 0.3.16 on PyPI, in the lock file so that a rebuild cannot silently change scanner behavior. Do not upgrade the package as part of this change, because the project is archived and any upgrade changes the baseline you are testing against. Done means the environment reproduces from the pinned file and pip freeze matches the recorded versions.

  3. Stage the Malicious URLs model for offline use

    Identify the CodeBERT model the Malicious URLs scanner loads from Hugging Face and copy it into an internal model store or cache directory that the production host can read. Confirm the license and provenance of the model with your legal and compliance team before it is approved, since the archived project no longer publishes updates for its models. Done means the model files and their checksums are recorded and the team has written approval to use them.

  4. Load the scanner with the model offline

    Block outbound network access from the test host, then instantiate the Malicious URLs output scanner in a short Python script using the staged model path or cache. Confirm that the scanner initializes without attempting a download. A failure to load usually means a missing cache variable or a model path mismatch, so fix that before going further. Done means the script completes and the log shows the model loaded from local storage.

  5. Set the threshold and the action for flagged output

    Set the detection threshold in the scanner configuration and decide what happens when a URL scores above it: redact the link, replace the whole response, or log and pass it through. Document the chosen value with the reason, and confirm the default in the LLM Guard documentation for the pinned release before you change it. Include the action in the same config file that the API server reads so the setting is reviewed alongside the code. Done means the config diff is reviewed and the chosen threshold and action are written in the runbook.

  6. Add the URL reachability or threat feed pairing check

    Add a second check that runs after the CodeBERT score. Options include a reachability test that resolves and probes the link, or a lookup against a threat intelligence feed you already license. Keep the pairing in your own code path, because LLM Guard does not verify live status. Confirm the feed's terms allow automated lookups from your environment. Done means a URL that the model scores as benign but the feed lists is routed to the block or review action in a test run.

  7. Test against a labeled set of benign and malicious URLs

    Assemble a labeled test set with known benign URLs from your business domains and known malicious examples from a source you can cite, then run every entry through the scanner and the pairing check. Record true positives, false positives and misses in a results file. Include a known test URL that must be flagged and confirm it is flagged on every run. Done means the results are reviewed by the security owner, the miss rate and false positive rate are written down, and the threshold is either accepted or adjusted and retested.

  8. Record the baseline and the rollback path

    Save the pinned version, model checksums, threshold, action, test set and results in the deployment record, then confirm that the previous configuration can be restored without a rebuild. Ask the maintainer or platform owner to sign off on the baseline before the scanner runs on live traffic. Done means the baseline record is stored with the runbook and a rollback has been rehearsed once in a non-production environment.

Why pairing the scanner with reachability checks or a threat feed matters

The Malicious URLs scanner judges the text of a link, not the destination behind it. A classifier reads the URL string and estimates whether it looks malicious, so it cannot tell whether the host is live, whether the domain was registered yesterday, or whether the address already appears in threat intelligence. A link to a freshly registered phishing domain can look ordinary on the page and still pass a text-based score. For that reason, a score from the scanner should be treated as one signal among several, and teams should decide in advance which other signals they will act on before a link reaches a user.

A reachability check and a threat feed catch different cases. A reachability check, run by a component you control, resolves the host and confirms whether it responds, which helps with dead, parked or redirect-heavy links that a text score may misread. A threat feed compares the domain or address against indicators that a provider has already published, which helps with known bad infrastructure but misses anything not yet listed. Both add latency, because each lookup happens before or alongside the response, and both require outbound network access from the service that performs them. Allowing that traffic is a firewall and egress decision that your network team should make explicitly, and it should be logged.

Both additions also raise data handling questions. A reachability check sends the URL, and possibly the requesting context, to the destination, so you need to decide whether links containing tokens or personal data are ever fetched. A commercial or community feed may restrict redistribution, require attribution, or update on a schedule that does not match your response needs. Ask the feed provider for the license terms, the update frequency and the process for removing false positives, and confirm them in writing before you rely on the feed. Because LLM Guard is no longer maintained, these checks sit outside the scanner and will need to be kept working as the rest of the guardrail stack changes.

Security and operational risks to plan for

The Malicious URLs scanner depends on a model and a project that are no longer maintained, so each risk below has to be owned by your team. The cards cover the model and its files, detection gaps, blocked legitimate links, outbound lookups and the logs that hold flagged URLs.

Archived model and no fixes

The LLM Guard repository was archived on 9 July 2026, and the README says the project and its Hugging Face models are no longer under active development or maintained. Expect no security fixes or model updates. Before relying on the scanner, confirm with the maintainers' notice whether any advisories will still be published, and record who on your team watches for vulnerabilities in the Python dependencies and the CodeBERT model.

LLM Guard repository

Model file integrity and storage

The scanner loads CodeBERT weights at runtime, usually from Hugging Face. Pin the exact model revision, download it once into storage you control, and compare file checksums against the copy you tested. Restrict who can write to the model directory, because a replaced file would change every verdict without any code change. Confirm with the maintainers' notice where the model artifacts will remain available.

Missed new and shortened domains

A model trained on past URL patterns can score a newly registered domain or a URL shortener link as benign. Treat a low score as a weak signal, not proof that a link is safe. Test the scanner against recent phishing samples and shortened links from your own threat data, and record the miss rate before you accept the threshold in production.

Blocking legitimate links

Threshold tuning trades misses for false positives, and a strict setting can reject valid documentation, vendor portals or internal links in model output. Build a sample of links your users actually share, run them through the scanner at each candidate threshold, and review blocked results with the people who own those sites. Decide whether a blocked link is removed, replaced with a warning or sent to human review.

Outbound lookups leaking user data

Pairing the scanner with a reachability check or a threat feed sends the flagged URL, and sometimes the request context, to a third party or to your own network egress. Limit the lookup to the URL host, route it through an approved proxy, and confirm that the destination does not log query strings. Document this flow in your data inventory, since the lookup can expose data the scanner itself never stores.

Logging of flagged URLs

Flagged URLs often contain session tokens, reset links or internal hostnames, so the scanner's output becomes sensitive data once written to logs. Set a retention period for scan results, strip query parameters before logging, and restrict access to the log store. Confirm with your compliance team which retention and access rules apply to these records before the scanner goes live.

Limits to confirm in library and API server deployments

When LLM Guard runs as a Python library, the scanner is imported and called inside your application process, so the model load, memory use and latency all land on that process. The library is installed with pip, and the last release on PyPI is 0.3.16, uploaded on 19 May 2025, which requires Python 3.10 or newer but below 3.13. Confirm each point below in your own environment rather than assuming defaults.

  • Model location: Confirm where the CodeBERT model is downloaded from, whether it is cached on disk, and whether your hosts can reach the model source at startup.
  • Memory and latency: Measure resident memory per worker process and the time a single URL scan takes under your real traffic, since each worker may load its own copy.
  • Threshold configuration: Confirm how the threshold is passed to the scanner constructor in code, and whether any value is overridden elsewhere in your application.
  • Upgrade constraints: Check that your Python interpreter falls within the supported range for the 0.3.16 release, because the project is archived and will not receive new releases.
  • Dependency pinning: Pin the exact library and transformer versions so a rebuild does not pull different model or dependency code.

Before go-live, run a test set of known safe and known malicious links through the exact build you will ship.

Questions teams ask before they hire help with LLM Guard link scanning

Is the LLM Guard Malicious URLs scanner enough on its own to keep links safe?

No. The scanner gives a model-based score for a link in model output, so it is one signal, not a complete link safety control. It does not tell you whether a domain is currently serving malware, whether a link resolves, or whether a domain was registered yesterday. Teams usually pair it with URL reachability checks, a threat intelligence feed or a secure web gateway, and with output handling that does not render links automatically. Confirm which of these controls already exist in your environment before you decide what the scanner must cover.

How much effort does it take to keep this scanner running until it is replaced?

The effort is mostly operational. LLM Guard was archived on 9 July 2026 and its README states the project and its Hugging Face models are no longer maintained, so there will be no upstream fixes for the model or its dependencies. The last PyPI release, 0.3.16, uploaded on 19 May 2025, requires Python 3.10 or newer but below 3.13. Ongoing work includes pinning versions, keeping the runtime on a supported Python version, watching for vulnerabilities in dependencies and monitoring false positives and false negatives. Ask any provider to state how they will handle a security issue in a pinned dependency that no upstream will fix.

What drives the cost of a migration or extension of this scanner?

The main drivers are the number of output paths that call the scanner, the number of URL types and channels you must cover, and how much evidence you need that the replacement blocks at least what the scanner blocked. Costs include a one-time discovery and test set build, the replacement or pairing design, integration into your gateway or application code, and a retest. Recurring costs include threat feed licensing, hosting, and support. DeployOpen does not publish prices. Ask each quote to list the scanner paths in scope, the test URL sets to be built, the replacement or feed options, the retest scope, and which costs recur after handover.

What does the work need from our team before it can start?

Expect to provide access and decisions, not just time. Typical inputs are:

  • Access to the application or gateway where LLM Guard runs, and a non-production environment that mirrors it
  • Network rules that allow controlled outbound checks for reachability, with a decision on whether those checks run from an isolated segment
  • Representative test URL sets, including known-bad examples handled under your security policy, and examples of legitimate links your users rely on
  • Model access if the scanner's model files must be fetched or mirrored into your environment
  • Change approvals for the production switch and a named owner for false positive reviews

Confirm the exact list during scoping, because network and approval rules differ by organization.

Can our own team run the Malicious URLs scanner without outside help?

Yes, if your team has the skills to run a Python service, manage model artifacts, and tune thresholds from evidence. Many teams can keep an existing deployment running with their own engineers. Outside help usually makes sense for the decisions that are hard to reverse: designing the pairing with reachability checks or a threat feed, building a test set that covers your traffic, proving the replacement blocks at least what LLM Guard did, and handling a security finding in an archived dependency. Ask your team to name who owns threshold changes, the test set, and the on-call response before deciding.

Does DeployOpen recommend new LLM Guard rollouts for link scanning?

No. DeployOpen does not recommend new LLM Guard rollouts because the project is archived and no longer maintained. For new work, the usual path is to plan a maintained guardrail option, such as NeMo Guardrails, and to combine link checks with the controls your organization already runs. For existing deployments, the focus is containment and a scanner-by-scanner replacement plan. Ask any provider to explain which maintained options they evaluated and why they chose them for your use case.

How do we know the replacement blocks at least what the scanner blocked?

You prove it with a comparison test, not with a claim. Run the same representative set of model outputs and URLs through the existing scanner and the replacement, record each decision, and review every case where the two disagree. The test set should include known-bad links handled under your policy, lookalike domains, shortened links, and legitimate links your users need. Ask for the test set design, the pass criteria you will sign off, and how the results will be documented for your security review.

How DeployOpen works on this

DeployOpen plans, implements, tests and documents link controls around LLM Guard's Malicious URLs output scanner inside infrastructure you control. Because LLM Guard is archived, our work focuses on keeping an existing scanner contained and on replacing it with a maintained guardrail where needed.

How we scope

  • Engagements are fixed-scope, with the LLM Guard version, deployment mode and link-handling rules agreed in writing before work starts.
  • We inventory where the Malicious URLs scanner runs, which model files it loads, and which output paths it guards.
  • The written scope states whether the work keeps the scanner, pairs it with reachability or threat feed checks, or plans a replacement.

How we build

  • We set the scanner threshold and match behavior against a labeled set of URLs drawn from your own traffic and known bad samples.
  • We add URL reachability or threat feed checks as separate controls, with the order of checks and failure handling documented.
  • We test the link controls with benign, phishing and obfuscated URLs, including redirects and shortened links, and record the results.

How we hand over

  • You receive configuration, thresholds, test cases and results, and a record of the model versions and dependencies in use.
  • The handover documents the known blind spots of the scanner and the checks that cover them, in plain language for operators.
  • Where replacement is in scope, we deliver a comparison showing the replacement blocks at least the URLs the archived scanner blocked.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, and the retainer scope is agreed in writing.
  • Support can cover monitoring of the pinned model and dependencies, since the upstream project is no longer maintained.
  • Ask us to confirm the support boundaries, response expectations and retest cadence in the quote before the work begins.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.