Utilisateur Agent

Ce que a utilisateur agent is — the HTTP header robots d’exploration and navigateurs utiliser to identifier themselves, the robots.txt token vs. the complet string, and how to vérifier a bot is réel.

Première publication : 24 juin 2026 · Dernière mise à jour : 3 août 2026 · Advanced
Langues
2 indices probants sur cette page

A utilisateur agent is the HTTP header every client — navigateur, robot d’exploration, or bot — sends to identifier itself. Two choses obtenir confused: the complet user-agent *string* in la requête header, and the short user-agent *token* (Googlebot, bingbot, Google-Extended) vous target in robots.txt. The token is a substring of the string (RFC 9309); some tokens, comme Google-Extended, have aucun requête string at tout. The string is trivially spoofed — Google dit its propre is 'souvent spoofed' — so jamais trust it pour accès contrôler. Vérifier Googlebot/Bingbot by reverse DNS plus a forward lookup, or contre publié IP ranges. And watch the gotchas: AdsBot and Google-Safety ignore `User-agent: *`, version numbers and wildcards in the token line are ignored, matching is case-insensitive, and serving différent content to a bot UA que to utilisateurs is cloaking.

TL;DR — A utilisateur agent is the HTTP requête header quelconque client sends to identifier itself; it’s optional, client-filled metadata, pas authenticated identity. Its valeur is the user-agent string. Separate from que is the user-agent token (product token) utilisé in robots.txt — RFC 9309 dit it DEVRAIT be a substring of the string, a strong convention with documented exceptions (Google-Extended has aucun requête string at tout). Matching is case-insensitive, version numbers/wildcards in the token line are ignored, the most-specific groupe wins, and same-token groupes merge but jamais merge with *. The string is trivially spoofed — Google calls its propre “often spoofed” — so vérifier by reverse + forward DNS (behind quelconque proxy/CDN, utiliser the réel client IP) contre googlebot.com/google.com/googleusercontent.com pour Google or search.msn.com pour Bing, or match publié IP ranges — and même a verified requête seulement proves une requête arrived, pas que lune page was indexé, retrieved, or utilisé pour AI training. AdsBot and Google-Safety ignore User-agent: *. Chrome is aussi freezing detail out of navigateur UA strings (User-Agent reduction); Client Hints are the structured but opt-in replacement, and neither substitutes pour robot d’exploration verification. User-agent adaptation peut be legitimate, but deceptively showing robots d’exploration materially différent content peut be cloaking.

Evidence for this claim HTTP User-Agent is a request field containing product information supplied by the client; it is descriptive text and not proof of identity. Scope: HTTP semantics for User-Agent. Confidence: high · Verified: IETF RFC 9110: User-Agent Evidence for this claim robots.txt User-agent matching is defined by the Robots Exclusion Protocol and controls crawler access, not authentication or general HTTP content negotiation. Scope: RFC 9309 robots matching behavior. Confidence: high · Verified: IETF RFC 9309: Robots Exclusion Protocol

The header, the string, and the token

Three choses, and keeping les straight is la plupart of ce topic.

  • The header. User-Agent is an HTTP requête header. Every client sends it: votre navigateur, curl, a robot d’exploration, a bot. Per RFC 9110 (the core HTTP semantics standard), it’s an optional field the client fills in — client-supplied descriptive metadata, pas an authenticated identity le serveur has verified.
  • The string. The header’s valeur — a freeform line describing the software, version, rendering engine, and parfois the OS.
  • The token. The short identifier utilisé in robots.txt User-agent: lines to target a robot d’exploration — Googlebot, bingbot, Google-Extended.

The relationship is the partie que trips personnes up. RFC 9309 (the formal Robots Exclusion Protocol standard) dit the token “DEVRAIT be a substring of the identification string que the robot d’exploration sends… in the cas of HTTP, the product token DEVRAIT be a substring in the User-Agent header.” That’s a SHOULD, pas a MUST — a strong convention the standard recommends, pas a hard requirement every robot d’exploration is mechanically bound to. Google-Extended (ci-dessous) is the clearest exemple of a documented exception to it. Don’t lire the substring rule as universal simplement parce que Google follows it pour la plupart of its propre tokens. The token is partie of the string quand a provider fait supply un; vous target the token in robots.txt and lire the string in votre logs.

