How it works
Intercept middleware sits between your Laravel AI agent and your AI provider. Each middleware is fully customisable and can inspect the prompt and decide what should happen next. For example, Injection Guard can block prompt injection attempts before the prompt reaches the provider. PII Redactor can redact emails, phone numbers, IP addresses, and other structured sensitive data before the prompt is sent.Current middleware collection
Injection Guard
Injection Guard detects common prompt injection attempts such as “ignore previous instructions” and can take action before the prompt reaches the provider.PII Redactor
PII Redactor detects structured sensitive values such as IP addresses and can take action before the prompt reaches the provider.Configuration style
Intercept uses one shared config fileconfig/intercept.php publishable with:
Intercept use cases
Use Intercept when your Laravel app accepts user input and sends it to AI agents or providers. It is especially useful for:- public AI chat interfaces
- support agents
- internal assistants
- admin copilots
- tool-calling agents
- workflows that handle sensitive user content
What Intercept is not
Intercept is not a complete AI security platform. It is a practical middleware layer that helps you add a final line of defense before prompts reach an AI provider. It should be used alongside other controls, including:- tool permission checks
- client-side and server-side validation
- least-privilege access
- audit logging
- provider safety controls
- human approval for high-risk actions
Next step
Check out the quickstart guide to get started.Quickstart
Get started with Intercept.
Configuration
Intercept uses one shared config file
config/intercept.php for all middleware.Middleware collection
Learn about the different middleware options available in Intercept.