# Bot detection enrichment
> Consolidate bot indicators from multiple enrichments into a single entity for easier filtering and analysis.
> Source: https://docs.snowplow.io/docs/pipeline/enrichments/available-enrichments/bot-detection-enrichment/
> Documentation index: https://docs.snowplow.io/llms.txt

Applies to **Enrich 6.9.0+**[Latest: 6.14.1](/docs/api-reference/versions/#feature-availability-by-version "The latest Enrich version is 6.14.1")

Multiple enrichments can independently detect bots: [YAUAA](/docs/pipeline/enrichments/available-enrichments/yauaa-enrichment/), [IAB](/docs/pipeline/enrichments/available-enrichments/iab-enrichment/), and the [ASN lookup](/docs/pipeline/enrichments/available-enrichments/asn-lookup-enrichment/). In addition, the [bot detection tracker plugin](/docs/sources/web-trackers/tracking-events/bot-detection/) for web can detect automated browsers client-side.

The bot detection enrichment consolidates these indicators into a single [entity](/docs/fundamentals/entities/). This lets you filter bot traffic in your data models, or drop bot events entirely using a [JavaScript enrichment](/docs/pipeline/enrichments/available-enrichments/custom-javascript-enrichment/#discard-events).

## How bot indicators are combined

The enrichment uses "any positive = bot" logic. If any of the enabled sources flags the event as coming from a bot, the event is classified as a bot. A negative result from one source doesn't override a positive result from another. This is because none of the existing enrichments can produce a strong "not a bot" result.

Each source contributes an indicator as follows:

| Source                | Flagged as bot when                                                                                                                                                                                             |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| YAUAA                 | `deviceClass` is `"Robot"`, `"Robot Mobile"`, or `"Robot Imitator"`, or `agentClass` is `"Robot"` or `"Robot Mobile"` in the [YAUAA entity](/docs/pipeline/enrichments/available-enrichments/yauaa-enrichment/) |
| IAB                   | `spiderOrRobot` is `true` in the [IAB entity](/docs/pipeline/enrichments/available-enrichments/iab-enrichment/)                                                                                                 |
| ASN lookup            | `likelyBot` is `true` in the [ASN entity](/docs/pipeline/enrichments/available-enrichments/asn-lookup-enrichment/)                                                                                              |
| Client-side detection | `bot` is `true` in the [client-side bot detection entity](/docs/sources/web-trackers/tracking-events/bot-detection/)                                                                                            |

For example, if YAUAA detects a bot based on user agent but IAB doesn't, the event is still classified as a bot. Similarly, if the ASN lookup flags the event based on a known bad ASN, that result stands regardless of what YAUAA or IAB report.

> **Note: Missing sources**
>
> It's safe to enable all sources - `useYauaa`, `useIab`, `useAsnLookups`, `useClientSideDetection` - even if some of the underlying enrichments or plugins aren't in use. If a contributing source isn't enabled or its entity isn't present, that source is silently skipped.

## Configuration

The enrichment takes these parameters:

| Name                     | Type      | Required | Since  | Description                                                                  |
| ------------------------ | --------- | -------- | ------ | ---------------------------------------------------------------------------- |
| `useYauaa`               | `boolean` | Required |        | Whether to use YAUAA `deviceClass` and `agentClass` as a bot signal.         |
| `useIab`                 | `boolean` | Required |        | Whether to use IAB spiders and robots as a bot signal.                       |
| `useAsnLookups`          | `boolean` | Required |        | Whether to use ASN lookups as a bot signal.                                  |
| `useClientSideDetection` | `boolean` | Required | 6.10.0 | Whether to use the client-side bot detection tracker plugin as a bot signal. |

**Console:**

Configure the parameters in the Console enrichment editor. For example:

```json
{
  "useYauaa": true,
  "useIab": true,
  "useAsnLookups": true,
  "useClientSideDetection": true
}
```

**Self-Hosted:**

For Self-Hosted, [provide a complete JSON](/docs/pipeline/enrichments/managing-enrichments/terraform/). For example:

```json
{
  "schema": "iglu:com.snowplowanalytics.snowplow.enrichments/bot_detection_enrichment_config/jsonschema/1-0-1",
  "data": {
    "name": "bot_detection_enrichment_config",
    "vendor": "com.snowplowanalytics.snowplow.enrichments",
    "enabled": true,
    "parameters": {
      "useYauaa": true,
      "useIab": true,
      "useAsnLookups": true,
      "useClientSideDetection": true
    }
  }
}
```

***

> **Tip: Testing with Micro**
>
> Unsure if your enrichment configuration is correct or works as expected? You can easily test it using [Snowplow Micro](/docs/testing/snowplow-micro/), either [through Console](/docs/testing/snowplow-micro/console/) or [on your machine](/docs/testing/snowplow-micro/local/).

The `useClientSideDetection` parameter needs Enrich 6.10.0 or later. Applies to **Enrich 6.10.0+**[Latest: 6.14.1](/docs/api-reference/versions/#feature-availability-by-version "The latest Enrich version is 6.14.1")

## Output

The enrichment produces a `bot_detection` entity that summarizes all bot indicators for the event. It adds this entity to all events, even when no bot is detected.

### `bot_detection`

**Type:** Entity

Schema for bot detection context generated by the Bot Detection enrichment

**Properties:**

| Property             | Description                                                      |
| -------------------- | ---------------------------------------------------------------- |
| `bot` _boolean_      | _Required._ Whether the event is classified as coming from a bot |
| `indicators` _array_ | _Required._ List of sources that indicated bot activity          |
