---
title: "db scan-pii"
description: "Scan a database for likely-PII columns"
canonical: "https://pgbeam.com/docs/cli/db/scan-pii"
last-updated: "2026-11-10T19:09:29.000Z"
---

# db scan-pii

> Scan a database for likely-PII columns

URL: https://pgbeam.com/docs/cli/db/scan-pii

{/* Auto-generated from CLI commands. Do not edit. Run `pnpm generate:cli-docs` to regenerate. */}

Connects to the upstream database read-only, inspects information_schema and samples column values against PII heuristics, and returns ranked masking suggestions. Suggestions are advisory: the operator reviews them and applies the ones they want into a policy profile's masking rules. Nothing is auto-applied.

## Usage

```bash
pgbeam db scan-pii <id>
```

## Options

| Option | Description | Required | Default |
| ------ | ----------- | -------- | ------- |
| `<id>` |             | Yes      | -       |

> **Global options**
>
> All [global options](/docs/cli/global-options) (`--token`, `--profile`,
> `--project`, `--org`, `--json`, `--no-color`, `--no-trunc`, `--debug`) are
> also available on this command.

## Examples

```bash
# Scan a database for likely-PII columns
pgbeam db scan-pii

# Output as JSON
pgbeam db scan-pii --json
```

## Output

Renders a human-readable table or detail view by default; pass `--json` for the raw API response.