2026-11-26 15:39 UTC

Rust Foundation tests AI scoring to triage crates.io malware

state: seedheat: mediumuncertainty: mediumrelevance: highsoftware-supply-chain ai-security rustRust FoundationAdam Harveycrates.io

What is this?

On November 23, 2026, Rust Foundation software engineer Adam Harvey described an exploratory project using decision models to score newly published crates.io packages for apparent maliciousness and send candidates for human review. The Foundation says it has scanned 135,548 crate files published November 11–21 and found four crates it identifies as malicious. Scanning is not automated enforcement: people review findings, and any takedown follows existing procedures. The initial threshold table shows many false positives at lower cutoffs, though its counts do not fully reconcile: at ≥0.35 it reports 332 flagged, but only 4 true positives and 240 false positives; other rows also leave small discrepancies. False negatives are not yet measurable, and the Foundation plans a January retrospective. This is a first-party account of an ongoing experiment, not evidence of independently validated detection performance.

Why it matters

This tests whether inexpensive, constrained AI scoring can add a continuous triage layer to open-source supply-chain security: scanning every new package may help humans spot malware earlier without handing the model authority to remove code. The early results are promising for surfacing known malicious crates but also show the operational tradeoff—review burden rises sharply at lower thresholds, and missed threats remain unquantified. If refined and combined with non-AI signals, this approach could extend security monitoring across large package ecosystems; for now, its effectiveness and sustainable funding are unresolved.

Current assessment

New first-party evidence: the Rust Foundation says its exploratory scanner has been running for a little over a week, scoring each crate file in the covered publication window from 0.0 to 1.0 for apparent active maliciousness. It reports four known malicious crates among the 135,548 files scanned. At thresholds ≥0.7 and above, the table continues to show those four, with fewer flagged candidates, but the reported true-positive/false-positive subtotals do not consistently add up to the flagged totals. The Foundation says a threshold around 0.7 may be workable for this model-and-prompt combination; this is its preliminary judgment, not an established general performance result. At lower thresholds, reported false positives are substantial. No crate files are retained after scanning; the service keeps names, versions, file names and scores. No automated actions follow from a score: human reviewers decide whether to use normal takedown procedures. The Foundation cannot yet quantify false negatives and expects to assess them in January using other ecosystem reports. It identifies over-scoring crates with embedded non-source data as a failure mode. Further model/prompt experiments, possible sponsorship or partnerships in early 2027, and integration with non-AI security signals are future possibilities, not current capabilities. The supplied search results also mention crates.io hardening plans for quarantine and automated detection, but do not establish that those plans are part of this scanner or already deployed.

Measured heat

now 0 pts/hpeak 3 pts/hcomments 0/hpeers p21momentum: steady2 platformsage 98h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

11-22 13:00⭐ origin echo-reconstructedThe origin is the Rust Foundation’s own blog post, by Adam Harvey. It says the Foundation is “sponsoring exploratory work on using decision
The Rust Foundation (by Adam Harvey) on blog (echo) · attributed from hn.story.50639915
—
11-25 08:21first on hacker news · published · +67.4hScanning every new crates.io crate for malicious code with decision models
dverlaeckt80
—
11-25 08:21amplified on hacker news 👑hn.story.50639915
dverlaeckt80
peak 3 · 0 comments · 98% of case engagement
11-25 09:20our radar first saw it · +68.3hdiscovery anchor: hn.story.50639915—
pace: p41 vs 2105 stories at the 96h mark (now 98h old) — ahead of adobe-max-ai-agents-creative-tools-mcp (1.5x), behind 42loop-agent-operated-product-experiment (0.8x)

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnScanning every new crates.io crate for malicious code with decision models
Retrieved article excerpt

Open article · Retrieved 2026-11-25T09:20:56.906631+00:00

