Manuscript Offprint
arXiv:2610.36143Program-Level Adversarial Co-Adaptive Self-Play for Robotic Security
Abstract:
Coding agents can adapt robotic software by revising executable programs, but successful responses to an evolving opponent may not remain effective. We present a framework for program-level adversarial co-adaptive self-play in which coding agents generate attacks and defenses from tested opponent code and mission feedback, without model fine-tuning. Environment-specific interfaces support external programs for autonomous driving and SDK-level defenses for humanoid locomotion. Two eight-generation case studies reveal concrete software responses: a driving defender introduces direct-actuation recovery, while a humanoid defender revises incoming-state validation. These responses provide local task recovery but do not establish sustained robustness. The framework makes such adaptation and limitations observable through executable artifacts and task-level evidence.
Keywords: agentic robotics, robotic security, coding agents, adversarial self-play, program-level adaptation
Coding agents provide a way to study this interaction through executable programs. Prior work connects generated code to embodied control [2], develops executable skills through environmental feedback [3], and investigates code-mediated improvement and autonomous cyber co-evolution [4, 5]. In this work, we study a system-level question: can agents attack an existing robotic stack and revise defenses effectively as the opponent adapts?
Our framework implements program-level adversarial co-adaptive self-play. Attack-generating agents and a shared defense-generating agent are placed around a running robotic system. Programs submitted by agents are checked and frozen, executed on the robotic system, and returned with independently observed outcomes to inform subsequent revisions. Adaptation occurs in software and retained context rather than through arena-driven model fine-tuning. Environment-specific tasks and permissions determine what those programs may change.
We study this process in Autoware-CARLA and Unitree G1-MuJoCo. The driving configuration uses fixed attacker roles; the humanoid configuration additionally uses an orchestrator, development-time tests against frozen opponents, and separate clean, attack-only, defense-only, and joint episode executions. The studies reveal concrete program revisions alongside recurrent failures, motivating evaluation beyond a favorable individual match.
Equal contribution.
The authors are with Isuzu Technical Center of America, Plymouth, MI 48170 USA. Ibenahar@purdue.edu, {chi.zhang, wei.zheng, weifan.zhang, yifan.wei}@isuzu.com
Our contributions are:
• A robotic-security self-play framework with directly competing programs. Independent coding agents revise programs that execute together around an operating autonomy stack through robotic middleware and permitted software modifications.
• A mission-grounded evaluation protocol. The humanoid evaluation combines clean, attack-only, defense-only, and repeated joint trials to distinguish attack effectiveness, defense viability, and normalized task recovery.
• Two eight-generation case studies of adversarial adaptation. Driving and humanoid experiments trace how agents develop countermeasures and counterattacks in response to each other, revealing targeted recovery alongside persistent failures.
2 Related Work
From executable behavior to competitive adaptation. Code as Policies connects language-model-generated programs to robotic perception and control interfaces [2]. Voyager extends feedback-driven program development to a growing library of Minecraft skills without model fine-tuning [3]. CodeClash alternates independent code revision with competition between the resulting programs, and separately studies access to previous opponent code [6]. FAMOU evolves strategy programs against an updating opponent pool [7], while COvolve jointly generates policies and challenging environments, including CARLA scenes [8]. Our experiments keep the mission and simulator configuration fixed and instead revise attack and defense programs around an existing robotic stack.
From competition to security hardening. Cybersecurity gives the two sides different responsibilities: disrupting a system and preserving useful operation. Hemberg et al. study cyber-controller coevolution, including LLM-assisted mutation of Python controllers [9]. Our agents instead revise programs through coding sessions without population-level selection. RvB couples vulnerability discovery with report-driven patching and verification [10], while ZERO-APT evaluates attack execution against a log-based detection agent in an attacker–defender–judge loop [11]. We study generated attack and defense programs that compete directly during a robotic mission, with the outcomes guiding both agents’ next program revisions.
From software interference to robot behavior. RoboFuzz uses ROS-aware mutation and correctness oracles to detect semantic failures, connecting software tests to robotic behavior rather than crashes alone [12]. Somma et al. apply an environment-grounded multi-agent workflow to ROS/ROS 2 penetration testing [13]. Haque et al. investigate LLM-generated dynamic tests for Autoware [14]. RoboPAIR studies a different entry point, adversarial instructions to LLM-controlled robots [15]. Here the language models develop the attack and defense software; the targeted autonomy stack need not itself contain an LLM. Combining this software-level access with mission outcomes lets us examine not only whether interference succeeds, but how generated countermeasures alter the robot's behavior and become targets of later attacks.
3 Methodology
Figure 1 summarizes the program-generation and evaluation loop. A fixed mission focuses adaptation on the opponent's software. One shared defender faces each attacker separately, so it must accommodate different forms of interference with the same submission.
3.1 Attack-Defense Self-Play Loop
Before the self-play loop begins, the arena verifies a clean mission as baseline and captures exposed interfaces for agent context. At each generation, attacker (Red) and defender (Blue) agents develop concurrently in private workspaces. Each receives role-specific context describing the rules,

