200 is an exhaustive catalog export or a stuffing attempt. In the handler, a verified bot identity (Web Bot Auth or Personal Agent Protocol SIGNATURE evidence, IP, FINGERPRINT, or UNVERIFIED) becomes one input to a decision that also knows the user and the operation.What is application-layer bot detection?
Application-layer bot detection is classifying and constraining automated clients inside the request handler, where you can see the route, the authenticated user, the parsed body, and the business operation, not only the TLS connection. Edge products see volume, IP reputation, and client fingerprints. They do not see that this 200 is a logged-in export of tenant X's entire catalog.
Abuse often no longer looks like abuse. Dashboards stay calm. Rate-limit graphs stay flat. Meanwhile data leaves through pagination, credentials get tested one account at a time, or an AI script retries until a parameter works. That disconnect is the signal. Legacy bot products assumed static automation. Modern abuse is adaptive and application-aware.
This article is the application-layer slice of that problem: why the handler has context the edge lacks, how a verified bot identity and its evidence level feed a decision there, what a v1 rule looks like, and how scraping, credential stuffing, and AI-scripted abuse show up as ordinary requests. For more information about the broader technique menu, see bot detection techniques. For more information about valid operations used for harm, see what is API abuse. For more information about enforcing in the request path, see what is runtime application security.
Why is "bot versus human" no longer enough?
For a long time a "bot" meant a script with a stable fingerprint, a tight loop, and an obvious User-Agent. That definition is no longer useful. A large gray area now sits between a person in a browser and a naive crawler. The client uses the same browsers your users use, talks to the same APIs, and walks plausible paths.
AI-driven agents push the gray area further. Instead of a fixed script they observe responses and adapt. If a route rate-limits, they slow down. If a parameter fails, they try another. If an endpoint is valuable, they concentrate. If your mental model is still a binary, you block real users and miss clients that act like users.
You still need to know whether the client is automated. You also need the type, the route, and the outcome. A verified indexer on /blog is not the same client on /login. A shopping agent on an existing session is not a stuffing script. Classification without application context cannot make that cut.
Some agents can prove who they are. A Web Bot Auth signature proves the operator, and a Personal Agent Protocol session proves the agent acts for one of its users. That replaces "bot or human" with three questions: which bot is this, how sure are you, and is it acting for one of your users? The answers are inputs to your handler's decision, not the decision itself.
How does modern bot behavior differ from traditional bots?
Older scrapers and stuffing tools were easy to reason about. They produced sharp rate spikes, repeated payloads, and stable TLS or header fingerprints. Their goals were simple: copy content, test passwords, overwhelm a route. Static defenses worked because the automation did not hide. IP denylists, fixed windows, and User-Agent checks caught a lot of it.
Modern automation is built to look normal:
- It runs in a real browser and executes JavaScript.
- It carries cookies and session tokens.
- It varies timing on purpose.
- It rotates IPs and fingerprints, often through residential proxies.
From the outside, requests are well-formed and volumes stay under static thresholds. That is not a monitoring failure. It is the client doing its job. You will not see a spike. You will see a workflow that no cohort of real users completes in that shape or at that completeness.
Why does AI-driven abuse adapt instead of failing?
Scripted abuse used to die at the first hard error. AI-scripted abuse treats your responses as feedback. A 429 becomes a slower scheduler. A validation error becomes a new payload. A successful search facet becomes the next crawl seed.
Fixed thresholds fail against that loop. Staying under the alarm is the strategy. "Nothing fired" can mean the campaign is healthy. Detection has to look at sequences: repetition, path order, pagination depth, hold-to-purchase ratio, fan-out from one device to many accounts. Those facts live in the application, or in logs the application must emit.
Why do legacy bot products break down?
Most edge bot products still make a binary decision from a short list of connection signals. That works when automation is clumsy. It breaks when the client can mimic a user and rotate infrastructure.
Individual requests stop being informative. Behavior over time matters. When the product cannot see sessions, tenants, or workflow state, two failures follow. Aggressive rules catch shared networks, mobile NATs, and accessibility tools. Adaptive abuse never crosses a hard line and keeps going.
Edge tools remain useful for DDoS, known crawlers, and obvious automation. They are a layer, not the application-layer control.
Why does the application layer matter?
Network controls see what is on the wire. Many of the signals that distinguish abuse from use only exist inside the app:
- Which routes fire, and in what order.
- Which workflows repeat (search → paged export, login → reset → login).
- How a session evolves after authentication.
- Whether volume matches how real customers use the product.
At the application layer you can reason about intent, not just request shape. The goal is not a perfect label on every packet. It is limiting harmful behavior without breaking legitimate use. A handler can allow a verified crawler on public HTML, deny the same User-Agent family on account APIs, and key a token bucket on userId instead of IP. It can also require SIGNATURE evidence before an AI agent reaches an account route, because it knows which routes those are.
How does a verified bot identity help at the application layer?
A verified bot identity tells your handler which bot sent a request and how strongly that was proven, and the handler adds what the bot identity can't: the user, the account, and the operation. Cryptographic standards such as Web Bot Auth and the Personal Agent Protocol let an AI agent prove its operator, and an evidence level says how far to trust the claim. Neither one decides what that agent may do on this route. That decision needs application context.
Arcjet reports one primary bot identity for each request that a bot rule detects. It has the following fields:
kind:AI_AGENTfor an agent working on demand for a waiting person,AI_CRAWLERfor collection ahead of time,AUTOMATIONfor a browser that a program drives with no named bot, orOTHER.evidence: how the identity was established, from weakest to strongest:UNVERIFIED(aUser-Agentclaim or IP reputation),FINGERPRINT(failed browser checks),IP(published ranges or reverse DNS), orSIGNATURE(a verified Web Bot Auth signature or Personal Agent Protocol session).operator: the signing hostname, such aschatgpt.com, set only withSIGNATUREevidence.spoofed:truewhen IP or reverse DNS verification shows that the claim is false.delegated:truewhen a verified Personal Agent Protocol session shows that the agent acts for one of its users.
For more information about how the levels compare, see AI agent evidence levels.
An edge product can verify a signature too. What the edge can't do is weigh it against the request's business meaning. In the handler you can let a signed agent read product pages at a higher budget than anonymous clients, let a delegated agent add to a cart only after your authorization server accepts its OAuth token, and send every other automated client to your API. The same code holds the bot identity and the order total, so one decision can use both.
State the limits plainly in your policy, because they're the reason the decision belongs in your code:
- A Web Bot Auth signature identifies the operator, not the person. Hosted browser platforms sign for many unrelated customers. For more information, see what is Web Bot Auth.
- A Personal Agent Protocol session never identifies the user and doesn't prove that the person approved this action. Arcjet checks the session against the request. Your authorization server checks the access token and its scopes. For more information, see what is the Personal Agent Protocol.
UNVERIFIEDis only a claim. A stuffing script can send an agent'sUser-Agentheader.- An agent that runs in a person's own browser carries their cookies and address, and looks like that person.
The following examples allow AI agents on an add-to-cart route, then admit only agents with a verified Personal Agent Protocol session. Other agents get a pointer to the API. Your own checks for the user and the cart still run after this.
Check for a delegated agent in JavaScript
import arcjet, { detectBot } from "@arcjet/next";import { isAiAgent, isSpoofedBot } from "@arcjet/inspect";
const aj = arcjet({ key: process.env.ARCJET_KEY!, rules: [ detectBot({ mode: "LIVE", allow: ["CATEGORY:AI_AGENT"], }), ],});
export async function POST(req: Request) { const decision = await aj.protect(req); if (decision.isDenied() || decision.results.some(isSpoofedBot)) { return new Response("Forbidden", { status: 403 }); }
for (const result of decision.results) { if (isAiAgent(result) && result.reason.isBot()) { // Only a verified Personal Agent Protocol session reaches the cart if (!result.reason.identity?.delegated) { return Response.json( { error: "Use the API.", api: "https://api.example.com/docs" }, { status: 403 }, ); } } }
// Check the access token, the user, and the cart here return new Response("Added to cart");}Check for a delegated agent in Python
import os
from arcjet import BotCategory, Mode, arcjet, detect_bot, is_ai_agent, is_spoofed_botfrom 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.AI_AGENT]), ],)
@app.post("/cart")async def add_to_cart(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": # Only a verified Personal Agent Protocol session reaches the cart if not reason.identity.delegated: return JSONResponse( {"error": "Use the API.", "api": "https://api.example.com/docs"}, status_code=403, )
# Check the access token, the user, and the cart here return {"message": "Added to cart"}Check for a delegated agent in Go
package main
import ( "encoding/json" "log" "net/http" "os"
"github.com/arcjet/arcjet-go")
func main() { aj, err := arcjet.NewClient(arcjet.Config{ Key: os.Getenv("ARCJET_KEY"), Rules: []arcjet.Rule{ arcjet.DetectBot(arcjet.BotOptions{ Mode: arcjet.ModeLive, Allow: []string{arcjet.BotCategoryAIAgent}, }), }, }) if err != nil { log.Fatal(err) }
http.HandleFunc("/cart", func(w http.ResponseWriter, r *http.Request) { decision, err := aj.Protect(r.Context(), r) if err != nil { http.Error(w, "Internal Server Error", http.StatusInternalServerError) return } if decision.IsDenied() || decision.IsSpoofedBot() { http.Error(w, "Forbidden", http.StatusForbidden) return }
if decision.IsAIAgent() { for _, result := range decision.Results { bot := result.Reason.Bot if bot == nil || bot.Identity == nil || bot.Identity.Kind != arcjet.BotKindAIAgent { continue } // Only a verified Personal Agent Protocol session reaches the cart if !bot.Identity.Delegated { w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusForbidden) json.NewEncoder(w).Encode(map[string]string{ "error": "Use the API.", "api": "https://api.example.com/docs", }) return } } }
// Check the access token, the user, and the cart here w.Write([]byte("Added to cart")) })
log.Fatal(http.ListenAndServe(":8080", nil))}What does application-layer detection look like in code?
Put Shield, bot detection, and a rate limit in the route that owns the operation. Allow search engines on a public GET. Use an empty allow list on POST /login. Pin @arcjet/next to v1.
import arcjet, { detectBot, shield, fixedWindow } from "@arcjet/next";import { isSpoofedBot } 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 }), ],});
export async function GET(req: Request) { const decision = await aj.protect(req);
if (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 }); }
return new Response("OK");}Key the limit on a stable application identifier when you have one. Compose a tighter client on /login with allow: []. Start in DRY_RUN. HTTP checks can fail open if the cloud API is unreachable; your handler can treat an errored decision as a deny if you prefer fail-closed.
How do scraping, credential stuffing, and AI-scripted abuse show up?
The following table maps three common campaigns to the operation they abuse, the application signals you can actually see, and the control that belongs in the handler.
| Campaign | Abused operation | Application signals | Handler control |
|---|---|---|---|
| Scraping | Search, listing, profile, or price reads | Sequential IDs, exhaustive pagination, low interaction diversity, export-sized responses | Query budgets, pagination caps, bot allowlists, deny on authenticated dump routes |
| Credential stuffing | Login or token issuance | One attempt per account, high failure rate, many accounts per device, few attempts per IP | Per-account limits, breached-password checks, empty bot allow list, step-up after risk |
| AI-scripted abuse | Any valuable workflow the model can retry | Parameter mutation after errors, slower retries after 429, focus on high-value routes, human-like timing | Identity-aware quotas, sequence alerts, route-specific bot policy, graduated responses |
Scraping. A client walks /products?cursor= until the catalog is empty. Each request looks like a shopper. The population-level pattern is exhaustive traversal. Cap page size, cap pages per identity per hour, and deny unverified automation on the listing API. Allow verified search crawlers on the public HTML equivalent if marketing wants that.
Credential stuffing. Stolen pairs are tested once per account from many addresses. A per-IP login limit misses it. A per-account and per-device limit, plus bot detection with allow: [], hits the campaign. Pair that with MFA and breached-password screening. Bot detection does not replace authentication.
AI-scripted abuse. A generated client probes checkout holds, promo codes, or an inference API. It respects your documented rate limit and still extracts value. Watch outcomes (holds without purchases, tokens without users) and shrink the budget for that identity. A script that claims to be an AI agent only through its User-Agent header gets UNVERIFIED evidence, so give it the anonymous budget, not the one for signed agents. A CAPTCHA on a page the script never loads will not see this traffic.
Layer the controls. Detection is probabilistic. The win condition is making abuse expensive and inefficient, not labeling every request. As automation improves, the application layer is where your product still has meaning, and where you make the decision.
Frequently asked questions
What is application-layer bot detection?
It is running bot classification and limits in the request handler, using route, identity, and workflow context the edge does not have.
Why don't edge bot products see enough?
They see TLS, IP, and headers. They do not see tenant, cart, or that this authenticated GET is paging every private object unless you forward that context.
Why do dashboards look calm during modern abuse?
Adaptive clients stay under static thresholds, rotate IPs, and vary timing. The signal is workflow shape and business outcome, not a traffic spike.
How do I handle credential stuffing in the handler?
Use an empty bot allow list on login, key limits on the account not only the IP, and add MFA or breached-password checks. Per-IP ceilings miss distributed stuffing.
Should a signed AI agent be allowed to make purchases?
A signature proves the operator, not the person or their intent. A Personal Agent Protocol session adds that the agent acts for one of its users, but doesn't prove the user approved this order. Let the handler combine the identity with your OAuth token check, the user, and the order total.
Why check bot identity in the handler instead of at the edge?
The edge can verify who sent a request. Only the handler knows the route's risk, the signed-in user, and the business operation, so it's where the identity and its evidence level can decide what the bot may do.
Is the February 2026 date in this article a market statistic?
No. 10 February 2026 is the publication date of the Arcjet source post this article ports. It is not a traffic-share figure.
Does application-layer detection replace a WAF?
No. Keep the edge for volumetric attack. Put route-aware bot policy and identity-aware quotas in the handler.
Application security in your code
Protect your application with Arcjet
Read the verified bot identity in your route handler and decide what each AI agent may do with the user and the operation in view.