Arcjet skills: protect routes and agent tool calls
Arcjet skills
Five agent skills that wire Arcjet protection into JavaScript: rate limits, bots, Shield, prompt injection and guards on tool calls
- 700 ★ on the repository
- Last commit
- Apache-2.0
Extended access
Why this level
- The `cli` skill signs in to your Arcjet account and writes `ARCJET_KEY` into the project, and the remote MCP server manages rules through OAuth
- Protection changes who gets through and who is blocked: wrong rules lock out real users or leave a route open
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/arcjet-skillsDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The `cli` skill signs in to your Arcjet account and writes `ARCJET_KEY` into the project, and the remote MCP server manages rules through OAuth
- Protection changes who gets through and who is blocked: wrong rules lock out real users or leave a route open
This is third-party code. Review the repository files before installing.
What it does
The `@arcjet/skills` package gives an agent five skills for the Arcjet JavaScript and TypeScript SDK. The `protect` skill adds protection to HTTP handlers in Next.js, Express, Fastify, SvelteKit, Remix, Hono, Astro, Nuxt, Bun, Deno and NestJS: rate limits, bot detection, Shield, email validation and sensitive-data detection. The `choose-protections` skill helps pick a rule for a problem, for example `detectBot`, `shield`, `tokenBucket` or `detectPromptInjection`. For code with no HTTP request, meaning agent tool calls, MCP handlers and background jobs, there is the `guard` skill. It wires in `@arcjet/guard` with rules like blocking prompt injection and limiting the rate of agent actions. For specific frameworks such as LangChain, Mastra and the OpenAI Agents SDK, the `@arcjet/guard` package carries separate integration skills. The `cli` and `mcp` skills obtain a real `ARCJET_KEY`: through `npx @arcjet/cli` with an account sign-in, or through the remote Arcjet MCP server. The skills are versioned together with the package, so their content matches the SDK in `node_modules`. TanStack Intent finds the `SKILL.md` files as static files without executing package code.
Who it is for. For JavaScript and TypeScript developers who ask Claude Code, Cursor or another agent to protect an API, a login form or an AI agent's tools and do not want to explain Arcjet from scratch.
Good fit when
- You need to cover a Next.js or Express route with rate limits, bot detection and Shield, and the agent must detect the framework itself
- You are choosing between `detectBot`, `shield` and rate limits and want a table matching problems to rules
- An agent calls tools or MCP handlers and the arguments must be checked for prompt injection
- The agent needs a working key: the `cli` skill signs in through `npx @arcjet/cli` and writes `ARCJET_KEY`
- A team wants skill versions that match the SDK version
Not a fit when
- The project is not JavaScript or TypeScript: the `protect` skill tells the agent to stop if the language differs
- You need protection with no external service: Arcjet requires an account and a key, and some rules work through its cloud
- The app is reachable directly, with no proxy that overwrites forwarding headers: a client address taken from `X-Forwarded-For` can be spoofed
- You only want the SDK with no skills: then the `arcjet` package and its documentation are enough
Example request
Load the protect skill from @arcjet/skills and protect the POST /api/login route: rate limit, bot detection and Shield. Get the key through the cli skillLimitations
The skills cover only the Arcjet SDK for JavaScript and TypeScript. Protecting code outside HTTP needs `@arcjet/guard` on Node.js 22.21 or newer in the 22 line, or 24.5 and newer. Without an account and an `ARCJET_KEY`, protection will not work, and the `cli` skill needs a browser sign-in to an account.
The `@arcjet/skills` package connects through TanStack Intent: it finds skills in `node_modules`, and you set the list of allowed packages in `package.json` yourself. If the `intent.skills` key is missing, every discovered package with skills gets attached and the tool prints a warning about it. A `"*"` entry means trusting skills from the whole dependency tree.
The remote MCP server lives at `https://api.arcjet.com/mcp`, sign-in goes through OAuth, and the author advises turning on write confirmations. When the client address comes from forwarding headers, Arcjet logs one warning per client instance.
How to disable. Remove the package with `npm uninstall @arcjet/skills`, delete the `intent` block from `package.json` and the Arcjet entry in `AGENTS.md` that `intent install` added. If you installed through `npx skills add arcjet/skills`, delete the skills from the agent's skills folder.
FAQ
How do I install the Arcjet skills?
Run `npm install @arcjet/skills`, then `npx @tanstack/intent@latest install`: the command finds skills in `node_modules` and writes instructions into `AGENTS.md`. A separate route is `npx skills add arcjet/skills`, but the versioned package matches the SDK better.
Which skills are in the package?
Five: `protect` for HTTP routes, `choose-protections` for choosing rules, `guard` for code with no HTTP, `cli` for sign-in and the key, `mcp` for connecting the remote MCP server. Integration skills for LangChain, Mastra and others live in `@arcjet/guard`.
How do I get ARCJET_KEY?
Run `npx @arcjet/cli auth login`, pick a team and a site, and the `cli` skill writes the key. The alternative is to sign up at `app.arcjet.com` or connect the Arcjet MCP server.
How do I connect the Arcjet MCP server?
The server address is `https://api.arcjet.com/mcp`, and sign-in uses OAuth on the first connection. The `mcp` skill describes setup for Cursor and other clients and recommends turning on write confirmations. If a terminal with the CLI is available, prefer the `cli` skill.
Is there a plugin for Claude Code?
Yes, the README links to an Arcjet plugin for Claude Code and Cursor in the documentation. It bundles skills, MCP and coding rules in one install.
Discussion
No questions or reviews yet.
Related
SkillsA security scanner for agent skills: finds prompt injection, data exfiltration and malicious code before you install
Auth0's official skill: it detects the project framework and adds authentication step by step through the right SDK.
Cybersecurity Skills
Cybersecurity Skills for AI Agents
42 security skills for Claude Code, Cursor and Codex: code and cloud audits, authorization-gated pentesting and incident response
Security scanner for agent skills and MCP servers: finds prompt injection, data exfiltration and supply chain risks before install
Rust OS-level sandbox and MCP server for agent skills: process isolation, install-time scanning and self-evolution
VibeSec
VibeSec-Skill
A secure coding skill: the agent looks at code from a bug hunter's perspective and prevents common web vulnerabilities
README in short
The Arcjet guide walks through three steps: CLI sign-in, skill installation and package installation. It continues with a warning about spoofed client addresses and rule examples for different frameworks. The skills package README covers trust, the allowlist and the typed manifest.
README badge
Original SKILL.md
---
name: protect
description: Add Arcjet request protection to JavaScript and TypeScript HTTP handlers. Use when protecting Next.js, Express, Fastify, SvelteKit, Remix, React Router, Hono, Astro, Nuxt, Bun, Deno, NestJS, or Node.js routes with rate limiting, bot detection, Shield, email validation, or sensitive info detection.
license: Apache-2.0
compatibility: JavaScript and TypeScript HTTP apps using an @arcjet/* framework adapter.
metadata:
author: arcjet
type: core
library: "@arcjet/skills"
library_version: "1.15.0" # x-release-please-version
sources:
- docs/protect.md
---
# Protect HTTP routes with Arcjet
Use this skill for HTTP route handlers. If there is no request object (tool
calls, MCP handlers, queue workers), load `@arcjet/skills#guard` instead.
Load `@arcjet/skills#choose-protections` when you need to pick rules.
Load `@arcjet/skills#cli` to get an `ARCJET_KEY` before writing code.
## Checklist
- [ ] Language is JS/TS (stop if not)
- [ ] Runtime is Node `>=22.21.0 <23 || >=24.5.0`, Bun ≥ 1.3.0, or Deno stable
- [ ] `ARCJET_KEY` is in the env file (CLI first; do not leave a TODO)
- [ ] Shared `arcjet()` client at module scope, `withRule()` for extras
- [ ] `protect()` inside each route handler, not middleware
- [ ] Rules that should block use `mode: "LIVE"`
- [ ] Client IP comes from trusted ingress, not a copied forwarding header
- [ ] Decisions verified with a real request plus CLI or Console
## Client
```ts
import arcjet, { shield, detectBot } from "@arcjet/next";
export const aj = arcjet({
key: process.env.ARCJET_KEY!,
rules: [
shield({ mode: "LIVE" }),
detectBot({ mode: "LIVE", allow: ["CATEGORY:SEARCH_ENGINE"] }),
],
});
```
Pick the adapter the app already uses (`@arcjet/next`, `@arcjet/node`,
`@arcjet/fastify`, …). Install it with the project's package manager. Do not
hand-edit `package.json` and guess a version.
Omitted `mode` is `DRY_RUN`. `detectBot` requires exactly one of `allow` or
`deny`. `detectPromptInjection` takes `mode` only — no `threshold`.
One client. `withRule()` clones share the decision cache. A second