Skip to content

Step 2 of 7: Connect your data

One command reads a source and writes your privacy model. There is no connection setup and no configuration file: you name the source, the engine reads a sample of it and writes a .opp.yaml file in the folder you are in.

opp-engine scan postgres://[email protected]/crm --org "Acme"

The engine asks for the password with hidden input, uses it for the connection and forgets it. It then prints what it found in each table and writes acme.opp.yaml. You only say --org the first time.

What a source can be

Source How you write it Example
PostgreSQL a database URL postgres://[email protected]:5432/crm
MySQL, MariaDB a database URL mysql://[email protected]:3306/shop
SQLite a file URL sqlite:///data/app.db
SQL Server, Oracle, Snowflake, BigQuery, Redshift, ClickHouse, DuckDB, Trino a SQLAlchemy URL see Data sources
MongoDB a MongoDB URL mongodb://[email protected]:27017/crm
Files a path or a folder ./exports (CSV, TSV, JSON, Parquet, text, Markdown, HTML, PDF, Word)
Web pages a URL https://intranet.example/handbook
A URL kept in the environment env: and the variable's name env:CRM_URL

Connect safely

  • Use a read-only account. The engine only runs SELECT and find queries, with a row limit.
  • Leave the password out of the command. At a terminal the engine asks for it. In a script or in CI, put the whole URL in an environment variable and name it:

    opp-engine scan env:CRM_URL
    
  • Credentials never reach the model. Only the scheme, host, port and database name are kept as the source's locator.

  • Values stay in memory. By default 200 rows or documents per table are sampled, used to classify, and discarded. Change it with --sample N.
  • Run it inside your network. The machine that runs the engine needs to reach your sources; nothing is sent anywhere else.

Check that it worked

The scan ends with a summary like this one, and the file is in your folder:

Scanned 1 source with rule detectors + OPP Model v1.

  crm  (database, postgresql://db.internal/crm)
      12 datasets, 84 fields, 23 with private data
      found: Email address (4), Person's name (6), Health data (2)

Wrote acme.opp.yaml: 1 source in the model, 31 proposed entries to review.

The first line names what read your data: the rule detectors and OPP Model, which the engine downloads from Hugging Face once, verifies, and then uses from a local cache. opp-engine model info shows where it is.

If the scan stops instead, it says why without showing the password. Common problems are a firewall between the engine and the database, an account without read rights, or a database that needs its own driver. See Troubleshooting.

Next: 3. Generate the privacy model →