How to detect AI agents on your website
Detect AI agents on your website with browser-session evidence and verified request identities. Install Marshy, investigate visits, and choose a response.
Dev Shah6 min read
AI agent detection identifies software operating your website’s browser sessions so you can understand the task, measure its outcome, and choose a response. Start by separating browser agents from crawlers and API clients: each access path leaves different evidence. Install Marshy on the browser journey, investigate its classification alongside account and operation records, and verify named request clients through their documented contracts.
This guide gives you a workflow from installation to a useful decision. For a merchant, that decision could be offering a clearer checkout route. For a SaaS team, it could be investigating costly retries or protecting an account export.
What does AI agent detection change for your business?
An assistant can help a customer compare plans, complete onboarding, or assemble a basket. Knowing that software operated the journey helps you distinguish useful delegated work from a broken interface or unwanted repeated operation.
Keep two outcome views: all completed customer tasks, and results segmented by the original classification. Removing agent-assisted orders from the revenue report can hide valuable customer work. Conversely, counting every crawler fetch as a visit can distort the funnel before a customer ever reaches it.
Use detection for a concrete decision: an analyst investigates a repeated export, a product team fixes a confusing error, or a merchant tests a direct basket-review link. That decision determines the timing and coverage you need.
What kind of AI traffic are you trying to detect?
The same company can operate several access paths. A crawler retrieving public pages and a customer’s assistant changing a cart leave different evidence. Select the path before choosing the detection method.
| Access path | Evidence to collect | Suitable next step |
|---|---|---|
| Browser agent using your UI | Instrumented session, classification, journey, account context | Inspect the session in Marshy |
| Declared crawler or fetcher | Claimed user agent and trustworthy request identity evidence | Verify the provider’s current contract |
| API, connector, or MCP client | Authenticated client, scope, operation, backend outcome | Investigate the server operation |
| Mixed human and agent journey | Session timeline and known handoff context | Preserve a mixed-control interpretation |
Browser instrumentation covers pages where it loads and can collect. It should not be expected to classify a direct API call that never renders a page.
Which detection evidence should you trust?
| Evidence | What it contributes | What to verify next |
|---|---|---|
| Declared user-agent name | A client claims an identity | The provider's current verification contract |
| Provider-published address match | Attribution for the documented request service | Correct client-address handling and fresh ranges |
| Validated signed request | Evidence of the request's signer | Trusted keys, signature contract, and account authority |
| Browser-session classification | Assessment of instrumented browser activity | Coverage, result timing, and independently labeled validation |
| Authenticated operation record | Account and completed business action | Resource ownership, scope, and workflow state |
Choose the evidence for the access surface you observe. Combining several browser hints does not turn them into a provider credential or account permission.
Step 1: choose one valuable website task
Begin with a task you can trace, such as completing onboarding, assembling a basket, or exporting an account-owned report. Record the pages, account, and backend operation involved.
Decide what detection would change. Segmented analytics, an easier checkout route, and restrictions on an expensive export require different timing and error tolerance. Write the decision down before evaluating a detector.
This also gives you an outcome to measure. “An agent visited” is less useful than “a classified agent session reached checkout, but the selected variant was unavailable.”
Step 2: install and verify Marshy collection
Create the appropriate project in Marshy and copy its integration snippet from Settings. Install your Marshy integration’s snippet on the pages in the chosen journey. Preserve the supplied configuration; keep management credentials and identity-signing secrets on the server.
Complete a harmless task and find the visit in Sessions. Check route changes and an authenticated account switch. If the session is absent, inspect installation, script delivery, collection eligibility, and application configuration before interpreting the traffic.
The Next.js installation tutorial provides an App Router example. Other frameworks should preserve the same project-specific snippet and verification steps.
Step 3: read the result alongside the journey
Marshy’s documented verdict contract includes human, agent, and review. The browser result is advisory. Some visits do not reach a verdict, so reporting also needs an absent-result state.
| Result | Investigation action |
|---|---|
| Human | Keep the original classification and ordinary application checks |
| Agent | Inspect the task, timing, account association, and available automation kind |
| Review | Retain uncertainty and inspect the available evidence |
| No verdict | Check coverage, task duration, and collection conditions |
Open a session and use Journey to compare the classification time with the important operation. Correlate it with the backend record that confirms whether the task completed. A browser click does not establish an order or a successful export.
The session investigation walkthrough shows the current interface. The PostHog tutorial explains how to forward classification observations into an existing analytics setup.
Step 4: verify named request clients separately
For a request claiming a provider identity, use that provider’s documented verification method. Obtain the source address through trusted edge handling and refresh any published address lists. A copied user-agent string is a claim, not verification.
OpenAI documents distinct search, training, and user-triggered clients. Google and Perplexity also publish request-client information. Those contracts are covered in the OpenAI, Google, and Perplexity guides.
For interactive browser work, preserve an unknown-provider result when the evidence does not establish attribution. The Muse, Grok Bot, and Claude Code guides explain the documented access paths without inventing universal provider headers.
Step 5: check whether the detection works for your population
Use known human and automation operators on comparable owned tasks. Include the browsers and control methods your customers use, short visits, unavailable scripts, and a human takeover. Ground truth comes from the test setup rather than the detector’s own answer.
Report valid run counts, classification errors, undecided coverage, and time to result. Define acceptable limits from the proposed decision. A few successful demonstrations establish neither a universal fingerprint nor a production accuracy rate.
Use the evaluation guide and its run sheet to preserve versions, conditions, exclusions, and backend outcomes.
Can I detect AI agents using webdriver or trusted clicks?
Those values are useful browser observations, but they do not prove a human operator or a specific AI provider. Treating navigator.webdriver === false as a human result, or event.isTrusted as customer approval, adds an unsupported inference. The browser signal guide explains the API contracts and the test cases your rule needs to cover.
Should I block every AI agent I detect?
Choose the response from the task and business rules. An assistant completing a customer’s permitted checkout can be valuable. An unauthorized export must be rejected regardless of its classification.
Use the website protection guide for controls around expensive and sensitive operations. For useful shopping tasks, the checkout and upsell guide shows how to evaluate a simpler customer path.
Get started with Marshy to investigate one traceable journey, then expand coverage once you can explain its classifications and outcomes.
Prepared October 8, 2026 from the documented verdict contract and current Marshy interface. This workflow does not assert live-provider fingerprints or detector performance.