arcjet-js is a free, open source ai security & privacy project written in TypeScript and released under Apache-2.0. It has 683 GitHub stars, 31 forks and 11 open issues, and was last pushed 12 hours ago. On this registry it ranks #32 of 34 tracked projects in AI Security & Privacy, with 5 head-to-head comparisons available.

What is arcjet-js?

Arcjet for JavaScript is an Apache-2.0 TypeScript monorepo of runtime security packages that developers call directly inside JavaScript and TypeScript applications, so AI features and agents can detect prompt injection, authorize tool calls, redact sensitive data, and block bots and abuse before an action runs.

What it is

The project is the JavaScript SDK for Arcjet, described as the runtime security platform that ships in your AI code. It is a monorepo publishing several open source packages into the JavaScript and TypeScript ecosystem, split by the entry point each one protects. Request protection covers HTTP route handlers, API endpoints, and middleware — anything with an incoming Request object — through framework SDKs such as @arcjet/next, @arcjet/node, and @arcjet/bun. Guard protection covers AI agent tool calls, MCP server handlers, queue workers, and background jobs, which have no HTTP request at all, through @arcjet/guard. Both can be used in the same project.

The problem it solves is that AI features and agents take real actions: they call tools, read data, and hit APIs. Arcjet runs inside that code and lets developers enforce security on each action in real time, then audit what happened. Rather than securing only at the network edge, the SDK places the check in the call path itself, before the action happens — which is why it matters for agent workflows where a single tool call is the unit of risk.

Key capabilities

  • Prompt injection detection for AI input reaching application code.
  • Tool-call authorization for AI agent tools and MCP server handlers, via @arcjet/guard.
  • Sensitive data redaction and PII detection.
  • Bot detection and abuse blocking on incoming requests.
  • Rate limiting as one of the real-time security building blocks.
  • Framework SDKs @arcjet/next, @arcjet/node, and @arcjet/bun for HTTP route handlers, API endpoints, and middleware.
  • Client IP provenance tooling: client.clientIpDetails(request) in @arcjet/node, findIpDetails() and resolveClientIp() from @arcjet/ip, and the client_ip_provenance debug facet.

Who uses it and how

  • Next.js, Node, and Bun teams serving HTTP route handlers, API endpoints, or middleware adopt @arcjet/next, @arcjet/node, or @arcjet/bun as their request-protection path.
  • Agent builders whose work has no HTTP request — AI agent tool calls, MCP server handlers, queue workers, background jobs — adopt @arcjet/guard.
  • Teams with both surfaces run request protection and guard protection in the same project.
  • Teams that prefer agent-driven setup log in with npx @arcjet/cli auth login and install skills, or use the Arcjet plugin for Claude Code and Cursor, which bundles skills, MCP, and coding rules.
  • Deployments behind proxies or a proxy service list every trusted hop in proxies and can use a helper such as cloudflare() so client IPs stay trustworthy.

Getting started

Log in with npx @arcjet/cli auth login, or sign up and manage keys at app.arcjet.com. Then install the package for your surface — @arcjet/next, @arcjet/node, @arcjet/bun, or @arcjet/guard — or let an agent do it with npx @tanstack/intent@latest install, which discovers @arcjet/skills and @arcjet/guard from node_modules.

How it compares

The facts supplied for this page name no paid products, alternatives, or similar tools for comparison, so Arcjet for JavaScript stands alone in this registry. Any comparison against other runtimes would have to come from sources outside the facts provided here.

When to use it — and when not to

Self-hosters still need an Arcjet account and keys obtained through the CLI or app.arcjet.com, so this is not a self-contained offline component. Do not rely on client IP values if you cannot guarantee the application is reachable only through a proxy that overwrites or safely appends forwarding headers: Arcjet may fall back to headers such as X-Forwarded-For, marks the source as unverified-header, and warns once per client instance, while invalid proxy entries and non-empty malformed ipSrc values are rejected and trusting 0.0.0.0/0 or ::/0 raises a configuration warning. The package-install step in the supplied README is truncated, so the install instructions here are incomplete and should be finished from docs.arcjet.com.

project readme (upstream, from github) — read inline
Arcjet Logo

Arcjet - JS SDK

npm badge

[Arcjet][arcjet] is the runtime security platform that ships in your AI code. Detect prompt injection, authorize agent tool calls, redact sensitive data, and block bots and abuse. Real-time security building blocks you call inside your app, before an action happens.

This is the monorepo containing various [Arcjet][arcjet] open source packages for JS.

Why Arcjet?

Your app's AI features and agents take real actions, calling tools, reading data, hitting APIs. Arcjet runs inside that code and lets you enforce security on each action in real time, then audit what happened

Which package do I need?

Arcjet protects two types of entry points. Pick the right path for your use case:

Entry point When to use Package
Request protection HTTP route handlers, API endpoints, middleware — anything with an incoming Request object. @arcjet/next, @arcjet/node, @arcjet/bun, etc.
Guard protection AI agent tool calls, MCP server handlers, queue workers, background jobs — anything without an HTTP request. @arcjet/guard

