# Compliance controls

> Compliance frameworks and their controls, evidence linked to controls (attachments or notes, with a validity date), recurring evidence tasks with assignees and an overdue state, a status rollup per framework, and policies published as frozen versions that members acknowledge.

- Category: Admin & compliance
- Module: `compliance`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/compliance
- Page: https://bettersupabase.com/blocks/compliance

## Install

```bash
npx better-supabase add compliance
```

The command also installs `updated-at`, `memberships`, `permissions`, `versions`.

## Configure

Add the block to `better-supabase.config.ts`:

```ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  blocks: {
    // Required by compliance; add installs them too.
    "updated-at": {},
    memberships: {},
    permissions: {},
    versions: {},
    // Modes: "managed", "custom". The default is "managed".
    compliance: { mode: "managed" },
  },
});
```

## Client

The block has no React entry yet. Its server-side TypeScript is in `better-supabase/blocks/compliance`.

## Events

- `control.evidence_added`
- `control.saved`
- `evidence_task.missed`
- `policy.acknowledged`
- `policy.published`

## Related blocks

Requires: [memberships](https://bettersupabase.com/blocks/memberships.md), [permissions](https://bettersupabase.com/blocks/permissions.md), [versions](https://bettersupabase.com/blocks/versions.md)

Works with: [attachments](https://bettersupabase.com/blocks/attachments.md), [notifications](https://bettersupabase.com/blocks/notifications.md), [outbox](https://bettersupabase.com/blocks/outbox.md), [audit](https://bettersupabase.com/blocks/audit.md)

## Recipes

- [Control posture](https://bettersupabase.com/recipes/control-posture.md): One card per compliance framework with its passing, failing and not started controls, then the overdue evidence tasks.
