safeslice

FAQ

Straight answers about what Safeslice does, what it refuses to claim, and how it compares to the alternatives.

What is Safeslice?

A command-line tool that copies a subset of a PostgreSQL database into another one, replacing personal data on the way out and verifying the result.

Why not just use pg_dump?

pg_dump is excellent at what it does: a complete, faithful copy. That is the problem. It copies every row and every column, including the ones holding customers, and it copies all 480 GB of them. Safeslice takes a few thousand rows and replaces the people.

Does Safeslice modify production?

No. The source session is set read-only before anything else runs, so the server itself rejects any write. It also refuses to start when the target resolves to the same database as the source. Run it against a replica.

Which PostgreSQL versions are supported?

13 through 17, tested against both ends of that range in CI. No other database is supported and none is planned.

Can I mask custom columns?

Yes — any column, by name, in safeslice.yaml. Eleven rules are available: email, phone, name, first_name, last_name, address, govid, ip, secret, redact and keep.

Is masking deterministic?

Yes, given a seed. The same input always produces the same replacement, so a customer’s email masks identically in every table it appears in and every join still works. Share the seed and your whole team’s snapshots agree.

Can I use it in CI?

Yes. safeslice run and safeslice verify are non-interactive, and verify exits non-zero on any finding, so it gates a pipeline as-is. summary.json is written for a job to assert on.

What happens to free-text fields?

Safeslice will not guess. Columns it cannot classify are surfaced for a decision, and strict mode — on by default — refuses to run while any remain unreviewed. That refusal is deliberate: silently passing an unreviewed text column through is how personal data reaches a laptop.

What if the target database already exists?

Nothing is silently overwritten. You are asked whether to use it as it is, create one under a different name, choose a new name, or replace it — and replacing requires typing the database name.

Can I use the output with my ORM?

Yes. It is an ordinary PostgreSQL database with your schema. The generated README includes connection snippets for psql, Prisma, Rails, Django, Node.js and Go.

How does verification work?

It scans the loaded database for values that still look like real personal data: email addresses, phone numbers, IP addresses, and long digit runs confirmed by the Luhn checksum. Findings are reported per column with a redacted sample.

Does Safeslice guarantee no PII exists in the output?

No, and it will not claim to. A clean scan means no known pattern of personal data was detected in the sampled rows. It is not a mathematical proof that arbitrary free text contains none. That sentence appears in every artifact it writes.

What it does instead is refuse — by default — to run while any text column is unreviewed, so the judgement is made by a person who can be asked about it later.

Is there telemetry?

None. No usage counters, no error reporting, no update check. It is a static binary that talks to two databases and nothing else.

Is it open source?

Apache-2.0, on GitHub. No hosted service, no paid tier gating features, nothing to shut down.