> ## Documentation Index
> Fetch the complete documentation index at: https://kb.vinfer.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Compliance Monitoring and Script Adherence — NeuronLens

> Automatically monitor calls for regulatory compliance, script adherence, and policy violations across your entire agent and bot workforce.

In regulated industries like BFSI, every customer call is a potential compliance event. Agents must make required disclosures, avoid prohibited language, follow approved scripts, and stay within the bounds of regulatory guidelines from bodies like the RBI, TRAI, and SEBI. Manually auditing even a fraction of your call volume is slow, inconsistent, and expensive. NeuronLens compliance monitoring checks every single call automatically, flags violations at the segment level, and maintains a timestamped audit trail — so you catch issues before they become regulatory problems.

## What NeuronLens Checks

NeuronLens compliance monitoring runs five categories of checks on each processed call. You configure which checks apply to which campaigns, agent teams, or product lines.

<CardGroup cols={2}>
  <Card title="Required Disclosure Checks" icon="file-contract">
    Verify that agents stated all mandatory regulatory disclosures — loan terms, interest rates, MITC, product risk warnings — within the required point in the call.
  </Card>

  <Card title="Prohibited Language Flags" icon="ban">
    Detect threatening, coercive, deceptive, or otherwise non-compliant language. Flags include the exact timestamp and transcript segment where the violation occurred.
  </Card>

  <Card title="Script Adherence" icon="list-check">
    Calculate the percentage of your approved script that was covered in the call. Surface sections that agents consistently skip.
  </Card>

  <Card title="DNC Compliance" icon="phone-slash">
    Cross-reference call records against your DNC (Do Not Call) lists and TRAI opt-out registries to verify no calls were made to opted-out numbers.
  </Card>

  <Card title="Policy Deviation Alerts" icon="triangle-exclamation">
    Flag calls where agents offered terms, discounts, waivers, or commitments outside what your policy authorises — before those commitments become a liability.
  </Card>

  <Card title="Audit Trail" icon="clock-rotate-left">
    Every compliance check result is stored with its timestamp, the triggering transcript segment, the rule it violated, and the severity level — ready for regulatory audit.
  </Card>
</CardGroup>

## Configuring Compliance Rules

Set up your compliance rules in **NeuronLens → Compliance → Rules → New Rule**. Each rule has a type, the condition to check, the severity of a violation, and the scope (which campaigns or teams it applies to).

<Steps>
  <Step title="Choose the Rule Type">
    Select one of the five check types: Required Disclosure, Prohibited Language, Script Adherence, DNC, or Policy Deviation.
  </Step>

  <Step title="Define the Condition">
    For disclosure checks, enter the required phrases or topics that must appear in the call. For prohibited language, enter the terms or patterns to detect. For script adherence, upload or link your approved script. NeuronLens matches against the transcript semantically — you don't need to list every exact wording variant.
  </Step>

  <Step title="Set Severity">
    Assign a severity level to violations: `critical`, `high`, `medium`, or `low`. Critical and high violations trigger immediate alerts; medium and low violations are logged for review.
  </Step>

  <Step title="Assign Scope">
    Apply the rule to all calls, specific campaigns, specific product lines, or specific agent groups. Rules can stack — a call may be evaluated against multiple rule sets simultaneously.
  </Step>

  <Step title="Activate the Rule">
    Toggle the rule to **Active**. NeuronLens applies it to all new calls matching the scope from that point forward, and you can retroactively run it against historical calls using the batch compliance endpoint.
  </Step>
</Steps>

<Note>
  Compliance rules can be configured per campaign type, product line, or agent team. A collections campaign for personal loans might require different disclosures than a credit card sales campaign — set them up as separate rule sets so each call is evaluated against the right standard.
</Note>

## Viewing Compliance Results

### Single Call

