isAiAgent, is_ai_agent, or decision.IsAIAgent().What is AI agent identification?
AI agent identification is the practice of determining whether an HTTP client is a named automated agent, then verifying that claim, so you can allow useful crawlers and assistants while denying impersonators. The hard part is not "blocking bots." It is distinguishing a malicious scraper from a search indexer, a training crawler, or a browser-capable assistant that a customer sent.
You already decide what automated traffic you want. Should your catalog appear in AI answers? Should an agent sign up or check out on a user's behalf? Do you want Googlebot on every route? Identification is how you enforce that policy without trusting a string the client wrote about itself.
Four methods carry most of the weight: the User-Agent header, IP and reverse-DNS verification, Web Bot Auth signatures, and Personal Agent Protocol sessions. Use them together. A header tells you who the client claims to be. Verification tells you whether that claim is true. Signatures help when the agent uses a real browser and no longer looks like a crawler, and a Personal Agent Protocol session adds that the agent acts for one of its users. Arcjet reports the result as one bot identity with an evidence level, so your code reads how strongly the name was proven, not only the name.
For more information about layered detection, see bot detection techniques. For more information about impersonation, see detect bot spoofing.
How do the identification methods compare?
The following table scores the four methods on reliability, spoofability, and setup cost, and gives the evidence level that Arcjet reports for each. Scores are relative, not absolute. A high-reliability method still fails if you skip key rotation or treat an outdated IP prefix as current.
| Method | Reliability | Spoofability | Setup cost | Evidence level | Best for |
|---|---|---|---|---|---|
| User-Agent string | Low | Trivial | Low | UNVERIFIED | First-pass classification and known-bot allow or deny lists |
| IP prefixes and reverse DNS | High for named crawlers | Low | Medium | IP | Confirming Google, Bing, OpenAI, and other operators that publish address space |
| Web Bot Auth (HTTP message signatures, RFC 9421) | High when keys are current | Low | Medium to high | SIGNATURE | Browser-capable agents that share a Chrome User-Agent and a hosting or CDN IP |
| Personal Agent Protocol (Poppy) session | High for vetted agents | Low | High: an OAuth server and a published discovery file |
| Personal agents that act for one of their users, such as Meta's Muse |
A fifth source, advanced signals, runs checks in the browser and reports automation with FINGERPRINT evidence. It tells you a program drives the browser, not which agent it is. For more information about what each level proves, see AI agent evidence levels.
Treat published prefixes, key IDs, and browser version strings as maintained data. Operators rotate them. Examples later in this article are illustrative, not a list to hard-code forever.
How reliable is the User-Agent header?
The User-Agent header is the lowest-effort identification signal and the weakest. HTTP clients are supposed to send it. Nothing stops them from sending anything they like.
A terminal client identifies itself by default. curl sends a string such as curl/8.7.1. A browser sends a long Mozilla-compatible string. Well-behaved bots identify themselves truthfully. OpenAI's search indexer uses a dedicated string such as OAI-SearchBot/1.0; +https://openai.com/searchbot. Googlebot uses a documented Googlebot token inside a browser-like string. Arcjet tracks hundreds of these identifiers in the open source well-known-bots project and the public bot list.
That honesty is voluntary. You can change curl's header with --user-agent "hello" and the server sees hello. Malicious scrapers set a current Chrome string and skip past naive allowlists. Chrome ships a new stable milestone every few weeks, so any allowlist that hard-codes a version number is stale within the month; at the time of writing stable is on Chrome 156, which is eighteen milestones past where a list written in mid-2025 would have stopped. Use the header to classify a claim, then verify the claim.
An empty or missing User-Agent is itself a signal. Most legitimate clients send the header because HTTP/1.1 says they should. You can deny those requests with a filter, or inspect the decision and return 400.
How do you verify a bot by IP and reverse DNS?
IP verification checks that the source address belongs to the operator named in the User-Agent. Large crawler operators publish this data so you can allow their indexer without allowing every client that copies the header.
Reverse DNS is the usual implementation, because it avoids shipping a constantly changing prefix list in your app:
- Resolve the PTR record for the client IP. Confirm the hostname sits under an expected domain, such as
googlebot.com,google.com, orsearch.msn.com. - Resolve that hostname forward (A or AAAA). Confirm the result matches the original client IP.
If either step fails, the client is spoofing or the operator has not published verification data for that bot. Do not allow it as a search engine.
Some operators also publish machine-readable IP prefixes. OpenAI documents SearchBot prefixes as JSON that you can fetch and cache. A containment check against a CIDR is then enough. Prefixes change, so treat any example range as illustrative and refresh the list. Hard-coding a snapshot such as a /28 from a blog post allows the wrong network or blocks the real crawler once the operator renumbers.
IP verification lets you trust the User-Agent for named crawlers. You can allow verified Google and OpenAI indexers on public content and deny everyone else who claims those names. It does not identify a browser-capable agent. That client looks like Chrome, often arrives from a CDN or hosting range, and may geolocate near the human who launched it.
How do HTTP message signatures identify browser agents?
Browser-capable agents break the crawler model. ChatGPT's agent mode, which launched in mid-2025, is one example: the product opens a real browser, follows instructions, and sends a standard Chrome User-Agent. In one captured session the source IP belonged to Cloudflare, not OpenAI, and geolocated near the person talking to ChatGPT. User-Agent and IP both said "ordinary browser on a hosting network."
Some platforms sign outbound HTTP with Web Bot Auth, a profile of RFC 9421 HTTP Message Signatures that adds a Signature-Agent header. ChatGPT's agent has used Signature-Agent: "https://chatgpt.com" (quotes included) and advertised keys from a /.well-known/http-message-signatures-directory document. Verification then looks like this:
- Confirm
Signature-Agentmatches the expected origin, including quoting. - Fetch the current key set from that origin's well-known directory.
- Verify
SignatureagainstSignature-Inputwith the key ID, algorithm, created and expiry timestamps, and covered components.
The following TypeScript sketch uses web-bot-auth. The key material and header values are illustrative. Fetch live keys. Do not paste expired kid or x values from an old capture into production.
import { verify } from "web-bot-auth";import { verifierFromJWK } from "web-bot-auth/crypto";
// Replace with a JWK from the operator's current well-known directory.const jwk = await fetchCurrentJwk(keyidFromSignatureInput);
const signedRequest = new Request("https://example.com/", { headers: { Signature: request.headers.get("Signature") ?? "", "Signature-Input": request.headers.get("Signature-Input") ?? "", "Signature-Agent": request.headers.get("Signature-Agent") ?? "", },});
await verify(signedRequest, await verifierFromJWK(jwk));Current Node.js releases can run TypeScript files directly, so you can prototype this without a separate compile step. In production, cache the key set, enforce expiry, and fail closed when the signature is missing on a route that requires a named agent.
Signatures do not replace IP verification for crawlers. They cover the case IP verification cannot: a real browser, a CDN egress IP, and a platform that is willing to non-repudiate the request.
Arcjet verifies Web Bot Auth signatures inside the detectBot rule, for the signers in the open well-known-bots catalog and for any directory you name with a SIGNED_BOT: entry. A verified signature gives the bot identity SIGNATURE evidence and names the signing host in operator, such as chatgpt.com. A signature proves the operator, not the end user: Browserbase, Kernel, and Cloudflare Browser Run sign for many customers. For more information about what a platform signature tells you, see hosted browser agent signatures. For more information about ChatGPT agent in particular, see how to detect ChatGPT agent.
How does the Personal Agent Protocol identify delegated agents?
The Personal Agent Protocol (Poppy) identifies a personal agent and shows that it acts for one of its users. The agent sends a Poppy-Session header with each request: a token signed by a short-lived key that the agent's published keys authorize, and bound to the request's method and URL. It signs in through your own OAuth server, with scopes that the person approves, instead of using the person's password.
A site opts in by publishing /.well-known/poppy.json, which its authorization server provides. Specification 1.0 was published on November 14, 2026. Meta's Muse publishes a Poppy client_id, and Arcjet reports a verified Muse session as META_MUSE.
Arcjet verifies sessions only for agents vetted in the well-known-bots catalog, and it doesn't fetch a client_id URL that a request supplies. A verified session gives the identity kind AI_AGENT, SIGNATURE evidence, the agent's domain as operator, and delegated set to true. The session's user ID is pseudonymous and different for each site, so Poppy doesn't tell you who the person is, and it doesn't prove that they approved this action. Your authorization server still checks the access token and its scopes.
For more information, see what is the Personal Agent Protocol and how to detect Meta's Muse AI agent.
How do you combine methods in application code?
Allow the categories you want in a detectBot rule, deny spoofed claims, then read the bot identity instead of matching bot IDs yourself. Arcjet runs every method in one rule: it classifies the User-Agent against the bot list, verifies claims with IP data and reverse DNS, and verifies Web Bot Auth signatures and Personal Agent Protocol sessions. It then reports one primary identity, with the strongest evidence, on the bot rule's reason.
Read it with the AI agent helper and the identity fields:
isAiAgentfrom@arcjet/inspectin JavaScript,is_ai_agentin Python, anddecision.IsAIAgent()in Go return true for aLIVEbot rule whose identity has kindAI_AGENTand isn't spoofed. They don't check evidence.- The identity is on
result.reason.identityin JavaScript,result.reason_v2.identityin Python, andresult.Reason.Bot.Identityin Go. Readevidencewhen the strength of the identity matters, anddelegatedfor a Personal Agent Protocol session.
Only Arcjet Cloud computes the identity. A decision that the SDK makes locally has none, and the AI agent helpers return false for it.
Read the bot identity in JavaScript
The following Next.js route handler allows search engines and AI agents, denies other detected bots, and serves AI agents a Markdown page. Pin @arcjet/next and @arcjet/inspect to v1.
import arcjet, { detectBot, shield, fixedWindow, type ArcjetBotIdentity, type ArcjetDecision,} from "@arcjet/next";import { isAiAgent, isSpoofedBot } from "@arcjet/inspect";
const aj = arcjet({ key: process.env.ARCJET_KEY!, rules: [ shield({ mode: "LIVE" }), detectBot({ mode: "LIVE", allow: ["CATEGORY:SEARCH_ENGINE", "CATEGORY:AI_AGENT"], }), 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);
if (decision.results.some(isSpoofedBot)) { return new Response("Forbidden", { status: 403 }); }
// Check the conclusion before the agent branch. Returning early on an // agent would hand it an unlimited budget, because the fixedWindow rule // has not been acted on yet. 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 }); }
if (decision.results.some(isAiAgent)) { const identity = botIdentity(decision); // For example: CHATGPT_AGENT SIGNATURE chatgpt.com console.log(identity?.botId, identity?.evidence, identity?.operator); return new Response("# Pricing\n\nThe same content, without layout.", { headers: { "Content-Type": "text/markdown" }, }); }
return new Response("OK");}Order matters here. A bot identity is a fact, not an allowance, so branching on it before isDenied() would return 200 to an agent that had already used up the fixedWindow budget in the same config. Check the conclusion first, then use the identity to decide what an allowed client gets. isVerifiedBot still works for a yes-or-no answer, and the identity's evidence tells you which method verified the bot.
Read the bot identity in Python
The Python SDK uses is_ai_agent and is_spoofed_bot, and names the bot ID field bot_id:
import os
from arcjet import ( BotCategory, Mode, arcjet, detect_bot, is_ai_agent, is_spoofed_bot,)from fastapi import FastAPI, Requestfrom fastapi.responses import HTMLResponse, JSONResponse, PlainTextResponse
app = FastAPI()
aj = arcjet( key=os.environ["ARCJET_KEY"], rules=[ detect_bot( mode=Mode.LIVE, allow=[BotCategory.SEARCH_ENGINE, BotCategory.AI_AGENT], ), ],)
@app.get("/pricing")async def pricing(request: Request): decision = await aj.protect(request)
if decision.is_denied() or any(is_spoofed_bot(r) for r in decision.results): return JSONResponse({"error": "Forbidden"}, status_code=403)
for result in decision.results: reason = result.reason_v2 if is_ai_agent(result) and reason.type == "BOT" and reason.identity: identity = reason.identity # For example: OPENAI_CRAWLER_USER IP print(identity.bot_id, identity.evidence, identity.operator) return PlainTextResponse( "# Pricing\n\nThe same content, without layout.", media_type="text/markdown", )
return HTMLResponse("<h1>Pricing</h1>")Read the bot identity in Go
In Go, the spoof and AI agent checks are methods on the decision instead of a separate package:
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, arcjet.BotCategoryAIAgent, }, }), },})if err != nil { return err}
http.HandleFunc("GET /", func(w http.ResponseWriter, r *http.Request) { decision, _ := aj.Protect(r.Context(), r)
// Denied: the claimed bot is not on the allow list. // Spoofed: the address does not back the claim. if decision.IsDenied() || decision.IsSpoofedBot() { http.Error(w, "Forbidden", http.StatusForbidden) return }
if decision.IsAIAgent() { for _, result := range decision.Results { if bot := result.Reason.Bot; bot != nil && bot.Identity != nil { // For example: CHATGPT_AGENT SIGNATURE chatgpt.com log.Println(bot.Identity.BotID, bot.Identity.Evidence, bot.Identity.Operator) } } w.Header().Set("Content-Type", "text/markdown") w.Write([]byte("# Pricing\n\nThe same content, without layout.")) return }
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. A named category such as CATEGORY:SEARCH_ENGINE is the usual public-content default. Pass exactly one of allow or deny. Do not use a block list. After an allow decision, still check spoofing. A client can present a Googlebot User-Agent from a residential proxy.
Signature and session verification run in the same rule, so you don't add a separate check to recognize a signed browser agent. Compose the identity with the route: allow a verified agent on /docs, and still deny the same client on /login. For more information about the full procedure, see how to block AI crawlers but allow AI agents.
What policy should you apply after you know who it is?
Identification is not permission. A verified search crawler is still not authorized to hit a private API. A signed shopping agent is still not allowed to stuff credentials. Write the rule per route.
Useful defaults:
- Allow verified search-engine indexers on public pages. Deny unverified clients that only copy those User-Agents.
- Decide explicitly what to do with
CATEGORY:AIandCATEGORY:AI_AGENTon docs versus login. Every AI agent is also inCATEGORY:AI, so denying that category blocks agents too. - Treat hosting and CDN IPs as automated until a signature or another strong signal says otherwise. Don't blanket-block them on an API that is supposed to receive server-side clients.
- Allow a named, verified agent on a confined path (catalog, docs) and deny it on signup, password reset, and checkout unless you have a commerce policy for delegated purchase.
- Treat agents that run in a person's own browser, such as Claude in Chrome and Perplexity Comet, as that person. No server-side method identifies them. For more information, see how to detect AI agents in a person's browser.
Start those rules in DRY_RUN. Measure how much login and catalog traffic would have been denied. Then promote route by route. For more information about classifying agents as clients rather than blocking every bot, see AI agent bot management.
Frequently asked questions
What is AI agent identification?
It is classifying a client as a named automated agent and verifying that claim before you grant crawler or agent privileges. The User-Agent is a claim. IP, reverse DNS, signatures, and Personal Agent Protocol sessions are how you test it.
Can I trust the User-Agent header?
No. Any client can set it. Use it to decide who the client claims to be, then verify with reverse DNS, published IP prefixes, or a message signature.
When do HTTP message signatures help?
When the agent uses a real browser, a Chrome-like User-Agent, and a CDN or hosting IP. Reverse DNS will not name the operator. Web Bot Auth signatures, built on RFC 9421, can, if you fetch current keys.
What does the Personal Agent Protocol add?
A verified Poppy session shows which agent sent the request and that it acts for one of its users. Arcjet reports it with SIGNATURE evidence and delegated set to true. It doesn't identify the user or prove that the user approved the action.
Should I allow every verified AI agent?
No. Verification is identity, not permission. Allow a verified indexer on public pages. Deny the same family on login, signup, and checkout unless you have an explicit commerce policy.
How does Arcjet identify AI agents in code?
detectBot classifies known bots and categories, verifies claims with IP and reverse DNS, and verifies Web Bot Auth signatures and Personal Agent Protocol sessions. It reports one primary bot identity. Check it with isAiAgent from @arcjet/inspect, is_ai_agent in Python, or decision.IsAIAgent() in Go, and read evidence for how strongly it was proven.
Are published OpenAI IP prefixes stable?
No. Treat prefix lists, key IDs, and browser version strings as maintained data. Fetch the current feed. Do not hard-code a blog snapshot.
Application security in your code
Protect your application with Arcjet
Read the bot identity in the request handler, where the route, the user, and the business operation decide what a verified agent may do.