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

# Policy Classification Using ACORD Lines-of-Business Codes

> Learn how CL SDK 4.0 classifies insurance policies using ACORD lines-of-business codes returned as part of the source-backed operational profile.

In CL SDK 4.0, policy classification is no longer a standalone step. Instead, the `linesOfBusiness` field inside the `PolicyOperationalProfile` carries ACORD LOB codes extracted alongside every other policy fact — in the same bounded, source-cited generation call that produces coverage units, dates, and premium. This means classification evidence is traceable to specific source nodes just like any other extracted value.

## How Classification Works

The extraction pipeline populates `linesOfBusiness` as an array of `AcordLobCode` values. A single policy can return multiple codes when the document covers a package program.

```typescript theme={"system"}
interface PolicyOperationalProfile {
  documentType: "policy" | "quote";
  linesOfBusiness: AcordLobCode[];  // e.g. ["CGL", "AUTOB"]
  // ... other fields
}
```

> [!NOTE]
>
> `linesOfBusiness` intentionally accepts multiple codes. A commercial package policy covering general liability and business auto will return `["CGL", "AUTOB"]` — do not reduce it to a single value in your application unless you have a specific reason to do so.

## Legacy-to-ACORD Code Mapping

If you are migrating from an earlier version of the SDK, the table below maps every legacy `policyType` string to its corresponding ACORD code or codes.

| Legacy value | ACORD code(s) |
| - | - |
| `general_liability` | `CGL` |
| `commercial_property` | `PROP` |
| `commercial_auto`, `non_owned_auto` | `AUTOB` |
| `workers_comp` | `WORK` |
| `umbrella` | `UMBRC` |
| `excess_liability` | `EXLIA` |
| `professional_liability` | `PL` |
| `cyber` | `CYBER` |
| `environmental`, `product_liability` | `OLIB` |
| `management_liability_package` | `MGMLI` |
| `homeowners_ho3`, `homeowners_ho5` | `HOME` |
| `renters_ho4`, `condo_ho6` | `HOME` |
| `flood_nfip`, `flood_private` | `FLOOD` |
| `travel` | `TRVL` |
| `life`, `long_term_care`, `pet`, `identity_theft`, `title`, `other` | `UN` |

> [!WARNING]
>
> The legacy `policyType` string field is deprecated and will be removed in a future major version. Migrate your code to read `linesOfBusiness` from the operational profile instead.

## Exported Utilities

Import all classification utilities from the `policy-taxonomy` subpath:

```typescript theme={"system"}
import {
  AcordLobCodeSchema,
  ACORD_LOB_CODES,
  ACORD_LOB_LABELS,
  LEGACY_POLICY_TYPE_TO_LOB,
  normalizeOperationalLinesOfBusiness,
  resolveOperationalProfileLinesOfBusiness,
  PERSONAL_LOB_CODES,
} from "@claritylabs/cl-sdk/policy-taxonomy";
```

> **AcordLobCodeSchema**
>
> A Zod enum containing all 107 ACORD LOB codes. Use it to validate user input or parse external data before passing it into your application logic.

> **ACORD\_LOB\_CODES**
>
> A plain array of all 107 ACORD LOB code strings. Useful for populating dropdowns or building filter sets.

> **ACORD\_LOB\_LABELS**
>
> A `Record<AcordLobCode, string>` map from code to human-readable label. Use this to display friendly names in your UI.

> **LEGACY\_POLICY\_TYPE\_TO\_LOB**
>
> Maps every legacy `policyType` string to one or more ACORD codes. Use this during a migration to translate stored legacy values.

### Utility Functions

**normalizeOperationalLinesOfBusiness**

Accepts an array of raw LOB strings — which may be legacy values, ACORD codes, or mixed — and returns a deduplicated array of valid `AcordLobCode` values.

```typescript theme={"system"}
import { normalizeOperationalLinesOfBusiness } from "@claritylabs/cl-sdk/policy-taxonomy";

const codes = normalizeOperationalLinesOfBusiness(["general_liability", "CGL", "AUTOB"]);
// ["CGL", "AUTOB"]
```

**resolveOperationalProfileLinesOfBusiness**

Resolves the final normalized code array from a `PolicyOperationalProfile` by combining the profile's `linesOfBusiness` hint with coverage-derived inference. Use this when you have a full profile object and want a single authoritative code list.

```typescript theme={"system"}
import { resolveOperationalProfileLinesOfBusiness } from "@claritylabs/cl-sdk/policy-taxonomy";

const { linesOfBusiness } = resolveOperationalProfileLinesOfBusiness({
  profileLinesOfBusiness: operationalProfile.linesOfBusiness,
  coverages: operationalProfile.coverages,
});
// ["CGL", "AUTOB"]
```

**PERSONAL\_LOB\_CODES**

A `Set<AcordLobCode>` containing all personal lines codes. Use it to branch logic between personal and commercial policies.

```typescript theme={"system"}
import { PERSONAL_LOB_CODES } from "@claritylabs/cl-sdk/policy-taxonomy";

const isPersonal = codes.some((c) => PERSONAL_LOB_CODES.has(c));
```

## Full Classification Example

The following example runs extraction and then reads the resulting LOB codes with a human-readable label for each:

```typescript theme={"system"}
import { createExtractor } from "@claritylabs/cl-sdk";
import {
  ACORD_LOB_LABELS,
  resolveOperationalProfileLinesOfBusiness,
} from "@claritylabs/cl-sdk/policy-taxonomy";

const extractor = createExtractor({ generateObject });
const result = await extractor.extract(pdfBase64, "doc-123", { sourceSpans });

const { linesOfBusiness: codes } = resolveOperationalProfileLinesOfBusiness({
  profileLinesOfBusiness: result.operationalProfile!.linesOfBusiness,
  coverages: result.operationalProfile!.coverages,
});

for (const code of codes) {
  console.log(`${code}: ${ACORD_LOB_LABELS[code]}`);
}
// CGL: Commercial General Liability
// AUTOB: Business Auto
```

> [!TIP]
>
> Store the raw `AcordLobCode[]` array in your database rather than labels or legacy strings. Labels may be updated in future SDK versions, but code values are stable ACORD-defined identifiers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.