Skip to content

feat(examples): migrate unique examples from arcjet-js - #193

Open
davidmytton wants to merge 2 commits into
mainfrom
migrate-examples-from-arcjet-js
Open

feat(examples): migrate unique examples from arcjet-js#193
davidmytton wants to merge 2 commits into
mainfrom
migrate-examples-from-arcjet-js

Conversation

@davidmytton

@davidmytton davidmytton commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Consolidates the remaining unique examples from the arcjet/arcjet-js examples/ directory into this repository, rebuilt to the canonical example pattern (canonical package.json metadata, templated README, Dockerfile, compose.yaml, devcontainer, LICENSE) with Arcjet packages pinned to published versions.

Paired with the removal PR in arcjet-js: arcjet/arcjet-js#6217 (removes the examples from that repo).

Examples added (8)

Example Demonstrates Compose/CI Arcjet version
bun Canonical Bun runtime example (mirrors deno) 1.8.0
express-newman Testing Arcjet-protected Express routes with Newman/Postman 1.8.0
nextjs-bot-categories Advanced bot category allow/deny + per-bot filtering 1.8.0
react-router-middleware React Router v8 middleware pattern 1.8.0
nextjs-ai-agent Arcjet Guard AI agent guardrails standalone 1.10.0-rc.0
nextjs-sensitive-info Sensitive info detection incl. Rampart NER backend + Guard standalone 1.9.1
nextjs-guard-policy Remotely-configured Guard policy for AI tool calls standalone 1.10.0-rc.0
node-guard-policy Guard policy on a plain Node.js server standalone 1.10.0-rc.0

The first four are wired into the root compose.yaml and the Docker build CI matrix. The Guard/AI examples are standalone — they need an AI gateway key, dashboard policy config, or a native NER backend, so they are excluded from the default compose/CI run.

⚠️ Pre-release note

