Battle Drones: Treating a Vibe-Coded Game's Audio Link as Untrusted Input
Simon Willison's agent-built RTS syncs multiplayer state over sound between nearby devices. As a design, it is a small, useful case study in out-of-band channels, determinism and trusting AI-generated code.
Key Takeaways
- Battle Drones, built mostly by coding agents, supports two-device multiplayer in microphone range by sending game messages as audio.
- Any channel that accepts data from a nearby device is an input surface; the source does not describe validation or anti-cheat on the audio link.
- Deterministic simulation made sync possible, and a cross-browser maths mismatch (Chrome vs Safari) showed how fragile that assumption is.
- The author says he had little time to test the audio multiplayer, so it is an experiment, not a hardened design.
What was built
Simon Willison describes Battle Drones as a Command & Conquer-style real-time strategy game, built as static HTML and JavaScript so it costs nothing to host. Most of its 321 commits were made by coding agents, mainly Claude Code. It runs offline as a Progressive Web App.
The notable feature is multiplayer. Two devices within microphone range of each other play together, with audio carrying the game messages. According to the write-up, Claude first built a "Radio Probe" tool to measure usable bandwidth between devices, then implemented an audio modem system. The author reports it working between laptops, iPhones and iPads, but says he had not had much time to test it.
Why a security team should care
None of this is a vulnerability disclosure, and the source does not claim a security issue. It is interesting to us for the design pattern: a sound-based data link means a microphone is now an input to the application. Anything within earshot can, in principle, produce bytes the game will try to parse.
The write-up does not mention validation, anti-cheat or trust handling on the audio link, so we make no claim about how it behaves. For readers building something similar, the questions are standard ones:
- Authentication: can a third device in range inject or replay messages into a session?
- Parsing: is every decoded message length-checked and schema-validated before it touches game state?
- Authority: does each peer trust the other's reported state, or only its inputs?
Prior art the author cites is ggwave, a library for exchanging small amounts of data by sound. It uses FSK modulation with Reed-Solomon error correction and has a low data rate of roughly 8-16 bytes per second. The source does not say whether Battle Drones uses it. The low bandwidth is still a reminder that such links favour compact messages, such as player inputs, over full state, and that matters for what must be validated.
Determinism is a trust assumption
Replays and multiplayer both depend on a deterministic simulation. The author notes that Chrome and Safari returned slightly different values for Math.sin() and Math.cos(), which desynchronized replays; Claude replaced them with custom implementations. In a lockstep design where each peer re-runs the simulation, a divergence is not just a bug. It is a place where two honest peers can disagree, and where a dishonest one can hide.
The vibe-coding angle
The author admits some unease about building software this way with limited game-development background. That is the right instinct. Agent-written code gets built quickly, and the review effort rarely scales with it. For anything that accepts external input, we would review that boundary by hand and fuzz it, whoever or whatever wrote it.
Frequently Asked Questions
Is Battle Drones' audio multiplayer insecure?
The source does not say. It describes the feature and reports that testing was limited. We have not assessed the code, so this post only outlines what to check in any similar design.
Why does deterministic simulation matter for multiplayer?
If peers exchange inputs and each re-runs the simulation, they must compute identical results. The write-up shows a concrete failure: Chrome and Safari returned slightly different sin/cos values, which broke replay sync until the functions were replaced.
Should AI-generated code get extra review?
Review effort should follow risk rather than authorship. Code that parses data from outside the process, such as a microphone, network or file, deserves focused manual review and fuzzing.
Sources
- 1Battle Drones - a vibe coded RTS with audio-based multiplayer — Simon Willison
- 2ggwave: tiny data-over-sound library — GitHub (Georgi Gerganov)