Figure 1: Program-level adversarial co-adaptation. Coding agents develop attack and defense programs that are checked, frozen, and evaluated in Autoware-CARLA or G1-MuJoCo. Independent referees judge outcomes from simulator ground truth; results and tested opponent code guide the next generation.
robotic software, retained history, and previous execution feedback. Each Red sees its own preceding evidence and the tested defender; Blue receives the preceding attackers and their match records. Current development workspaces are hidden from opponents.
After development, the arena checks submissions and permits up to two automated repairs. Middleware access is assumed, and direct manipulation of the simulator or referee is outside the interaction policy.
Environment-specific permissions define the allowed interventions. For driving, both sides use external ROS 2 programs, and Blue may issue direct actuation commands. For the humanoid, Red uses DDS messages, while Blue supplies a monitor and permitted SDK replacements that process inputs before the fixed locomotion policy consumes them. The monitor can also publish commands.
Accepted programs are checked, frozen, and evaluated, with one attacker paired with the same generation-specific defense in each joint episode. They execute without live language-model calls or mid-trial edits. An independent referee determines outcomes from simulator ground truth while the results and tested opponent code are returned for subsequent revision. The robot resets between trials.
3.2 Attacker Allocation and Evaluation
The driving configuration assigns five fixed specializations: perception, failsafe, planning, control, and chained attacks. In the humanoid configuration, an orchestrator proposes five roles before each generation using the available interfaces, task, and prior feedback. Role identities preserve their histories; unused attackers remain available to Blue. The orchestrator is instructed to retain effective pressure and explore other directions when roles become ineffective or well recovered.
Shorter humanoid episodes and up to sixteen parallel slots make more testing practical than the sequential driving setup with per-match Autoware restarts. This supports both unscored development sparring, where agents test candidate programs alone or against frozen prior opponents, and more formal evaluation episodes. Each generation runs one clean, one defense-only, five attack-only, and fifteen joint episodes (three per attacker): formal evaluations.
3.3 Mission-Grounded Evaluation
Driving reward and revision feedback. Blue's terminal reward is +1 for reaching the goal, -1 for collision or off-road departure, and 0 for timeout or no progress; Red receives its negative. Timeouts are draws regardless of how far the car travels. Terminal rewards do not capture partial mission recovery, so a separate quality score exposes differences in progress and speed for revision.
Let be the start-to-goal distance and the greatest recorded progress, giving the route fraction , set to one on goal completion. Let be peak vehicle speed and the clean-baseline peak, giving . Driving quality is , with and . Progress rewards task completion, while retained speed discourages a slow defensive takeover and encourages preserving Autoware's nominal driving behavior. This is a lightweight proxy. Quality informs revision but is not added to the terminal reward.
Humanoid quality and reward. A faster fall should not outscore a completed walk, so humanoid quality separates partial progress from completion:
Here, is progress along the route and is peak body walking speed relative to the clean baseline. Failed episodes are rewarded for progress; speed distinguishes successful walks.
Unlike driving, humanoid evaluation includes attack-only and repeated joint episodes, allowing reward to measure how much attack-induced loss Blue restores. Let be the quality in a clean episode, be the quality in an attack-only episode, and quality in joint episode :
Thus, means no improvement over attack-only and restores clean quality. For gaps below 0.05, recovery falls back to goal completion: 1 if reached and 0 otherwise.
Blue's reward is the median of the three joint-episode recovery scores; Red receives its complement. The median limits the effect of one lucky success or one failed episode. A matchup is eligible when the attack disrupts the undefended mission, the defense preserves the defense-only mission, and the joint episodes are valid. Blue's lowest eligible reward guides revision toward its weakest defense.
4 Experimental Results
4.1 Experimental Setup
Table 1 summarizes the two robotic platforms, agent configurations, attacker allocation, and evaluation settings. Across both studies, we trace implemented attack and defense revisions and link them to their resulting mission outcomes.
Table 1: Evaluated configurations. Each uses one eight-generation run and one shared defender per generation.
| Driving | Humanoid | |
|---|---|---|
| Task | 60 m clear-road route | 3 m flat-ground walk |
| Robot software | Autoware in CARLA | G1 policy + navigation in MuJoCo |
| Coding harness | Claude Code / Opus | Claude Code / Sonnet |
| Agent budget | 40 min per session | 60 min per session |
| Attacker roles | Five fixed | Five orchestrated |
| Joint episode repetitions | One per attacker | Three per attacker |
| Additional controls | Initial clean trial | Clean, defense only, attack only |
| Execution | Sequential; stack reset | Up to 16 isolated parallel slots |
4.2 Driving
Across 40 driving matches, 18 reach the goal, 16 time out, and 6 end in collision. The evaluated route contains no other traffic. Figure 2 summarizes these outcomes, while the progression below highlights how wins and losses shift across generations as new attacks defeat prior defenses, countermeasures regain ground, and some failures persist despite adaptation.

