Research map / Reinforcement learning / Visual and representation RL
APIRL: Deep Reinforcement Learning for REST API Fuzzing
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes APIRL, a DQN-based deep RL tool that mutates HTTP request templates to fuzz REST APIs, using a pre-trained RoBERTa embedding of JSON responses as state feedback.
Problem
Black-box REST API fuzzing is inefficient: existing tools use undirected search or simplistic status-code feedback, and miss contextual information in response bodies, requiring many test requests to find server-side bugs.
Approach
A DQN agent with a fixed set of 23 request-mutation actions, whose observation combines a RoBERTa embedding (pre-trained by masked language modelling on 2566 API responses) of the HTTP response with functional features; it is trained once on Generic University and then applied black-box to unseen APIs.
Key results
- APIRL finds 3 unique bugs on VAmPI vs 2.4 for the best baseline, and 10.2 on Spree vs 1.75 for MINER, using fewer requests.
- APIRL finds at least 6.4% more bugs than all baselines across 26 REST APIs (823 operations), and improves coverage over RestTestGen, ARAT-RL and MINER by 13.6%, 49.7% and 40.6%.
- Ablation: the PPO variant finds the fewest bugs and has 9.9% lower coverage than APIRL; removing the transformer reduces coverage by 8.4%.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| use learned DQN action selection instead of random actions | APIRL · vAPI | Unique bugs: 7.6 (1.1) -> 9.5 (0.6) | Helped |
| use learned DQN action selection instead of random actions | APIRL · Spree | Unique bugs: 2.25 (1.0) -> 10.2 (0.8) | Helped |
| remove transformer embeddings (ablation) | APIRL · All APIs | Coverage: 95.6% -> 87.2% | Hurt |
| remove transformer embeddings (ablation) | APIRL-cov · All APIs | Coverage: 96.4% -> 92.4% | Hurt |
| replace DQN with PPO (ablation) | APIRL · All APIs | Coverage: 95.6% -> 85.7% | Hurt |
| replace DQN with PPO (ablation) | APIRL-cov · All APIs | Coverage: 96.4% -> 90.8% | Hurt |
| use status-code ratio reward (ablation) | APIRL · All APIs | Coverage: 95.6% -> 87.2% | Hurt |
| use sparse uniform status-code reward (ablation) | APIRL · All APIs | Coverage: 95.6% -> 92.4% | Hurt |
| use ARAT-RL-style reward (ablation) | APIRL · All APIs | Coverage: 95.6% -> 90.7% | Hurt |
| use coverage-based reward instead of status-code reward (ablation) | APIRL · All APIs | Coverage: 95.6% -> 96.4% | Helped |
| use sparse uniform coverage reward instead of coverage reward (ablation) | APIRL-cov · All APIs | Coverage: 96.4% -> 97.6% | Helped |
| use coverage-ratio reward instead of coverage reward (ablation) | APIRL-cov · All APIs | Coverage: 96.4% -> 92.4% | Hurt |
Surprising findings
- Coverage-based rewards gave more coverage but fewer bugs per request than the status-code reward; the uniform and ratio rewards performed poorly.
- PPO produced zero invalid requests but found the fewest bugs, apparently getting stuck in local optima.
Limitations
- The action set cannot add arbitrary key-value pairs beyond schema keys, so some bugs are missed (7 bugs missed relative to the union of tools).
- Tested on locally deployed APIs rather than live services for ethical reasons.
- Transformer pre-training data and RL training on a single didactic API may bias performance.
Experimental setup
Datasets: Generic University SwaggerHub-crawled REST API responses (2566 responses, 1283 operations)
Benchmarks: VAmPI vAPI c{api}tal Spree Commerce BitBucket WordPress
Metrics: unique bugs (5XX) line coverage number of requests LoC per request
Baselines: EvoMaster RestTestGen DeepREST ARAT-RL MINER Rand-APIRL
Builds on: DQN prioritised experience replay RoBERTa ARAT-RL MINER
Closest papers by meaning
- TTRL: Test-Time Reinforcement Learning (NeurIPS 2025 · similarity 0.82)
- WebRL: Training LLM Web Agents via Self-Evolving Online Curriculum Reinforcement Learning (ICLR 2025 · similarity 0.82)
- Learning to Generate Unit Test via Adversarial Reinforcement Learning (ICLR 2026 · similarity 0.81)
- TAI3: Testing Agent Integrity in Interpreting User Intent (NeurIPS 2025 · similarity 0.81)
- Cheaper and Faster: Distributed Deep Reinforcement Learning with Serverless Computing (AAAI 2024 · similarity 0.81)
- ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIs (ICLR 2024 · similarity 0.81)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