nextjs-guard-policy and node-guard-policy depend on the Arcjet Guard remote-policy API (policyInput, guardTool actor, launchArcjet({ sensitiveInfoBackend }), decision.policyResults) which is not yet published to npm. They are pinned to 1.10.0-rc.0 as the closest published release and carry a prominent README note that npm ci + build will not succeed until that API ships. nextjs-ai-agent is pinned to 1.10.0-rc.0 (first release with the agent guardrail API); nextjs-sensitive-info to 1.9.1 (Rampart's earliest release).

Wiring

  • Root compose.yaml — includes the 4 non-AI examples
  • .github/workflows/docker-build.yml — matrix updated with the 4 non-AI examples
  • scripts/prepare-to-publish.ts — all 8 registered for publishing to their own repos
  • README.md — all 8 listed

Validation

npm install + npm run build/typecheck pass for all buildable examples (bun verified by code review only — Bun isn't installed in the build environment; it builds via bun install in its Dockerfile). The two guard-policy examples build once the Guard remote-policy API is published.

🤖 Generated with Claude Code

Consolidates the remaining unique examples from the `arcjet/arcjet-js`
`examples/` directory into this repository, rebuilt to the canonical
example pattern (canonical metadata, README, Dockerfile, compose.yaml,
devcontainer, LICENSE) with Arcjet packages pinned to published versions.

Examples added:

- bun — canonical Bun runtime example (mirrors the Deno example)
- express-newman — testing Arcjet-protected Express routes with Newman
- nextjs-bot-categories — advanced bot category allow/deny + filtering
- react-router-middleware — React Router v8 middleware pattern
- nextjs-ai-agent — Arcjet Guard AI agent guardrails
- nextjs-sensitive-info — sensitive info detection incl. Rampart NER backend
- nextjs-guard-policy — remotely-configured Guard policy for AI tool calls
- node-guard-policy — Guard policy on a plain Node.js server

The first four are wired into the root `compose.yaml` and the Docker
build CI matrix. The Guard/AI examples are standalone (they need an AI
gateway key, dashboard policy config, or a native NER backend) and are
excluded from the default compose/CI run.

Note: nextjs-guard-policy and node-guard-policy depend on the Arcjet
Guard remote-policy API which is not yet published to npm; they are
pinned to 1.10.0-rc.0 and documented as not building until that API
ships. nextjs-ai-agent is pinned to 1.10.0-rc.0 (first release with the
agent guardrail API) and nextjs-sensitive-info to 1.9.1 (Rampart's
earliest release).

All examples are registered in scripts/prepare-to-publish.ts for
publishing to their own repositories.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@socket-security

socket-security Bot commented Aug 7, 2026

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • npm/@arcjet/bun@1.8.0
  • npm/@types/bun@1.3.14
  • npm/bun-types@1.3.14
  • npm/@napi-rs/lzma-linux-x64-gnu@1.5.1
  • npm/@arcjet/guard@1.9.1
  • npm/@arcjet/guard@1.10.0-rc.0
  • npm/@arcjet/sensitive-info-rampart@1.9.1
  • npm/@arcjet/sensitive-info-rampart@1.10.0-rc.0
  • npm/@huggingface/jinja@0.5.9
  • npm/@huggingface/tokenizers@0.1.3
  • npm/@huggingface/transformers@4.2.0
  • npm/adm-zip@0.5.18
  • npm/boolean@3.2.0
  • npm/define-data-property@1.1.4
  • npm/define-properties@1.2.1
  • npm/detect-node@2.1.0
  • npm/es6-error@4.1.1
  • npm/flatbuffers@25.9.23
  • npm/global-agent@3.0.0
  • npm/globalthis@1.0.4
  • npm/guid-typescript@1.0.9
  • npm/has-property-descriptors@1.0.2
  • npm/json-stringify-safe@5.0.1
  • npm/matcher@3.0.0
  • npm/object-keys@1.1.1
  • npm/onnxruntime-common@1.24.3
  • npm/onnxruntime-common@1.24.0-dev.20251116-b39e144322
  • npm/onnxruntime-node@1.24.3
  • npm/onnxruntime-web@1.26.0-dev.20260416-b7804b056c
  • npm/platform@1.3.6
  • npm/roarr@2.15.4
  • npm/semver-compare@1.0.0
  • npm/serialize-error@7.0.1
  • npm/@rolldown/binding-android-arm64@1.2.3
  • npm/@rolldown/binding-darwin-arm64@1.2.3
  • npm/@rolldown/binding-darwin-x64@1.2.3
  • npm/@rolldown/binding-freebsd-x64@1.2.3
  • npm/@rolldown/binding-linux-arm-gnueabihf@1.2.3
  • npm/@rolldown/binding-linux-arm64-gnu@1.2.3
  • npm/@rolldown/binding-linux-arm64-musl@1.2.3
  • npm/@rolldown/binding-linux-ppc64-gnu@1.2.3
  • npm/@rolldown/binding-linux-s390x-gnu@1.2.3
  • npm/@rolldown/binding-linux-x64-gnu@1.2.3
  • npm/@rolldown/binding-linux-x64-musl@1.2.3
  • npm/@rolldown/binding-openharmony-arm64@1.2.3
  • npm/@rolldown/binding-win32-arm64-msvc@1.2.3
  • npm/@rolldown/binding-win32-x64-msvc@1.2.3
  • npm/@workflow/serde@4.1.0
  • npm/@workflow/serde@4.1.2
  • npm/env-runner@0.1.16
  • npm/eve@0.31.0
  • npm/nf3@0.3.23
  • npm/nitro@3.0.260610-beta
  • npm/ocache@0.1.5
  • npm/rolldown@1.2.3
  • npm/@aws-sdk/core@3.977.6
  • npm/@aws-sdk/credential-provider-web-identity@3.972.49
  • npm/@aws-sdk/nested-clients@3.997.41
  • npm/@aws-sdk/signature-v4-multi-region@3.996.43
  • npm/@aws-sdk/types@3.974.2
  • npm/@aws-sdk/xml-builder@3.972.37
  • npm/@aws/lambda-invoke-store@0.3.0
  • npm/@cbor-extract/cbor-extract-darwin-arm64@2.2.2
  • npm/@cbor-extract/cbor-extract-darwin-x64@2.2.2
  • npm/@cbor-extract/cbor-extract-linux-arm@2.2.2
  • npm/@cbor-extract/cbor-extract-linux-arm64@2.2.2
  • npm/@cbor-extract/cbor-extract-linux-x64@2.2.2
  • npm/@cbor-extract/cbor-extract-win32-x64@2.2.2
  • npm/@img/sharp-freebsd-wasm32@0.35.3
  • npm/@img/sharp-webcontainers-wasm32@0.35.3
  • npm/@keyv/serialize@1.1.1
  • npm/@napi-rs/nice@1.1.1
  • npm/@napi-rs/nice-android-arm-eabi@1.1.1
  • npm/@napi-rs/nice-android-arm64@1.1.1
  • npm/@napi-rs/nice-darwin-arm64@1.1.1
  • npm/@napi-rs/nice-darwin-x64@1.1.1
  • npm/@napi-rs/nice-freebsd-x64@1.1.1
  • npm/@napi-rs/nice-linux-arm-gnueabihf@1.1.1
  • npm/@napi-rs/nice-linux-arm64-gnu@1.1.1
  • npm/@napi-rs/nice-linux-arm64-musl@1.1.1
  • npm/@napi-rs/nice-linux-ppc64-gnu@1.1.1
  • npm/@napi-rs/nice-linux-riscv64-gnu@1.1.1
  • npm/@napi-rs/nice-linux-s390x-gnu@1.1.1
  • npm/@napi-rs/nice-linux-x64-gnu@1.1.1
  • npm/@napi-rs/nice-linux-x64-musl@1.1.1
  • npm/@napi-rs/nice-openharmony-arm64@1.1.1
  • npm/@napi-rs/nice-win32-arm64-msvc@1.1.1
  • npm/@napi-rs/nice-win32-ia32-msvc@1.1.1
  • npm/@napi-rs/nice-win32-x64-msvc@1.1.1
  • npm/@oclif/core@4.11.4
  • npm/@oclif/plugin-help@6.2.37
  • npm/@sec-ant/readable-stream@0.4.1
  • npm/@smithy/core@3.31.1
  • npm/@smithy/fetch-http-handler@5.6.13
  • npm/@smithy/node-http-handler@4.9.13
  • npm/@smithy/signature-v4@5.6.12
  • npm/@smithy/types@4.16.1
  • npm/@swc/core-darwin-arm64@1.15.3
  • npm/@swc/core-darwin-x64@1.15.3
  • npm/@swc/core-linux-arm-gnueabihf@1.15.3
  • npm/@swc/core-linux-arm64-gnu@1.15.3
  • npm/@swc/core-linux-arm64-musl@1.15.3
  • npm/@swc/core-linux-x64-gnu@1.15.3
  • npm/@swc/core-linux-x64-musl@1.15.3
  • npm/@swc/core-win32-arm64-msvc@1.15.3
  • npm/@swc/core-win32-ia32-msvc@1.15.3
  • npm/@swc/core-win32-x64-msvc@1.15.3
  • npm/@swc/counter@0.1.3
  • npm/@swc/types@0.1.28
  • npm/@types/http-cache-semantics@4.2.0
  • npm/@vercel/cli-auth@0.0.1
  • npm/@vercel/cli-config@0.2.2
  • npm/@vercel/cli-exec@1.0.1
  • npm/@vercel/functions@3.9.0
  • npm/@vercel/queue@0.3.1
  • npm/mixpart@0.0.6
  • npm/mixpart@0.0.4
  • npm/@workflow/astro@4.0.16
  • npm/@swc/core@1.15.3
  • npm/@workflow/swc-plugin@4.1.2
  • npm/@workflow/builders@4.1.6
  • npm/@workflow/cli@4.3.5
  • npm/@workflow/core@4.8.1
  • npm/@workflow/errors@4.2.1
  • npm/@workflow/next@4.1.5
  • npm/@workflow/nitro@4.1.7
  • npm/@workflow/nuxt@4.0.17
  • npm/@workflow/rollup@4.0.16
  • npm/@workflow/sveltekit@4.0.16
  • npm/@workflow/typescript-plugin@4.0.3
  • npm/@workflow/utils@4.1.4
  • npm/@workflow/vite@4.0.16
  • npm/@workflow/web@4.1.17
  • npm/@workflow/world@4.3.1
  • npm/@workflow/world-local@4.2.4
  • npm/@workflow/world-vercel@4.6.2
  • npm/@xhmikosr/archive-type@8.1.0
  • npm/@xhmikosr/bin-check@8.2.2
  • npm/@xhmikosr/bin-wrapper@14.5.1
  • npm/@xhmikosr/decompress@11.1.4
  • npm/@xhmikosr/decompress-tar@9.0.2
  • npm/@xhmikosr/decompress-tarbz2@9.0.2
  • npm/@xhmikosr/decompress-targz@9.0.1
  • npm/@xhmikosr/decompress-unzip@8.2.1
  • npm/@xhmikosr/downloader@16.3.1
  • npm/@xhmikosr/os-filter-obj@4.1.0
  • npm/async-listen@3.0.0
  • npm/binary-version@7.1.0
  • npm/binary-version-check@6.1.0
  • npm/bowser@2.14.1
  • npm/builtin-modules@5.0.0
  • npm/byte-counter@0.1.0
  • npm/cacheable-lookup@7.0.0
  • npm/cacheable-request@13.0.19
  • npm/cbor-extract@2.2.2
  • npm/cbor-x@1.6.0
  • npm/clean-stack@3.0.1
  • npm/convert-hrtime@5.0.0
  • npm/date-fns@4.1.0
  • npm/decompress-response@10.0.0
  • npm/easy-table@1.2.0
  • npm/ext-list@2.2.2
  • npm/ext-name@5.0.0
  • npm/figures@6.1.0
  • npm/filename-reserved-regex@4.0.0
  • npm/filenamify@7.0.2
  • npm/find-versions@6.0.0
  • npm/form-data-encoder@4.1.0
  • npm/function-timeout@1.0.2
  • npm/got@14.6.6
  • npm/http2-wrapper@2.2.1
  • npm/indent-string@4.0.0
  • npm/inspect-with-kind@1.0.5
  • npm/keyv@5.6.0
  • npm/kind-of@6.0.3
  • npm/lowercase-keys@3.0.0
  • npm/make-asynchronous@1.1.0
  • npm/mimic-function@5.0.1
  • npm/mimic-response@4.0.0
  • npm/node-gyp-build-optional-packages@5.1.1
  • npm/normalize-url@8.1.1
  • npm/os-paths@4.4.0
  • npm/p-cancelable@4.0.1
  • npm/p-event@6.0.1
  • npm/parse-ms@4.0.0
  • npm/parse-ms@2.1.0
  • npm/pend@1.2.0
  • npm/piscina@4.9.3
  • npm/pretty-ms@9.3.0
  • npm/pretty-ms@7.0.1
  • npm/quick-lru@5.1.1
  • npm/resolve-alpn@1.2.1
  • npm/responselike@4.0.2
  • npm/seedrandom@3.0.5
  • npm/seek-bzip@2.0.0
  • npm/semver-regex@4.0.5
  • npm/semver-truncate@3.0.0
  • npm/sort-keys@1.1.2
  • npm/sort-keys-length@1.0.1
  • npm/stdin-discarder@0.2.2
  • npm/strip-dirs@3.0.0
  • npm/super-regex@1.1.0
  • npm/system-architecture@1.0.0
  • npm/terminal-link@5.0.0
  • npm/through@2.3.8
  • npm/time-span@5.1.0
  • npm/ulid@3.0.2
  • npm/unbzip2-stream@1.4.3
  • npm/web-worker@1.5.0
  • npm/wordwrap@1.0.0
  • npm/workflow@4.8.1
  • npm/@swc/cli@0.8.1
  • npm/@workflow/nest@4.0.17
  • npm/xdg-app-paths@5.1.0
  • npm/xdg-portable@7.3.0
  • npm/yauzl@3.4.0
  • npm/yoctocolors@2.2.0
  • npm/@faker-js/faker@5.5.3
  • npm/@postman/form-data@3.1.1
  • npm/@postman/tough-cookie@4.1.3-postman.1
  • npm/@postman/tunnel-agent@0.6.8
  • npm/@types/newman@5.3.6
  • npm/@types/postman-collection@3.5.11
  • npm/asn1@0.2.6
  • npm/assert-plus@1.0.0
  • npm/aws-sign2@0.7.0
  • npm/aws4@1.13.2
  • npm/aws4@1.12.0
  • npm/bcrypt-pbkdf@1.0.2
  • npm/bluebird@2.11.0
  • npm/brotli@1.3.3
  • npm/caseless@0.12.0
  • npm/charset@1.0.1
  • npm/cli-progress@3.12.0
  • npm/colors@1.4.0
  • npm/dashdash@1.14.1
  • npm/des.js@1.1.0
  • npm/ecc-jsbn@0.1.2
  • npm/extsprintf@1.3.0
  • npm/filesize@10.1.4
  • npm/flatted@3.4.4
  • npm/forever-agent@0.6.1
  • npm/getpass@0.1.7
  • npm/handlebars@4.7.9
  • npm/har-schema@2.0.0
  • npm/har-validator@5.1.5
  • npm/http-reasons@0.1.0
  • npm/http-signature@1.4.0
  • npm/http-signature@1.3.6
  • npm/httpntlm@1.8.13
  • npm/httpreq@1.1.1
  • npm/isstream@0.1.2
  • npm/js-md4@0.3.2
  • npm/js-sha512@0.9.0
  • npm/jsbn@0.1.1
  • npm/jsprim@2.0.2
  • npm/liquid-json@0.3.1
  • npm/mime-format@2.0.1
  • npm/minimalistic-assert@1.0.1
  • npm/mkdirp@3.0.1
  • npm/newman@6.2.2
  • npm/node-oauth1@1.3.0
  • npm/oauth-sign@0.9.0
  • npm/performance-now@2.1.0
  • npm/postman-collection@4.4.0
  • npm/postman-collection-transformer@4.1.8
  • npm/postman-request@2.88.1-postman.48
  • npm/postman-request@2.88.1-postman.34
  • npm/postman-runtime@7.39.1
  • npm/postman-sandbox@4.7.1
  • npm/postman-url-encoder@3.0.5
  • npm/psl@1.15.0
  • npm/querystringify@2.2.0
  • npm/requires-port@1.0.0
  • npm/serialised-error@1.1.3
  • npm/sshpk@1.18.0
  • npm/stream-length@1.0.2
  • npm/teleport-javascript@1.0.0
  • npm/tweetnacl@0.14.5
  • npm/uglify-js@3.19.3
  • npm/underscore@1.13.8
  • npm/url-parse@1.5.10
  • npm/uvm@2.1.1
  • npm/verror@1.10.0
  • npm/word-wrap@1.2.5
  • npm/xmlbuilder@15.1.1
  • npm/@arcjet/analyze@1.9.1
  • npm/@arcjet/analyze@1.10.0-rc.0
  • npm/@arcjet/analyze-wasm@1.9.1
  • npm/@arcjet/analyze-wasm@1.10.0-rc.0
  • npm/@arcjet/body@1.9.1
  • npm/@arcjet/cache@1.9.1
  • npm/@arcjet/cache@1.10.0-rc.0
  • npm/@arcjet/duration@1.9.1
  • npm/@arcjet/env@1.9.1
  • npm/@arcjet/headers@1.9.1
  • npm/@arcjet/ip@1.9.1
  • npm/@arcjet/logger@1.9.1
  • npm/@arcjet/logger@1.10.0-rc.0
  • npm/@arcjet/next@1.9.1
  • npm/@arcjet/protocol@1.9.1
  • npm/@arcjet/protocol@1.10.0-rc.0
  • npm/@arcjet/runtime@1.9.1
  • npm/@arcjet/sprintf@1.9.1
  • npm/@arcjet/sprintf@1.10.0-rc.0
  • npm/@arcjet/stable-hash@1.9.1
  • npm/@arcjet/transport@1.9.1
  • npm/@bufbuild/protobuf@2.13.0
  • npm/@bufbuild/protobuf@2.12.1
  • npm/@emnapi/runtime@1.11.3
  • npm/@img/sharp-darwin-arm64@0.35.3
  • npm/@img/sharp-darwin-x64@0.35.3
  • npm/@img/sharp-libvips-darwin-arm64@1.3.2
  • npm/@img/sharp-libvips-darwin-x64@1.3.2
  • npm/@img/sharp-libvips-linux-arm@1.3.2
  • npm/@img/sharp-libvips-linux-arm64@1.3.2
  • npm/@img/sharp-libvips-linux-ppc64@1.3.2
  • npm/@img/sharp-libvips-linux-riscv64@1.3.2
  • npm/@img/sharp-libvips-linux-s390x@1.3.2
  • npm/@img/sharp-libvips-linux-x64@1.3.2
  • npm/@img/sharp-libvips-linuxmusl-arm64@1.3.2
  • npm/@img/sharp-libvips-linuxmusl-x64@1.3.2
  • npm/@img/sharp-linux-arm@0.35.3
  • npm/@img/sharp-linux-arm64@0.35.3
  • npm/@img/sharp-linux-ppc64@0.35.3
  • npm/@img/sharp-linux-riscv64@0.35.3
  • npm/@img/sharp-linux-s390x@0.35.3
  • npm/@img/sharp-linux-x64@0.35.3
  • npm/@img/sharp-linuxmusl-arm64@0.35.3
  • npm/@img/sharp-linuxmusl-x64@0.35.3
  • npm/@img/sharp-wasm32@0.35.3
  • npm/@img/sharp-win32-arm64@0.35.3
  • npm/@img/sharp-win32-ia32@0.35.3
  • npm/@img/sharp-win32-x64@0.35.3
  • npm/@types/node@24.10.9
  • npm/@types/node@24.13.3
  • npm/arcjet@1.9.1
  • npm/baseline-browser-mapping@2.11.12
  • npm/caniuse-lite@1.0.30001809
  • npm/nanoid@3.3.18
  • npm/nanoid@5.1.6
  • npm/postcss@8.5.26
  • npm/postcss@8.4.31
  • npm/semver@7.7.4
  • npm/semver@7.5.4
  • npm/semver@7.6.3
  • npm/sharp@0.35.3
  • npm/undici-types@7.18.2
  • npm/@babel/parser@7.29.8
  • npm/@babel/types@7.29.8
  • npm/@rollup/rollup-android-arm-eabi@4.62.4
  • npm/@rollup/rollup-android-arm64@4.62.4
  • npm/@rollup/rollup-darwin-arm64@4.62.4
  • npm/@rollup/rollup-darwin-x64@4.62.4
  • npm/@rollup/rollup-freebsd-arm64@4.62.4
  • npm/@rollup/rollup-freebsd-x64@4.62.4
  • npm/@rollup/rollup-linux-arm-gnueabihf@4.62.4
  • npm/@rollup/rollup-linux-arm-musleabihf@4.62.4
  • npm/@rollup/rollup-linux-arm64-gnu@4.62.4
  • npm/@rollup/rollup-linux-arm64-musl@4.62.4
  • npm/@rollup/rollup-linux-loong64-gnu@4.62.4
  • npm/@rollup/rollup-linux-loong64-musl@4.62.4
  • npm/@rollup/rollup-linux-ppc64-gnu@4.62.4
  • npm/@rollup/rollup-linux-ppc64-musl@4.62.4
  • npm/@rollup/rollup-linux-riscv64-gnu@4.62.4
  • npm/@rollup/rollup-linux-riscv64-musl@4.62.4
  • npm/@rollup/rollup-linux-s390x-gnu@4.62.4
  • npm/@rollup/rollup-linux-x64-gnu@4.62.4
  • npm/@rollup/rollup-linux-x64-musl@4.62.4
  • npm/@rollup/rollup-openbsd-x64@4.62.4
  • npm/@rollup/rollup-openharmony-arm64@4.62.4
  • npm/@rollup/rollup-win32-arm64-msvc@4.62.4
  • npm/@rollup/rollup-win32-ia32-msvc@4.62.4
  • npm/@rollup/rollup-win32-x64-gnu@4.62.4
  • npm/@rollup/rollup-win32-x64-msvc@4.62.4
  • npm/picomatch@4.0.5
  • npm/commander@8.3.0
  • npm/commander@6.2.1
  • npm/crossws@0.4.10
  • npm/escape-string-regexp@4.0.0
  • npm/h3@2.0.1-rc.22
  • npm/is-plain-obj@1.1.0
  • npm/is-wsl@2.2.0
  • npm/p-limit@4.0.0
  • npm/p-timeout@6.1.4
  • npm/prettier@3.9.6
  • npm/range-parser@1.3.0
  • npm/readdirp@5.1.1
  • npm/rollup@4.62.4
  • npm/unstorage@2.0.0-alpha.7
  • npm/zod@4.1.11
  • npm/zod@4.3.6
  • npm/@ai-sdk/gateway@4.0.45
  • npm/@ai-sdk/gateway@4.0.27
  • npm/@ai-sdk/provider@4.0.6
  • npm/@ai-sdk/provider@4.0.3
  • npm/@ai-sdk/provider-utils@5.0.24
  • npm/@ai-sdk/provider-utils@5.0.12
  • npm/@vercel/oidc@3.8.2
  • npm/ai@7.0.57
  • npm/ai@7.0.36
  • npm/find-up@7.0.0
  • npm/has-flag@5.0.1
  • npm/locate-path@7.2.0
  • npm/p-locate@6.0.0
  • npm/path-exists@5.0.0
  • npm/@babel/generator@7.29.8
  • npm/@babel/traverse@7.29.8
  • npm/@oxc-project/types@0.143.0
  • npm/acorn@8.18.0
  • npm/ansis@3.17.0
  • npm/brace-expansion@5.0.9
  • npm/brace-expansion@2.1.4
  • npm/is-stream@4.0.1
  • npm/minimatch@10.2.6
  • npm/async@3.2.5
  • npm/browserslist@4.28.7
  • npm/core-util-is@1.0.2
  • npm/define-lazy-prop@2.0.0
  • npm/electron-to-chromium@1.5.402
  • npm/errx@0.1.2
  • npm/execa@9.6.1
  • npm/exsolve@1.1.1
  • npm/exsolve@1.0.7
  • npm/get-stream@9.0.1
  • npm/giget@3.3.1
  • npm/httpxy@0.5.5
  • npm/human-signals@8.0.1
  • npm/ignore@7.0.6
  • npm/node-releases@2.0.53
  • npm/onetime@7.0.0
  • npm/open@8.4.0
  • npm/srvx@0.11.22
  • npm/strip-final-newline@4.0.0
  • npm/tar-stream@3.1.7
  • npm/type-fest@0.13.1
  • npm/type-fest@4.41.0
  • npm/unicorn-magic@0.1.0
  • npm/update-browserslist-db@1.3.0
  • npm/body-parser@1.20.6
  • npm/content-disposition@2.0.1
  • npm/iconv-lite@0.7.3
  • npm/media-typer@1.1.1
  • npm/p-map@7.0.6
  • npm/qs@6.15.3
  • npm/valibot@1.4.2
  • npm/@types/express-serve-static-core@5.1.3
  • npm/@nestjs/common@11.1.28
  • npm/@nestjs/core@11.1.28
  • npm/chardet@2.0.0
  • npm/cli-cursor@5.0.0
  • npm/enhanced-resolve@5.19.0
  • npm/file-type@3.9.0
  • npm/fs-extra@11.4.0
  • npm/is-interactive@2.0.0
  • npm/is-unicode-supported@2.1.0
  • npm/is-unicode-supported@1.3.0
  • npm/log-symbols@6.0.0
  • npm/ora@8.2.0
  • npm/restore-cursor@5.1.0
  • npm/universalify@0.2.0
  • npm/watchpack@2.5.1
  • npm/filelist@1.0.6
  • npm/@protobufjs/utf8@1.1.2
  • npm/boxen@8.0.1
  • npm/camelcase@8.0.0
  • npm/cli-boxes@3.0.0
  • npm/csv-parse@4.16.3
  • npm/uuid@3.4.0
  • npm/uuid@8.3.2
  • npm/ip-address@10.4.0
  • npm/jose@5.10.0
  • npm/jose@5.6.3
  • npm/object-hash@1.3.1
  • npm/protobufjs@7.6.5
  • npm/sprintf-js@1.1.3
  • npm/stack-trace@0.0.9
  • npm/supports-hyperlinks@4.5.0
  • npm/undici@8.9.0
  • npm/undici@7.29.0
  • npm/undici@7.28.0
  • npm/widest-line@5.0.0

View full report

@davidmytton
davidmytton marked this pull request as ready for review August 7, 2026 19:10
@davidmytton

Copy link
Copy Markdown
Collaborator Author

@SocketSecurity ignore-all

@arcjet-review arcjet-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arcjet Review — 🔴 High Risk

Decision: Needs Review

Rationale: This PR adds many new runnable examples, new public API endpoints, multiple new dependency sets, Dockerfiles, root compose wiring, and CI matrix changes. Multiple escalation triggers fire, and the diff is far above the automated review size threshold. The most immediate correctness concern is that several Dockerfiles and READMEs use npm ci, but the diff does not include corresponding lockfiles for the new npm examples, so the newly added Docker CI matrix entries are likely to fail. Security review also found public AI/model-triggering endpoints without authentication, rate limiting, or request-size limits, plus demo endpoints exposing policy/tool trace details and bot-detection internals. These may be acceptable for isolated examples, but they need human review before merge.

Summary of Changes

Adds eight Arcjet examples for Bun, Express/Newman, Next.js bot categories, React Router middleware, AI agent guardrails, sensitive info detection, and Guard policy demos; wires four into root compose and Docker build CI; updates README and publishing script registrations.

Escalation Triggers

  • Dependency Changes: The PR adds multiple new package.json files with new runtime, AI, Arcjet, Next.js, React Router, Rampart, Newman, and workflow dependencies.
  • CI/CD Pipeline: The PR modifies .github/workflows/docker-build.yml and adds many Dockerfiles/devcontainer Dockerfiles.
  • Authentication & Authorization: The diff introduces public endpoints handling API keys, AI gateway access, policy actors, guard decisions, and token/rate-limit terminology; content trigger patterns matched and the authorization posture needs review.

Security Flags

  • [MEDIUM] Abuse prevention / access control (examples/nextjs-ai-agent/app/api/agent/route.ts:34): New AI/model-triggering endpoints can be called anonymously and do not apply request rate limiting, authentication, or input length limits before starting workflows or model calls. If deployed publicly, this can be abused to consume AI gateway credits or create background workload.
  • [LOW] Data exposure (examples/nextjs-guard-policy/app/api/context/route.ts:12): The Guard policy demo returns full demo client records and later returns tool traces/results to the browser. The data appears synthetic and the README warns this is a demo, but hosted versions should avoid returning raw records, tool inputs, tool outputs, prompts, or sensitive-looking fields to untrusted clients.
  • [LOW] Security information disclosure (examples/nextjs-bot-categories/app/api/arcjet/route.ts:18): The bot-categories API returns headers that disclose which bot identifiers were allowed or denied. The inline comment correctly warns that this can aid evasion; reviewers should confirm this is acceptable for a public example or gate it behind a debug/demo mode.
  • [LOW] Supply chain (examples/bun/.devcontainer/Dockerfile:4): The Bun devcontainer installs Bun by piping a remote install script into bash without pinning or verifying the downloaded script. This is lower risk for a devcontainer, but it is still a supply-chain pattern reviewers should explicitly accept or replace with a pinned package/image.

Review Focus Areas

Notes

The diff is far above the 1000-line automated review threshold, so this review should be treated as a high-level risk scan rather than exhaustive validation. Human reviewers should verify generated/example files, lockfiles, CI behavior, and the intended demo-versus-production security posture.

Path filtering: 7 files excluded by ignore paths. 137 of 144 files included in review.

Review: 97442b64 | Model: openai/gpt-5.5 | Powered by Arcjet Review

EXPOSE 8080

COPY package*.json ./
RUN npm ci

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a committed package-lock.json for this example or change the install command. npm ci fails when no lockfile is present, and this example is now in the Docker build CI matrix.

EXPOSE 3000

COPY package*.json ./
RUN npm ci

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the corresponding package-lock.json or avoid npm ci here. This example is included in the new Docker CI matrix, so a missing lockfile will break the CI build.

EXPOSE 4321

COPY package*.json ./
RUN npm ci

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a lockfile or use an install command that does not require one. The Dockerfile currently uses npm ci, but no package-lock.json is shown in the diff.

labels:
- dev.orbstack.domains=react-router-middleware.arcjet-examples.orb.local
ports:
- 3000

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please align this exposed port with the actual dev-server port. The README says to open localhost:5173, while this compose file exposes container port 3000 and the Dockerfile exposes 4321.

}),
});

