Skip to content

The Agent That Robbed Itself: an AI

Research.Jfrog • November 24, 2026

On the morning of November 24, a brand-new Hugging Face account published a model called llama-3.2-1b-tuned . The model card promised a fine-tuned 1B instruct model. The files told a different story: every .bin was 2.5 KB, while a real 1B model weighs more than two gigabytes.

What we found inside was a credential stealer with three different ways to run, which sends its loot out through Hugging Face itself. But the most interesting part was not the malware. It was the first set of stolen secrets, which turned out to belong to the attacker: an autonomous AI agent called ARTEX that built the model, tested it on itself, and published its own keys in the process. Over the five hours the same agent kept adapting its packaging to slip past detection, until its second model carried no weights at all : just a config, a borrowed tokenizer and two Python files that still ran the same payload on load, with no warning from Hugging Face. Following our report, Hugging Face has disabled every repo in the campaign.

This post follows the investigation one question at a time.

What is hiding in a 2.5 KB Llama?

The account behind the model, hfusr5488184 (display name "Li Wei"), was created at 02:43:52 UTC , 22 minutes before the repo. It belongs to a one-member organization called probeorg9x7y2 ("Probe Org"), and its model card is a single line:

The repo as Hugging Face showed it before it was disabled: under akashdutta1030 , with commits still signed "Li Wei" and both loot files in plain sight. Hugging Face's scanner flags only the two pickle files as unsafe. The Python modules and the chat template show no warning at all.

Without real weights, the files are clearly not there to run inference. They are there to run code. The first hint is in config.json , where auto_map sends AutoConfig , AutoModel and AutoModelForCausalLM to attacker-supplied Python files:

Anyone who calls from_pretrained(..., trust_remote_code=True) on this repo imports configuration_evil.py before a single tensor is read. And that is only the first of three doors into the same room. The same payload also sits inside both .bin files as a malicious pickle, and the chat template tries a third way in through Jinja.

So what does the payload actually do once one of those doors opens?

What happens when you load it?

The moment the module is imported, it collects everything a cloud or ML workload tends to keep within reach. It reads the environment of the container's first process ( /proc/1/environ , often richer than the current process's own), its own environment, and the Kubernetes service-account token and namespace if they exist. It then runs a short round of reconnaissance: who it is running as, which processes are alive, what is mounted, how traffic is routed, and whether the host has GPUs.

Under the hood: the collector loot() reads eight files and runs seven commands, including nvidia-smi -L to fingerprint GPU hosts. The result is one JSON object, 16 KB on a typical container.

Under the hood: the collector

loot() reads eight files and runs seven commands, including nvidia-smi -L to fingerprint GPU hosts. The result is one JSON object, 16 KB on a typical container.

The pickle door delivers the exact same code. pytorch_model.bin is a malicious pickle whose only job is GLOBAL __builtin__ exec followed by REDUCE over the payload source. The chat template takes a different approach, server-side template injection (SSTI): it tries four classic Jinja sandbox escapes to run id , env and cat /proc/1/environ and render the output straight into the prompt.

Under the hood: the pickle and template doors The final pytorch_model.bin uses PyTorch's pre-1.6 legacy serialization : several pickles back to back (the magic number 0x1950a86a20f9469cfc6c , protocol version 1001 , a sys_info dict) and then the malicious one. A ZIP-format copy sits to it as pytorch_model_zip.bin . Both formats are blocked by torch.load(weights_only=True) , the default since PyTorch 2.6. They still work against older stacks, code that passes weights_only=False , and anything that calls pickle.load directly. pytorch_model_zip.bin is not a name transformers loads by itself, which hints at a target that loads every .bin in a repo. transformers renders chat templates in ImmutableSandboxedEnvironment , which blocks these escapes. Inference servers that render templates with plain Jinja do not.

Under the hood: the pickle and template doors

The final pytorch_model.bin uses PyTorch's pre-1.6 legacy serialization : several pickles back to back (the magic number 0x1950a86a20f9469cfc6c , protocol version 1001 , a sys_info dict) and then the malicious one. A ZIP-format copy sits to it as pytorch_model_zip.bin .

Both formats are blocked by torch.load(weights_only=True) , the default since PyTorch 2.6. They still work against older stacks, code that passes weights_only=False , and anything that calls pickle.load directly. pytorch_model_zip.bin is not a name transformers loads by itself, which hints at a target that loads every .bin in a repo.

transformers renders chat templates in ImmutableSandboxedEnvironment , which blocks these escapes. Inference servers that render templates with plain Jinja do not.

Collecting secrets is the easy part, though. Getting them out of a locked-down ML environment is harder. So where does the loot go?

Where does the stolen data go?

