Arcjet is a set of JavaScript and TypeScript packages that run security checks inside your own application code, before an action happens. It covers rate limiting, prompt-injection detection, sensitive-information detection, bot protection, a shield against common web attacks, and email validation, and it records what was decided so the outcome can be audited.
There are two entry points. Request protection wraps HTTP route handlers, API endpoints, and middleware through a framework package — Next.js, Node.js, Bun, Deno, Express, Fastify, Hono, NestJS, Nuxt, Remix, React Router, SvelteKit, and Astro each have one. Guard protection covers everything without an incoming request object: agent tool calls, Model Context Protocol server handlers, queue workers, and background jobs. Both can be used in the same project.
Setup runs through the command-line interface and a skill for coding assistants, which teaches the assistant to detect your framework, install the right package, and wire up rules; an allowlist in package.json limits which packages may surface skills. A plugin for Claude Code and Cursor bundles the skills, an MCP server, and coding rules.
One operational caveat is documented for client addresses: when the hosting platform does not supply a client IP, Arcjet falls back to forwarding headers such as X-Forwarded-For, which a client can spoof if it reaches the application directly. In that case the source is marked unverified-header in a debug facet and one warning is logged per client instance. In production, reach the application only through a proxy that rewrites those headers, and list every trusted hop in the proxies option.
Features
- Rate limiting: token bucket, fixed window, and sliding window algorithms, available to both the request SDKs and guard
- Prompt injection detection: blocks injection attempts before the text reaches your model
- Sensitive information detection: flags personally identifiable information, credit card numbers, and custom patterns
- Bot protection: stops scrapers, credential stuffers, and AI crawlers on request paths
- Shield: filters SQL injection, cross-site scripting, and other OWASP Top 10 patterns
- Email validation: rejects disposable, invalid, and undeliverable addresses
- Signup form protection: combines bot detection, email validation, and rate limiting in one rule
- Request filters: expression-based rules on IP address, path, and headers
- IP analysis: geolocation, autonomous system number, and VPN, proxy, Tor, and hosting detection
- Custom rules: guard supports your own local evaluation logic alongside the built-in checks
- Framework packages: one adapter per JavaScript framework, plus @arcjet/guard for non-HTTP entry points
- Example apps and blueprints: starter projects per framework and recipes such as AI quota control and payment-form protection