Figure 2: Driving. A crash, collision, or off-road event results in an attacker win; successful completion results in a defender win; and a timeout results in a tie.

Figure 3: Humanoid. Each box summarizes an orchestrator-assigned task, grouped by attack type. Solid arrows show continuation of a strategy while dashed arrows show borrowed mechanisms. Blue marks eligible matchups where the median of the three joint-episode recovery scores is 1; red marks the remaining eligible matchups. Gray marks attacks that do not disrupt attack-only execution and are excluded from scoring.
Generations 1-3: Initial message repairs do not prevent five timeouts in generation 2. Blue identifies a common downstream effect across false objects, zero speed limits, and stop requests. Generation 3 introduces a recovery driver at their shared actuation interface, and all five matches reach the goal.
Generation 4: The recovery driver disables its bypass when it detects another publisher on /control/command/actuation_cmd. The control attacker deliberately publishes there, triggering the stand-down; the match ends in collision.
Generations 5-6: Red shifts toward targeting the new defense itself. Perception targets the recovery driver’s LiDAR inputs, Control increases command publication, and Chained competes with Blue’s throttle through braking. Blue responds with map and lane based recovery and dedicated command handling. In generation 6, Failsafe exploits apparent goal arrival, producing a timeout.
Generations 7-8: Blue adds arrival cross-checks, stall detection, lane-center recovery, and counter-steering. Red responds with intermittent false obstacles and incorrect-path motion intended to evade these checks. Perception and Planning reach the goal in both generations, while Failsafe recovers by generation 8.
Figure 4 shows representative cases where adaptation succeeds and where attacks continue to break the defense. The humanoid study provides a complementary view, using attack-only controls and repeated joint episodes to separate attack effectiveness from defensive recovery.

