promptphp/
intercept
g4t.io

Intercept: Middleware Guardrails for Laravel AI Agents

22 views 66 stars by Yannick Lyn Fatt

A modular, drop-in middleware collection for Laravel AI SDK agents. Offers middleware across security, observability, performance and guidance.

ai laravel laravel-ai laravel-ai-sdk middleware observability pii pii-detection
README from promptphp/intercept Open on GitHub →

Introduction

Intercept is a modular, drop-in collection of reusable AI agent middleware for the Laravel AI SDK 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

Watch a quick demo of Intercept in action.

Intercept Demo

Requirements

[!Important] Requires PHP 8.3+ and laravel/ai ^1.0.

AI Agent Middleware collection

Documentation on the full suite of middleware is available on the documentation site. The roadmap provides an overview of planned features, upcoming middleware, and the project's future direction, while the changelog documents notable changes between releases.

Official Documentation

Official documentation can be found at https://intercept.promptphp.com/ or the docs directory on GitHub.

Code of Conduct

We follow the Laravel Code of Conduct. We expect you to abide by these guidelines as well.

License

Intercept by PromptPHP is open-sourced software licensed under the MIT license.

Support

This library is created by Victor Ukam with contributions from the Open Source Community. If you've found this package useful, please consider sponsoring this project. It will go a long way to help with maintenance.

More from the ecosystem

durable-workflow/
workflow
g4t.io
9 1,292

Durable Workflow: Long-Running Workflows for Laravel

Embedded durable workflow runtime and orchestration engine for Laravel applications.

durable-workflow/workflow via Laravel News
packstub/
session-replay
g4t.io
14 52

Session Replay for Laravel: Self-Hosted Browser Recordings

Session replay for Laravel: record what a person did in the browser with rrweb, keep the recording on your own disk and database, and watch it behind a gate you define — masked inputs by default, errors, failed Livewire requests and web vitals marked on the timeline, a link to the replay in every log line. packstub/filament-session-replay adds the sessions to a Filament panel.

packstub/session-replay via Laravel News
cyberwizard-dev/
schedule-catchup
g4t.io
17

Replay Missed Laravel Scheduled Tasks With Schedule Catchup

Schedule Catchup replays missed Laravel scheduled tasks after downtime, with opt-in recovery, bounded retries, and access to the original scheduled date.

cyberwizard-dev/schedule-catchup via Laravel News