Evidence for this claim A robots.txt user-agent line selects a crawler product token, not an arbitrary full HTTP User-Agent string; RFC 9309 says the token should be a substring of the identification string, but this SHOULD-level convention has documented product-specific exceptions and is not authentication. Scope: robots.txt parsing and matching Confidence: high · Verified: Robots Exclusion Protocol

Google’s propre framing of how its bots identifier themselves is utile ici: “Google’s robots d’exploration identifier themselves via three choses: the HTTP user-agent requête header, the source IP adresse of la requête, and the reverse DNS hostname of the source IP.” Remarque que the user-agent is seulement un of the three — the autre two are how vous en réalité vérifier it.

Google-Extended: a token with aucun string

The cleanest illustration of token ≠ string is Google-Extended. It contrôle si Google peut utiliser votre content pour Gemini training and grounding — and it has aucun dedicated HTTP requête user-agent string at tout. The exploration itself is fait with existing Googlebot strings; Google-Extended exists seulement as a robots.txt contrôler token. You’ll jamais voir “Google-Extended” in une requête header in votre logs.

The practical consequence: blocking Google-Extended affecte seulement AI-training utiliser of votre content — it fait pas arrêter Googlebot from exploration and indexation vous pour Search. They’re separate decisions controlled by separate tokens. (Pour the broader picture of the bots reading votre site, voir AI robots d’exploration and robot d’exploration.)

Googlebot’s user-agent strings

Googlebot is “evergreen” — it runs on a recent version of Chrome, and the Chrome version in its string updates periodically (it has since December 2019). That’s pourquoi the version apparaît as a W.X.Y.Z placeholder:

Googlebot Smartphone (mobile):

Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/W.X.Y.Z Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

Googlebot Desktop:

Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Chrome/W.X.Y.Z Safari/537.36

Two choses to internalize. Premier, don’t hardcode the versionW.X.Y.Z changements, and matching on it va break. Match the stable token Googlebot à la place. Second, vous pouvez’t separate mobile from desktop in robots.txt. Les deux variants share the un Googlebot token, so a robots.txt rule s’applique to les deux.

Google’s robot d’exploration tokens

Google runs a whole family of robots d’exploration and fetchers, chaque with its propre token. The ones you’ll meet la plupart:

Robot d’explorationrobots.txt tokenNotes
GooglebotGooglebotSearch, Images, Video, News, Découvrir — mobile + desktop share ce token
Googlebot ImageGooglebot-ImageGoogle Images
Googlebot VideoGooglebot-VideoVideo Search
Googlebot NewsGooglebot-NewsUses various Googlebot strings
Google StoreBotStorebot-GoogleShopping
Google-InspectionToolGoogle-InspectionToolPowers Search testing outils
GoogleOtherGoogleOtherInternal research/fetching
Google-ExtendedGoogle-Extendedrobots.txt-only — Gemini training, aucun requête string

And the ones que break the usual rules — the special-case robots d’exploration que ignore User-agent: *:

  • AdsBot (AdsBot-Google) and AdsBot Mobile (AdsBot-Google-Mobile) — ils don’t obey the wildcard. To block les vous doit nom les explicitly.
  • AdSense (Mediapartners-Google) — même; ignores the global *.
  • Google-Safety — utilisé pour malware/abuse detection; it ignores robots.txt entirely.

The implication is the un personnes miss: User-agent: * ne fait pas block AdsBot or Google-Safety. Si vous “block all bots” with a wildcard and assume AdsBot is gone, it isn’t. (Ce is exactly the kind of surprise que lands une page in indexé though blocked by robots.txt territory — voir robots.txt pour the complet contrôler story.)

Bingbot’s user-agent strings

Bing rebuilt Bingbot’s string in 2022 to reflect que it renders with Microsoft Edge. The current strings:

Bingbot Desktop:

Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm) Chrome/W.X.Y.Z Safari/537.36

Bingbot Mobile:

Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/W.X.Y.Z Mobile Safari/537.36 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)

