@arcjet/skills 1.13.0 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/version.js +1 -1
- package/docs/choose-protections.md +7 -0
- package/docs/guard.md +18 -7
- package/docs/mcp.md +3 -1
- package/docs/protect.md +4 -3
- package/package.json +2 -2
- package/skills/choose-protections/SKILL.md +6 -1
- package/skills/cli/SKILL.md +1 -1
- package/skills/guard/SKILL.md +15 -6
- package/skills/mcp/SKILL.md +6 -3
- package/skills/protect/SKILL.md +3 -3
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ const PACKAGE_NAME = "@arcjet/skills";
|
|
|
11
11
|
const skills = [
|
|
12
12
|
{
|
|
13
13
|
name: "protect",
|
|
14
|
-
description: "Add Arcjet request protection to JavaScript and TypeScript HTTP handlers. Use when protecting Next.js, Express, Fastify, SvelteKit, Remix, Astro, Nuxt, Bun, Deno, NestJS, or Node.js routes with rate limiting, bot detection, Shield, email validation, or sensitive info detection.",
|
|
14
|
+
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.",
|
|
15
15
|
file: "skills/protect/SKILL.md",
|
|
16
16
|
sources: ["docs/protect.md"]
|
|
17
17
|
},
|
package/dist/version.js
CHANGED
|
@@ -68,3 +68,10 @@ rate limiting.
|
|
|
68
68
|
|
|
69
69
|
**Rule:** `filter` (request-based only). Can also be a remote rule via CLI or
|
|
70
70
|
MCP.
|
|
71
|
+
|
|
72
|
+
## Claude Code / Copilot (no application SDK)
|
|
73
|
+
|
|
74
|
+
Not `protect()` or `@arcjet/guard`. Publish a coding-agent policy attached
|
|
75
|
+
to **Execute on** (Tool call, Prompt, or Model switch) via `@arcjet/skills#mcp`, then
|
|
76
|
+
install HTTP hooks from https://docs.arcjet.com/coding-agents. Copy the
|
|
77
|
+
templates: the hook URL must not name a policy and must omit `?surface=`.
|
package/docs/guard.md
CHANGED
|
@@ -11,6 +11,10 @@ MCP server handlers, queue workers, and background jobs.
|
|
|
11
11
|
The word "server" on MCP is misleading. MCP tools are invoked over stdio or
|
|
12
12
|
SSE and do not receive an HTTP request.
|
|
13
13
|
|
|
14
|
+
Claude Code / Copilot HTTP hooks are not `@arcjet/guard`. Author the
|
|
15
|
+
policy via MCP and install hooks from https://docs.arcjet.com/coding-agents
|
|
16
|
+
(omit `?surface=`). **Execute on** is Tool call, Prompt, or Model switch.
|
|
17
|
+
|
|
14
18
|
## Client
|
|
15
19
|
|
|
16
20
|
```ts
|
|
@@ -32,12 +36,16 @@ Declare rules at module scope so `.deniedResult(decision)` and
|
|
|
32
36
|
Call `guard()` where you already know the operation. Hardcode the `label`.
|
|
33
37
|
Do not interpolate names in a generic dispatcher.
|
|
34
38
|
|
|
35
|
-
Hardcode labels as slugs
|
|
36
|
-
(`tools.get-weather`)
|
|
37
|
-
|
|
39
|
+
Hardcode labels as slugs: ASCII letters of either case, digits, `-`, `.`, and
|
|
40
|
+
`_` (`tools.get-weather`). Start and end with a letter or digit; max 256 bytes.
|
|
41
|
+
Labels match case-sensitively.
|
|
42
|
+
Prefer dash/dot in new labels. Do not interpolate user input. Check a label
|
|
43
|
+
you build yourself with `validateGuardLabel` — a slug the service will not
|
|
44
|
+
match reads as `ALLOW` with `hasFailedOpen()` false.
|
|
38
45
|
|
|
39
46
|
```ts
|
|
40
|
-
const decision = await arcjet.guard(
|
|
47
|
+
const decision = await arcjet.guard({
|
|
48
|
+
label: "tools.get-weather",
|
|
41
49
|
rules: [/* ... */],
|
|
42
50
|
metadata: { user: { id: userId } },
|
|
43
51
|
});
|
|
@@ -102,6 +110,7 @@ Prefer the versioned Guard namespaces over hand-wrapping every tool:
|
|
|
102
110
|
| Google ADK JS | `@arcjet/guard/google-adk/v2` |
|
|
103
111
|
| Strands Agents JS | `@arcjet/guard/strands-agents/v1` |
|
|
104
112
|
| TanStack AI | `@arcjet/guard/tanstack-ai/v0` |
|
|
113
|
+
| Cloudflare Think | `@arcjet/guard/cloudflare-think/v0` |
|
|
105
114
|
|
|
106
115
|
Unversioned aliases do not resolve. Load the matching
|
|
107
116
|
`@arcjet/guard#integrate-arcjet-guard-*` skill for the integration you are
|
|
@@ -113,8 +122,9 @@ Framework wrappers fail closed by default when Guard is unavailable. Core
|
|
|
113
122
|
JS LangChain `createAgent` is `@arcjet/guard/langchain/v1`, not LangGraph.
|
|
114
123
|
JS Google ADK is `guardPlugin` on the Runner — there is no `guardTool`.
|
|
115
124
|
TanStack AI is `guardMiddleware` — do not use `guardTool` (an `execute`
|
|
116
|
-
throw is swallowed).
|
|
117
|
-
|
|
125
|
+
throw is swallowed). Cloudflare Think is `guardHooks` on
|
|
126
|
+
`beforeToolCall` — default DENY is substitute. JS Strands Agents is
|
|
127
|
+
official `@strands-agents/sdk`, not Python `strands`.
|
|
118
128
|
|
|
119
129
|
Every JS wrapper policy accepts optional `actor` and `inputs` (static values
|
|
120
130
|
or a resolver over that adapter's native call — parsed input plus trusted
|
|
@@ -129,7 +139,8 @@ per-framework: return the object (AI SDK, Mastra, OpenAI Agents, Genkit
|
|
|
129
139
|
`toolResponse.output`, LangGraph, LangChain `guardTool`, Google ADK plugin
|
|
130
140
|
dict, Strands `guardTool`); wrap it (Claude Agent SDK `isError: true`,
|
|
131
141
|
LangChain `guardMiddleware` `ToolMessage`, Strands `guardHooks` cancel
|
|
132
|
-
string, TanStack `onBeforeToolCall` skip
|
|
142
|
+
string, TanStack `onBeforeToolCall` skip, Cloudflare Think
|
|
143
|
+
`beforeToolCall` substitute); or throw `ArcjetDeniedError`
|
|
133
144
|
(Eve, unless `onDeny: "result"`). A throw from a return-style adapter
|
|
134
145
|
drops the fields.
|
|
135
146
|
|
package/docs/mcp.md
CHANGED
|
@@ -66,10 +66,12 @@ Add a custom connector named `Arcjet` with URL `https://api.arcjet.com/mcp`.
|
|
|
66
66
|
|
|
67
67
|
OAuth. The first connection redirects to sign in with an Arcjet account.
|
|
68
68
|
|
|
69
|
+
Agent registration (the agent registers for its own identity): follow https://arcjet.com/auth.md — do not invent that ceremony.
|
|
70
|
+
|
|
69
71
|
## Common workflows
|
|
70
72
|
|
|
71
73
|
- Bootstrap: `list-teams` → `list-sites` → `get-site-key` → write `ARCJET_KEY`
|
|
72
74
|
- Investigate: `analyze-traffic` → `list-requests` → `investigate-ip`
|
|
73
75
|
- Remote rules: `create-rule` (DRY_RUN) → `get-dry-run-impact` → `promote-rule`
|
|
74
|
-
- Guard policies: `list-guard-policies` → `describe-guard-policy` → `validate-guard-policy` → `put-guard-policy`. Authoring is MCP-only; the CLI has no policy commands. Application policies select by `label` / wrapper `action`. Coding-agent policies attach by **Execute on** (Tool call or
|
|
76
|
+
- Guard policies: `list-guard-policies` → `describe-guard-policy` → `validate-guard-policy` → `put-guard-policy`. Authoring is MCP-only; the CLI has no policy commands. Application policies select by `label` / wrapper `action`. Coding-agent policies attach by **Execute on** (Tool call, Prompt, or Model switch), not by label. Install Claude Code / Copilot HTTP hooks from https://docs.arcjet.com/coding-agents — copy the templates. The hook URL must not name a policy and must omit `?surface=` (managed settings reach CLI, IDE, Desktop, and cloud; a hard-coded `cli` mislabels most traffic).
|
|
75
77
|
- Briefing: `get-security-briefing`
|
package/docs/protect.md
CHANGED
|
@@ -156,9 +156,10 @@ values are rejected. Syntax validation does not prove provenance.
|
|
|
156
156
|
Never silence an `unverified-header` warning by copying `X-Forwarded-For` (or
|
|
157
157
|
another client-controlled header) into `ipSrc`. That relabels attacker input
|
|
158
158
|
as trusted. Inspect representative requests with
|
|
159
|
-
`
|
|
160
|
-
`resolveClientIp()` from `@arcjet/ip`. Check `ip`,
|
|
161
|
-
and `header`. These diagnostics do not consume
|
|
159
|
+
`aj.clientIpDetails(request)` on the constructed `@arcjet/node` client, or
|
|
160
|
+
`findIpDetails()` / `resolveClientIp()` from `@arcjet/ip`. Check `ip`,
|
|
161
|
+
`provenance`, `verified`, and `header`. These diagnostics do not consume
|
|
162
|
+
the once-per-client warning.
|
|
162
163
|
|
|
163
164
|
`protect()` accepts nested-JSON `metadata`. It does not affect fingerprinting.
|
|
164
165
|
Do not put secrets or PII in it. When present, request decisions also expose
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcjet/skills",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.1",
|
|
4
4
|
"description": "Versioned Agent Skills for the Arcjet JavaScript SDK, shipped with TanStack Intent",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-skills",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@tanstack/intent": "0.4.0",
|
|
60
|
-
"@types/node": "22.20.
|
|
60
|
+
"@types/node": "22.20.4",
|
|
61
61
|
"tsdown": "0.23.0",
|
|
62
62
|
"typescript": "7.0.2"
|
|
63
63
|
},
|
|
@@ -7,7 +7,7 @@ metadata:
|
|
|
7
7
|
author: arcjet
|
|
8
8
|
type: core
|
|
9
9
|
library: "@arcjet/skills"
|
|
10
|
-
library_version: "1.
|
|
10
|
+
library_version: "1.14.1" # x-release-please-version
|
|
11
11
|
sources:
|
|
12
12
|
- docs/choose-protections.md
|
|
13
13
|
---
|
|
@@ -42,3 +42,8 @@ entities never match without `backend: rampart()`.
|
|
|
42
42
|
|
|
43
43
|
Remote bot and filter rules can be managed with the CLI or MCP without a
|
|
44
44
|
redeploy — load `@arcjet/skills#cli` or `@arcjet/skills#mcp`.
|
|
45
|
+
|
|
46
|
+
Claude Code / Copilot hooks are not this table. Publish a coding-agent
|
|
47
|
+
policy via `@arcjet/skills#mcp` (**Execute on**: Tool call, Prompt, or
|
|
48
|
+
Model switch) and install hooks from
|
|
49
|
+
https://docs.arcjet.com/coding-agents (omit `?surface=`).
|
package/skills/cli/SKILL.md
CHANGED
package/skills/guard/SKILL.md
CHANGED
|
@@ -7,7 +7,7 @@ metadata:
|
|
|
7
7
|
author: arcjet
|
|
8
8
|
type: core
|
|
9
9
|
library: "@arcjet/skills"
|
|
10
|
-
library_version: "1.
|
|
10
|
+
library_version: "1.14.1" # x-release-please-version
|
|
11
11
|
sources:
|
|
12
12
|
- docs/guard.md
|
|
13
13
|
---
|
|
@@ -20,8 +20,13 @@ and agent tool calls are Guard. HTTP routes are `@arcjet/skills#protect`.
|
|
|
20
20
|
For a specific vendor SDK, load the matching skill from `@arcjet/guard`
|
|
21
21
|
(`@arcjet/guard#integrate-arcjet-guard-agents`, `-eve`, `-mastra`,
|
|
22
22
|
`-langgraph`, `-langchain`, `-openai-agents`, `-genkit`, `-google-adk`,
|
|
23
|
-
`-strands-agents`, `-tanstack-ai`, `-
|
|
24
|
-
`-claude-managed-agents`).
|
|
23
|
+
`-strands-agents`, `-tanstack-ai`, `-cloudflare-think`,
|
|
24
|
+
`-claude-agent-sdk`, `-claude-managed-agents`).
|
|
25
|
+
|
|
26
|
+
Claude Code / Copilot HTTP hooks are not this package. Publish a
|
|
27
|
+
coding-agent policy via `@arcjet/skills#mcp` (**Execute on**: Tool call,
|
|
28
|
+
Prompt, or Model switch) and install hooks from
|
|
29
|
+
https://docs.arcjet.com/coding-agents (omit `?surface=`).
|
|
25
30
|
|
|
26
31
|
## Client
|
|
27
32
|
|
|
@@ -38,11 +43,15 @@ Declare rules at module scope so `.deniedResult(decision)` works.
|
|
|
38
43
|
|
|
39
44
|
Hardcode the `label`. Do not interpolate in a generic dispatcher.
|
|
40
45
|
|
|
41
|
-
Hardcode labels as slugs
|
|
42
|
-
(`tools.get-weather`). Start and end with a letter or digit.
|
|
46
|
+
Hardcode labels as slugs: ASCII letters of either case, digits, `-`, `.`, and
|
|
47
|
+
`_` (`tools.get-weather`). Start and end with a letter or digit; max 256 bytes.
|
|
48
|
+
Labels match case-sensitively.
|
|
49
|
+
Prefer dash/dot in new labels. Check a label you build yourself with
|
|
50
|
+
`validateGuardLabel`.
|
|
43
51
|
|
|
44
52
|
```ts
|
|
45
|
-
const decision = await arcjet.guard(
|
|
53
|
+
const decision = await arcjet.guard({
|
|
54
|
+
label: "tools.get-weather",
|
|
46
55
|
rules: [/* ... */],
|
|
47
56
|
metadata: { user: { id: userId } },
|
|
48
57
|
});
|
package/skills/mcp/SKILL.md
CHANGED
|
@@ -7,7 +7,7 @@ metadata:
|
|
|
7
7
|
author: arcjet
|
|
8
8
|
type: core
|
|
9
9
|
library: "@arcjet/skills"
|
|
10
|
-
library_version: "1.
|
|
10
|
+
library_version: "1.14.1" # x-release-please-version
|
|
11
11
|
sources:
|
|
12
12
|
- docs/mcp.md
|
|
13
13
|
---
|
|
@@ -39,10 +39,13 @@ claude mcp add arcjet --transport http https://api.arcjet.com/mcp
|
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
Bootstrap: `list-teams` → `list-sites` → `get-site-key` → write `ARCJET_KEY`.
|
|
42
|
+
Agent identity (not human browser OAuth): follow https://arcjet.com/auth.md.
|
|
42
43
|
Investigate: `analyze-traffic`, `list-requests`, `list-guards`,
|
|
43
44
|
`investigate-ip`. Remote rules: `create-rule` (DRY_RUN) →
|
|
44
45
|
`get-dry-run-impact` → `promote-rule`. Guard policies (MCP-only; no CLI
|
|
45
46
|
commands): `list-guard-policies` → `describe-guard-policy` →
|
|
46
47
|
`validate-guard-policy` → `put-guard-policy`. Application policies select by
|
|
47
|
-
`label` / `action`. Coding-agent policies attach by **Execute on** (Tool call
|
|
48
|
-
or
|
|
48
|
+
`label` / `action`. Coding-agent policies attach by **Execute on** (Tool call,
|
|
49
|
+
Prompt, or Model switch). Install Claude Code / Copilot hooks from
|
|
50
|
+
https://docs.arcjet.com/coding-agents — copy the templates. The hook URL
|
|
51
|
+
must not name a policy and must omit `?surface=`.
|
package/skills/protect/SKILL.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: protect
|
|
3
|
-
description: Add Arcjet request protection to JavaScript and TypeScript HTTP handlers. Use when protecting Next.js, Express, Fastify, SvelteKit, Remix, Astro, Nuxt, Bun, Deno, NestJS, or Node.js routes with rate limiting, bot detection, Shield, email validation, or sensitive info detection.
|
|
3
|
+
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.
|
|
4
4
|
license: Apache-2.0
|
|
5
5
|
compatibility: JavaScript and TypeScript HTTP apps using an @arcjet/* framework adapter.
|
|
6
6
|
metadata:
|
|
7
7
|
author: arcjet
|
|
8
8
|
type: core
|
|
9
9
|
library: "@arcjet/skills"
|
|
10
|
-
library_version: "1.
|
|
10
|
+
library_version: "1.14.1" # x-release-please-version
|
|
11
11
|
sources:
|
|
12
12
|
- docs/protect.md
|
|
13
13
|
---
|
|
@@ -94,7 +94,7 @@ input as trusted.
|
|
|
94
94
|
When no usable public address is available, adapters may fall back to
|
|
95
95
|
forwarding headers and log one `unverified-header` warning per client.
|
|
96
96
|
Configure `proxies` (or `cloudflare()`). Inspect with
|
|
97
|
-
`clientIpDetails()` (`@arcjet/node`) or `findIpDetails()` /
|
|
97
|
+
`aj.clientIpDetails(request)` (`@arcjet/node`) or `findIpDetails()` /
|
|
98
98
|
`resolveClientIp()` (`@arcjet/ip`) before shipping.
|
|
99
99
|
|
|
100
100
|
Nested `metadata` is for the Console — no secrets, no PII.
|