const run = await start(supportAgentWorkflow, [{ question, ctx }]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add abuse controls before starting the workflow, such as an Arcjet rate limit and a maximum question length. As written, an unauthenticated caller can trigger background AI work repeatedly.

const headers = new Headers();
if (decision.reason.isBot()) {
// WARNING: This is illustrative! Don't share this metadata with users;
// otherwise they may use it to subvert bot detection!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you gate these diagnostic bot headers behind an explicit demo/debug flag or remove them from the default response? Exposing allow/deny classifications can help clients tune bot evasion.


export function GET() {
return NextResponse.json({
clients,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider returning only display labels and scenario metadata from this endpoint, or add a stronger code-level guard/comment explaining that the full records are synthetic demo fixtures and must not be copied into production.

async function readJson(request: IncomingMessage): Promise<unknown> {
const chunks: Buffer[] = [];
for await (const chunk of request) {
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a maximum request body size while reading JSON. Accumulating the entire request stream without a cap allows a client to consume memory with a large POST body.

Migrates the Vercel Eve agent example from arcjet-js, demonstrating
Arcjet Guard AI guardrails (guardTool, guardApproval, guardInbound) on a
Vercel Eve agent. Standalone example (not wired into compose/CI).

Pinned to @arcjet/guard@1.10.0-rc.0; the Eve integration subpath
(@arcjet/guard/vercel-eve) is not yet published to npm, so the README
notes it will not build until that API ships.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant