← Lab /Security & privacy

MRG auto-generates OpenAPI specs and detects API attacks with 100% precision and 11.4% higher recall

The authors claim MRG achieves perfect precision and up to 11.4% higher recall than prior methods for API attack detection

Security & privacy arXiv 21 Apr 2026 Method Prototype evidence

Published as “API Security Based on Automatic OpenAPI Mapping”

Why it matters

The fast, explainable detection and automatic OpenAPI generation can improve real-time API security monitoring and reduce manual documentation effort.

Summary

MRG attains perfect 100% precision, recall and F1 on the synthetic ATRDF2 dataset and matches HRAL’s precision on other benchmarks while running up to 20× faster than FT-ANN. However, its recall drops to 69.78% on the CSIC 2010 benchmark and to 70.92% on CSIC 2010 anomaly detection, especially for obfuscated LOG4J payloads. The evidence comes from multiple dataset evaluations, but the paper notes limited body-payload analysis and lack of complex attack datasets.

What they found 2

  1. Fast per-request processing time

    “On average, MRG processes each request in 0.0002560 seconds, with the fastest case at 0.0001002 seconds and the slowest at 0.0003579 seconds.”

  2. Overall high precision and speed compared to FT-ANN

    “MRG achieved perfect precision and high recall on structured datasets such as ATRDF and ATRDF2, with fast inference times-up to 20 times faster than FT-ANN.”

Caveats 6

  • HRAL achieves perfect recall and F1 on CSIC 2010 as presented in Table V, while MRG underperforms (69.78% recall, 82.20% F1) due to its limited analysis depth on synthetic payloads.
  • MRG’s recall (0.7092) and F1 (0.8256) lag behind FT-ANN ... due to false positives (e.g., strict rules, static DL thresholds).
  • While MRG achieves strong results in detecting structural and content-based anomalies, it primarily focuses on analyzing URL paths and query parameters for anomaly detection.
  • The core schema learning relies on regex-based generalization to distinguish static from dynamic segments, which may misclassify values (e.g., personal names like ”John” or ”Steve”) and lead to false positives or negatives.
  • deep analysis of request bodies is delegated to a lightweight AI-based model, which limits detection depth, particularly for obfuscated or nested payloads (e.g., embedded JSON or XML).
  • MRG also currently supports only REST over HTTP, lacking compatibility with GraphQL, gRPC, or WebSocket.

What’s new here 4

  • Unsupervised tree-graph framework that learns API schemas directly from live traffic without labeled data
  • Automatic generation of explainable OpenAPI specifications from observed traffic
  • Incremental, streaming updates and a reset mechanism for real-time adaptation
  • A new synthetic dataset (ATRDF2) for evaluating API-layer attacks