guard

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

A guide for adding Arcjet checks to JavaScript operations that do not handle web requests, such as agent tools, MCP handlers, queue workers, and background jobs. MCP is a way for AI systems to call external tools.

In plain words
What is it for?
Guarding agent actions, tool arguments, queue jobs, and other non-web operations against excessive use or prompt-injection attempts.
Why use it?
It provides a way to limit or deny unsafe tool calls when there is no HTTP request to protect.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; mentions Codex.

Good fit Guarding agent actions, tool arguments, queue jobs, and other non-web operations against excessive use or prompt-injection attempts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/arcjet/arcjet-js/guard
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 guard
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 guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/arcjet/arcjet-js/guard/github.svg)](https://agentmods.dev/skills/arcjet/arcjet-js/guard)
Your own site
<a href="https://agentmods.dev/skills/arcjet/arcjet-js/guard"><img src="https://agentmods.dev/badge/skills/arcjet/arcjet-js/guard/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for guard

Your own site · 80×15
<a href="https://agentmods.dev/skills/arcjet/arcjet-js/guard"><img src="https://agentmods.dev/badge/skills/arcjet/arcjet-js/guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,737 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00058 $0.01737
Opus 5.5 $0.00023 $0.00695
Sonnet 5.5 $0.00012 $0.00347
Haiku 4.5 $0.00006 $0.00174

Measured 6d ago against content hash fd53cb882969, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

guard scanned grade A with 0 findings 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 6d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

arcjet-skills/skills/guard/SKILL.md · 142 lines

How it starts

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

Guard non-HTTP JavaScript

Use @arcjet/guard when there is no HTTP request. MCP tools, queue workers, and agent tool calls are Guard. HTTP routes are @arcjet/skills#protect.

For a specific vendor SDK, load the matching skill from @arcjet/guard (@arcjet/guard#integrate-arcjet-guard-agents, -eve, -mastra, -langgraph, -langchain, -openai-agents, -genkit, -google-adk, -strands-agents, -tanstack-ai, -cloudflare-think, -claude-agent-sdk, -claude-managed-agents).

Coding-agent hooks (Claude Code, Copilot, Codex, Cursor, Muse Code) are not this package. Publish a coding-agent policy from a Console starter (Execute on: Tool call, Prompt, or Model switch) and install the hooks from the vendor's page under https://docs.arcjet.com/coding-agents. Don't add a matcher, label, or ?surface=. Claude Code and Copilot HTTP hooks fail open on any non-2xx, including 401.

Client

import { launchArcjet } from "@arcjet/guard";

export const arcjet = launchArcjet({ key: process.env.ARCJET_KEY! });

One client at module scope. Get the key with @arcjet/skills#cli first. Declare rules at module scope so .deniedResult(decision) works.

One guard() per operation

Hardcode the label. Do not interpolate in a generic dispatcher.

Hardcode labels as slugs: ASCII letters of either case, digits, -, ., and _ (tools.get-weather). Start and end with a letter or digit; max 256 bytes. Labels match case-sensitively. Prefer dash/dot in new labels. Check a label you build yourself with validateGuardLabel.

async function getWeather(userId: string) {
  const decision = await arcjet.guard({
    label: "tools.get-weather",
    rules: [/* ... */],
    metadata: { user: { id: userId } },
  });

  if (decision.conclusion === "DENY") {
    const rateLimited = toolCallLimit.deniedResult(decision);
    if (rateLimited) {
      return { error: `rate limited, retry after ${rateLimited.resetAtUnixSeconds}` };
    }
    return { error: decision.reason };
  }
  if (decision.hasFailedOpen()) {
    // ALLOW only because a rule could not run — deny for content scans
    return { error: "unavailable" };
  }
  // ... run the tool
}

Read the full file on GitHub · 142 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. 6d ago Changed · +3 lines fd53cb882969
  2. 10d ago Changed · +2 lines 9b2828f91ecc
  3. 13d ago Changed · +2 lines 17545bc93700
  4. 18d ago Changed · +28 lines d6a97e972d30
  5. 1mo ago Changed · +3 lines 778b16b56ed2
  6. 1mo ago Changed · +3 lines 611c5601b266
  7. 1mo ago Changed · +1 lines 35d79d4c778f
  8. 1mo ago Changed · +8 lines eff03944a358
  9. 2mo ago Changed 4342ae509482
  10. 2mo ago First seen · 92 lines · 58 tokens per session scan A 3c5c749bf3d8

Subscribe to this mod's changes

guard is a skill published in the GitHub repository arcjet/arcjet-js (704 stars, last pushed 2d ago), licensed Apache-2.0. It adds 58 tokens to every session and 1,737 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

guard compared with skills from other repositories

guard next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
guardarcjet/arcjet-jsSkill7042d agoApache-2.0A58Claude Code, Codex
clinical-trial-protocol-skillAgent-Threat-Rule/agent-threat-rulesSkill445yesterdayMITA70Claude Code, Codex
claude-d3js-skillAgent-Threat-Rule/agent-threat-rulesSkill445yesterdayMITA25Claude Code, Codex
adr-skillAgent-Threat-Rule/agent-threat-rulesSkill445yesterdayMITA89Claude Code, Codex
linear-claude-skillAgent-Threat-Rule/agent-threat-rulesSkill445yesterdayMITA15Claude Code, Codex
playwright-skillAgent-Threat-Rule/agent-threat-rulesSkill445yesterdayMITA60Claude Code, Codex
terraform-skillAgent-Threat-Rule/agent-threat-rulesSkill445yesterdayMITA10Claude Code, Codex