> For the complete documentation index, see [llms.txt](https://coldbox-security.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coldbox-security.ortusbooks.com/secure-your-app/route-middleware/honeypot.md).

# Honeypot

Catch form spam bots with the Honeypot middleware.

Bots fill in every field they find. `Honeypot@cbsecurity` adds a trap field that people never see. If it arrives filled in, the request is a bot and your handler does not run.

```javascript
route( "/contact" ).middleware( "Honeypot@cbsecurity" ).to( "contact.send" )
```

Add the field to your form and hide it with CSS. Do not use `type="hidden"`, many bots skip those.

```html
<div style="position:absolute;left:-9999px" aria-hidden="true">
    <input type="text" name="website_url" tabindex="-1" autocomplete="off">
</div>
```

## What Bots Get

By default the bot gets a silent `200 OK`, so it believes it succeeded and does not adapt. Set `silent` to `false` to answer `422` instead.

| Route meta key   | Setting                      | Default       |
| ---------------- | ---------------------------- | ------------- |
| `honeypotField`  | `middleware.honeypot.field`  | `website_url` |
| `honeypotSilent` | `middleware.honeypot.silent` | `true`        |

A honeypot stops simple bots only. Pair it with [Throttle](/secure-your-app/route-middleware/throttle.md) and use a CAPTCHA where the stakes are high.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://coldbox-security.ortusbooks.com/secure-your-app/route-middleware/honeypot.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