(a)
(b)
(c)
(d)
Figure 4: Driving. Each column progresses from top to bottom, pairing the Autoware visualization (left) with the simulated vehicle (right). (a) the attacker overwhelms the defender with competing steering commands; (b) the defender mitigates fabricated vehicle detections; (c) a false arrival signal prevents mission completion; (d) the attacker progressively reduces the speed limit to 0 km/h.
4.3 Humanoid
Across 176 formal humanoid evaluations (8 clean, 8 defense-only, 40 attack-only, and 120 joint), 51 reach the goal. All clean and defense-only episodes succeed, while 30 of 40 attack-only episodes disrupt the mission. Of the 120 joint episodes, 25 reach the goal, including 11 of 90 corresponding to attacks that disrupt attack-only execution. Agents also run 253 development tests, 57 against frozen opponents. Figure 3 traces how the orchestrator's attack assignments evolve across generations alongside their outcomes against the defender. The following analysis examines how attacks and defenses change in response to earlier outcomes.
Generations 1-3: Blue initially checks message order and position plausibility. Its SDK notes expose the next weakness: old state can appear newer, while small position changes can accumulate over time. Blue adds orientation checks and bounds on tick advancement and cumulative drift. Nevertheless, generation 3 produces no joint episode that reaches the goal.
Generations 4-5: Blue’s earlier filter rejects large tilt readings, yet IMU spoofing still causes falls. Its notes identify the gap: early values in Red’s gradual false-tilt ramp still pass the filter. In generation 4, Blue lowers the accepted IMU tilt from 0.35 to 0.22 rad; two of three joint episodes then reach the goal. The orchestrator retires IMU spoofing but retains the command attacks, while new joint-state and route-drift roles target other inputs.
Generations 6-8: The goal-spoofing role introduced in generation 6 targets the filter’s initial position reference. Generation 7 adds a bound referenced to the known start and rejects samples on validation errors. A later goal-spoofing attack instead ramps reported progress below the existing speed limit, while a new IMU-drift role keeps angular-velocity bias below Blue’s threshold. Blue responds in generation 8 by tightening both checks.
Figure 5 visualizes this progression through representative rollouts. Across both studies, agents repeatedly respond to each other's revisions: defenses recover specific failures, later counterattacks target those defenses, and some attack classes remain unresolved.

