guard

guard is a skill for Claude Code, Codex from arcjet/arcjet-js. It costs 58 tokens per session (1,092 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.

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,092 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.01092
Opus 5.5 $0.00023 $0.00437
Sonnet 5.5 $0.00012 $0.00218
Haiku 4.5 $0.00006 $0.00109

Measured yesterday against content hash 611c5601b266, 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 yesterday.

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 · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 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).

Claude Code / Copilot HTTP hooks are not this package. Publish a coding-agent policy via @arcjet/skills#mcp (Execute on: Tool call, Prompt, or Model switch) and install hooks from https://docs.arcjet.com/coding-agents (omit ?surface=).

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.

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 here if the site is sensitive
}

Core guard() fails open — check hasFailedOpen(). warnings never change the conclusion. Rate-limit rules need key and bucket. Nested metadata is Console-only; no secrets or PII. decision.reason is a flat string on DENY and undefined on ALLOW.

Read the full file on GitHub · 104 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. yesterday Changed · +3 lines 611c5601b266
  2. 9d ago Changed · +1 lines 35d79d4c778f
  3. 14d ago Changed · +8 lines eff03944a358
  4. 24d ago Changed 4342ae509482
  5. 29d ago Changed 3c5c749bf3d8
  6. 1mo ago Changed · +6 lines c6e374230790
  7. 1mo ago First seen · 86 lines · 58 tokens per session scan A 7bb32df56a0f

Subscribe to this mod's changes

guard is a skill published in the GitHub repository arcjet/arcjet-js (692 stars, last pushed today), licensed Apache-2.0. It adds 58 tokens to every session and 1,092 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

Other skills, from other repositories

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

adr-skill

Create and maintain Architecture Decision Records (ADRs) optimized for agentic coding workflows. Use when you need to propose, write, update, accept/reject, deprecate, or supersede an ADR; bootstrap an adr folder and index; consult existing ADRs before implementing changes; or enforce ADR conventions. This skill uses…

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

linear-claude-skill

Manage Linear issues, projects, and teams.

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

playwright-skill

IMPORTANT - Path Resolution: This skill can be installed in different locations (plugin system, manual installation, global, or project-specific). Before executing any commands, determine the skill directory based on where you loaded this SKILL.md file, and use that path in all commands below.

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

terraform-skill

Terraform infrastructure as code best practices.

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