spoofed on the bot identity when IP or reverse DNS verification contradicts a claim, and a spoofed identity always has UNVERIFIED evidence. Check it alongside isSpoofedBot from @arcjet/inspect, is_spoofed_bot in Python, or decision.IsSpoofedBot() in Go.What is bot spoofing?
Bot spoofing is when a client claims to be a known, usually trusted, automated agent while actually being someone else. The usual disguise is the User-Agent header: a scraper sends Googlebot's string so a naive allowlist lets it through. The request is still a scraper. The name badge is fake.
Spoofing works because many applications treat the User-Agent as identity. robots.txt is keyed on it. CDN rules are keyed on it. Open-source "is this a bot?" libraries are keyed on it. None of those checks prove the operator. They prove the client can write a string.
Verification is the countermeasure. Operators that want you to allow their crawlers publish IP ranges, reverse-DNS names, or both. You resolve the client address and accept the claim only when it matches. Arcjet runs that check for allowlisted bots and exposes the result in two places: the isSpoofedBot and isVerifiedBot helpers, and the bot identity on each decision, which sets spoofed when verification contradicts the claim.
Verification applies to bots that publish this data: Google, Bing, OpenAI, Apple, Datadog, and others that document how to confirm their crawlers. It is not limited to a fixed set of four names, and it does not cover every automated client. An unknown script has nothing to spoof and nothing to verify. You handle that client with allowlists, reputation, rate limits, and behavior.
For more information about the rest of the detection stack, see bot detection techniques. For more information about signatures when the client is a browser agent rather than a crawler, see identify AI agents and bots.
Why does User-Agent spoofing work?
The User-Agent is a self-asserted label. HTTP/1.1 says clients should send it. It does not say anyone must tell the truth. curl --user-agent "Mozilla/5.0 ... Googlebot/2.1 ..." is a complete spoof. Headless Chrome can send the same header as a person.
Well-behaved bots identify themselves so you can allow them. Googlebot, Bingbot, and OAI-SearchBot all use documented tokens. That honesty helps you and helps impersonators. If your rule is "allow any request whose User-Agent contains Googlebot," you have published the bypass.
Some browsers have reduced or frozen parts of the User-Agent. The header is still present on almost all legitimate traffic, and it is still the name robots.txt uses. Keep classifying it. Stop treating a match as proof.
A missing User-Agent is a different problem. Most real clients send one. You can deny empty values with a filter or inspect the decision and return 400. That is hygiene, not anti-spoofing.
How does reverse DNS verification work?
Reverse DNS (PTR) maps an IP address to a hostname. Forward DNS maps that hostname back to addresses. Verification is the pair of lookups plus a domain check:
- Take the client IP from a trustworthy source (platform headers your host sets, not a raw
X-Forwarded-Forthe client invented). - Look up the PTR record. Confirm the hostname sits under a domain the claimed operator publishes, such as
googlebot.comorsearch.msn.com. - Look up the hostname's A or AAAA records. Confirm one of them equals the original client IP.
If the PTR is missing, sits under a consumer ISP, or fails the forward match, the User-Agent is not evidence. The client may be a spoof, a misconfigured proxy, or a bot the operator has not listed. Deny the privileged path (the search-engine allow) and apply your default bot policy.
Some operators skip PTR and publish prefix lists instead. You then test ip in cidr against a cached feed. Refresh the feed. Prefixes change. A stale snapshot both false-allows and false-denies.
Reverse DNS is not instant. Cache positive and negative results for a short TTL. Do the work off the hottest path or use a platform that already did it. Arcjet performs IP and reverse-DNS checks for allow rules so your handler can read the outcome instead of talking to a resolver on every request.
How do you verify Googlebot?
Google documents this procedure and expects you to use it before you grant Googlebot privileges.
Suppose the client IP is 66.249.66.1 and the User-Agent contains Googlebot.
$ host 66.249.66.11.66.249.66.in-addr.arpa domain name pointer crawl-66-249-66-1.googlebot.com.
$ host crawl-66-249-66-1.googlebot.comcrawl-66-249-66-1.googlebot.com has address 66.249.66.1The PTR is under googlebot.com. The forward lookup returns the same address. Treat this request as verified Googlebot. Allow it on public content if that is your policy.
Now suppose the User-Agent is identical and the IP is a residential or cloud address whose PTR is 1-2-3-4.example-isp.net or is absent. The forward check cannot match a Google hostname. Treat the request as spoofed. Return 403 on any route you reserved for search engines. Do not "give it the benefit of the doubt" because the header looked official.
Bing, Applebot, and OpenAI's documented crawlers follow the same shape with different allowed domains or prefix files. Read the operator's current verification page. Do not copy a hostname suffix from memory.
Which bots can you verify?
You can verify a bot when the operator publishes a confirmation method and you have a claim to check (usually the User-Agent). The public bot list and well-known-bots catalog identifiers. Verification coverage is a subset: the crawlers whose owners want you to distinguish them from impersonators.
Common examples include Google crawlers, Bing, Applebot, OpenAI's documented fetchers, and monitoring products such as Datadog's. The set grows as operators document ranges or DNS. Do not write application logic that assumes "only these four." Do not assume every identifier on the bot list is verifiable. An unknown or spoofable client still belongs in UNKNOWN_BOT or a category deny.
Browser-capable agents are a separate case. They may send a Chrome User-Agent and a CDN IP. Reverse DNS will not say "OpenAI." Some of those agents sign requests with Web Bot Auth, and personal agents such as Meta's Muse can also present a Personal Agent Protocol session. Arcjet verifies both and reports them with SIGNATURE evidence. A signature is complementary to crawler verification, not a replacement.
What does the spoofed field on a bot identity mean?
The spoofed field on a bot identity is true when IP address or reverse DNS verification showed that a bot claim is false. A spoofed identity always has UNVERIFIED evidence, because the only thing that supports the name is the string the client sent, and the address contradicts it.
When Arcjet Cloud detects a bot, the bot rule's reason includes one primary bot identity. It names the bot in botId, says what kind of client it is in kind, and says how Arcjet established it in evidence, from weakest to strongest: UNVERIFIED, FINGERPRINT, IP, and SIGNATURE. The spoofed flag sits on the same record.
spoofed and UNVERIFIED evidence answer different questions:
| Identity | What it means | Example |
|---|---|---|
| Arcjet confirmed the claim | Googlebot from an address that reverse-resolves to
|
| Nobody confirmed the claim. The operator may publish no addresses, or Arcjet may have no data for this one | Claude Code, which fetches from the developer's own computer |
| Arcjet tested the claim and it failed | Googlebot's User-Agent from a residential address |
Treat the second case as unknown and the third as hostile. An unverified claim may come from a real bot that has no verification method. A spoofed claim comes from a client that copied a trusted name to get what that name gets.
The AI agent helpers apply the same rule: isAiAgent in JavaScript, is_ai_agent in Python, and decision.IsAIAgent() in Go return false for a spoofed identity. A client that claims to be ChatGPT-User from an address outside OpenAI's ranges doesn't count as an AI agent.
Only Arcjet Cloud computes the identity. A decision that the SDK makes locally has none, so keep the isSpoofedBot check, which reads the bot rule's own result. For more information about how the evidence levels compare, see AI agent evidence levels.
How do you detect spoofed bots with Arcjet?
Configure detectBot with an allow list of the bots you want. Arcjet classifies the User-Agent, then verifies allowlisted claims with IP data and reverse DNS. Inspect the rule's results with isSpoofedBot and isVerifiedBot from @arcjet/inspect, and read the bot identity for the bot's name, evidence, and spoofed flag.
A bot reason also carries isSpoofed() and isVerified(), so decision.reason.isBot() && decision.reason.isSpoofed() works. Prefer the @arcjet/inspect helpers anyway. They run per rule result and skip any rule in DRY_RUN, so a rule you are still evaluating cannot make a request look spoofed to your enforcement branch.
Detect spoofed bots in JavaScript
The following Next.js route handler denies spoofed claims, enforces the rules, and then reads the identity of a verified bot:
import arcjet, { detectBot, shield, fixedWindow, type ArcjetBotIdentity, type ArcjetDecision,} from "@arcjet/next";import { isSpoofedBot, isVerifiedBot } from "@arcjet/inspect";
const aj = arcjet({ key: process.env.ARCJET_KEY!, rules: [ shield({ mode: "LIVE" }), detectBot({ mode: "LIVE", allow: ["CATEGORY:SEARCH_ENGINE"], }), fixedWindow({ mode: "LIVE", window: "1h", max: 100 }), ],});
// The primary bot identity from an enforced bot rule, if anyfunction botIdentity(decision: ArcjetDecision): ArcjetBotIdentity | undefined { for (const result of decision.results) { if (result.state !== "DRY_RUN" && result.reason.isBot()) { return result.reason.identity; } } return undefined;}
export async function GET(req: Request) { const decision = await aj.protect(req); const identity = botIdentity(decision);
if (identity?.spoofed || decision.results.some(isSpoofedBot)) { return new Response("Forbidden", { status: 403 }); }
if (decision.isDenied()) { if (decision.reason.isBot()) { return new Response("Forbidden", { status: 403 }); } if (decision.reason.isRateLimit()) { return new Response("Too Many Requests", { status: 429 }); } return new Response("Forbidden", { status: 403 }); }
// Only after the conclusion: a verified crawler is still subject to the // fixedWindow rule, so this branch must not run before isDenied(). if (decision.results.some(isVerifiedBot)) { // For example: GOOGLE_CRAWLER IP console.log(identity?.botId, identity?.evidence); return new Response("Hello, verified crawler"); }
return new Response("OK");}Detect spoofed bots in Python
In Python, is_spoofed_bot and is_verified_bot come from the arcjet package, and the identity is on result.reason_v2.identity. This app has one bot rule, in LIVE mode, so the helper reads the first bot result:
import os
from arcjet import ( BotCategory, BotIdentity, Decision, Mode, arcjet, detect_bot, is_spoofed_bot, is_verified_bot,)from fastapi import FastAPI, Requestfrom fastapi.responses import JSONResponse
app = FastAPI()
aj = arcjet( key=os.environ["ARCJET_KEY"], rules=[ detect_bot(mode=Mode.LIVE, allow=[BotCategory.SEARCH_ENGINE]), ],)
def bot_identity(decision: Decision) -> BotIdentity | None: """Return the primary bot identity from the bot rule, if any.""" for result in decision.results: reason = result.reason_v2 if reason.type == "BOT": return reason.identity return None
@app.get("/")async def index(request: Request): decision = await aj.protect(request) identity = bot_identity(decision)
spoofed = identity is not None and identity.spoofed if spoofed or any(is_spoofed_bot(r) for r in decision.results): return JSONResponse({"error": "Forbidden"}, status_code=403)
if decision.is_denied(): return JSONResponse({"error": "Forbidden"}, status_code=403)
if any(is_verified_bot(r) for r in decision.results) and identity: # For example: GOOGLE_CRAWLER IP print(identity.bot_id, identity.evidence)
return {"message": "OK"}Detect spoofed bots in Go
In Go, the spoof and verify checks are methods on the decision, and the identity is on result.Reason.Bot.Identity:
aj, err := arcjet.NewClient(arcjet.Config{ Key: os.Getenv("ARCJET_KEY"), Rules: []arcjet.Rule{ arcjet.DetectBot(arcjet.BotOptions{ Mode: arcjet.ModeLive, Allow: []string{arcjet.BotCategorySearchEngine}, }), },})if err != nil { log.Fatal(err)}
// botIdentity returns the primary bot identity from an enforced bot rule.botIdentity := func(decision arcjet.Decision) *arcjet.BotIdentity { for _, result := range decision.Results { if result.State != arcjet.RuleStateDryRun && result.Reason.Bot != nil { return result.Reason.Bot.Identity } } return nil}
http.HandleFunc("GET /", func(w http.ResponseWriter, r *http.Request) { decision, _ := aj.Protect(r.Context(), r) identity := botIdentity(decision)
// A claim that IP or reverse DNS verification contradicted if decision.IsSpoofedBot() || (identity != nil && identity.Spoofed) { http.Error(w, "Forbidden", http.StatusForbidden) return }
if decision.IsDenied() { http.Error(w, "Forbidden", http.StatusForbidden) return }
if decision.IsVerifiedBot() && identity != nil { // For example: GOOGLE_CRAWLER IP log.Println(identity.BotID, identity.Evidence) }
w.Write([]byte("ok"))})Protect returns an error separately from the decision, and a transport failure fails open with a usable decision, so check IsDenied() rather than treating a non-nil error as a block.
An empty allow list denies every detected bot, which is correct for signup and login. On public pages, CATEGORY:SEARCH_ENGINE is the usual allow. Pass exactly one of allow or deny. After an allow decision, still check isSpoofedBot. Classification and verification are different facts.
Start in DRY_RUN if you are unsure who claims to be a search engine on your site. The dashboard shows the claimed identity and whether verification passed.
What should you do with a spoofed or verified bot?
A spoofed bot is not a search engine, and a spoofed AI agent is not an agent. Deny it on every route where you would have allowed the real bot. A 403 is appropriate. Do not issue a CAPTCHA. There is no person to solve it, and a solver farm will.
A verified bot is a known operator, not a trusted user. Allow it only where that operator has a job: public HTML, sitemaps, product listings you want indexed. Deny it on /login, /signup, /checkout, password reset, and private APIs. Verification answers "who sent this?" Authorization answers "may they do this?"
Unknown automation still exists. A strict allowlist blocks it. A permissive deny list lets unidentified clients through. That is a policy choice. Write it per route, measure it, and keep the spoof check on any path that grants crawler privileges.
See the bot protection reference for decision fields and error handling.
Frequently asked questions
What is bot spoofing?
It is impersonating a known bot, usually by copying its User-Agent, so an allowlist treats a scraper as Googlebot or another trusted crawler.
How do you verify Googlebot?
Reverse-lookup the client IP, confirm the PTR hostname is under a Google-published domain, then forward-lookup that hostname and confirm it returns the same IP.
Which bots can Arcjet verify?
Bots whose operators publish IP ranges or reverse-DNS rules, including Google, Bing, OpenAI, Apple, Datadog, and others as they document verification. It is not a fixed list of four names.
Which helpers should I use in v1?
isSpoofedBot and isVerifiedBot from @arcjet/inspect, typically via decision.results.some(...). The bot reason also has isSpoofed() and isVerified(), but prefer the helpers: they run per rule result and skip rules still in DRY_RUN.
What's the difference between spoofed and unverified?
UNVERIFIED evidence means nobody confirmed the claim, for example because the operator publishes no addresses. spoofed means Arcjet checked the claim against the operator's addresses and it failed. A spoofed identity always has UNVERIFIED evidence.
Is the spoofed field the same as isSpoofedBot?
They come from the same verification. spoofed is on the primary bot identity, which only Arcjet Cloud reports. isSpoofedBot reads the bot rule's own result, so it also works when a decision has no identity. Check both.
Should a verified bot get access everywhere?
No. Allow it on public content you want indexed. Deny it on login, signup, checkout, and private APIs.
What if the client is not a known bot?
There is nothing to verify. Handle unknown automation with your allow or deny list, rate limits, and reputation. Spoof checks apply when a client claims a verifiable identity.
Application security in your code
Protect your application with Arcjet
Verify the claim in the request handler and read the spoofed field, so a copied crawler name doesn't unlock what the real crawler gets.