> For the complete documentation index, see [llms.txt](https://docs.caf.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.caf.io/caf-sdk/web-javascript/security.md).

# Security

We are constantly taking actions to make the product more and more secure, mitigating a number of attacks observed in the capture process and, consequently, reducing as many possible identity frauds as possible. The SDK has some blocks that may prevent its execution in certain contexts. These are

> Initially, the security enhancements are only available for `PassiveFaceLiveness`.

## **Obfuscated Code** <a href="#sjbnjfrclugt" id="sjbnjfrclugt"></a>

The browser allows inspecting implementation details of solutions based on web tools. Understanding that this functionality can represent a point of vulnerability, it was implemented that the obfuscation of the code present in the SDK prevents implementation details from being revealed, thus inhibiting possible reverse engineering practices.

## **Automatic shutdown of the SDK** <a href="#id-2xd5d21mken6" id="id-2xd5d21mken6"></a>

> When enabled the security enhancements that terminate the SDK are, its execution will be terminated automatically, so it must be implemented in a way to directs the application to a screen at your discretion, both features that terminate the SDK are configurable and can be disabled, check the parameters used in the documentation of the corresponding SDK.

### **Tab change** <a href="#o8spfvljurpg" id="o8spfvljurpg"></a>

While running the SDK, changing browser tabs makes it impossible to capture the selfie, automatically terminating the SDK. Therefore, it is recommended that the user does not switch tabs while using `PassiveFaceLiveness`.

### **Face not detected** <a href="#hav38yag3ivr" id="hav38yag3ivr"></a>

In the process of capturing the selfie, it is necessary that the user keeps the face positioned in the indicated area, otherwise, the process will be terminated.

\*\* Only available for automatic capture

## **Attempt control** <a href="#id-1r45dsgj7rnv" id="id-1r45dsgj7rnv"></a>

For security measures, a mechanism was developed that limits the number of retries. After the user reaches the given number of tries, the SDK terminates the execution.


---

# 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.caf.io/caf-sdk/web-javascript/security.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.
