dtect Security API
Status PageDashboard
Status PageDashboard
  1. Frontend SDK
  • Getting Started
    • Introduction
    • Security Features
    • Security Request
    • API Credentials
  • Frontend SDK
    • Introduction
    • Quality Questions & AI Detection
    • React
    • JavaScript
    • Error List
  • Security Token
    • Introduction
    • Retrieve Security Result using Security Token
      GET
  1. Frontend SDK

Quality Questions & AI Detection

In addition to the core methods (getSecurityTokenandgetSecurityResult), the Frontend SDK provides optional checks to add more protection and validation:
Quality Questions – fetch and validate randomized questions to detect low-quality responses.
AI Usage Detection – detect if AI tools or behavior patterns were used during the session.

How They Work#

They can be used before and/or after retrieving a Security Token/Result.
Billing and session reuse work exactly as described in the Frontend SDK Introduction.
Both rely on the includeResults option to control whether results are visible in the frontend or only available to your backend.

AI Usage Detection#

Detects AI tool usage or behavior patterns during the session.

Recommended Implementation#

For best results, we recommend running the isAIUsageDetected() check after the visitor has answered at least one open-ended question. This provides more context for our detection models and increases the likelihood of accurately flagging AI usage during the session.

isAIUsageDetected(config)#

Parameters
projectId (required)
visitorId (optional)
Response
// When includeResults is false on init()
{ "token": "token-uuid" }

// When includeResults is true on init()
{
  "token": "token-uuid",
  "result": {
    "isAIUsageDetected": true
  }
}

Examples#

JavaScript
React

Quality Questions#

Get Quality Questions#

The getQualityQuestions(config?) method retrieves 4 randomized validation questions:
3 multiple-choice (single or multi-select)
1 open-ended
Once the questions are returned you should render them on the screen so your users can answer them and you provide the selected answers to checkQualityQuestions(config).
Parameters
respondentType (required) – see supported types
language (optional, default = en) – see supported languages
Response
[
  {
    "id": "7523cb83-139f-4754-8880-eb8edea07ff0",
    "text": "Which of the following best supports long-term cash flow stability during periods of economic uncertainty?",
    "type": "single_select",
    "options": [
      { "id": "d0f7ede0-5ba3-4704-a63a-19d665fc8097", "text": "Delaying discretionary capital expenditures" },
      { "id": "3a18cfec-eadb-402f-83bb-4c9c642fd399", "text": "Relying on short-term borrowing for payroll" },
      { "id": "631e9542-85f4-4760-a1c0-94f5d041a0b2", "text": "Increasing dividend payouts" },
      { "id": "80da9a11-5b9a-4ed9-8e78-4e74ab35e787", "text": "Reducing credit terms for key customers" }
    ]
  },
  {
    "id": "d7dc7848-e6f7-4075-b382-3a839550d8d1",
    "text": "Which of the following is not a typical objective of a finance function in enterprise risk management?",
    "type": "single_select",
    "options": [
      { "id": "a924935a-7a67-4344-b157-12a03959c4ca", "text": "Maximizing short-term stock price through one-time gains" },
      { "id": "dba4b297-6b1d-4466-b9d9-00e46d61f615", "text": "Ensuring proactive identification of financial exposures" },
      { "id": "f67eae39-cc18-418d-88c8-484ccb9812b2", "text": "Reducing volatility in earnings" },
      { "id": "58115dc3-c4bc-41c1-8ddf-8ec1f3714e19", "text": "Supporting continuity planning during financial disruption" }
    ]
  },
  {
    "id": "9326b68d-99cd-4f54-ab27-7c01ed90b343",
    "text": "A reverse factoring arrangement primarily benefits which party first in the transaction?",
    "type": "single_select",
    "options": [
      { "id": "276d2c98-8b55-4c7f-8cd5-d68e45df5312", "text": "The supplier" },
      { "id": "1fce3e4f-94bf-44f0-ab90-df2046131c6d", "text": "The bank" },
      { "id": "f2798c65-9234-44b8-a017-d681e3b6db81", "text": "The customer’s sales team" },
      { "id": "ec918d91-06fc-45df-914a-b901ed926c2d", "text": "The IT department" }
    ]
  },
  {
    "id": "7b460d63-69e6-41ad-b6eb-6ebe28a45f9c",
    "text": "List three considerations you take into account before approving a large capital investment.",
    "type": "open_end"
  }
]

Examples#

JavaScript
React

Check Quality Questions#

The checkQualityQuestions(config) method validates the visitor’s answers to quality control questions.
Parameters
projectId (required)
questions (required) – list of { questionId, answers }
visitorId (optional)
Response
// When includeResults is false on init()
{ "token": "token-uuid" }

// When includeResults is true on init()
{
  "token": "token-uuid",
  "result": {
    "isQualityRejected": false
  }
}

Examples#

JavaScript
React

Supported Respondent Types#

The respondentType must be one of:
ValueName
hr-manager-directorHR Manager / Director
web-developerWeb Developer
software-engineerSoftware Engineer
it-directorIT Director
business-administratorBusiness Administrator
accounts-payable-managerAccounts Payable Manager
accountantAccountant
finance-directorFinance Director
small-business-ownerSmall Business Owner
general-contractorGeneral Contractor
marketing-manager-directorMarketing Manager / Director
consumer-shopperConsumer / Shopper
travelTravel
entertainmentEntertainment
finance-and-bankingFinance & Banking
generalGeneral
b2b-white-collarB2B White Collar
b2b-blue-collarB2B Blue Collar
lawyerLawyer

Supported Languages#

The language parameter accepts the following codes. Default = en.
CodeLanguage
arArabic
bnBengali
deGerman
enEnglish
esSpanish
frFrench
hiHindi
idIndonesian
itItalian
jaJapanese
koKorean
msMalay
nlDutch
ptPortuguese
ruRussian
yueCantonese
zhChinese
The Frontend SDK exports two enums that can be used to inform language and respondent type: LanguageCodes and QualityQuestionsRespondentTypes.

Notes & Best Practices#

Both checks share the same token as the Security Result flow.
If isQualityRejected or isAIUsageDetected is true, the session will be classified as bad in the Security Result.
To understand billing, session rules, and method combinations, see the Frontend SDK Introduction.
Previous
Introduction
Next
React