> For the complete documentation index, see [llms.txt](https://docs.transparentedge.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.transparentedge.eu/security/waf/captcha.md). Agents can also search and read this documentation through its [MCP server](https://docs.transparentedge.eu/~gitbook/mcp).

# CAPTCHA

This function allows us to block requests made to our website by bots, ensuring that the traffic received comes from humans.

With this purpose in mind, CAPTCHAs (Completely Automated Public Turing test to tell Computers and Humans Apart) consist of small automated tests or challenges that can differentiate between human users and automated programs (bots). Specifically, the implementation of this function is based on the [reCAPTCHA](https://www.google.com/recaptcha/about/) solution offered by Google.

This function is invoked through our `TCDN-Command` header; therefore, we need to include the value `show-captcha.` The syntax of the function is as follows: `show-captcha[:`*`<ttl>`*`]`.

Internally, when a user successfully completes the CAPTCHA challenge, the cookies `TEDGECP` and `TEDGECPS` (the same value, for cross-site iframes) are assigned to their browser. They are signed for the user's IP address and User-Agent, and prevent them from being repeatedly asked to pass the CAPTCHA challenge; if the IP address or the browser changes, the CAPTCHA is shown again. By default they have a time to live `(ttl)` of one hour. Once this time has elapsed, the user will need to complete a new CAPTCHA challenge. The optional parameter *`<ttl>`* (up to 7 days) allows us to control the lifetime of these cookies.

For example, if we wanted to limit the presence of bots on our domain `mi-dominio.es` without excessively inconveniencing legitimate users, we could implement a CAPTCHA with an 8-hour TTL. In this case, we would deploy a [VCL](https://docs.transparentedge.eu/config/vcl.md) [configuration](https://docs.transparentedge.eu/config/easy-setup.md) similar to the following from the [dashboard:](https://docs.transparentedge.eu/getting-started/dashboard.md)

```c
# show-captcha
sub vcl_recv {
    if (req.http.host == "www.mi-dominio.es") {
        set req.http.TCDN-Command = "show-captcha:28800s";
    }
}
```

In this way, if the user successfully completes the CAPTCHA challenge, they will be assigned the `TEDGECP` cookies and can continue browsing normally for the next eight hours, after which they will be presented with the CAPTCHA again. Alternatively, if the user is unable to solve the challenge, the CAPTCHA page (403 status code) remains and asks them to try again.

The CAPTCHA is only shown on `GET` requests. Requests with other methods (`POST`, `HEAD`, ...) receive a `403` until the user has solved the CAPTCHA.

Of course, this is just a small example of a very specific use case. If you have any questions about how to integrate this functionality into your own domain, please don't hesitate to contact us at <soporte@transparentcdn.com>.


---

# 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://docs.transparentedge.eu/security/waf/captcha.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.