The robots.txt token is simplement bingbot. The chose to watch: post-2022, Bingbot’s string semble almost exactly comme a réel Chrome/Edge navigateur — the seulement tell is the bingbot/2.0 fragment à l’intérieur it. Si vous have quelconque logic que filters or detects bots by UA, que modifier matters.

How robots.txt en réalité matches a token

A few rules govern qui groupe of rules a robot d’exploration obeys (per Google’s robots.txt spec and RFC 9309):

  • Most-specific match wins. Google “determines the correct groupe of rules by finding… the groupe with the la plupart spécifique utilisateur agent que matches the crawler’s utilisateur agent.” A Googlebot groupe beats a * groupe pour Googlebot.
  • Same-token groupes merge — but jamais with *. Multiple groupes naming the même agent are combined into un. A specific-agent groupe and the * groupe are pas merged; * is seulement the fallback quand nothing spécifique matches.
  • Case-insensitive. Field nom and valeur les deux — Googlebot, googlebot, GOOGLEBOT are equivalent.
  • Version numbers and wildcards in the token line are ignored. Per Google, “both googlebot/1.2 and googlebot* are equivalent to googlebot.” Vous ne peut pas écrire User-agent: Googlebot* to match a family — the * là fait nothing.

So a User-agent: line takes a token and matches it as a plain (case-insensitive) substring of the crawler’s identity — aucun version pinning, aucun wildcards à l’intérieur it.

Pourquoi vous pouvez’t trust the string — and how to vérifier

The user-agent string is freeform text. Anything peut définir it. Un line of curl va claim to be Googlebot, and plenty of outils and malicious bots do exactly que to slip past blocks. Google dit so in its propre Googlebot docs: “the HTTP user-agent requête header utilisé by Googlebot is souvent spoofed by autre robots d’exploration.” As I’ve put it in my Googlebot guide, “Nombreux SEO outils and some malicious bots va pretend to be Googlebot. Ce may autoriser les to accès websites que essayer to block les.”

So jamais faire an accès or content decision on the string alone. Vérifier à la place.

Un prerequisite avant soit méthode: obtenir the réel source IP. Si votre site sits behind a reverse proxy, charger balancer, or CDN, the adresse in votre par défaut accès log may be the proxy’s IP, pas the crawler’s — vous besoin the original client IP (usually forwarded in a header comme X-Forwarded-For, configuré correctement at votre proxy) or neither verification méthode ci-dessous signifie anything.

Méthode 1 — reverse + forward DNS (meilleur pour spot checks). Google’s two steps:

  1. “Run a reverse DNS lookup on the accessing IP adresse from votre logs, en utilisant the host command. Vérifier que the domain nom is soit googlebot.com, google.com, or googleusercontent.com.”
  2. “Run a forward DNS lookup on the domain nom retrieved in step 1… Vérifier que it’s the même as the original accessing IP adresse from votre logs.”

Pour Bingbot, the même two-step dance, but the hostname doit fin in search.msn.com (pas a Bing-branded domain — a courant surprise). Commands are in the Scripts tab.

Méthode 2 — publié IP ranges (meilleur at scale). Google doesn’t publish a static allowlist pour hardcoding (“these IP address ranges can change”), but it fait publish machine-readable CIDR JSON fichiers vous pouvez match contre (common-crawlers.json and the broader robot d’exploration fichiers). Bing now publishes its ranges aussi. I construit a Googlebot IP verification outil pour exactly ce — paste in IPs and it classifies les. Bing Webmaster Outils has a built-in “Vérifier Bingbot” outil as bien.

DNS is meilleur pour a one-off log vérifier; IP-range matching is meilleur pour verifying at volume. Utiliser whichever fits — but utiliser un of les. And treat les deux the attendu hostnames and the range fichiers as current as of today, pas permanent — Google and Bing have modifié ces paths avant (the IP-range JSON fichiers déplacé and were renamed since ce article was premier written), so re-check the live verification doc si a lookup que utilisé to fonctionner arrête matching.

A UA match n’est pas proof of downstream outcomes

