PHPackages                             motikan2010/gpt-waf - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. motikan2010/gpt-waf

ActiveLibrary

motikan2010/gpt-waf
===================

v1.1.1(3y ago)613[1 issues](https://github.com/motikan2010/GPT-WAF/issues)MITPHPPHP &gt;=8.0

Since Apr 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/motikan2010/GPT-WAF)[ Packagist](https://packagist.org/packages/motikan2010/gpt-waf)[ RSS](/packages/motikan2010-gpt-waf/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

GPT WAF for Laravel
===================

[](#gpt-waf-for-laravel)

This is a WAF (Web Application Firewall) using GPT-4. (Laravel only)

**Requirement : OpenAI API key for GPT-4.**

Install
-------

[](#install)

```
composer require motikan2010/gpt-waf

```

Performance
-----------

[](#performance)

### Detect

[](#detect)

[![](https://user-images.githubusercontent.com/3177297/235656055-5b5ccd06-c89b-40fc-99b8-9d6a4b727c57.png)](https://user-images.githubusercontent.com/3177297/235656055-5b5ccd06-c89b-40fc-99b8-9d6a4b727c57.png)

### Speed

[](#speed)

StatusResponse Speed**Disable** GPT WAF00.68 Sec 🚗**Enable** GPT WAF19.04 Sec 🐢Using
-----

[](#using)

### Edit routing &amp; ".env" file

[](#edit-routing--env-file)

Set "`gpt-waf`" as the middleware for routing.

```
Route::group(['middleware' => 'gpt-waf'], function () {
  // Protect area
});
```

The following changes will be enabled.

### Setting of ".env"

[](#setting-of-env)

#### Required

[](#required)

ParamDescription`GPT_WAF_ENABLED`GPT-WAF enabled or disabled.`GPT_WAF_OPEN_AI_API_KEY`OpenAI API key for GPT-4.ex.

```
GPT_WAF_ENABLED=true
GPT_WAF_OPEN_AI_API_KEY=st-tGC**********

```

#### Option

[](#option)

ParamDescription`GPT_WAF_BLOCK_STATUS_CODE`Status code at block.
(default: `403`)`GPT_WAF_DEBUG_MODE`Output "question" and "answer" to log.
(default: `false`)`GPT_WAF_QUESTION_TEXT`Beginning of message when asking a question to GPT.
By default, the question is asked with the following text.
`Begin your answer with 'Yes' or 'No'.\nIs the following HTTP request a cyber attack?(Beware of false positives.)\n-----``GPT_WAF_SYSTEM_ROLE`GPT role(system).
(default: `You are Security engineer.`)ex.

```
GPT_WAF_BLOCK_STATUS_CODE=403
GPT_WAF_DEBUG_MODE=true
GPT_WAF_SYSTEM_ROLE=
GPT_WAF_QUESTION_TEXT=

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

3

Last Release

1109d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.0

v1.1.1PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/a5901067ca694e74bfea5606dd1cb5756bcecdc4f048df59a965f5d377fa3364?d=identicon)[motikan2010](/maintainers/motikan2010)

---

Top Contributors

[![motikan2010](https://avatars.githubusercontent.com/u/3177297?v=4)](https://github.com/motikan2010 "motikan2010 (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/motikan2010-gpt-waf/health.svg)

```
[![Health](https://phpackages.com/badges/motikan2010-gpt-waf/health.svg)](https://phpackages.com/packages/motikan2010-gpt-waf)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