Not sure? If you have an HTTP request, use a framework SDK. If you don't, use @arcjet/guard. You can use both in the same project.

Getting started

The fastest way to get started is with an AI coding agent. Log in, install a skill, and let your agent handle the rest.

Step 1: Log in with the CLI

npx @arcjet/cli auth login

You can also sign up and manage keys at app.arcjet.com, or connect the Arcjet MCP server to your AI assistant.

Step 2: Install a skill

Skills give your agent the documentation to detect your framework, install the SDK, and wire up request or guard protection rules.

npx @tanstack/intent@latest install

This discovers @arcjet/skills (and @arcjet/guard if installed) from node_modules without executing package code. Add an allowlist in your app package.json so only those packages can surface skills:

{
  "intent": {
    "skills": ["@arcjet/skills", "@arcjet/guard"]
  }
}

Load only the skill for the current task, for example npx @tanstack/intent@latest load @arcjet/skills#protect. Editor hooks from intent hooks install are convenience, not a security boundary.

The standalone marketplace install (npx skills add arcjet/skills) still works from arcjet/skills. Prefer the versioned package when you want skills that match the SDK in node_modules.

You can also use the Arcjet plugin for Claude Code and Cursor, which bundles skills, MCP, and coding rules.

Step 3: Install the package

[!WARNING] When a platform-provided client IP is unavailable, Arcjet may use forwarding headers such as X-Forwarded-For. Clients can spoof these headers if they can reach your application directly or your proxy preserves client-supplied values. Arcjet continues protecting the request, but logs one warning for the lifetime of each Arcjet client instance and marks the source as unverified-header in the client_ip_provenance debug facet.

In production, make the application reachable only through a proxy that overwrites or safely appends forwarding headers, and list every trusted hop in proxies. Use a proxy-service helper such as cloudflare() where available. Invalid proxy entries and non-empty malformed ipSrc values are rejected (ipSrc: "" remains equivalent to omitting the option); trusting 0.0.0.0/0 or ::/0 emits a configuration warning. Inspect the selection with client.clientIpDetails(request) in @arcjet/node, or findIpDetails() / resolveClientIp() from @arcjet/ip in other adapters. If your application determines the address itself, pass that validated value as ipSrc to both the debugging API and protect().

For request protection — pick the SDK for your framework:

Framework Package Install
Next.js @arcjet/next npm i @arcjet/next
Node.js @arcjet/node npm i @arcjet/node
Bun @arcjet/bun bun add @arcjet/bun
Deno @arcjet/deno deno add npm:@arcjet/deno
Express @arcjet/node npm i @arcjet/node
Fastify @arcjet/fastify npm i @arcjet/fastify
Hono @arcjet/node or @arcjet/bun npm i @arcjet/node
NestJS @arcjet/nest npm i @arcjet/nest
Nuxt @arcjet/nuxt npm i @arcjet/nuxt
Remix @arcjet/remix npm i @arcjet/remix
React Router @arcjet/react-router npm i @arcjet/react-router
SvelteKit @arcjet/sveltekit npm i @arcjet/sveltekit
Astro @arcjet/astro npm i @arcjet/astro

For guard protection:

npm i @arcjet/guard

Step 4: Tell your agent what to protect

Ask your coding agent to implement protection. The skill you installed in Step 2 gives it everything it needs. For example:

"Add Arcjet bot protection and rate limiting to my /api/chat route"

"Add Arcjet guard with prompt injection detection to my MCP tool handler"

The agent will install the right package, configure rules, and wire up protect() or guard() calls — or see the full list of protections below.

Get help

[Join our Discord server][discord-invite] or [reach out for support][support].

Features

Feature Request SDKs Guard
🛑 Rate Limiting — token bucket, fixed window, sliding window
🔒 Prompt Injection Detection — block attacks before they reach your LLM
🕵️ Sensitive Information Detection — block PII, credit cards, custom patterns
🤖 Bot Protection — stop scrapers, credential stuffers, AI crawlers
🛡️ Shield WAF — protect against SQL injection, XSS, OWASP Top 10
📧 Email Validation — block disposable, invalid, undeliverable addresses
📝 [Signup Form Protection][feature-signup-protection] — bot + email + rate limiting combined
🎯 Request Filters — expression-based rules on IP, path, headers
🌐 IP Analysis — geolocation, ASN, VPN, proxy, Tor, hosting detection
🔧 Custom Rules — define your own local evaluation logic

Request SDKs = @arcjet/next, @arcjet/node, @arcjet/bun, etc. — for HTTP routes. Guard = `@arcjet/guar

readme truncated — read the full docs on github

Frequently asked questions

Is arcjet-js free to use?

arcjet-js is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does arcjet-js do?

Runtime security for AI apps and agents: prompt injection detection, tool-call authorization, sensitive-data redaction, bot protection, and rate limiting. Drop

What is arcjet-js written in?

arcjet-js is primarily written in TypeScript. Its source is publicly available at https://github.com/arcjet/arcjet-js, and it has 683 GitHub stars.