Send suspect bots to a honeypot

Use the bot score field to send bots to a honeypot.

Last updated Oct 13, 2025

export default {
    async fetch(request) {
        const response = await fetch(request);

        // Clone the response so that it is no longer immutable
        const newResponse = new Response(response.body, response);

        if (request.cf.botManagement.score < 30) {
            const honeypot = "https://example.com/";
            return await fetch(honeypot, request);
        } else {
            return newResponse;
        }
    },
};

Was this helpful?

YesNo

On this page

Send suspect bots to a honeypot - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/rules/snippets/examples/bots-to-honeypot/#page","headline":"Send suspect bots to a honeypot","description":"Use the bot score field to send bots to a honeypot.","url":"https://developers.cloudflare.com/rules/snippets/examples/bots-to-honeypot/","inLanguage":"en","image":"https://developers.cloudflare.com/rules/snippets/examples/bots-to-honeypot/og.png?v=0b8b3d095cb458ec","dateModified":"2025-10-13","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"},"keywords":["Redirects"]}


description: Redirect requests to certain URLs based on a mapped object to the request's URL. title: Bulk redirect based on a map object image: https://developers.cloudflare.com/rules/snippets/examples/bulk-redirect-map/og.png?v=d07a46eb3f172f72


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/rules/llms.txt
Use this file to discover all available pages before exploring further.