How to block unwanted AI bots and protect website workflows
Control unwanted AI bots, crawler access, costly requests, and sensitive actions while preserving useful customer-agent workflows with Marshy.
Dev Shah5 min read
To block unwanted AI bots, identify the operation causing harm and enforce its permissions, quotas, and workflow rules on the server. Use robots.txt for cooperating crawler preferences and Marshy for interactive browser-session investigation. This lets you restrict unwanted exports, expensive requests, or inventory holds while supporting a customer’s permitted assistant.
A useful protection policy states what is restricted, where it is enforced, and how a legitimate task completes. It covers direct API calls as well as the visible website.
What are you trying to protect?
Start with the business effect rather than the assistant’s brand. Meta Muse, Grok Bot, and other agents may read public information, operate a signed-in browser, or use a structured integration. Your controls need to cover the operation through each supported path.
Pick one resource: trial credits, stock holds, account exports, or administrator settings. Identify its server operation and the account or client authorized to call it.
| Operation | Control to implement | Evidence for reviewing the result |
|---|---|---|
| Read public pages | Documented crawl policy and appropriate request limits | Request volume, useful discovery, and errors |
| Consume paid computation or trial credits | Account eligibility, budgets, and operation quotas | Actual cost and completed jobs |
| Reserve inventory | Account-linked limits, expiring holds, and transactional stock checks | Reservation records and completed orders |
| Export account data | Resource ownership, role checks, and scoped limits | Authorization decision and export record |
| Change billing or team access | Explicit permission and approval tied to the proposed change | Approved inputs and server audit record |
These are policy design examples. Select thresholds from your capacity and customer requirements; a fixed rule from another website is not a substitute for that analysis.
Keep public crawling separate from account access
The Robots Exclusion Protocol defines crawler instructions rather than access authorization. A disallowed URL still needs enforced access controls if its contents are private.
Use documented provider tokens for public crawling preferences. For example, OpenAI’s crawler reference separates search access and training crawling. A site can permit search discovery while expressing a different training preference.
Do not put a guessed MuseBot or GrokBot token in a file and conclude that interactive browser access has been stopped. The provider guides for Muse and Grok Bot describe the documented browser paths and current attribution limits.
Keep public blog and product pages reachable under the search policy you actually want. A site-wide challenge or edge block can affect discovery before an instrumented browser session exists.
Observe the browser journey with Marshy
Install your Marshy integration’s snippet across the relevant journey. Find classified sessions in Sessions, review Journey, and correlate the visit with the attempted server operation.
Record three facts separately: the classification, the account context, and the operation outcome. For example: “classified agent session attempted an export; account lacked the export role; backend denied the request.” This describes a controlled operation without guessing a provider.
Keep review and missing-verdict cases visible. A short or uninstrumented visit is not a passed human check. The detection workflow covers collection and validation.
Enforce the same permission boundary through the API
Your export, booking, or credit-consumption endpoint must enforce its rules when called directly. Removing a button in the browser cannot prevent a caller from submitting the request.
OWASP’s authorization guidance recommends checking permissions on every request. Use authenticated account and resource context for the decision. A browser-supplied agent verdict must not grant access to a private resource or exempt an account from its normal limits.
For a supported agent integration, define narrowly scoped grants and revocation. Keep its identity evidence separate from the customer’s authority to act on the resource. A verified provider can still request an operation the account is not permitted to perform.
Limit expensive work and make retries predictable
Map quotas to the resource being consumed. A computation budget may belong to an account; an inventory hold may belong to a basket and expire after a defined period. Apply these checks at the point where the resource changes.
Expose clear failure states. An assistant should be able to tell whether a job is pending, rejected, or complete before retrying. For duplicate-sensitive operations, bind a stable operation identity to the intended action and return its existing result when the same request is retried.
For processor-specific payment requests, follow the processor’s contract. Stripe documents idempotent requests; application-wide order and inventory consistency still need their own implementation.
Test the policy before enforcement
Use an owned staging account and a harmless version of the operation. Keep the test results in the policy template.
- A permitted human task and a permitted known-agent task both complete.
- The same account cannot access a resource outside its permission scope.
- A direct API request receives the same ownership and quota checks.
- A retry does not create an unintended duplicate operation.
- Review, missing-result, and detector-outage cases receive the documented treatment.
- A customer handoff preserves the draft and selected options.
Next, run the proposed policy in observation mode. Measure what would have been restricted and whether those sessions performed valuable customer work. A limited rollout should have an owner, stop conditions, and a rollback path.
Can I give useful AI agents a better experience?
Yes. Keep permitted browsing and checkout legible, provide a direct review route when the basket is ready, and preserve the handoff to the customer. You can improve task completion while still applying ordinary server controls.
The agent checkout and upsell guide explains that growth experiment. Marshy supplies browser-session context; your application implements the experience and the operation rules.
Explore Marshy to investigate the traffic behind one important workflow, and use the readiness worksheet to assign the controls you still need.
Sources checked October 8, 2026. This is an implementation policy guide, not a claim that Marshy automatically blocks agents or replaces backend access controls.