(a)
(b)
(c)
(d)
(e)
Figure 5: Humanoid. Each column progresses from top to bottom. The red marker indicates the goal. (a) IMU spoofing causes a fall without defense; (b) the defender mitigates the same attack; (c) Position drift sends the robot off-route; (d) Combined sensor spoofing and motor-command injection and (e) competing actuator commands both cause falls.
5 Limitations and Future Work
Scenario robustness. Each configuration has one eight-generation lineage and a simple task. To establish broad robustness, future studies should broaden scenario and task conditions.
Evaluation metrics. Both quality functions use peak speed and progress rather than comprehensive safety, smoothness, or control provenance. Their normalized values are configuration-specific. Clipping and median aggregation can obscure residual failures.
Agent ablations. We do not isolate which feedback mechanisms most improve agent learning. Future work should ablate tested opponent code, prior-match history, development sparring, and continuous quality feedback to determine which most improve adaptation across generations.
Future defender orchestrator. A future defender orchestrator could distribute development among specialists, but their changes must share SDK hooks, state, and command authority. Merge checks, rollback, and tests against historical attacks are needed to add protections without removing or conflicting with earlier ones.
6 Conclusion
We present a framework for program-level adversarial co-adaptive self-play using executable robotic software, opponent artifacts, and mission feedback. Two eight-generation studies trace direct task recovery and SDK-based defensive responses while revealing recurrent failures. The results motivate studying how opposing programs change, with explicit intervention authority, behavior-linked feedback, and historical-opponent regression.
References
[1] VulnCheck. Unitree Go2 Missing DDS Authentication Enables Adjacent RCE, 2026. CVE-2026-27509. Advisory, February 26.
[2] J. Liang, W. Huang, F. Xia, P. Xu, K. Hausman, B. Ichter, P. Florence, and A. Zeng. Code as policies: Language model programs for embodied control. arXiv preprint arXiv:2209.07753, 2022. doi:10.48550/arXiv.2209.07753. URL https://arxiv.org/abs/2209.07753. Revised 2023.
[3] G. Wang, Y. Xie, Y. Jiang, A. Mandlekar, C. Xiao, Y. Zhu, L. Fan, and A. Anandkumar. Voyager: An open-ended embodied agent with large language models. arXiv preprint arXiv:2305.16291, 2023. doi:10.48550/arXiv.2305.16291. URL https://arxiv.org/abs/2305.16291.
[4] M. Robeyns, M. Szummer, and L. Aitchison. A self-improving coding agent. arXiv preprint arXiv:2504.15228, 2025. doi:10.48550/arXiv.2504.15228. URL https://arxiv.org/abs/2504.15228.
[5] Y. Meng, S. Li, J. Huang, J. Jin, P. Wang, H. Jiang, A. Yusof, P. Jiang, Z. Liang, Y. Guo, and D. Li. SysEvolve: An AI-native, safe, autonomous adversarial attack-defense co-evolutionary system. arXiv preprint arXiv:2608.15012, 2026. doi:10.48550/arXiv.2608.15012. URL https://arxiv.org/abs/2608.15012. Technical report.
[6] J. Yang, K. Lieret, J. Yang, C. E. Jimenez, M. Oblokulov, A. Siddiqui, O. Press, L. Schmidt, and D. Yang. CodeClash: Benchmarking goal-oriented software engineering. arXiv:2511.00839, 2025. Version 2, May 2026.
[7] H. Li, Z. Ge, Z. Zhang, X. Yuan, Y. Lo, Q. Liu, B. An, D. Rong, J. Liu, A. Li, J. Wu, D. Yin, and D. Shen. Beyond static evaluation: Co-evolutionary mechanisms for LLM-driven strategy evolution in adversarial games. arXiv:2606.10389, 2026.
[8] A. Sygkounas, R. Hazra, A. Persson, P. Zuidberg Dos Martires, and A. Loutfi. COvolve: Adversarial co-evolution of large-language-model-generated policies and environments via two-player zero-sum game. arXiv:2603.28386, 2026.
[9] E. Hemberg, E. Liu, L. Fuller, S. Moskal, and U.-M. O'Reilly. Evolutionary and coevolutionary multi-agent design choices and dynamics. arXiv:2507.05534, 2025.
[10] L. Huang, Z. Liu, J. Zhang, L. Yan, D. Liu, and J. Shao. RvB: Automating AI system hardening via iterative red-blue games. arXiv:2601.19726, 2026.
[11] A. Zheng and T. Zhu. ZERO-APT: A closed-loop adversarial framework for LLM-driven automated penetration testing under intelligent defense. arXiv:2606.05567, 2026.
[12] S. Kim and T. Kim. RoboFuzz: Fuzzing robotic systems over robot operating system (ROS) for finding correctness bugs. In Proceedings of ESEC/FSE 2022. ACM, 2022. doi:10.1145/3540250.3549164.
[13] M. Somma, M. Großpointner, P. Zabalegui, E. Heilimo, and B. Stojanović. Environment-grounded multi-agent workflow for autonomous penetration testing. arXiv:2603.24221, 2026.
[14] M. W. Haque, S. Dasgupta, M. Rahman, and M. R. Rahman. LLM-assisted dynamic threat analysis for attacker-reachable software weaknesses in autonomous vehicles. arXiv preprint arXiv:2608.13450, 2026. doi:10.48550/arXiv.2608.13450. URL https://arxiv.org/abs/2608.13450.
[15] A. Robey, Z. Ravichandran, V. Kumar, H. Hassani, and G. J. Pappas. Jailbreaking LLM-controlled robots. arXiv:2410.13691, 2024.