PHPackages                             promptphp/intercept - 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. [Security](/categories/security)
4. /
5. promptphp/intercept

ActiveLibrary[Security](/categories/security)

promptphp/intercept
===================

A modular, drop-in middleware kit for Laravel AI agents. Protect, observe, and govern your AI agents with granular, install-what-you-need middleware packages.

v0.1.7(2w ago)55167↑2450%2[4 issues](https://github.com/promptphp/intercept/issues)MITPHPPHP ^8.4.0CI passing

Since Jun 19Pushed 2w agoCompare

[ Source](https://github.com/promptphp/intercept)[ Packagist](https://packagist.org/packages/promptphp/intercept)[ Docs](https://intercept.promptphp.com)[ Fund](https://www.paypal.com/paypalme/veeqtoh)[ GitHub Sponsors](https://github.com/veeqtoh)[ RSS](/packages/promptphp-intercept/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (7)Dependencies (18)Versions (8)Used By (0)

 [![Intercept by PromptPHP](docs/logo/intercept-banner-dark.jpg)](docs/logo/intercept-banner-dark.jpg)

 [![Build Status](https://github.com/promptphp/intercept/actions/workflows/tests.yml/badge.svg)](https://github.com/promptphp/intercept/actions) [![Latest Version on Packagist](https://camo.githubusercontent.com/54fa1103ff1bfb41346977a470e4477ccaaac6408453ea64a0014284110386be/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70726f6d70747068702f696e746572636570743f7374796c653d666c61742d737175617265)](https://packagist.org/packages/promptphp/intercept) [![Downloads](https://camo.githubusercontent.com/1fd3efde3fd60810214a33a95cdbe42823af20c54ea36ad9efbdf7caced43583/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70726f6d70747068702f696e746572636570743f7374796c653d666c61742d737175617265)](https://packagist.org/packages/promptphp/intercept) [![License](https://camo.githubusercontent.com/0c500ee4639ce032badc2a1a1c8789ffbd1b8da89695f9cdb1fc9549415993a5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70726f6d70747068702f696e74657263657074)](https://github.com/promptphp/intercept/blob/main/LICENSE) [![Featured in Laravel News](https://camo.githubusercontent.com/1c1d699e17124bfe9da504b23f4612249aaefca82f52cb3fb251116edd25f677/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4665617475726564253230696e2532304c61726176656c2532304e6577732d4639333232433f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)](https://laravel-news.com/intercept-middleware-guardrails-for-laravel-ai-agents/) [![Demo Video](https://camo.githubusercontent.com/3fb83ca730f7c2c2309ff46aefb4ff0464b2a4618ff29b823e1f13c8d8a0cb52/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f44656d6f2d2532334646303030302e7376673f7374796c653d666c61742d737175617265266c6f676f3d596f7554756265266c6f676f436f6c6f723d7768697465)](https://www.youtube.com/watch?v=vFIfnufTYGQ)

Introduction
------------

[](#introduction)

Intercept is a modular, drop-in collection of reusable AI agent middleware for the [Laravel AI SDK](https://github.com/laravel/ai) offering middleware across security, observability, performance and guidance. It works by siting between your AI agent and your AI provider providing guardrails to prompts before they reach the provider, just like a typical HTTP middleware that sits between the route and your app's business logic.

### Demo

[](#demo)

Watch a quick demo of Intercept in action.

[![Intercept Demo](https://camo.githubusercontent.com/f5284a33335be5671abc9f1b8c1919e3ecf41f3b6c8327a102c0f34e779f2ea9/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f764649666e7566545947512f302e6a7067)](https://www.youtube.com/watch?v=vFIfnufTYGQ)

Requirements
------------

[](#requirements)

Important

Requires PHP 8.4+ and `laravel/ai`.

AI Agent Middleware collection
------------------------------

[](#ai-agent-middleware-collection)

Documentation on the full suite of middleware is available on the [documentation site](https://intercept.promptphp.com). The [roadmap](ROADMAP.md) provides an overview of planned features, upcoming middleware, and the project's future direction, while the [changelog](CHANGELOG.md) documents notable changes between releases.

Official Documentation
----------------------

[](#official-documentation)

Official documentation can be found at  or the [docs](docs/) directory on GitHub.

Code of Conduct
---------------

[](#code-of-conduct)

We follow the Laravel [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). We expect you to abide by these guidelines as well.

License
-------

[](#license)

Intercept by PromptPHP is open-sourced software licensed under the [MIT license](LICENSE).

Support
-------

[](#support)

This library is created by [Victor Ukam](https://victorukam.com) with contributions from the [Open Source Community](https://github.com/promptphp/Intercept/graphs/contributors). If you've found this package useful, please consider [sponsoring this project](https://github.com/sponsors/veeqtoh). It will go a long way to help with maintenance.

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance95

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~5 days

Total

7

Last Release

16d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19429315?v=4)[Victor Ukam](/maintainers/veeqtoh)[@veeqtoh](https://github.com/veeqtoh)

---

Top Contributors

[![veeqtoh](https://avatars.githubusercontent.com/u/19429315?v=4)](https://github.com/veeqtoh "veeqtoh (24 commits)")[![Falgunimoridhara](https://avatars.githubusercontent.com/u/6088011?v=4)](https://github.com/Falgunimoridhara "Falgunimoridhara (2 commits)")[![nexxai](https://avatars.githubusercontent.com/u/4316564?v=4)](https://github.com/nexxai "nexxai (1 commits)")

---

Tags

ailaravellaravel-ailaravel-ai-sdkmiddlewareobservabilitypiipii-detectionpii-redactionprompt-injectionsecuritysecurity-toolsmiddlewarelaravelsecurityperformanceaiAgentrate limitingobservabilitygovernanceprompt-injectionpromptphppii-redactionsemantic-caching

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/promptphp-intercept/health.svg)

```
[![Health](https://phpackages.com/badges/promptphp-intercept/health.svg)](https://phpackages.com/packages/promptphp-intercept)
```

PHPackages © 2026

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