Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Expert guidance for Arcjet, the developer-first security platform that provides rate limiting, bot protection, email validation, and attack detection as a code-first SDK. Helps developers add security layers to Next.js, Node.js, and other JavaScript/TypeScript applications without managing infrastructure.
.claude/skills/terminalskills-arcjet/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 92% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 93% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 110% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 163% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 111% | 0% |
Arcjet, the developer-first security platform that provides rate limiting, bot protection, email validation, and attack detection as a code-first SDK. Helps developers add security layers to Next.js, Node.js, and other JavaScript/TypeScript applications without managing infrastructure.
Protect endpoints from abuse with flexible rate limiting:
typescript// src/lib/arcjet.ts — Configure Arcjet security rules import arcjet, { tokenBucket, slidingWindow, fixedWindow } from "@arcjet/next"; // Token bucket — allows bursts, then limits sustained rate // Good for APIs where occasional spikes are normal export const aj = arcjet({ key: process.env.ARCJET_KEY!, characteristics: ["ip.src"], // Rate limit per IP address rules: [ tokenBucket({ mode: "LIVE", // "LIVE" enforces; "DRY_RUN" logs only refillRate: 10, // Add 10 tokens per interval interval: 60, // Every 60 seconds capacity: 20, // Max burst of 20 requests }), ], }); // Sliding window — smooth rate limiting without burst allowance // Good for login endpoints where you want strict limits export const loginLimiter = arcjet({ key: process.env.ARCJET_KEY!, characteristics: ["ip.src"], rules: [ slidingWindow({ mode: "LIVE", max: 5, // 5 attempts interval: "15m", // Per 15-minute window }), ], }); // Fixed window with multiple tiers export const apiLimiter = arcjet({ key: process.env.ARCJET_KEY!, characteristics: ["http.request.headers[\"x-api-key\"]"], // Per API key rules: [ fixedWindow({ mode: "LIVE", max: 100, // 100 requests interval: "1h", // Per hour }), fixedWindow({ mode: "LIVE", max: 1000, // 1000 requests interval: "1d", // Per day }), ], });
Detect and block automated traffic:
typescript// app/api/signup/route.ts — Protect signup from bots import arcjet, { detectBot, shield } from "@arcjet/next"; import { NextRequest, NextResponse } from "next/server"; const aj = arcjet({ key: process.env.ARCJET_KEY!, rules: [ // Shield — detects common attack patterns (SQLi, XSS, path traversal) shield({ mode: "LIVE" }), // Bot detection — blocks automated clients detectBot({ mode: "LIVE", allow: [ "CATEGORY:SEARCH_ENGINE", // Allow Google, Bing, etc. "CATEGORY:MONITOR", // Allow uptime monitors ], // Everything else (scrapers, headless browsers, AI crawlers) is blocked }), ], }); export async function POST(request: NextRequest) { const decision = await aj.protect(request); if (decision.isDenied()) { if (decision.reason.isBot()) { return NextResponse.json( { error: "Bot traffic is not allowed" }, { status: 403 } ); } if (decision.reason.isRateLimit()) { return NextResponse.json( { error: "Too many requests" }, { status: 429, headers: { "Retry-After": "60" } } ); } if (decision.reason.isShield()) { return NextResponse.json( { error: "Suspicious request blocked" }, { status: 403 } ); } } // Request passed all security checks — process normally const body = await request.json(); const user = await createUser(body); return NextResponse.json({ user }, { status: 201 }); }
Validate email addresses before accepting them:
typescript// app/api/subscribe/route.ts — Validate emails at signup import arcjet, { validateEmail } from "@arcjet/next"; import { NextRequest, NextResponse } from "next/server"; const aj = arcjet({ key: process.env.ARCJET_KEY!, rules: [ validateEmail({ mode: "LIVE", block: [ "DISPOSABLE", // Block temporary email services "INVALID", // Block malformed addresses "NO_MX_RECORDS", // Block domains without mail servers ], // Allow free email providers (Gmail, Yahoo) — block only throwaway }), ], }); export async function POST(request: NextRequest) { const { email } = await request.json(); const decision = await aj.protect(request, { email }); if (decision.isDenied()) { const reason = decision.reason; if (reason.isEmail()) { // Specific error messages based on email issue if (reason.emailTypes.includes("DISPOSABLE")) { return NextResponse.json( { error: "Please use a permanent email address" }, { status: 422 } ); } if (reason.emailTypes.includes("INVALID")) { return NextResponse.json( { error: "Please check your email address" }, { status: 422 } ); } } } // Email is valid — proceed with subscription await addToMailingList(email); return NextResponse.json({ success: true }); }
Apply security rules globally via middleware:
typescript// middleware.ts — Global security middleware for Next.js import arcjet, { detectBot, shield, tokenBucket } from "@arcjet/next"; import { NextRequest, NextResponse } from "next/server"; const aj = arcjet({ key: process.env.ARCJET_KEY!, characteristics: ["ip.src"], rules: [ shield({ mode: "LIVE" }), detectBot({ mode: "LIVE", allow: ["CATEGORY:SEARCH_ENGINE", "CATEGORY:MONITOR", "CATEGORY:PREVIEW"], }), tokenBucket({ mode: "LIVE", refillRate: 60, interval: 60, capacity: 120, }), ], }); export async function middleware(request: NextRequest) { const decision = await aj.protect(request); // Log all decisions for monitoring console.log(`[Arcjet] ${request.url} | ${decision.conclusion} | IP: ${decision.ip.ip}`); if (decision.isDenied()) { // Return appropriate error based on reason if (decision.reason.isRateLimit()) { return NextResponse.json({ error: "Rate limited" }, { status: 429 }); } return NextResponse.json({ error: "Forbidden" }, { status: 403 }); } // Add security headers const response = NextResponse.next(); response.headers.set("X-Arcjet-Decision", decision.conclusion); return response; } export const config = { matcher: [ "/api/:path*", // Protect all API routes "/((?!_next|favicon).*)", // Protect pages (exclude static assets) ], };
Use Arcjet with Express or any Node.js framework:
typescript// src/middleware/security.ts — Arcjet with Express import arcjet, { tokenBucket, detectBot, shield } from "@arcjet/node"; import { Request, Response, NextFunction } from "express"; const aj = arcjet({ key: process.env.ARCJET_KEY!, characteristics: ["ip.src"], rules: [ shield({ mode: "LIVE" }), detectBot({ mode: "LIVE", allow: ["CATEGORY:SEARCH_ENGINE"] }), tokenBucket({ mode: "LIVE", refillRate: 30, interval: 60, capacity: 60 }), ], }); export async function arcjetMiddleware(req: Request, res: Response, next: NextFunction) { const decision = await aj.protect(req); if (decision.isDenied()) { const status = decision.reason.isRateLimit() ? 429 : 403; return res.status(status).json({ error: decision.reason.isRateLimit() ? "Rate limited" : "Forbidden", }); } next(); } // Usage in Express app app.use("/api", arcjetMiddleware);
bash# Next.js npm install @arcjet/next # Node.js / Express npm install @arcjet/node # Get API key at https://app.arcjet.com
User request:
I just installed Arcjet. Help me configure it for my TypeScript + React workflow with my preferred keybindings.The agent creates the configuration file with TypeScript-aware settings, configures relevant plugins/extensions for React development, sets up keyboard shortcuts matching the user's preferences, and verifies the setup works correctly.
User request:
I want to add a custom bot protection to Arcjet. How do I build one?The agent scaffolds the extension/plugin project, implements the core functionality following Arcjet's API patterns, adds configuration options, and provides testing instructions to verify it works end-to-end.
mode: "DRY_RUN" first to monitor traffic patterns before enforcing rules| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 11,545 | 11,047 | -4% | 1 | 1 | 0% | 2,578 | 4,950 | +92% | 0 | 0 | — |
case-02 | pass→pass | 12,920 | 7,388 | -43% | 1 | 1 | 0% | 2,356 | 4,117 | +75% | 0 | 0 | — |
case-03 | pass→pass | 13,359 | 5,971 | -55% | 1 | 1 | 0% | 2,518 | 3,680 | +46% | 0 | 0 | — |
case-04 | fail→pass | 10,366 | 9,008 | -13% | 1 | 1 | 0% | 2,044 | 3,942 | +93% | 0 | 0 | — |
case-05 | pass→pass | 10,685 | 7,262 | -32% | 1 | 1 | 0% | 2,027 | 4,080 | +101% | 0 | 0 | — |
case-06 | pass→pass | 7,240 | 4,761 | -34% | 1 | 1 | 0% | 1,412 | 3,521 | +149% | 0 | 0 | — |
case-07 | pass→pass | 11,595 | 9,749 | -16% | 1 | 1 | 0% | 2,332 | 4,166 | +79% | 0 | 0 | — |
case-08 | pass→pass | 11,920 | 7,137 | -40% | 1 | 1 | 0% | 1,993 | 3,983 | +100% | 0 | 0 | — |
case-09 | pass→pass | 10,019 | 6,528 | -35% | 1 | 1 | 0% | 1,956 | 3,944 | +102% | 0 | 0 | — |
case-10 | fail→fail | 12,981 | 8,657 | -33% | 1 | 1 | 0% | 2,714 | 4,254 | +57% | 0 | 0 | — |
case-11 | pass→pass | 14,576 | 10,295 | -29% | 1 | 1 | 0% | 2,622 | 4,507 | +72% | 0 | 0 | — |
case-12 | fail→pass | 12,602 | 13,005 | +3% | 1 | 1 | 0% | 2,161 | 4,543 | +110% | 0 | 0 | — |
case-13 | pass→pass | 6,123 | 3,585 | -41% | 1 | 1 | 0% | 1,201 | 3,267 | +172% | 0 | 0 | — |
case-14 | pass→pass | 13,866 | 9,767 | -30% | 1 | 1 | 0% | 2,226 | 4,437 | +99% | 0 | 0 | — |
case-15 | pass→pass | 9,875 | 4,311 | -56% | 1 | 1 | 0% | 1,259 | 3,369 | +168% | 0 | 0 | — |
case-20 | pass→pass | 12,976 | 13,440 | +4% | 1 | 1 | 0% | 2,898 | 5,514 | +90% | 0 | 0 | — |
case-16 | fail→pass | 6,565 | 3,086 | -53% | 1 | 1 | 0% | 1,191 | 3,128 | +163% | 0 | 0 | — |
case-17 | fail→pass | 9,513 | 4,802 | -50% | 1 | 1 | 0% | 1,528 | 3,228 | +111% | 0 | 0 | — |
case-18 | pass→pass | 6,587 | 2,639 | -60% | 1 | 1 | 0% | 1,162 | 2,970 | +156% | 0 | 0 | — |
case-19 | pass→pass | 5,002 | 3,502 | -30% | 1 | 1 | 0% | 881 | 3,162 | +259% | 0 | 0 | — |
case-21 | pass→pass | 10,037 | 9,338 | -7% | 1 | 1 | 0% | 2,032 | 4,343 | +114% | 0 | 0 | — |
case-22 | pass→pass | 12,885 | 12,894 | +0% | 1 | 1 | 0% | 2,410 | 4,622 | +92% | 0 | 0 | — |
case-23 | pass→pass | 11,022 | 9,979 | -9% | 1 | 1 | 0% | 2,392 | 4,509 | +89% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +22 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.