protect

protect is a skill for Claude Code, Codex from arcjet/arcjet-js. It costs 67 tokens per session (1,170 once invoked), scanned A, original, Apache-2.0.

A guide for adding Arcjet protection to JavaScript and TypeScript HTTP routes. HTTP routes are the parts of a web server that receive requests and send responses.

In plain words
What is it for?
Protecting routes in Next.js, Express, Fastify, SvelteKit, Remix, Astro, Nuxt, Bun, Deno, NestJS, and other Node.js applications.
Why use it?
It helps prevent abuse such as excessive requests, automated bots, and requests containing sensitive information.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Protecting routes in Next.js, Express, Fastify, SvelteKit, Remix, Astro, Nuxt, Bun, Deno, NestJS, and other Node.js applications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/arcjet/arcjet-js/protect
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add arcjet/arcjet-js --skill protect
Clone the repo
git clone --depth 1 https://github.com/arcjet/arcjet-js

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for protect

README.md
[![agentmods](https://agentmods.dev/badge/skills/arcjet/arcjet-js/protect.svg)](https://agentmods.dev/skills/arcjet/arcjet-js/protect)
Your own site
<a href="https://agentmods.dev/skills/arcjet/arcjet-js/protect"><img src="https://agentmods.dev/badge/skills/arcjet/arcjet-js/protect.svg" alt="Measured on agentmods" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,170 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00067 $0.01170
Opus 5 $0.00034 $0.00585
Sonnet 5 $0.00013 $0.00234
Haiku 4.5 $0.00007 $0.00117

Measured 2d ago against content hash 4161836f65be, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

protect scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

Type-check, then `curl` the route. Confirm with
arcjet-skills/skills/protect/SKILL.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

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 arcjet() constructor does not.

Astro is an integration (arcjet:client), not a shared file. Nuxt is a module (#arcjet). NestJS is ArcjetModule + @InjectArcjet(). Bun and Deno wrap fetch with aj.handler() for IP detection, then still call protect(). Hono on Node passes c.env.incoming.

Handler

export async function GET(request: Request) {
  const decision = await aj.protect(request);

  if (decision.isDenied()) {
    return Response.json({ error: "Forbidden" }, { status: 403 });
  }

  return Response.json({ ok: true });
}

Read the full file on GitHub · 122 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 122 lines · 67 tokens per session scan A 4161836f65be

Subscribe to this mod's changes

protect is a skill published in the GitHub repository arcjet/arcjet-js (682 stars, last pushed yesterday), licensed Apache-2.0. It adds 67 tokens to every session and 1,170 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

Other skills, from other repositories

create-auth-skill

Scaffold and implement authentication in TypeScript/JavaScript apps using Better Auth. Detect frameworks, configure database adapters, set up route handlers, add OAuth providers, and create auth UI pages. Use when users want to add login, sign-up, or authentication to a new or existing project with Better Auth.

Agent-Threat-Rule/agent-threat-rules · 66 tokens

fhir-developer-skill

FHIR API development guide for building healthcare endpoints. Use when: (1) Creating FHIR REST endpoints (Patient, Observation, Encounter, Condition, MedicationRequest), (2) Validating FHIR resources and returning proper HTTP status codes and error responses, (3) Implementing SMART on FHIR authorization and OAuth…

Agent-Threat-Rule/agent-threat-rules · 132 tokens

create-auth-skill

Scaffold and implement authentication in TypeScript/JavaScript apps using Better Auth. Detect frameworks, configure database adapters, set up route handlers, add OAuth providers, and create auth UI pages. Use when users want to add login, sign-up, or authentication to a new or existing project with Better Auth.

Agent-Threat-Rule/agent-threat-rules · 66 tokens

hunt-api-misconfig

Hunt API security misconfiguration — mass assignment, prototype pollution, HTTP verb tampering. Mass assignment: send {isadmin:true, role:admin, verified:true} on profile/account/reset endpoints — server blindly applies. JWT signature/crypto forging (alg:none, key confusion, kid/jku) is owned by hunt-jwt-crypto; this…

elementalsouls/Claude-BugHunter · 207 tokens

clinical-trial-protocol-skill

Generate clinical trial protocols for medical devices or drugs. This skill should be used when users say "Create a clinical trial protocol", "Generate protocol for [device/drug]", "Help me design a clinical study", "Research similar trials for [intervention]", or when developing FDA submission documentation for…

Agent-Threat-Rule/agent-threat-rules · 70 tokens

claude-d3js-skill

This skill provides guidance for creating sophisticated, interactive data visualisations using d3.js.

Agent-Threat-Rule/agent-threat-rules · 25 tokens