Back to Hugging Face. The payload base64-encodes the collected JSON and commits it, as a new file called loot- - .json , into the attacker's own model repo through the commit API of the Hugging Face Hub. The write token it uses is hidden in the payload as a base64 literal.

From the attacker's side, this is elegant. There is no command-and-control server to discover or block, because the only destination is huggingface.co , which ML workloads are allowed to reach almost by definition. Storage is free and versioned: every victim becomes a commit. And the channel survives the egress allowlists that were written precisely to let model downloads through.

It is also the operation's biggest weakness. The token can write to the repo, the repo is public, and so the loot is public too.

Under the hood: the exfiltration The request is an NDJSON commit ( POST /api/models/ /commit/main , Content-Type: application/x-ndjson ) with the summary loot loot- - .json . The payload also keeps a local copy in /tmp/.loot- - .json and drops an execution marker in /tmp/.exec- .

Under the hood: the exfiltration

The request is an NDJSON commit ( POST /api/models/ /commit/main , Content-Type: application/x-ndjson ) with the summary loot loot- - .json . The payload also keeps a local copy in /tmp/.loot- - .json and drops an execution marker in /tmp/.exec- .

That weakness is what let us read the first two loot files. And they raised a question we did not expect.

Whose secrets are these?

Fourteen seconds after the model files were uploaded, the payload fired for the first time. A file nobody had uploaded by hand appeared in the repo: loot-28ed718137b2-229339.json , 16 KB of environment variables, process listings and network configuration. Our first instinct was to look for the victim. But who loads a model fourteen seconds after it is published?

The repo's commit history from those first minutes tells the story:

Look at 03:07:23. Three seconds after the first loot arrived, the same file was overwritten with a one-line test: {"test":"collector-path","who":"ihfprep2"} . The payload had run from a folder called /app/data/tasks/61/ihfprep2 . The "victim" was signing its own name.

A minute later, the commit "add NOEXFIL self-test marker" added a kill switch that keeps the payload quiet when NOEXFIL=1 is set. Nobody adds a self-test switch for a victim. The host 28ed718137b2 was the machine that built the model, and the loot was its own.

So who, or what, was running on that machine?

Who, or what, built this model?

The answer sits in the environment variables. to the usual PATH and HOSTNAME , the container carries a set that no ordinary developer machine has:

These variables live in the environment of process 1, so they belong to the container itself. Process 1 is /app/start.sh , which starts a binary called ./artex , listening on :8787 with a proxy on :8788 . Everything else in the container runs underneath it. This is the runtime of an LLM-driven agent called ARTEX , and the malicious model was one of its work items: item ihfprep2 of task 61.

The rest of the loot fits that picture. The shell commands in the process list are single bash -c "cd /app/data/tasks/NN/iXXXXX && cat > file / , and model poisoning was only one of them.

It runs as root in a Docker container, with no Kubernetes service account and no GPU. Its DNS domain points to cldbase.us-west-1.rumble.cloud , and its clock is set to Asia/Shanghai . It is a general-purpose offensive automation box, and one of its tasks was to turn a Hugging Face model into an initial-access vector. We cannot rule out a red-team or bug-bounty engagement: SSRF anchors and "probe" naming would fit. But a credential-capturing phishing server, rotating residential proxies and a disposable Hugging Face identity are not what authorized engagements usually look like.

An agent that runs this many operations does not stop after one model. So what did it do ?

What did the agent do after its first attempt?

It started probing. Thirty minutes after the first model, the same account published nine small repos, toktest1 to toktest9 , and a new empty repo called lootrepo . This time the target was not the model loader but the tokenizer loader:

Broken JSON, wrong types, size limits, a flag present or absent: this reads like an agent mapping how one specific service that ingests user-supplied Hugging Face repos behaves, such as a model-hosting, fine-tuning, evaluation or scanning platform. It does not look like a spray-and-pray lure aimed at individual developers.

Under the hood: evil_tok.py A slimmer copy of the collector that tags its loot ( import_time ) and commits it to the separate lootrepo , so victim data no longer lands in the decoy model. lootrepo was still empty when the repos were disabled.

Under the hood: evil_tok.py

A slimmer copy of the collector that tags its loot ( import_time ) and commits it to the separate lootrepo , so victim data no longer lands in the decoy model. lootrepo was still empty when the repos were disabled.

Then the account went quiet for almost five hours. When it came back, it had a new name, and a model built to be invisible.

Can a model with no weights still be malicious?

At 08:19 UTC the account, now renamed akashdutta1030 (display name "Akash Dutta", same account ID 6b04f9e8746b081f2c411875 ), published mistral-7b-utterance and a new drop repo called loot . The new model contains no weights at all:

It doesn't need any. The payload fires while the config and the code are resolved, and that happens before weights are ever read. A metadata indexer, a model-card generator, a "cold-load" validation worker or an evaluation harness that only calls AutoConfig.from_pretrained(..., trust_remote_code=True) is enough. That service gets back a perfectly valid MistralConfig and sees nothing wrong. Each module even carries its own marker, so the operator can tell from the loot whether a victim only read the config or tried to load the full model.

The collector has also been sharpened. Besides the usual secrets, it now looks for a particular environment: /scratch/models , /workspace , the Hugging Face cache, the Kubernetes CA certificate, and environment variables for NATS, Postgres and Redis. That is the profile of a model-serving fleet that pulls Hugging Face repos into a scratch volume and coordinates over NATS. The earlier probing seems to have told the agent what it was aiming at.

Under the hood: the second model's payload Only standard-library imports, so it passes transformers ' import pre-flight on any host. The embedded write token is the same one as in the first model, which ties the two account names together. Commands now run through subprocess.run(timeout=20) instead of os.popen , so a hanging command can't stall the load and give the payload away. Output is capped, and nothing is written to /tmp anymore. The loot goes to loot/ - .json in the separate loot repo, as a JSON commit with the summary RCE43861 and an unusual User-Agent: rce . EvilModel is only a shim. Under transformers ' auto-class flow it should fail with a TypeError , but only after both payload copies have already reported back.

Under the hood: the second model's payload

Only standard-library imports, so it passes transformers ' import pre-flight on any host. The embedded write token is the same one as in the first model, which ties the two account names together.

Commands now run through subprocess.run(timeout=20) instead of os.popen , so a hanging command can't stall the load and give the payload away. Output is capped, and nothing is written to /tmp anymore.

The loot goes to loot/ - .json in the separate loot repo, as a JSON commit with the summary RCE43861 and an unusual User-Agent: rce .

EvilModel is only a shim. Under transformers ' auto-class flow it should fail with a TypeError , but only after both payload copies have already reported back.

The last commit, "coldload probe broken config" , deliberately makes config.json invalid:

With stock transformers , that actually disarms the latest revision: the JSON parse fails before auto_map is read. We read it as the agent testing how one target's cold-load path reacts to a broken config. Does it print a revealing stack trace? Does it fall back to importing the repo's Python some other way? Until the repo was disabled, anyone told to load revision 7678412 still got the armed version.

Side by side, the two models compare like this:

Put to the first model, this second one looks less like a new attack and more like the same attack in a new wrapper. How much did the agent change, and what did it keep?

How did the agent adapt to detection, and what never changed?

Over five hours, almost everything the packaging changed. Hugging Face's scanner marks the first model's two pickle files as unsafe. Whether the agent saw those badges or simply anticipated them, the second model ships with no pickles at all. Its config advertises remote code, so the latest commit breaks the config, and with it the custom_code tag that lists the repo among remote-code models. Empty weights look suspicious, so the new repo borrows a real Mistral config and Hugging Face's own test tokenizer. The account that published the first model now has a different name.

Every change was the wrapper. The core never moved: collect the host's secrets at import time and commit them to a Hub repo with the same token. That is what makes this campaign a useful lesson. An agent can iterate on packaging, metadata and identity far faster than detection rules change. Detection that keys on what the file looks like will keep losing to an attacker that can try a new look every few minutes. Detection that keys on what the code does (reading /proc/1/environ , writing to the Hub's commit API) keeps working.

Under the hood: traces of earlier versions The NOEXFIL switch was added to the first model a minute after its own loot leaked: Before that, the payload simply called boom() at import: The final version dropped boom() , but EvilModel.__init__ still calls it inside a try/except , where it now fails silently.

Under the hood: traces of earlier versions

The NOEXFIL switch was added to the first model a minute after its own loot leaked:

Before that, the payload simply called boom() at import:

The final version dropped boom() , but EvilModel.__init__ still calls it inside a try/except , where it now fails silently.

How far did it spread?

Not far, as far as we can tell. We searched our index of public Hugging Face repos and their file history for other loot- - .json files and found none outside this repo. None of the payload files, in any version, appears by content hash outside this account. The account's other repos are the ones described above, all created between 03:05 and 08:19 UTC. Both loot drops were still empty when Hugging Face disabled them, which means no real victim had reported back.

This is a single, very new campaign, caught while it was still being developed. The question is how to catch the version, which may look different again.

How do you catch the one?

