> For the complete documentation index, see [llms.txt](https://doc.ozforensics.com/oz-knowledge-ru/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.ozforensics.com/oz-knowledge-ru/rukovodstva/rukovodstvo-razrabotchika/sdk/websdk/web-plugin/rekomendacii-po-bezopasnosti.md). Agents can also search and read this documentation through its [MCP server](https://doc.ozforensics.com/oz-knowledge-ru/~gitbook/mcp).

# Рекомендации по безопасности

### Получение и обработка результатов анализа на бэкенде

Результаты анализа доступны клиентскому приложению через функции-колбэки Web Plugin, однако мы рекомендуем получать их через бэкенд напрямую от Oz API и там же обрабатывать впоследствии. Таким образом исключается вероятность манипуляций с результатами анализов через контекст браузера.

Чтобы найти нужную папку со стороны бэкенда, сделайте следующее:

1. На фронтенде добавьте уникальный идентификатор папки через метаданные:<br>

   ```javascript
   OzLiveness.open({
     ...
     meta: { 
     // идентификатор пользователя или лида из стороннего лидогенератора
     // передавайте ID, если вам нужно отслеживать несколько попыток от одного и того же пользователя
       'end_user_id': '<user_or_lead_id>',
     // уникальный идентификатор попытки
       'transaction_id': '<unique_id1>'
     }
   });
   ```

   Вы можете добавить собственные пары ключ-значение для хранения любой текстовой информации, например, номера документа или телефона. Однако удостоверьтесь при этом, что соблюдаются нормы законодательства о защите персональной информации.
2. Для оповещения о завершении анализа используйте функцию-колбэк `on_result`, затем вызовите бэкенд и передайте значение `transaction_id`.
3. На стороне бэкенда найдите папку по присвоенному ранее идентификатору с помощью метода `Folder LIST`:

   ```json
   /api/folders/?meta_data=transaction_id==unique_id1&with_analyses=true
   ```

   Для ускорения обработки запроса мы рекомендуем ограничить выдачу по времени:

   ```json
   /api/folders/?meta_data=transaction_id==unique_id1&with_analyses=true&time_created.min=([CURRENT_TIME]-1hour)
   ```
4. В ответе придут результаты анализов и идентификатор папки `folder_id` - он потребуется для дальнейших действий.

### Ограничение объема данных, которые сервер отправляет Web Plugin

Web Adapter отправляет Web Plugin данные с различным уровнем детализации. Для продакшна рекомендуется установить минимальный уровень. Для этого в [файле конфигурации](https://doc.ozforensics.com/oz-knowledge-ru/rukovodstva/rukovodstvo-administratora/web-adapter/nastroiki-faila-konfiguracii.md) Web Adapter установите параметру `result_mode` значение "safe".

```json
"result_mode": "safe"
```


---

# 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://doc.ozforensics.com/oz-knowledge-ru/rukovodstva/rukovodstvo-razrabotchika/sdk/websdk/web-plugin/rekomendacii-po-bezopasnosti.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.
