Install
Add the middleware
Register the WAF after ApiTraffic and any middleware that parses request bodies, but before your routes. This lets the WAF inspect parsed request data and stop blocked requests before your application handles them.- Express
- Fastify
- Koa
- Hapi
Create a policy
- Open WAF in the ApiTraffic dashboard.
- Select Add WAF Policy.
- Choose the environments and buckets the policy protects.
- Start in Monitor mode. Matching requests continue normally while you review detections in WAF → Insights.
- Change the policy to Enforcing when you are ready to block matching requests.
Verify
- Start your application and send normal traffic through a protected endpoint.
- Open WAF → Insights and confirm that the application is reporting WAF activity.
- Review detections while the policy is in Monitor mode before switching to Enforcing.
Disable the WAF locally
Set the environment variable below as an emergency, process-level kill switch:.env