SDK migration
Our philosophy around major SDK version upgrades is to avoid breaking changes where possible. When they are necessary, we deprecate rather than break, and provide a clear migration path that remains supported for some time.
This page documents breaking changes and migrations between SDK releases.
The latest releases are JS SDK
1.17.0, Python
SDK 1.7.0, and Go
SDK 1.5.0.
JavaScript SDK
Section titled “JavaScript SDK”1.17.0
Section titled “1.17.0”Released December 1, 2026.
Guard fails closed
Section titled “Guard fails closed”A direct guard() call on @arcjet/guard now returns DENY with reason
ERROR when a required LIVE check has no result: a timeout, an unavailable
response, a missing or invalid verdict, or no registered client. Before, these
calls returned ALLOW with decision.hasFailedOpen() set to true, so code
that checked only decision.conclusion === "DENY" let the call through.
hasFailedOpen() is true only when the conclusion is ALLOW, so it is now
false for these failures. Code that blocks on
decision.conclusion === "DENY" || decision.hasFailedOpen() needs no change.
Code that blocks only on hasFailedOpen() must also block on DENY. To see
which check failed, read decision.errorResults():
const decision = await arcjet.guard({ label: "refund", rules: [limit(input)] });
if (decision.conclusion === "DENY") { if (decision.reason === "ERROR") { console.warn("Guard check could not run", decision.errorResults()); } throw new Error("Request denied");}The test client from registerTestClient() also returns DENY with reason
ERROR, because no rule runs.
Tool and action wrappers, such as guardTool and guardAction, already
blocked by default and still do. Set onGuardError: "allow" on a wrapper to
let an unavailable check through. A Guard service denial or a LIVE rule
denial still blocks. HTTP protect() is unchanged.
Unknown sensitive info entity names throw
Section titled “Unknown sensitive info entity names throw”sensitiveInfo() throws when allow or deny lists a name that is not a
built-in entity type and neither a detect function nor a backend is
configured. Before, the name was accepted and matched nothing, so the rule
never denied it. @arcjet/redact throws the same way when there is no detect
function.
Both also throw for a name that looks like a built-in type, even with detect
or a backend. A name looks like a built-in type when it matches one with case
and punctuation ignored, or, at five or more letters and digits, is a prefix of
one or one typo away from it.
Correct a misspelled name, or give a custom type a name that is not close to a built-in one:
// Before: "CREDITCARD" matched nothing.sensitiveInfo({ mode: "LIVE", deny: ["CREDIT_CARD_NUMBER"] });Email and card detection
Section titled “Email and card detection”Built-in email detection now requires a dot in the domain or a bracketed
literal such as user@[192.0.2.1]. user@localhost is no longer detected or
redacted. Use a custom detect function to match such addresses.
Card numbers are detected with the same definition the Arcjet server uses. Some card numbers that were missed are now found, and some that were found are not.
@arcjet/sensitive-info-rampart now takes card numbers from
@arcjet/analyze, which is a required peer dependency. creditCardRecognizer
is deprecated and removed from defaultRecognizers. If card detection, the
model, or a recognizer fails, the backend rejects with
SensitiveInfoIncompleteScanError. The sensitiveInfo rule returns DENY for
what the rest of the scan found, or ERROR if it found nothing.
unredact() throws on ambiguous replacements
Section titled “unredact() throws on ambiguous replacements”unredact() in @arcjet/redact throws when one replacement stands for
different values, or when the input already contained replacement text. Before,
it could restore text the original never held.
Deprecations
Section titled “Deprecations”@arcjet/deno is deprecated and logs a warning when created. On Deno, use
@arcjet/node with a node:http server, which Deno runs through its Node.js
compatibility layer.
@arcjet/redact and @arcjet/redact-wasm are deprecated and will be removed.
1.16.0
Section titled “1.16.0”Released November 16, 2026.
Missing WebAssembly surfaces as an error
Section titled “Missing WebAssembly surfaces as an error”When WebAssembly is unavailable, @arcjet/analyze throws
WasmUnavailableError instead of returning a fallback result. Before, email
validation reported every address as valid and bot detection found nothing, so
protect() returned a plain ALLOW.
Rules that Arcjet Cloud also evaluates (rate limiting, Shield, bot detection,
email validation, and filter without filterLocal) now defer to the cloud.
Local-only rules (sensitiveInfo, and filter with filterLocal) return an
ERROR result. In LIVE mode, an ERROR result from these rules turns an
ALLOW into an error decision. DENY and CHALLENGE stand.
This also applies to sensitiveInfo and filter errors unrelated to
WebAssembly. For example, a LIVE sensitiveInfo rule that cannot read the
request body now produces an error decision. An app that returns 500 when
decision.isErrored() is true now returns 500 where it used to return 200.
Rampart denies input over its scan limit
Section titled “Rampart denies input over its scan limit”A LIVE sensitiveInfo rule or localDetectSensitiveInfo Guard rule using
@arcjet/sensitive-info-rampart denies text longer than maxInputChars
without scanning it. The default is 100,000 UTF-16 code units. Before, text
past the limit went unscanned and the request was allowed. In DRY_RUN mode,
the rule logs a warning and does not deny.
To accept longer text, raise the limit:
rampart({ maxInputChars: 200_000 });1.14.0 – 1.15.0
Section titled “1.14.0 – 1.15.0”No breaking changes.
1.13.0
Section titled “1.13.0”Released September 16, 2026.
Invalid Guard labels raise at construction
Section titled “Invalid Guard labels raise at construction”Guard adapter factories now check a literal action label when you create
them, and raise ArcjetInvalidLabelError if the service cannot match it. Before, the
factory accepted the label, the label matched no policy, and the guard
silently did not run.
A label must be 1 to 256 bytes of ASCII letters, digits, dash (-), dot
(.), and underscore (_), and must start and end with a letter or digit.
Correct any label that fails. To check a label you build at runtime, call
validateGuardLabel(). A label given as a callable is checked by the service at call time.
Releases 1.13.0 to 1.14.0 also rejected uppercase letters, which the service accepts. Upgrade to 1.14.1 or later if your labels use them.
1.12.0
Section titled “1.12.0”No breaking changes.
1.11.0
Section titled “1.11.0”Released August 26, 2026.
Remove threshold and score from prompt injection detection
Section titled “Remove threshold and score from prompt injection detection”detectPromptInjection({ threshold }) and
ArcjetPromptInjectionReason.score are removed. Only mode remains.
The verdict is binary. Use decision.reason.isPromptInjection() or
decision.reason.injectionDetected:
detectPromptInjection({ mode: "LIVE" });
if (decision.reason.isPromptInjection()) { return new Response("Prompt injection detected", { status: 403 });}Drop threshold and score when you upgrade. The core SDK ignores leftover
threshold – it does not throw and it does not change the rule ID.
@arcjet/astro validates rule options with Zod .strict(). Leftover
threshold in the integration config throws at startup. Remove threshold
from astro.config when you upgrade.
1.6.1 – 1.10.0
Section titled “1.6.1 – 1.10.0”No breaking changes.
Released June 30, 2026.
Node.js 22.21.0 or later required
Section titled “Node.js 22.21.0 or later required”Node.js 20 is no longer supported. Every package requires Node.js
>=22.21.0 <23 or >=24.5.0. Node.js 23 is not supported.
Guard hasError() deprecated
Section titled “Guard hasError() deprecated”decision.hasError() in @arcjet/guard is deprecated. Use
decision.errorResults() to read the failed results.
1.1.0 – 1.5.0
Section titled “1.1.0 – 1.5.0”No breaking changes.
The
1.0.0
version of the Arcjet JS SDK was released on January 22, 2026. No migrations are required from the last 1.0.0-beta-18 release.
1.0.0 beta 18
Section titled “1.0.0 beta 18”The
1.0.0-beta-18
version of the Arcjet JS SDK was released on January 22, 2026 and includes the
following breaking changes.
Deprecate automatic body reading
Section titled “Deprecate automatic body reading”Reading streams has various pitfalls. You can now pass what value to check explicitly:
const decision = await arcjet.protect(request, { sensitiveInfoValue: "..." });This value is processed locally and is not sent to the Arcjet cloud API.
If you use tools that patch request.body, such as body-parser, you are not affected and can continue to use them.
1.0.0 beta 17
Section titled “1.0.0 beta 17”The
1.0.0-beta-17
version of the Arcjet JS SDK was released on January 13, 2026 and includes the
following breaking changes.
Remove block field in validateEmail rule config
Section titled “Remove block field in validateEmail rule config”This field was deprecated in
1.0.0-beta-1
in favor of deny:
validateEmail({ deny: ["DISPOSABLE"], mode: "LIVE" });1.0.0 beta 1
Section titled “1.0.0 beta 1”The
1.0.0-beta-1
version of the Arcjet JS SDK was released on January 15, 2025 and includes the
following breaking changes.
block is now deny for validateEmail rules
Section titled “block is now deny for validateEmail rules”When configuring the validateEmail rule we have renamed the block option to
deny. This follows the same API design as the other rules.
validateEmail({ mode: "LIVE", // replace block with deny as shown // block: ["DISPOSABLE"], deny: ["DISPOSABLE"],});It is now also possible to configure email types to allow. In the following example, Arcjet allows only email addresses from free email providers.
validateEmail({ mode: "LIVE", allow: ["FREE"],});The old options continue to work, but are flagged as deprecated.
ArcjetEnum objects are now deprecated
Section titled “ArcjetEnum objects are now deprecated”In earlier versions of the SDK we provided enum objects for configuring your rules. These have been deprecated in favor of string-type enums.
The following table shows which enums to replace and their equivalent strings.
| alpha | beta |
|---|---|
ArcjetMode.LIVE | "LIVE" |
ArcjetMode.DRY_RUN | "DRY_RUN" |
ArcjetRateLimitAlgorithm.TOKEN_BUCKET | "TOKEN_BUCKET" |
ArcjetRateLimitAlgorithm.FIXED_WINDOW | "FIXED_WINDOW" |
ArcjetRateLimitAlgorithm.SLIDING_WINDOW | "SLIDING_WINDOW" |
ArcjetEmailType.DISPOSABLE | "DISPOSABLE" |
ArcjetEmailType.FREE | "FREE" |
ArcjetEmailType.NO_MX_RECORDS | "NO_MX_RECORDS" |
ArcjetEmailType.NO_GRAVATAR | "NO_GRAVATAR" |
ArcjetEmailType.INVALID | "INVALID" |
ArcjetStack.NODEJS | "NODEJS" |
ArcjetStack.NEXTJS | "NEXTJS" |
ArcjetStack.BUN | "BUN" |
ArcjetStack.SVELTEKIT | "SVELTEKIT" |
ArcjetStack.DENO | "DENO" |
ArcjetStack.NESTJS | "NESTJS" |
ArcjetStack.REMIX | "REMIX" |
ArcjetRuleState.RUN | "RUN" |
ArcjetRuleState.NOT_RUN | "NOT_RUN" |
ArcjetRuleState.CACHED | "CACHED" |
ArcjetRuleState.DRY_RUN | "DRY_RUN" |
ArcjetConclusion.ALLOW | "ALLOW" |
ArcjetConclusion.DENY | "DENY" |
ArcjetConclusion.CHALLENGE | "CHALLENGE" |
ArcjetConclusion.ERROR | "ERROR" |
ArcjetSensitiveInfoType.EMAIL | "EMAIL" |
ArcjetSensitiveInfoType.PHONE_NUMBER | "PHONE_NUMBER" |
ArcjetSensitiveInfoType.IP_ADDRESS | "IP_ADDRESS" |
ArcjetSensitiveInfoType.CREDIT_CARD_NUMBER | "CREDIT_CARD_NUMBER" |
ArcjetRuleType.LOCAL | "LOCAL" |
ArcjetRuleType.REMOTE | "REMOTE" |
URL-encoded data in sensitive info detection
Section titled “URL-encoded data in sensitive info detection”Arcjet Sensitive info detection
and
@arcjet/redact features
handle both raw and URL-encoded data simultaneously. This dual processing
approach improves detection, particularly for content containing the +
character, which serves both as a literal plus sign (common in phone numbers)
and as an encoded space in URLs.
When implementing custom detection functions on data containing + characters, you may observe duplicate token matches across different processing windows. This occurs because the system analyzes the input in two ways:
- With
+interpreted as a literal plus sign - With
+decoded as a space character
For example:
# Input: "phone+number+123"# Processed as both:# - "phone+number+123"# - "phone number 123"Wasm loading has moved to @arcjet/analyze-wasm
Section titled “Wasm loading has moved to @arcjet/analyze-wasm”We have moved the responsibility for loading Wasm on your target platform from
@arcjet/analyze to @arcjet/analyze-wasm. This does not affect users who were
using the SDK through the high level framework adapters, such as @arcjet/next.
1.0.0-alpha.24
Section titled “1.0.0-alpha.24”The
1.0.0-alpha-24
version of the Arcjet JS SDK was released on September 5, 2024 and includes the
following breaking changes.
add and remove replaced with allow and deny in detectBot rule
Section titled “add and remove replaced with allow and deny in detectBot rule”Passing user agent patterns to the bot detection rules has been deprecated in
favor of specifying string-type enums to allow or deny.
To maintain the previous default behavior of denying all bots, you can configure the following rule:
detectBot({ mode: "LIVE", allow: [],});We now publish
a list of known bots
as both individual user agents as well as categories of types of bots. You can use these to configure your bot detection rules.
For example, a common configuration is to block all bots except search engine crawlers:
detectBot({ mode: "LIVE", // Block all bots except the following allow: [ "CATEGORY:SEARCH_ENGINE", // Google, Bing, etc // Uncomment to allow these other common bot categories // See the full list at https://arcjet.com/bot-list //"CATEGORY:MONITOR", // Uptime monitoring services //"CATEGORY:PREVIEW", // Link previews such as Slack, Discord ],}),Python SDK
Section titled “Python SDK”Released December 1, 2026.
Guard fails closed
Section titled “Guard fails closed”A direct guard() or guard_sync() call now returns DENY with reason
ERROR when a required LIVE check has no result: a timeout, an unavailable
response, a missing or invalid verdict, or no registered client. Before, these
calls returned ALLOW with has_failed_open() set to True, so code that
checked only decision.conclusion == "DENY" let the call through.
has_failed_open() is True only when the conclusion is "ALLOW", so it is
now False for these failures. Code that blocks on
decision.conclusion == "DENY" or decision.has_failed_open() needs no change.
Code that blocks only on has_failed_open() must also block on DENY. To see
which check failed, read decision.error_results(). Each entry has a code and
a message.
Tool and action wrappers already blocked by default and still do. Set
on_guard_error="allow" on a wrapper to let an unavailable check through. A
Guard service denial or a LIVE rule denial still blocks. DRY_RUN checks and
protect() are unchanged.
Unknown sensitive info entity names raise ValueError
Section titled “Unknown sensitive info entity names raise ValueError”detect_sensitive_info() and SensitiveInfoDetection raise ValueError when
allow or deny lists a name that is not a built-in SensitiveInfoEntityType
and neither a detect function nor a backend is configured. Before, the name
was accepted and matched nothing, so the rule never denied it.
A name that looks like a built-in type also raises ValueError, even with
detect or a backend. A name looks like a built-in type when it matches one
with case and punctuation ignored, or, at five or more letters and digits, is a
prefix of one or one typo away from it.
from arcjet import Mode, SensitiveInfoEntityType, detect_sensitive_info
# Before: "CREDITCARD" matched nothing.detect_sensitive_info( mode=Mode.LIVE, deny=[SensitiveInfoEntityType.CREDIT_CARD_NUMBER],)For an intentional custom type, pass a detect function that returns it:
def detect(tokens: list[str]) -> list[str | None]: return ["ACCOUNT_ID" if t.startswith("ACC-") else None for t in tokens]
detect_sensitive_info(mode=Mode.LIVE, deny=["ACCOUNT_ID"], detect=detect)Email and card detection
Section titled “Email and card detection”The built-in email detector now requires a dot in the domain or a bracketed
literal such as user@[192.0.2.1]. user@localhost is no longer detected or
redacted. Use a custom detect function to match such addresses.
Card numbers are detected with the same definition the Arcjet server uses. Some card numbers that were missed are now found, and some that were found are not.
With arcjet-sensitive-info-rampart, card numbers come from the core package.
credit_card_recognizer is deprecated and removed from default_recognizers.
If card detection, the model, or a recognizer fails, the backend raises
arcjet.SensitiveInfoIncompleteScanError. The rule still denies what the rest
of the scan found.
Failed sensitive info scans are no longer skipped
Section titled “Failed sensitive info scans are no longer skipped”A detect_sensitive_info rule that cannot scan its value, because the
WebAssembly component is unavailable or the backend raises, is no longer
skipped. In LIVE mode, protect() turns an ALLOW into an ERROR decision
and lists the failed rule in its results. In DRY_RUN mode, the failed rule is
only listed.
For an ERROR decision, both is_allowed() and is_denied() return False.
An app that admits a request only when is_allowed() is True now blocks
requests it used to admit. To keep admitting requests when the scan fails,
admit on is_allowed() or is_error(), keep your existing handling for other
conclusions such as CHALLENGE, and log or alert on is_error().
Released November 16, 2026.
Python 3.11 or later required
Section titled “Python 3.11 or later required”Python 3.10 reached end of life in October 2026 and is no longer supported.
Rampart denies input over its scan limit
Section titled “Rampart denies input over its scan limit”A LIVE detect_sensitive_info rule or LocalDetectSensitiveInfo Guard rule
using arcjet-sensitive-info-rampart denies text longer than
max_input_chars without scanning it. The default is 100,000 characters.
Before, the backend scanned the first 100,000 characters, ignored the rest, and
allowed the request. In DRY_RUN mode, the rule logs a warning and does not
deny. To accept longer text, raise RampartOptions.max_input_chars.
1.3.0 – 1.5.0
Section titled “1.3.0 – 1.5.0”No breaking changes.
Released September 16, 2026.
Invalid Guard labels raise at construction
Section titled “Invalid Guard labels raise at construction”Guard adapter factories now check a literal action label when you create
them, and raise ArcjetInvalidLabelError if the service cannot match it. Before, the
factory accepted the label, the label matched no policy, and the guard
silently did not run.
A label must be 1 to 256 bytes of ASCII letters, digits, dash (-), dot
(.), and underscore (_), and must start and end with a letter or digit.
Correct any label that fails. To check a label you build at runtime, call
validate_guard_label(). A label given as a callable is checked by the service at call time.
Releases 1.2.0 to 1.3.0 also rejected uppercase letters, which the service accepts. Upgrade to 1.4.0 or later if your labels use them. ArcjetInvalidLabelError subclasses ArcjetMisconfiguration, so code that already catches that keeps working.
No breaking changes.
Remove threshold from prompt injection detection
Section titled “Remove threshold from prompt injection detection”detect_prompt_injection(threshold=...) and the threshold field on
PromptInjectionDetection are removed. Only mode remains, and it is
required.
from arcjet import Mode, detect_prompt_injection
detect_prompt_injection(mode=Mode.LIVE)Drop threshold when you upgrade. Passing threshold= raises TypeError.
This differs from the JS core SDK, which ignores leftover threshold.
PromptInjectionReason.score remains deprecated. This release does not remove
it.
Require explicit mode on HTTP rule factories
Section titled “Require explicit mode on HTTP rule factories”HTTP rule factories require mode. Omitting it raises TypeError. Pass mode
on every shield(), detect_bot(), token_bucket(), fixed_window(),
sliding_window(), validate_email(), detect_sensitive_info(),
filter_request(), and detect_prompt_injection() call.
from arcjet import Mode, detect_bot, shield
rules = [ shield(mode=Mode.LIVE), detect_bot(mode=Mode.LIVE, allow=["CATEGORY:SEARCH_ENGINE"]),]protect_signup() forwards its nested rate_limit, bots, and email
mappings to those factories, so each mapping must include mode too.
JavaScript HTTP rules default to "DRY_RUN". A Python default of DRY_RUN
would silently turn LIVE configs into observe-only, so Python requires mode
instead.
Guard constructors still default to Mode.LIVE, matching the JavaScript Guard
SDK. You can omit mode on Guard constructors.
Go SDK
Section titled “Go SDK”Guard fails closed
Section titled “Guard fails closed”A direct Guard call now returns ConclusionDeny with ReasonError when a
required LIVE check has no result: a timeout, an unavailable response, or a
missing or invalid verdict. Before, a missing result could look like an
ordinary allow. Read decision.ErrorResults() to see which check failed, and
handle any RPC error alongside the decision.
GuardAction blocks by default. Set OnGuardError: arcjet.OnGuardErrorAllow
on an action to let an unavailable check through. A Guard service denial or a
LIVE rule denial still blocks. HTTP Protect is unchanged.
Sensitive info entity names are validated
Section titled “Sensitive info entity names are validated”SensitiveInfo and GuardSensitiveInfo rules return
ErrUnsupportedEntityType, and redact.New returns an error, when a listed
name isn’t a built-in type and neither a custom detect function nor a backend
can report it. Before, the name was accepted and matched nothing.
A name that looks like a built-in type is rejected even with a detect function
or a backend. A name looks like a built-in type when it matches one with case
and punctuation ignored, or, at five or more letters and digits, is a prefix of
one or one typo away from it. For a SensitiveInfo rule with a lookalike name,
NewClient and WithRule return the error. Use the exact built-in name, or
rename an
intentional lookalike in both the rule and the detector or backend that
reports it.
Email and card detection
Section titled “Email and card detection”Built-in email detection requires a dot in the domain or a bracketed literal
such as user@[192.0.2.1], so user@localhost isn’t detected or redacted.
Card numbers are detected with the same definition the Arcjet server uses. Some
card numbers that were missed are found, and some that were found aren’t. The
new arcjet.DetectCardNumbers function finds card numbers with the bundled
analyzer.
With the sensitiveinfo/rampart backend, card numbers come from
DetectCardNumbers. rampart.CreditCardRecognizer is deprecated and removed
from rampart.DefaultRecognizers. If card detection or the model fails, the
backend returns a *arcjet.SensitiveInfoIncompleteScanError that carries what
the rest of the scan denied. A LIVE rule denies those with an error reason.
Failed sensitive info scans are reported
Section titled “Failed sensitive info scans are reported”A LIVE SensitiveInfo rule that can’t scan its value turns an ALLOW from
Arcjet into an ERROR decision and lists the failed rule in its results.
decision.IsAllowed() stays true, so check decision.IsErrored() to fail
closed. In DRY_RUN mode, the failed rule is only listed.
Without a backend, the rule denies input over
arcjet.BundledSensitiveInfoMaxInputChars (8,388,608 characters) without
scanning it, as it does for input over a backend’s MaxInputChars.
redact returns ErrNotReversible
Section titled “redact returns ErrNotReversible”The redact package is deprecated. Redact returns redact.ErrNotReversible,
with the redacted text and a nil Unredact, when one replacement stands for
different values or the input already contains replacement text. Check the
error before you call Unredact.
Released November 16, 2026.
Go 1.26 or later required
Section titled “Go 1.26 or later required”The module now declares go 1.26.0. Go 1.25 is no longer supported.
Rampart denies input over its scan limit
Section titled “Rampart denies input over its scan limit”A SensitiveInfo or GuardSensitiveInfo rule using the
sensitiveinfo/rampart backend denies text longer than
Options.MaxInputChars without scanning it. The default is 4,096 Unicode code
points. Before, the backend scanned the first 4,096 characters, ignored the
rest, and allowed the request. To accept longer text, raise the limit:
backend, err := rampart.New(rampart.Options{MaxInputChars: 16384})A custom backend can declare its own limit by implementing
SensitiveInfoBackendLimiter.
1.1.0 – 1.3.0
Section titled “1.1.0 – 1.3.0”No breaking changes.
Released September 17, 2026. This is the first stable release.
Get help
Section titled “Get help”Need help with anything? Email us or join our Discord to get support from our engineering team.