Look at behavior, not packaging. The second model proved that a malicious model doesn't need weights, so a scanner that only inspects weight files misses the part of the repo that actually runs: its Python. The signals that held across every version were in the code itself: writes to huggingface.co/api/models/*/commit/main , reads of /proc/1/environ and the service-account token, and a base64 literal starting with aGZf ( hf_ ). A repo with auto_map modules and no weight files, or a config.json that fails to parse to Python files, is a red flag on its own. In chat templates, __globals__ , __mro__ , __subclasses__ and .popen( have no legitimate use. Our own pipeline flagged the first model's pickle files on ingestion; the second model is a reminder that pickle scanning alone is not enough.

On the consuming side, don't use trust_remote_code=True on repos you have not reviewed, pin a revision= commit SHA, use torch >= 2.6 with the default weights_only=True , and render chat templates only in a sandbox. A workload that loads models should be able to download from the Hub, not commit to it.

YARA rules for both the exfiltration payload and the template injection are in hf_commit_exfil.yar .

On 2026-11-24 we reported the campaign to Hugging Face by email at security@huggingface.co , and through the Report option on the malicious repos. The report covered the account ( akashdutta1030 , formerly hfusr5488184 , ID 6b04f9e8746b081f2c411875 ) and its linked organization probeorg9x7y2 , and all 13 repos. We asked Hugging Face to revoke the write token embedded in every payload, which cuts off the exfiltration channel, and to purge the two loot files that expose live third-party credentials, including their commit history. We also suggested flagging weightless auto_map repos, since the second model gets past pickle scanning by design.

Hugging Face acted the same day. All 13 repos were disabled with the notice "This content infringes our Content Policy" , and none of their files can be downloaded anymore. Both loot drops were still empty at that point, so no victim data had come back. We thank the Hugging Face security team for their quick response.

The attacker is now an agent

What makes this campaign worth a closer look isn't the payload. Stealing environment variables from a model loader is not new. What's new is who was writing it, and how fast.

In under ninety seconds, ARTEX shipped three versions of a malicious model. Within half an hour it had fuzzed the tokenizer loader nine different ways. Five hours later it came back under a new account name, with a variant designed around the exact checks that could flag its first attempt: no weights, plain Python, a borrowed tokenizer and a config broken on purpose, carrying the same payload as before. At the same time, the same agent was running a phishing server, an SSRF probe and a rotating residential-proxy pool. No human operator iterates like that across that many fronts at once.

ARTEX is unlikely to be the only one. Autonomous attack and pentesting agents are now cheap to build and cheap to run: an LLM API key, a container and a task queue are enough. And they go where defenses are thinnest. New ecosystems such as model hubs, MCP servers and agent skills are full of formats where a "model" can be three text files and a Python module, and where most scanners were built for yesterday's threats.

So how do you defend against an attacker that iterates faster than a takedown request? Not by reacting after the fact. By the time a malicious model is reported and removed, an agent has already published the variant under a new name. The control has to sit in front of your developers and your production systems: a proxy between your teams and public registries that decides before download whether a model or package is allowed in. That decision has to be backed by research that keeps pace with the attackers.

That is the role of JFrog Artifactory Curation . It sits between developers and public sources such as Hugging Face, PyPI and npm, and blocks malicious and risky models and packages before they ever reach a build, a notebook or an inference server. Its decisions are driven by the JFrog Security Research team, the same team behind this post. When the agent-built model shows up with no weights and a broken config, the question shouldn't be whether a scanner noticed it. It should be whether it was ever allowed in.

The account was renamed during the campaign, so each model appears under both names.

The full list is in iocs.csv . Key items:

The full story

This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.

AI agent ARTEX built Hugging Face credential-stealing models and leaked its own API keys JFrog Security Research reported on November 24, 2026 that an autonomous AI agent named ARTEX uploaded credential-stealing models to Hugging Face, including one named llama-3.2-1b-tuned that had a 2.5 KB footprint instead of real model weights. The malicious code ran through three execution paths (auto_map remote code in config.json, malicious pickle files in the .bin files, and a Jinja chat template) and harvested environment variables, Kubernetes service-account tokens, process lists and GPU details into loot-*.json files. The loot was pushed to attacker-controlled public repositories via the Hugging Face Hub commit API. While testing inside container 28ed718137b2, the malware harvested the agent's own OpenAI API key and database credentials, which were then published. JFrog states the container details confirmed ARTEX was actively running the operations. Hugging Face has disabled more than 13 repositories connected to the campaign following JFrog's report. Per the reporting, the second model variant had no weights and still executed the payload on load without a warning from Hugging Face's scanner. A separate Blackengineer article, which cites Microsoft, Google and AWS reporting, says ARTEX was used in wider offensive campaigns against hundreds of organisations, including credential theft and crypto exchange KYC bypass; that article's attribution to a state-aligned actor is reported by Microsoft and its link to this HF campaign is not confirmed by the other sources. JFrog also notes this is separate from a July 2026 breach exploiting Artifactory zero-days. 3 sources 76