```bash theme={null}
curl "https://api.vinfer.ai/v1/analytics/compliance?call_id=call_abc123" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Response

```json theme={null}
{
  "call_id": "call_abc123",
  "compliance_score": 91,
  "overall_status": "passed",
  "checked_at": "2024-01-15T10:51:00Z",
  "violations": [
    {
      "rule_id": "rule_prohibited_001",
      "type": "prohibited_language",
      "severity": "high",
      "timestamp": "00:02:34",
      "transcript_segment": "If you don't pay by tomorrow, we will have to take legal action against your family.",
      "description": "Agent referenced action against third party (customer's family), which violates RBI Fair Practice Code guidelines."
    }
  ],
  "passed_checks": [
    {
      "rule_id": "rule_disclosure_001",
      "type": "required_disclosure",
      "description": "Agent disclosed outstanding principal amount and applicable interest rate within the first 2 minutes of the call."
    },
    {
      "rule_id": "rule_disclosure_002",
      "type": "required_disclosure",
      "description": "Agent stated the DPD (days past due) status and MITC reference correctly."
    },
    {
      "rule_id": "rule_script_001",
      "type": "script_adherence",
      "description": "Script adherence score: 87%. Agent covered all mandatory sections; skipped optional upsell section."
    }
  ]
}
```

<ResponseField name="compliance_score" type="integer">
  Aggregate compliance score for the call, 0–100. Calculated from the severity-weighted outcome of all applied rules.
</ResponseField>

<ResponseField name="overall_status" type="string">
  `passed`, `failed`, or `review_required` — based on your configured thresholds.
</ResponseField>

<ResponseField name="violations" type="array">
  Array of detected violations. Each entry includes the rule type, severity, the timestamp in the call, the exact transcript segment, and a plain-language description of the issue.
</ResponseField>

<ResponseField name="passed_checks" type="array">
  Array of compliance checks that the call passed. Useful for generating positive audit evidence, not just flagging failures.
</ResponseField>

## Alerts and Escalations

Configure automatic alerts so the right person is notified the moment a call breaches your compliance thresholds.

<Tabs>
  <Tab title="Email Alerts">
    Set up email notifications in **Compliance → Alert Settings → Email**. Choose which severity levels trigger an email, who receives it, and whether it includes the full violation detail or a summary link.
  </Tab>

  <Tab title="Webhook Alerts">
    Receive a `POST` to your configured webhook URL whenever a `critical` or `high` violation is detected. The payload mirrors the violations array from the compliance response, plus the call metadata.

    ```json theme={null}
    {
      "event": "compliance.violation.detected",
      "call_id": "call_abc123",
      "agent_id": "ag_001",
      "severity": "high",
      "violation": {
        "type": "prohibited_language",
        "timestamp": "00:02:34",
        "transcript_segment": "If you don't pay by tomorrow, we will have to take legal action against your family.",
        "description": "Agent referenced action against third party (family), violating RBI Fair Practice Code."
      },
      "detected_at": "2024-01-15T10:51:22Z"
    }
    ```
  </Tab>

  <Tab title="Dashboard Notifications">
    Critical and high violations appear as banner notifications in the NeuronLens dashboard for compliance officers and team leads. Clicking a notification opens the call transcript at the exact violation timestamp.
  </Tab>
</Tabs>

## Audit Trail

Every compliance check result — whether passed or failed — is stored with a full audit record:

| Field                | Description                                 |
| -------------------- | ------------------------------------------- |
| `call_id`            | Unique identifier for the call              |
| `agent_id`           | The agent who handled the call              |
| `campaign_id`        | The campaign the call belongs to            |
| `rule_id`            | The specific compliance rule evaluated      |
| `result`             | `passed` or `violation`                     |
| `severity`           | Severity level if a violation               |
| `transcript_segment` | The exact text that triggered the result    |
| `timestamp`          | Position in the call (HH:MM:SS)             |
| `checked_at`         | UTC timestamp when NeuronLens ran the check |

You can export the full audit trail for any date range via **Compliance → Audit Trail → Export**, or query it programmatically via the API for integration with your compliance management system.

## Script Adherence in Detail

Script adherence scoring tells you not just whether an agent followed the script, but **which sections** they covered and which they skipped — and how consistently agents skip particular sections.

Use the script adherence report (available under **Compliance → Script Reports**) to:

* Identify script sections that agents routinely skip — a signal that the script may be too long, unclear, or impractical
* Compare script adherence across agents on the same campaign
* Track whether adherence improves after a training or script update
* Find calls where an agent deviated from the approved script immediately before a customer complaint

<Warning>
  NeuronLens compliance monitoring is a tool designed to help you identify potential issues at scale — it does not constitute legal compliance advice. The accuracy of automated checks depends on the quality and specificity of the rules you configure. Always consult your compliance team and legal counsel to determine the exact regulatory requirements applicable to your business, products, and geographies before relying on NeuronLens results for formal compliance reporting or regulatory submissions.
</Warning>
