# Chainalysis Address Screening \[Use Chainalysis data in Newton policies to screen addresses for sanctions and high-risk categories before vault actions execute.]

The Chainalysis policy screens an address for sanctions and risk categories. It is useful for vault deposits, withdrawals, curator operations, or any flow where the vault needs address-level compliance and AML controls.

## Deployment

| Field | Value |
| --- | --- |
| Pack id | `chainalysis` |
| PolicyData addresses | [VaultKit address table](/developers/vaults/policy-packs#deployed-policydata-addresses) |
| Canonical deployments | [`deployments.json`](https://github.com/newt-foundation/newton-policy-packs/blob/main/deployments.json) |

### Secrets

| Secret | Required? | Where to get it |
| --- | --- | --- |
| `CHAINALYSIS_SANCTIONS_KEY` | Required by schema | [chainalysis.com](https://www.chainalysis.com) |
| `CHAINALYSIS_SCREENING_KEY` | Required only for paid risk screening APIs | [chainalysis.com](https://www.chainalysis.com) |

The sanctions endpoint is public/keyless, so a placeholder can satisfy schemas that require `CHAINALYSIS_SANCTIONS_KEY`. Use `CHAINALYSIS_SCREENING_KEY` only when your deployed policy calls the paid risk API.

## Data Inputs

The Chainalysis data oracle returns values such as:

* `sanctioned`
* `is_high_risk`
* `risk_categories`

## Rego Checks

Use these exact Rego checks to enforce each guardrail.

### Sanctioned Address

```rego
deny contains "chainalysis_sanctioned" if {
    t.deny_on_sanctioned
    v.sanctioned
}
```

### High-Risk Address

```rego
deny contains "high_risk_address" if {
    t.deny_on_high_risk_category
    v.is_high_risk
}
```

### Blocklisted Risk Category

```rego
deny contains "risk_category_blocklisted" if {
    some cat in v.risk_categories
    cat in t.risk_categories_blocklist
}
```

### Final Allow Rule

```rego
allow if count(deny) == 0
```

## Complete Policy

```rego
package chainalysis_address_screening

import future.keywords

default allow := false

t := data.params.chainalysis
v := data.wasm.chainalysis

deny contains "chainalysis_sanctioned" if {
    t.deny_on_sanctioned
    v.sanctioned
}

deny contains "high_risk_address" if {
    t.deny_on_high_risk_category
    v.is_high_risk
}

deny contains "risk_category_blocklisted" if {
    some cat in v.risk_categories
    cat in t.risk_categories_blocklist
}

allow if count(deny) == 0
```
