Cheap AI agents write loaders that slip past EDR
Reviewing BypassGym: A Benchmark for Evaluating AI Agents' Endpoint Defense Evasion Capabilities · Weifeng Yuan, Zifan Chen, Yucheng Zhang et al.

Researchers gave lightweight AI agents command-and-control shellcode and a live Windows endpoint running commercial endpoint detection and response, and most runs produced a loader that executed the payload and survived. The agents mostly reused an old, dependable technique, and a detailed feedback loop mattered more than the model's reasoning effort.
Give a small, cheap language model some command-and-control (C2) shellcode, a compiler and ten attempts against a live Windows machine. That machine runs a commercial endpoint detection and response (EDR) product. Most of the time, the model comes back with a program that runs the payload and stays running. Across several lightweight models, half a dozen EDR products and a few payloads, 71 of 90 runs got through.
That is the result from BypassGym, a benchmark the researchers built on real Windows virtual machines. The task is narrow and realistic. The agent must write and compile a loader: a small program whose only job is to get a payload into memory and running without the endpoint product killing it. Each submission is first checked on a clean machine to prove it works at all. Then it is run on a machine with one EDR installed. A pass means the payload executed, the process was not blocked or terminated, and the C2 session did what it was told.
What interests me is how the agents won. Roughly 70% of the passing loaders used dynamic-link library (DLL) side-loading through a signed host binary. That is not a new idea. Attackers have leaned on it for years, because a trusted, signed program loading a library looks normal to a lot of defensive logic. The agents did not invent evasion. They reached for the dependable old trick, and it still works.
The feedback loop does the work
The benchmark returns structured detection feedback after each attempt. Detailed feedback produced more passes than a plain yes or no. Supplied evasion knowledge helped too: strip it out and success fell for the models reported, sometimes sharply. Raising the models' reasoning effort did not reliably help. Patience and a good error message did.
Products differed. Windows Defender let every submission in its tests through. Bitdefender was the hardest target, letting only about a third of runs through, and no model got the Havoc payload past it. Most passing loaders still worked when replayed weeks later, so these were not one-off flukes.
The preconditions matter. An attacker needs a lab running the same product they want to beat, because that feedback is what drives success. These were commodity products in tested configurations, and Windows only. The bar was execution, not silence. A loader that raised an alert but was not stopped still counted as a pass. Some of these wins may have left traces an analyst could find, and that is the defender's opening.
The researchers suggest correlating telemetry across layers to catch recurring loader patterns, rather than trusting any single signal. That is the right approach. A signed binary loading an unfamiliar library, followed by new outbound C2 traffic, is a pattern, not an event.
The agent does not need to be clever. It needs a lab, a good error message and ten tries.
Further analysis
Problem
This paper studies whether autonomous AI agents can produce a program that executes a supplied command-and-control shellcode payload on a real Windows endpoint while evading deployed endpoint detection and response products. This capability matters because EDRs are a primary line of defence on hosts, and generative agents are already being integrated into real attack workflows. Existing benchmarks do not measure whether a generated loader can both run a payload and survive a live EDR on a real endpoint.
Approach
The authors introduce BypassGym, an end-to-end benchmark that fixes the payloads, toolchain and iteration budget but leaves loader design open. The evaluation runs inside Proxmox virtual machines and uses a two-stage oracle: a NoEDR Windows VM verifies functional execution and process survival, then a target Windows VM with a single deployed EDR applies the Endpoint Execution Check and a C2 Functionality Check. The oracle counts a submission as a pass if the payload executes, the launched process is not blocked or terminated during observation, and the C2 playbook completes. Alerts or logs that do not stop execution are still counted as passes. The benchmark supplies a curated evasion knowledge skill at three richness levels (full, partial, none) and supports agent scaffolds and backends. Experiments tested five model backends against six commodity EDR products and three C2 payloads, with up to ten iterations per run and structured execution feedback returned to the agent.
Key Findings
- Overall success rate: 71 of 90 runs passed the target checks, a 78.9% pass rate across five model backends, six EDRs and three payloads.
- Model and defence variance: the strongest backend, DeepSeek-V4.1 Flash, reached 17 of 18 successful runs; Qwen3.7 Plus achieved 10 of 18. Windows Defender allowed all 15 submissions in its cells, while Bitdefender was the hardest target, permitting 5 of 15 runs (33.3%).
- Payload difficulty varied: Sliver was easiest (27 of 30 passes), Havoc intermediate (24 of 30), and AdaptixC2 hardest (20 of 30). All models failed Havoc on Bitdefender in the tested configuration.
- Common techniques: among 71 passing submissions, 50 (70%) used DLL side-loading via a signed host binary. Revisions sometimes removed functionality, and repair efforts varied widely by model.
- Knowledge matters: removing supplied evasion knowledge reduced success. DeepSeek fell from 17/18 (full) to 13/18 (none); GLM fell from 15/18 to 9/18.
- Scaffold and effort effects: scaffold choice changed iteration costs but not always success; increasing configured reasoning effort did not reliably improve pass rates.
- Replay stability: of 71 passing runs replayed after one to four weeks, 62 (87.3%) still passed. Kaspersky showed the lowest replay survival (61.5%), while Trend Micro, Sophos and Bitdefender lost none of their replayable submissions.
- Feedback value: detailed structured endpoint feedback improved subsequent performance relative to binary-only signals, adding passes for some models.
Limitations
BypassGym currently targets Windows loaders and commodity EDR products; it does not measure evasion applied directly to payload internals and cannot fully separate loader detection from payload detection. The knowledge skill focuses on loader techniques and is deliberately limited, so reported success under these conditions is a lower bound on agent capability. Results reflect the tested product snapshots, payloads and configurations.
Implications
From an offensive perspective, the benchmark shows that relatively low-cost generative agent backends can produce loaders that execute payloads on defended endpoints in many cases, often using DLL side-loading and memory-execution techniques. Attackers with access to these agentic capabilities and a feedback loop could iterate to bypass varied EDRs. The findings suggest attackers can exploit detailed detection feedback and curated evasion knowledge to improve success, and that defenders should prioritise telemetry correlation across layers to detect recurring loader composition patterns rather than relying on single signals.
The paper title, authors and abstract
BypassGym: A Benchmark for Evaluating AI Agents' Endpoint Defense Evasion Capabilities
Artificial intelligence agents increasingly automate cybersecurity tasks, including offensive operations. Frequent attacks across the web make endpoint detection and response (EDR) a critical defense, but whether AI agents can evade it remains unclear. Benchmarks evaluate the offensive capabilities of large language model (LLM) agents in areas such as penetration testing and vulnerability discovery. One important capability that these benchmarks do not address is defense evasion, specifically whether an agent can develop a program that executes a payload without being blocked or terminated by a deployed EDR. We introduce BypassGym, to our knowledge the first benchmark to systematically evaluate this capability on real endpoints. Given command-and-control (C2) shellcode, an agent must generate and compile a loader that executes the payload without being blocked or terminated. A supplementary evasion knowledge skill provides domain knowledge and supports comparisons with and without this input. BypassGym is built on Proxmox VE(PVE), so the evaluation environment runs real Windows systems and EDR products inside virtual machines and returns structured detection feedback to the agent. We evaluate 5 lightweight model backends against 6 EDR products and 3 payloads, and find that even these simple models generate successful submissions, with DeepSeek-V4.1 Flash reaching 17/18 successful runs and Bitdefender allowing only 5 of 15 runs to pass. These results provide a systematic measurement of current AI agents' endpoint defense evasion capabilities and identify areas for defenders to investigate.


