Skip to main content
Snapshot rules let you enforce organization-level guardrails for every snapshot job, including required transformations and always excluded tables.

Organization Snapshot Rules (Team & Enterprise)

Use Settings -> Snapshot Rules in the app to define org-wide rules that are enforced on every snapshot. When rules are enabled, Basecut applies them at snapshot-job creation time:
  • Missing required transformations are added automatically.
  • Conflicting transformations fail fast before extraction starts.
  • Always excluded tables are merged into the job config.

Snapshot Rule Shape (rules)

Most users configure rules in Settings -> Snapshot Rules. For API/CLI integrations, the rules object supports this shape:
{
  "required_strategies": {
    "*.email": "fake_email",
    "users.ssn": {
      "strategy": "fake_ssn"
    },
    "users.created_at": {
      "strategy": "date_shift",
      "params": { "days": 30 }
    }
  },
  "required_excludes": ["audit_logs", "payment_events"]
}

API Payload Shape

When writing rules through the API, send enabled and rules:
{
  "enabled": true,
  "rules": {
    "required_strategies": {
      "*.email": "fake_email",
      "users.ssn": "fake_ssn"
    },
    "required_excludes": ["audit_logs", "payment_events"]
  }
}

Rule Behavior

RuleBehavior
required_strategiesEnsures a transformation is used for matching fields (for example *.email).
required_excludesForces tables into tables.exclude for every snapshot.
For rule keys like users.email, unqualified tables are normalized to public.users.

Conflict Example

If your org snapshot rules require *.email: fake_email and a job config sets users.email: none, Basecut returns a validation error and does not create the job.

Precedence and Conflict Behavior

  1. Organization snapshot rules are evaluated first at snapshot-job creation.
  2. Required transformations are merged into the job config.
  3. Always excluded tables are merged into tables.exclude.

Snapshot-Level Anonymization Configuration

Use YAML anonymization rules for snapshot-specific behavior. Organization snapshot rules are the governance layer above these settings.

Configuration Shape

anonymize: auto
# or
anonymize:
  mode: manual # auto | manual | off
  rules:
    users:
      email: fake_email
      phone: fake_phone
    '*.password_hash': redact

Modes

ModeBehavior
autoEnable built-in PII detection and apply explicit rules.
manualApply only explicit rules.
offDisable anonymization entirely.

Rules

You can define rules in two forms:
  1. Table-grouped rules
anonymize:
  mode: manual
  rules:
    users:
      full_name: fake_name
      date_of_birth:
        strategy: date_shift
        params:
          days: 90
  1. Wildcard / flat rules
anonymize:
  mode: manual
  rules:
    '*.email': fake_email
    '*.credit_card': redact
Unqualified table keys (for example users) are resolved as public.users.

Example: Balanced Auto + Overrides

anonymize:
  mode: auto
  rules:
    users:
      email: fake_email
      phone: fake_phone
      ssn: fake_ssn
    payments:
      card_number:
        strategy: partial_mask
        params:
          visible: 4
    '*.password_hash': redact

Strategies

Basic

StrategyDescription
noneNo transformation
redactReplace with [REDACTED]
nullReplace with null
fixedReplace with fixed value (params.value)
hashDeterministic hash

Person Data

StrategyDescription
fake_nameRealistic person name
fake_first_nameFirst name
fake_last_nameLast name
fake_emailRealistic email
email_preserve_domainFake local part, keep domain
fake_phonePhone number
fake_date_of_birthRealistic DOB
fake_usernameUsername/handle

Financial & Identity

StrategyDescription
fake_credit_cardLuhn-valid card number
fake_ssnSSN-like value
fake_passportPassport-like value
fake_ibanIBAN-like value
fake_bank_accountBank account-like value
fake_companyCompany name

Location & Networking

StrategyDescription
fake_addressStreet address
fake_cityCity
fake_stateState
fake_zipPostal code
fake_countryCountry
fake_ipIP address
fake_macMAC address

Utility

StrategyDescriptionParams
partial_maskKeep N trailing chars visiblevisible
date_shiftShift date ±N daysdays
numeric_noiseAdd ±N% variancepercent
fake_uuidGenerate UUID-
fake_urlGenerate URL-
fake_paragraphGenerate text-