By visiting our site, you agree to our [privacy policy](https://rustfoundation.org/policy/privacy-policy/) regarding cookies, tracking statistics, etc. Under GDPR, necessary cookies are exempt from consent as they are essential for a site to function. We’d like to set additional cookies to understand site usage and make improvements. By clicking Accept, you consent to allow this. By clicking Decline, you decline to give this consent and will only allow necessary cookies.

Accept
Decline

[Skip to content](https://rustfoundation.org/media/needles-haystacks-and-numbers-between-0-and-1/#fl-main-content)

# Needles, Haystacks, and Numbers Between 0 and 1

November 23, 2026/[Adam Harvey](https://rustfoundation.org/media/author/adamharvey/)

Given the increasingly hostile supply chain environment the entire software community is working within, the Rust Foundation is sponsoring exploratory work on using decision models to automatically scan crates as they are published, and flag potentially malicious crates for human review.

We’ve had the scanner running on the crate firehose for a little more than a week at this point, and here’s what we’ve learned so far.

### What It Is

Decision models have become prominent in the last 2-3 months as an alternative to the LLM-based chat interfaces that have dominated AI tasks in the last few years. Rather than providing open-ended natural language output, decision models are naturally constrained to choosing from a restricted set of answers, or providing scores against a question. Critically, they are also much faster and cheaper than LLMs, which makes it feasible to feed every crate in without bankrupting the Rust Foundation.

Almost as soon as decision models became generally available, we started experimenting with feeding crates in: developing and refining prompts, figuring out how to break up crates to fit them in a restrictive context window while still getting reasonable results, extrapolating the crate publication growth curve to estimate the cost that would be involved in running this against the entire [crates.io](http://crates.io) firehose, and looking at the results to see if they are reliable enough to justify the human review required.

After performing that analysis against a corpus of approximately 1,000 crate files — some known to be malicious from previous takedowns, some known to be good, and some randomly chosen from crates published in October — we decided that the results were cheap and effective enough to be worth a longer (and more expensive) experiment: namely, running every crate published in November and December through the decision model.

### What It Isn’t

Before getting into the early results, let’s talk about what we’re not doing on this project.

No automated actions are taken as a result of these scans. Effectively, we’re treating findings the same way as any normal third-party report of a potentially malicious crate: a [crates.io](http://crates.io) team member and/or a member of the Rust Foundation’s security initiative will review the crate file, and if action is deemed necessary, the normal takedown process takes place. As ever, this process involves the [crates.io](http://crates.io) team (for the mechanics of the takedown), Rust security response working group (for any security-related consulting), and [RustSec](https://rustsec.org/) (for advisories to notify users of the takedown).

The scanning service also doesn’t retain the crate file content once the initial scan is complete. Only the crate name, version number, a list of the file names within the crate, and the score are kept. If we do future comparative work, it will only be on crates that remain available at that time.

### Early Results

As of the writing of this blog post, we have scanned every crate file published between the 11th and 21st of November[1](https://rustfoundation.org/media/needles-haystacks-and-numbers-between-0-and-1/#f16aec60-6220-49d1-ad7b-e7c027a07734), inclusive. We intend to go back to November 1st, and continue until at least December 31st.

So far, we’ve scanned 135,548 crate files.

We’re asking the decision model to give a score in the range `0.0..1.0` that the crate is malicious — not whether it is buggy, or has unintended security concerns, but simply whether it appears to be actively malicious, with some extremely limited[2](https://rustfoundation.org/media/needles-haystacks-and-numbers-between-0-and-1/#f6930c70-468c-48ca-9acf-7985a102f515) context provided from previous malware campaigns that we’ve seen.

Calibrating the threshold for where a human should be involved is an ongoing process. Based on the initial analysis, we set the threshold — which is, of course, going to be highly model and prompt specific — at 0.35, suspecting that that threshold would likely return more false positives than we desired. (We were not wrong.)

Here are the thresholds we’ve tried so far:

| Threshold | Crates | True positives | False positives |
| --- | --- | --- | --- |
| ≥ 0.35 | 332 | 4 (1%) | 240 (99%) |
| ≥ 0.5 | 84 | 4 (5%) | 62 (95%) |
| ≥ 0.6 | 31 | 4 (13%) | 21 (87%) |
| ≥ 0.7 | 15 | 4 (27%) | 6 (73%) |
| ≥ 0.8 | 6 | 4 (67%) | 1 (33%) |
| ≥ 0.9 | 4 | 4 (100%) | 0 (0%) |

Given this, it appears that a threshold at or above 0.7 for this particular combination of model and prompt is likely to provide the sort of behaviour we want: relatively low background noise for the humans who need to review the findings, but still finding the malware.

Of course, this only covers what we find. It’s essentially impossible for us to quantify false negatives in any automated way: there are simply too many crates to review them manually, malicious crates are too infrequent for a random sampling approach to work, and the cost involved in using frontier LLMs is prohibitive.

On a longer time horizon, we should be able to get a sense of false negatives based on the other reports crates.io receives. We are grateful to the broader security ecosystem of companies, non-profits, and individuals who perform their own checks and make those reports! Commonly used crates tend to receive reports quickly, but it’s not uncommon for several months to pass for crates that see no usage.

We’ll do an in-depth look back and evaluation of the false negative rate in January as we will hopefully have more data by then.

### Future Directions

On a micro level, there is significant scope for experimentation with prompt and model over the coming weeks and months.

We’ve already observed specific failure modes for this particular combination: because the model has no real reasoning capability, it tends to over-score crates that contain significant embedded data that isn’t source code, as it simply can’t analyse what that data is or does.[3](https://rustfoundation.org/media/needles-haystacks-and-numbers-between-0-and-1/#2596dac9-72ee-4826-87e9-c3f72ae14504)

While we don’t have the financial resources to run parallel prompt and model combinations on the entire crate corpus during the experiment period, we will likely send some subsets of crates to other combinations to see if we can improve the scoring behaviour further.

If the outcome of this experiment is that we see value in continuing to scan crates in this way, we will likely seek partnerships and/or sponsorship in early 2027 to fund the operation and further development of this work, including going back through the full historical corpus.

Finally, on a macro level, we believe that there will be opportunities to match this sort of data with other security signals derived without the use of AI. Crate provenance data, metadata derived from maintainer actions, and capability analysis of the crates themselves are all active areas of research, both within the Rust Foundation, across ecosystems under the auspices of organisations such as [OpenSSF](https://openssf.org/) and [Alpha-Omega](https://alpha-omega.dev/), and in for-profit companies.

Being able to take those signals and integrate them holistically opens up opportunities for more rapid responses to malware, especially in combination with ongoing work at the crates.io level such as [RFC 4016 (Registry withholding)](https://github.com/jlizen/rfcs/blob/registry-withholding/text/4016-registry-crate-unavailability.md), which is currently in its final comment period.

Ultimately, regardless of the success of this particular experiment, we believe that work like this is crucial to the security and success of Rust, and of software development as a whole, and we’re excited to continue this work.

---

1. Dates in [the one true time zone](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), naturally. [↩︎](https://rustfoundation.org/media/needles-haystacks-and-numbers-between-0-and-1/#f16aec60-6220-49d1-ad7b-e7c027a07734-link)
2. Context lengths are a challenge here. Some decision models, including the one we’re currently using, have significantly more restricted context windows than frontier LLMs, and we obviously lose tokens with each additional sentence that we add to the prompt. We also, simultaneously, want to stuff as much context into a single request from the crate, because the analysis is more effective with a larger subset of the crate available. It’s a balancing act. [↩︎](https://rustfoundation.org/media/needles-haystacks-and-numbers-between-0-and-1/#f6930c70-468c-48ca-9acf-7985a102f515-link)
3. This has also resulted in us finding multiple crates that are shipping opaque bytecode or downloading and linking arbitrary binaries that, while they don’t result in malicious behaviour today, are questionable in terms of whether they are within the crates.io usage policy. We’ll be taking that to the crates.io team for further discussion. [↩︎](https://rustfoundation.org/media/needles-haystacks-and-numbers-between-0-and-1/#2596dac9-72ee-4826-87e9-c3f72ae14504-link)

Posted in [Blog](https://rustfoundation.org/media/category/blog/)

### Adam Harvey

Adam Harvey works at the Rust Foundation as a Software Engineer focusing on supporting the Security Initiative.
dverlaeckt8030
🟧 echo.blog ⭐The origin is the Rust Foundation’s own blog post, by Adam Harvey. It says the Foundation is “sponsoring exploratory work on using decision The Rust Foundation (by Adam Harvey)——

Interpretation history

Decision trace