ModSecurity was originally released in 2002 as a module for the Apache web server. The name "ModSecurity" comes from the naming convention used for Apache modules (extensions to the core Apache web server) where all modules names began with "mod" followed by the purpose of the module, such as mod_rewrite for modifying requested URLs and mod_proxy to proxy requests to other web servers.
In the many years since its initial release as an Apache module, ModSecurity became used in other web servers such as Nginx and in commercial services such as CDNs. Starting in 2015, major work began to improve ModSecurity's architecture to more easily support usage outside of Apache. In 2018, ModSecurity version 3 was released as a standalone library, called libmodsecurity, which could be more easily integrated into other software such as HeatShield.