> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.clossir.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.clossir.com/_mcp/server.

# Define & Attach a Compliance Policy

GUIDES · DEFINE A COMPLIANCE POLICY

This guide walks you through defining a compliance policy for an asset — setting regulation
parameters, reading the policy back, and triggering a compliance check.

## Prerequisites

* An organization set up ([Onboard an Organization](/guides/onboard-org))
* An asset created (see step 2 of [Deploy a Gated Asset](/guides/deploy-asset), or create one via the dashboard)
* An API key with `assets:write` and `assets:read` scopes

A compliance policy can be attached before or after asset deployment. It is common to create
the asset, attach the policy, and then deploy.

## 1. Install and authenticate

```ts title="client.ts"
import { SignumClient } from "@signum-tech/sdk";

const signum = new SignumClient({
  apiKey: process.env.SIGNUM_API_KEY,
});
```

## 2. Set the compliance policy

Attach a compliance policy to your asset. This example configures a Regulation D policy with
accredited investor requirements:

```ts title="set-policy.ts"
const policy = await signum.orgs.assets.compliancePolicy.set(
  orgId,
  assetId,
  {
    regulation_type: "reg_d",
    min_kyc_level: 2,
    accredited_investor_required: true,
    blocked_countries: ["IRN", "PRK", "CUB"],
    max_holders: 2000,
    lockup_period_days: 365,
    transfer_restricted: false,
    chain_eid: 30101,
  }
);

console.log(policy); // The saved policy
```

When `chain_eid` is provided, the API returns `202 Accepted` — the policy is saved and
queued for on-chain registration. Without `chain_eid`, it returns `200` with the saved
policy. Either way, the response includes `policyId` and `assetId` for tracking.

On-chain policy registration is asynchronous. Listen for the `signum.compliance.rule_synced`
event to confirm the policy is live on the smart contract.

### Policy fields

| Field                          | Type             | Description                                                               |
| ------------------------------ | ---------------- | ------------------------------------------------------------------------- |
| `regulation_type`              | `string`         | Regulation framework: `reg_d`, `reg_s`, `reg_a_plus`, `reg_cf`, or `none` |
| `min_kyc_level`                | `number`         | Minimum KYC level required (0-4)                                          |
| `accredited_investor_required` | `boolean`        | Whether holders must be accredited investors                              |
| `blocked_countries`            | `string[]`       | ISO 3166-1 alpha-3 country codes blocked from holding                     |
| `max_risk_score`               | `number`         | Maximum acceptable risk score (0-100)                                     |
| `max_holders`                  | `number`         | Maximum number of token holders                                           |
| `lockup_period_days`           | `number`         | Lockup period in days before transfers are allowed                        |
| `max_transaction_amount`       | `string \| null` | Maximum single transaction amount                                         |
| `cooling_off_period_hours`     | `number`         | Cooling-off period in hours between transactions                          |
| `transfer_restricted`          | `boolean`        | Whether all transfers are restricted                                      |
| `allow_pep`                    | `boolean`        | Whether politically exposed persons may hold                              |
| `chain_eid`                    | `number`         | Target chain EID for on-chain policy registration                         |

## 3. Read the policy back

Retrieve the current compliance policy for an asset:

```ts title="get-policy.ts"
const current = await signum.orgs.assets.compliancePolicy.get(orgId, assetId);

console.log(current.regulationType);          // "reg_d"
console.log(current.requiresAccreditation);   // true
console.log(current.blockedCountries);        // ["IRN", "PRK", "CUB"]
```

## 4. Trigger a compliance check

Queue an async compliance check against a wallet to verify it meets the policy requirements:

```ts title="compliance-check.ts"
const check = await signum.compliance.check({
  wallet: "0xabc...def",
  chainEid: 30101,
  assetId: assetId,
});

console.log(check.accepted);  // true
console.log(check.checkId);   // "chk_abc123"
console.log(check.message);   // Guidance on result delivery
```

The API returns `202 Accepted`. The check runs asynchronously — use webhooks or poll for
the result.

## 5. Listen for compliance events

Four compliance event channels notify you of policy and check lifecycle changes:

| Channel                             | Fires when                                |
| ----------------------------------- | ----------------------------------------- |
| `signum.compliance.rule_changed`    | Policy configuration is modified          |
| `signum.compliance.rule_synced`     | Policy is synced to the on-chain contract |
| `signum.compliance.check_requested` | A compliance check is queued              |
| `signum.compliance.check_completed` | A compliance check finishes               |

See [Subscribe to Webhooks](/guides/subscribe-webhooks) for how to receive these events, or
browse the full payload schemas in the [API Reference](/api/overview).

## Reference

* [API Reference](/api/overview) — operations and webhook payload schemas
* [Compliance — API](/products/compliance/api) — REST operations for compliance
* [Policies & Enforcement](/products/compliance/policies) — deep-dive into the compliance model

## Next steps

* [Deploy a Gated Asset](/guides/deploy-asset) — create, deploy, and distribute a token
* [Async Operations](/getting-started/sdk/async-operations) — polling and webhook correlation patterns