Security middleware that follows your AI agents off the web
Arcjet gives JavaScript AI apps runtime guardrails for prompt injection, tool-call authorization, and data redaction—whether they’re handling HTTP requests or running headless agent tasks.
What it does
This runtime security toolkit for TypeScript apps intercepts AI actions before they execute. It scans for prompt injection, sensitive data leaks, bots, and rate limits by calling protect() or guard() directly inside your code rather than at a network edge. The library ships as framework-specific SDKs for web routes and a separate @arcjet/guard package for agent tool calls and background jobs.
The interesting bit
Most security middleware assumes an HTTP request context, but the project explicitly splits its model: @arcjet/next and friends handle web traffic, while @arcjet/guard secures MCP server handlers, queue workers, and agent tool calls that have no incoming Request object. That distinction matters as AI agents increasingly operate outside traditional request/response cycles.
Key highlights
- Detects prompt injection and sensitive information (PII, credit cards) before content reaches the model
@arcjet/guardbrings rate limiting, prompt injection detection, and custom rules to non-HTTP contexts like MCP servers- Web SDKs add bot protection, WAF-style shielding, email validation, and IP analysis for traditional routes
- Supports a wide range of runtimes: Next.js, Bun, Deno, SvelteKit, Astro, NestJS, and others
- Some features are mode-specific: custom local rules are Guard-only, while bot protection and WAF are Request-only
Caveats
- Requires an Arcjet service account and API key; the open-source SDKs appear to be clients for a hosted platform
Verdict JavaScript developers building AI agents or MCP servers that need inline security checks will find the Guard mode genuinely useful. Teams seeking fully offline or purely self-hosted security should look elsewhere, since the platform relies on a hosted service tier.
Frequently asked
- What is arcjet/arcjet-js?
- Arcjet gives JavaScript AI apps runtime guardrails for prompt injection, tool-call authorization, and data redaction—whether they’re handling HTTP requests or running headless agent tasks.
- Is arcjet-js open source?
- Yes — arcjet/arcjet-js is open source, released under the Apache-2.0 license.
- What language is arcjet-js written in?
- arcjet/arcjet-js is primarily written in TypeScript.
- How popular is arcjet-js?
- arcjet/arcjet-js has 676 stars on GitHub.
- Where can I find arcjet-js?
- arcjet/arcjet-js is on GitHub at https://github.com/arcjet/arcjet-js.