Security measures taken to protect your applications.
ARCJET_KEY
environment variable.web
and app
apps have Arcjet configured with a central client at @repo/security
that includes the Shield WAF rules. Each app then extends this client with additional rules:
web
app, bot detection and the Arcjet Shield WAF are both configured in the Middleware to block scrapers and other bots, but still allow search engines, preview link generators, and monitoring services. This will run on every request by default, except for static assets.
app
, the central client is extended in the authenticated route layout in apps/app/app/(authenticated)/layout.tsx
with bot detection to block all bots except preview link generators. This will run just on authenticated routes. For additional protection you may want to configure Arcjet on the apps/app/app/(unauthenticated)/layout.tsx
route as well, but Clerk includes bot detection and rate limiting in their login route handlers by default.
When a rule is triggered, the request will be blocked and an error returned. You can customize the error message in code, redirect to a different page, or handle the error in a different way as needed.