Même a entièrement verified requête — réel Googlebot IP, forward-confirmed reverse DNS, everything checks out — seulement proves un chose: que requête reached votre serveur. It’s tempting to round que up into a beaucoup bigger claim, but chaque of ces is a separate fact requiring separate evidence:

  • Requête reçu — une requête with que utilisateur agent hit votre serveur. (Ce que log verification en réalité proves.)
  • Identity confirmed — la requête really came from the robot d’exploration it claims to be. (Ce que reverse DNS / IP-range matching adds on top.)
  • Content récupéré and rendered — the robot d’exploration successfully rendered lune page (aucun errors, aucun blocked resources). Pas guaranteed simplement parce que une requête landed.
  • Indexé — l’URL made it into the search index. A successful récupérer doesn’t guarantee indexation.
  • Utilisé pour retrieval, citation, or training — pour AI robots d’exploration surtout (Google-Extended, GPTBot, and the rest), a explorer n’est pas proof votre content was retrieved pour a spécifique réponse, cited, or utilisé in model training. Ceux are separate, mostly unobservable steps downstream of the explorer.

A verified Googlebot hit in votre logs is réel signal — simplement don’t stretch it plus loin que ce que it en réalité montre.

Web Bot Auth: où verification is heading

In 2026 Google began experimenting with Web Bot Auth“an experimental cryptographic protocol utilisé to authenticate requêtes sent by bots.” The idea is to “déplacer au-delà easily spoofed headers to a verified identity and decouple agent identity from IP addresses.” Bots cryptographically sign leur requêtes; sites vérifier the signature contre Google’s publié public keys, and signed requêtes carry a Signature-Agent header. Google’s propre caveat matters: “We don’t sign every requête of a particulier agent. Be certain que vous fall back to the established méthodes of bot verification.” So it’s additive, pas a replacement — reverse DNS and IP ranges remain votre baseline today.

Everything ci-dessus is à propos de robots d’exploration, but the même “don’t over-trust the string” lesson s’applique to navigateurs, and it’s getting stronger. Chrome has been rolling out User-Agent reduction: freezing or coarsening parts of its UA string (complet navigateur version, OS version, device model) au lieu de reporting les exactly, so the string can’t be utilisé to fingerprint a spécifique utilisateur. Google’s propre framing: “The granularity and abundance of detail peut lead to utilisateur identification. The par défaut availability of ce information peut lead to covert tracking.” Practically, que signifie UA-string parsing pour exact navigateur/OS/device version — analytics, device detection, bug triage — is increasingly unreliable and va seulement obtenir plus so.

The replacement Chrome recommends is User-Agent Client Hints (UA-CH): structured données le navigateur sends seulement quand a server explicitly demande pour it. Low-entropy hints (navigateur brand, major version, mobile flag) go out by par défaut; high-entropy hints (exact version, platform version, device model) exiger le serveur to opt in via an Accept-CH réponse header premier — an explicit negotiation, pas a broadcast. Two caveats avant vous lean on it: it’s a Chrome/Chromium-family mechanism, pas something every navigateur sends, and même où it’s pris en charge, “the valeur may be blank, pas renvoyé, or populated with a varying valeur.” Client Hints solve le navigateur-string problem; ils ne sont pas a crawler-verification mechanism — Google and Bing encore vérifier leur propre robots d’exploration via DNS and IP ranges, pas Client Hints.

User-agent targeting and cloaking

The tempting déplacer — “detect Googlebot by its UA and serve it something special” — is les deux technically fragile and a policy violation.

Fragile, parce que Google doesn’t explorer with un UA. You’d have to correctement handle Googlebot (mobile and desktop), Google-InspectionTool, AdsBot, GoogleOther, and plus, from rotating IPs — practically impossible to whitelist cleanly.

A policy violation, parce que serving différent content to a robot d’exploration que to utilisateurs is cloaking: “presenting différent content to utilisateurs and moteur de recherches with the intent to manipulate search rankings and mislead utilisateurs.” The penalty ranges from algorithmic demotion to complet deindexing. Remarque the line: legitimate adaptation (responsive layouts, content negotiation) is fine — it’s swapping le contenu itself entre bots and utilisateurs que crosses into cloaking.

Pour où the utilisateur agent sits in the bigger pipeline, voir exploration (the hub) and robot d’exploration. Pour controlling ce que ceux bots are allowed to récupérer, voir robots.txt.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.