Skip to content
BeryxTechBeryxTech
Retour aux réponses aux appels d'offres

Documentation de BeryX

Ce document est publié en portugais et en anglais ; voici la version anglaise.

BeryX — Connector guide

How to obtain credentials and configure each data source in the connection wizard. Technical contract in docs/ARQUITETURA.md §3.1; implementation in backend/app/infra/connectors/.

Principles common to all sources:

  • Read-only: BeryX only reads metadata, aggregates and samples — it never writes to the source. It always uses the vendors' official methods.
  • Encrypted credentials: the configuration is encrypted with Fernet before it is persisted and never appears in logs or in API responses. The connection test message goes to the connection's last error, which every workspace member sees. Since card #629, it always goes through the secrets filter, in every connector, even when the connector does not catch its own exception or repeats the config in the error. The values of the config's sensitive keys (passwords, tokens, secrets, keys and the url or the uri), the password of a ://user:password@ DSN, the value in pairs such as password=… and PEM blocks come out as ***. Proof: backend/tests/test_connection_last_error_redaction.py.
  • Flow in the wizard: create connection → Test connection (diagnostic message if it fails) → Discover datasets → schedule/run scans.
  • Fixed egress IP: with Cloud NAT active (DEPLOY_GCP §12), all connections to the sources leave from a fixed IP per region. The wizard shows it ("Our requests come from …") and it is also at GET /api/v1/public/egress-ips. In production it is not yet active: while that endpoint returns configured: false, the wizard hides the note and egress has no fixed IP. Ports per connector, TLS and private connectivity: REDE_ALLOWLIST.md.
  • Good neighbour to the DBA: all queries from the SQL connectors go out identified (application_name/program_name/QUERY_TAG and the comment /* DataVault scan <uuid> */), and each connection can have blackout windows, a maximum number of concurrent queries, a maximum sampling and a read replica (replica_host/replica_port in Postgres, MySQL and SQL Server). The report of what was executed can be exported as CSV/JSON. Full guide: DBA.md.
  • Optional drivers: each source has its own pip extra. Without the extra installed, the app still works: GET /api/v1/connections/types returns available=false and the type's missing_extra, and the wizard shows "driver not included in this installation" instead of letting you create a connection that would fail the test. The type → extra → modules map lives in backend/app/infra/connectors/extras.py (single source). The same endpoint returns the name (label), the family (group) and the anchor of this guide's section (docs_anchor) for each type — that is where the Help page gets the list of supported connectors; a new heading here that changes an anchor makes tests/test_connection_types.py fail.

Summary

Source Type (connector_type) Pip extra Wizard fields
PostgreSQL postgres datavault-backend[postgres] (psycopg2) host, port, database, user, password (or url); replica_host?, replica_port?, tls_mode?, ssl_ca_pem?
MySQL/MariaDB mysql datavault-backend[mysql] host, port, database, user, password (or url mysql+pymysql://); replica_host?, replica_port?, tls_mode?, ssl_ca_pem?
SQLite sqlite — (included) path (.db file; used in tests/demos)
CSV csv datavault-backend[csv] (optional); datavault-backend[excel] for Excel path (directory with .csv and .xlsx/.xlsm files)
Google Cloud Storage gcs datavault-backend[gcs] (gcsfs + pandas + pyarrow) bucket, prefix?, service_account_info (JSON key) or anonymous: true; max_files?, include_images?
Amazon S3 (and compatible) s3 datavault-backend[s3] (s3fs + pandas + pyarrow) bucket, prefix?, access_key_id + secret_access_key or anonymous: true; region?, endpoint_url?, max_files?, include_images?
Azure Blob Storage / ADLS Gen2 / Fabric OneLake adls datavault-backend[adls] (adlfs + pandas + pyarrow) account_name, container, prefix? and one credential: account_key, sas_token, tenant_id + client_id + client_secret or anonymous: true; endpoint_suffix?, max_files?, include_images?. OneLake: onelake_url + tenant_id + client_id + client_secret
SFTP (partner and bank file drops) sftp datavault-backend[sftp] (paramiko + pandas + pyarrow) host, port? (22), username, password or private_key_pem (+ passphrase?), host_key_fingerprint (required in production), root_path, prefix?, max_files?, include_images?
BigQuery bigquery datavault-backend[bigquery] project, dataset?, credentials_json (required in production); max_bytes_per_query?, max_bytes_per_scan?, partition_window_days?
Databricks databricks datavault-backend[databricks] host, access_token, http_path, catalog?, schema?
Snowflake snowflake datavault-backend[snowflake] account, user, password, database, schema?, warehouse?, role?
Salesforce salesforce datavault-backend[salesforce] username, password, security_token, domain
Dynamics 365 dynamics datavault-backend[dynamics] org_url, tenant_id, client_id, client_secret, entities?
Microsoft Fabric fabric datavault-backend[fabric] + ODBC driver server, database, tenant_id, client_id, client_secret
SQL Server / Azure SQL / Synapse mssql datavault-backend[mssql] (pymssql); Entra ID mode: + [fabric] and ODBC driver host, port?, database, user, password or tenant_id, client_id, client_secret; application_intent?, replica_host?, replica_port? (or url)
Oracle Database oracle datavault-backend[oracle] (oracledb, thin mode) host, port?, service_name or sid, user, password, schemas? (or url)
Amazon Redshift redshift datavault-backend[redshift] (sqlalchemy-redshift + redshift_connector) host, port?, database, user, password (or url)
MongoDB / Atlas mongodb datavault-backend[mongodb] (pymongo) uri or host, port?, user?, password?, auth_source?; database, collections?, sample_size?, tls_mode?, ssl_ca_pem?
Confluence Cloud (documents) confluence — (included) site, email, api_token, space_key?, mine_signals?
Jira Cloud (documents, signals) jira — (included) site, email, api_token, project_key?, jql?, mine_signals?
SharePoint / Teams (documents) sharepoint datavault-backend[sharepoint] site_urls, tenant_id, client_id, client_secret, folder?, drive_names?, include_images?
Google Drive (documents) gdrive datavault-backend[gdrive] credentials_json, folder_ids and/or shared_drive_id, folder?, subject?, include_images?
Google Sheets gsheets datavault-backend[gdrive] credentials_json, spreadsheet_ids, header_row?, sheets?, subject?
Slack — channels (signals) slack — (included) bot_token (xoxb-), channels, site?, lookback_days?, mine_signals?
Teams — channels (signals) teams datavault-backend[sharepoint] tenant_id, client_id, client_secret, channels, lookback_days?, mine_signals?
Apache Kafka (streaming) kafka datavault-backend[kafka] bootstrap_servers, security_protocol?, sasl_mechanism?, sasl_username?, sasl_password?, topics?, value_format?, sample_size?, consumer_group?, schema_registry_url?, schema_registry_username?, schema_registry_password?, ssl_ca_pem?
Google Pub/Sub (streaming) pubsub datavault-backend[pubsub] credentials_json, subscriptions, project_id?, value_format?, sample_size?, sample_window_seconds?, consumer_subscriptions?
SAP S/4HANA / Gateway (OData) sap — (included) base_url, auth? (basic, oauth2_client_credentials or api_key) with username + password, token_url + client_id + client_secret + scope? or api_key + api_key_header?; sap_client?, entity_sets?, sample_size?
OData v2/v4 (generic) odata — (included) base_url, auth? (none, basic, oauth2_client_credentials or api_key) and the mode's credentials, as in sap; sap_client?, entity_sets?, sample_size?
REST/JSON API (generic) rest_api — (included) base_url, auth? (none, bearer, basic or api_key) with token, username + password or api_key + api_key_header?; endpoints, records_path?, pagination?, total_path?, allowed_hosts?, contract?, sample_size?, max_pages?
Weaviate (vector indexes, metadata only) weaviate — (included) url, api_key?

Validation status

Live proof, per connector, that the sequence the product uses works: test_connection → list_tables (or list_documents in the document sources) → get_columns → profile_table (1 table, small sample) → fetch_rows(limit=5) and, when the connector implements it, table_metadata. It runs with backend/scripts/connector_matrix.py (logic in app/infra/connectors/conformity.py) and each row is classified by the strongest tier that passed:

Classification What it proves Where it runs
real_public Real public source, no account (PUBDATA presets: RNAcentral, Rfam, Ensembl, OpenAQ, NOAA GHCN, Azure Open Datasets holidays; GCS cloud-samples-data/bigquery/us-states; the OData.org reference services, Northwind v2 and TripPin v4) and local SQLite/CSV fixtures (seed/connectors/) --tier public — no infra, local or CI
real_docker Real service in docker-compose.connectors.yml (postgres:16, mysql:8, mongo:7, Redpanda, MinIO, Azurite) with the seed from seed/connectors/ --tier docker — docker job of the connectors-matrix.yml workflow
real_sandbox Vendor test account (BigQuery austin_311 with an SA key, Snowflake trial, Databricks, Salesforce Developer Edition, SAP Business Accelerator Hub sandbox with an API key, Confluence/Jira Cloud free, test Slack, test GCP project for Pub/Sub…) --tier sandbox — only types with all the DATAVAULT_MATRIX_<TIPO>_<CHAVE> secrets defined
fake_transport The connector's contract (parsing, pagination, guards) against the tests' fake transports (backend/tests/fakes/connectors.py) — does not prove the real source --tier fake
driver_missing The extra's driver is not installed where the matrix ran —
stub Connector with no implementation, roadmap only (none today) —
unverified Ran against a real source but no attempt passed — the tier and the source go in the "Fonte" (source) column; the classification never says real_* without proof —
untested Driver present but no source in the tiers that were run —

A step that fails because of the network or a timeout is marked 🌐 unreachable (not ❌): an unstable public source does not count as a regression. The CI gate (--fail-on-regression) compares with the baseline docs/verificacao/connector-matrix.json and fails when a real_* row that used to pass comes back with fail — and, on a real source that has never passed in full, when a step that was ✅ comes back ❌. Error messages go through redact(): no DATAVAULT_MATRIX_* value, password, token or private key reaches the JSON, the Markdown or the logs (tested in tests/test_connector_matrix.py).

cd backend
python scripts/connector_matrix.py --tier public,fake --write-docs   # no Docker, no secrets
docker compose -f ../docker-compose.connectors.yml up -d --wait && python ../seed/connectors/seed.py
DATAVAULT_ALLOW_PRIVATE_NETWORKS=true python scripts/connector_matrix.py --tier docker --write-docs

--write-docs rewrites only the table between the markers below and adds the tiers that were run to the baseline (the other tiers stay as they were). A new connector has to appear here — the matrix test fails if a type in the CONNECTOR_REGISTRY has no row.

Honest notes (2026-09-25):

  • Production image without Fabric. The image installs backend/requirements.lock, compiled with the extras in the build's CONNECTOR_EXTRAS (cd.yml, gcp_deploy.sh, security.yml — identical, tested). fabric is not there: it needs pyodbc and the msodbcsql18 system driver, and including it is a separate decision. In production it appears in the wizard as "driver not included in this installation". kafka and pubsub entered the lock on 15/10/2026. The sharepoint and gdrive extras are not in the list, but msal, google-auth and requests reach the lock through other extras: SharePoint, Teams, Google Drive and Google Sheets have their driver in the image. That is why the matrix's "Extra na imagem prod" column looks up each driver module in the lock (MODULE_DISTRIBUTIONS in backend/app/infra/connectors/extras.py), not the extra's name.
  • Pub/Sub does not use the emulator. The connector talks only to the fixed Google endpoints (anti-SSRF) and does not accept PUBSUB_EMULATOR_HOST; relaxing the guard to make a test pass is out of the question. The row stays fake_transport + real_sandbox (when there are secrets). The docker job therefore validates 9 types in real_docker (postgres, mysql, mssql/SQL Server 2022, oracle/Oracle 23ai Free, mongodb/MongoDB 7, s3/MinIO, adls/Azurite, sftp/atmoz/sftp, kafka/Redpanda) — GCS has the same fixed-endpoint design as Pub/Sub and is left out for the same reason.
  • SQL Server (mssql): real_docker only in the matrix job. There is no public SQL Server endpoint; the real proof is the SQL Server 2022 from docker-compose.connectors.yml (seed/connectors/mssql.sql, login with db_datareader only), run in the docker job (--expect-min real_docker:9 + tests/test_mssql_docker.py, which proves that the INSERT fails on the server). Proof from 2026-09-25: run 36093070996 (commit c2a8c4c = the code of 1296f65 + the workflow restricted to the mssql service, because the minio/minio image is no longer public on Docker Hub), with the 14 tests of tests/test_mssql_docker.py green in the url and fields modes, including the INSERT refused by the server for the db_datareader login. The Azure SQL/Synapse mode with Entra ID stays fake_transport (assembly of odbc_connect verified over a fake transport) until there are DATAVAULT_MATRIX_MSSQL_* secrets from an Azure sandbox.
  • Oracle (oracle): real_docker only in the matrix job, no run yet. There is no public Oracle. The real proof is the Oracle 23ai Free (gvenzl/oracle-free:23-slim) from docker-compose.connectors.yml, with seed/connectors/oracle.sql and the datavault_ro user with only CREATE SESSION + SELECT. It runs in the docker job (--expect-min real_docker:9 + tests/test_oracle_docker.py): connection, discovery without system schemas, types, a profile with CLOB and BLOB, rows, the catalogue estimate and the INSERT refused with ORA-01456 on a table where the GRANT would let it through. The connector went in without that run, because it was built on a machine without Docker: the row stays driver_missing until the job's first green run, which is left for a separate card.
  • Redshift (redshift): fake_transport, and real_sandbox only with the secret. There is no public Redshift and no Redshift docker image. The matrix row is fake_transport: the fake checks the engine (redshift+redshift_connector, TLS in verify-full) and runs the connector's contract over an in-memory SQLite with the matrix fixture. This does not prove the real source. The sandbox tier runs against a real Redshift only when the DATAVAULT_MATRIX_REDSHIFT_URL secret exists, with a redshift+redshift_connector://… url of a user with only SELECT. Without that secret, the connector has no proof against a real Redshift. BEGIN READ ONLY is proven in tests/test_redshift_connector.py, over an SQLite that imitates the driver and the server.
  • Azure Blob/ADLS (adls): Azurite outside compose in the 2026-10-09 proof. The baseline's real_docker attempt ran against Azurite 3.35.0 installed with npm (the version of the compose image), because the card's machine had no Docker; the attempt's source says so. The docker job runs the same seed against the mcr.microsoft.com/azure-storage/azurite:3.35.0 image, plus tests/test_adls_docker.py. The real_public attempt reads the Azure Open Datasets holidays Parquet with anonymous access.
  • SFTP (sftp): local OpenSSH outside compose in the 2026-10-09 proof. The baseline's real_docker attempt ran against macOS's OpenSSH 10.2 (internal-sftp -R, Ed25519 key), because the card's machine had no Docker; the attempt's source says so. The docker job runs tests/test_sftp_docker.py and the matrix against the compose sftp service (atmoz/sftp, chrooted user, host key generated on each run and pinned by its fingerprint). The real_public attempt connects to Rebex's public test server (test.rebex.net, user demo, read-only), which only holds a readme.txt: it proves the pinned key, the listing and reading one document, with no tables.
  • SAP (sap): the real proof is only the sandbox with an API key. The real source for sap in the matrix is the SAP Business Accelerator Hub sandbox (S/4HANA Cloud's API_BUSINESS_PARTNER), with the DATAVAULT_MATRIX_SAP_APIKEY secret; without it, the row stays fake_transport. The sandbox uses the api_key mode, so the basic and oauth2_client_credentials modes have no proof against a real SAP in the matrix. odata runs in the public tier against the OData.org reference services (v2 and v4).
  • MongoDB (mongodb): real_docker in the matrix job, optional real_sandbox. There is no public MongoDB for the matrix. The real proof is the mongo:7 from docker-compose.connectors.yml (seed/connectors/mongodb/, with mixed types, missing fields, a duplicated order_id, dates and nested documents, and a user with the read role only), run in the docker job with tests/test_mongodb_docker.py. That test also proves that the server refuses an insert from that user. With the DATAVAULT_MATRIX_MONGODB_URI and DATAVAULT_MATRIX_MONGODB_DATABASE secrets of a free Atlas M0 cluster, the sandbox tier also runs against Atlas. The baseline's real_docker attempt of 2026-10-09 ran against the official mongod 7.0.14 binary with the same seed, outside compose, because the card's machine had no Docker; the attempt's source says so.
  • RNAcentral (public postgres): catalogue yes, data no. Since 2026-09-25 the public user reader has no USAGE on any schema (permission denied for schema rnacen) and information_schema.columns comes back empty. The connector now reads the columns through pg_attribute + format_type, which never touches pg_collation, and so test + discover + columns pass: that is what validate_prod.sh checks. profile and rows fail on EBI's side. The row stays unverified in the public tier and the full proof for postgres is the one from the docker job (real_docker). The gate watches the steps that pass today, and if columns goes back to ❌ the job fails. We evaluated FlyBase's public Chado as an alternative, but it sits behind a pooler that rejects the default_transaction_read_only startup parameter, and the read-only guard is not relaxed to make a test pass. Supporting poolers (PgBouncer/Supavisor) without losing the mechanical read-only is separate work.

The generated table below keeps its Portuguese labels: Conector = connector, Classificação = classification, Estado = status, Fonte = source, Data = date, Extra na imagem prod = extra in the production image, sim/não = yes/no; in the legend, ok = passed, falhou = failed, fonte inacessível (rede/timeout — não conta como regressão) = source unreachable (network/timeout, not counted as a regression), não se aplica = not applicable, não corrido = not run.

Conector Classificação Estado Fonte test discover columns profile rows Data Commit Driver Extra na imagem prod Run
adls real_public (+ real_docker) pass Feriados públicos — Azure Open Datasets (ADLS público) ✅ ✅ ✅ ✅ ✅ 2026-10-09 1eb40a1 2026.8.0 sim —
bigquery driver_missing driver_missing — · · · · · — — — sim —
confluence fake_transport pass fake (tests/test_confluence.py) (documentos) ✅ ✅ — — ✅ 2026-09-25 e9fc57f 0.28.1 sim —
csv real_public pass fixture seed/connectors/csv/ ✅ ✅ ✅ ✅ ✅ 2026-09-25 1ce0273 — sim —
databricks driver_missing driver_missing — · · · · · — — — sim —
dynamics fake_transport pass fake (sessão Dataverse falsa) ✅ ✅ ✅ ✅ ✅ 2026-09-25 e9fc57f — sim —
excel (via csv/s3/sftp) real_public pass fixture seed/connectors/excel/vendas.xlsx (csv) ✅ ✅ ✅ ✅ ✅ 2026-10-14 2b3588a 3.1.5 sim —
fabric driver_missing driver_missing — · · · · · — — — não —
gcs driver_missing driver_missing — · · · · · — — — sim —
gdrive fake_transport pass fake (tests/test_gdrive.py) (documentos) ✅ ✅ — — ✅ 2026-09-25 e9fc57f — sim —
gsheets fake_transport pass fake (tests/test_gsheets_connector.py (folha pública «Class Data»)) ✅ ✅ ✅ ✅ ✅ 2026-10-09 5e325ca — sim —
jira fake_transport pass fake (API Jira falsa) (documentos) ✅ ✅ — — ✅ 2026-09-25 e9fc57f 0.28.1 sim —
kafka fake_transport pass fake (tests/test_kafka_connector.py) ✅ ✅ ✅ ✅ ✅ 2026-09-25 e9fc57f — sim —
mongodb real_docker (+ fake_transport) pass mongod 7.0.14 (binário oficial), local, com o seed do compose ✅ ✅ ✅ ✅ ✅ 2026-10-09 f153a84 4.18.3 sim —
mssql real_docker (+ fake_transport) pass SQL Server 2022 (compose) ✅ ✅ ✅ ✅ ✅ 2026-09-25 c2a8c4c 2.4.1 sim run
mysql real_public pass Rfam (EMBL-EBI) ✅ ✅ ✅ ✅ ✅ 2026-09-25 1ce0273 1.2.0 sim —
odata real_public (+ fake_transport) pass https://services.odata.org/V2/Northwind/Northwind.svc ✅ ✅ ✅ ✅ ✅ 2026-10-09 d181ba9 0.28.1 sim —
oracle driver_missing driver_missing — · · · · · — — — sim —
postgres unverified fail RNAcentral (EMBL-EBI) [public] ✅ ✅ ✅ ❌ · 2026-09-25 1ce0273 2.9.12 sim —
pubsub fake_transport pass fake (tests/test_pubsub_connector.py) ✅ ✅ ✅ ✅ ✅ 2026-09-25 e9fc57f — sim —
redshift fake_transport pass fake (sem fonte pública nem docker: engine e TLS verificados + SQLite em memória) ✅ ✅ ✅ ✅ ✅ 2026-10-14 4d0d66f — sim —
rest_api fake_transport pass fake (tests/test_rest_api_connector.py) ✅ ✅ ✅ ✅ ✅ 2026-10-10 ef56027 0.28.1 sim —
s3 real_public pass OpenAQ — qualidade do ar (S3 público) ✅ ✅ ✅ ✅ ✅ 2026-09-25 1ce0273 2026.7.0 sim —
salesforce fake_transport pass fake (cliente simple_salesforce falso) ✅ ✅ ✅ ✅ ✅ 2026-09-25 e9fc57f — sim —
sap fake_transport pass fake (tests/test_odata_connector.py, Gateway v2) ✅ ✅ ✅ ✅ ✅ 2026-10-09 d181ba9 0.28.1 sim —
sftp real_public (+ real_docker) pass test.rebex.net (SFTP público da Rebex) (documentos) ✅ ✅ — — ✅ 2026-10-09 bc1c8a0 5.0.0 sim —
sharepoint fake_transport pass fake (tests/test_sharepoint.py) (documentos) ✅ ✅ — — ✅ 2026-09-25 e9fc57f — sim —
slack fake_transport pass fake (tests/test_chat_signals.py) (documentos) ✅ ✅ — — ✅ 2026-09-25 e9fc57f 0.28.1 sim —
snowflake driver_missing driver_missing — · · · · · — — — sim —
sqlite real_public pass fixture seed/connectors/matrix.sql ✅ ✅ ✅ ✅ ✅ 2026-09-25 1ce0273 2.0.51 sim —
teams fake_transport pass fake (tests/test_chat_signals.py) (documentos) ✅ ✅ — — ✅ 2026-09-25 e9fc57f — sim —
weaviate untested skipped — · · · · · — — — sim —

Legenda: ✅ ok · ❌ falhou · 🌐 fonte inacessível (rede/timeout — não conta como regressão) · — não se aplica · · não corrido.


BigQuery

What you need: a Google Cloud service account with read access to the project/dataset and its JSON key.

Step by step:

  1. In the Google Cloud console, select the project → IAM & Admin → Service Accounts → Create service account (e.g. datavault-reader).
  2. Grant the minimum roles:
    • BigQuery Job User (roles/bigquery.jobUser) at project level — needed to run profiling queries;
    • BigQuery Data Viewer (roles/bigquery.dataViewer) — can be granted only on the dataset(s) to analyse (Dataset → Sharing → Permissions) instead of the whole project, for least privilege.
  3. On the service account: Keys → Add key → Create new key → JSON. Download the file.
  4. In the wizard: fill in project (the project ID, e.g. acme-analytics), optionally dataset, and paste the full contents of the JSON file into the credentials_json field (including the curly braces). credentials_path (the path of a file on the server) is accepted only when the file connectors are enabled (DATAVAULT_ENABLE_FILE_CONNECTORS, off in production).

Credentials always explicit (2026-09 sweep, A2): without credentials_json the connection is refused — BeryX never uses the server's own credentials (ADC/Cloud Run service account). The same applies to GCS (service_account_info with the JSON key, or anonymous: true for public buckets) and S3 (access_key_id + secret_access_key, or anonymous: true).

Guided wizard (GRAPH-ONBOARD): for BigQuery and GCS (with credentials), step 2 of the new connection shows the Google Cloud Registration guide (API enabled → service account → read roles → JSON key → fields) and the Test access button (POST /connections/check, config not saved). Here the test is a single step (connection, the connector's test_connection); the UI links the message to the likely step of the guide (API disabled, 403/permissions, JSON/invalid_grant, resource not found).

Installation: pip install "datavault-backend[bigquery]"

Known limitations:

  • Profiling runs queries in BigQuery — there is a cost per bytes read, limited by the caps in the next section.
  • Dataset names are case-sensitive; the dataset must be in the region the project expects.
  • If credentials_json and credentials_path are both filled in, the pasted JSON takes precedence.
  • The key must belong to a service account ("type": "service_account"); other credential types (e.g. external_account) are refused.
  • The connection test validates authentication, the project and that the dataset exists (when given), with a distinct message for each case.
  • The cost caps are config fields, set when the connection is created. To change them on an existing connection, recreate it or adjust the installation values (DATAVAULT_BIGQUERY_*, in CONFIGURACAO.md), which apply to every connection without its own value.

Actual usage and co-usage of tables (USAGEPRIO, card #715). The telemetry collection (POST /dashboard/finops/collect) reads INFORMATION_SCHEMA.JOBS_BY_PROJECT in the connection's region (region, eu by default): the queries per table and per day and, from the same referenced_tables grouped by job, the co-usage, that is, the pairs of tables read by the same query. For co-usage only the query count of each pair is stored, never the query text or the results. It needs the same permission as the usage read and the cost telemetry, bigquery.jobs.listAll on the project. The view keeps 180 days and only sees the queries run in this project.

Cost of a scan, caps and partitions

BigQuery on-demand bills the bytes of the columns each query reads, and LIMIT does not reduce them. Without caps, a scan of a 2 TB table with 100 columns could bill tens of TB. Since card #293, BeryX limits the cost before reading and not only afterwards (the cost telemetry, COSTX, measures what has already been billed).

Cost model per table. The scan counts in passes. Each pass reads, in the worst case, the whole table, with the size from __TABLES__.size_bytes (logical bytes, the basis of the on-demand bill). It is an upper bound, because each query reads only its own columns.

Pass What runs Bytes (upper bound)
Aggregates COUNT/MIN/MAX/AVG/STDDEV_POP in batches of 10 columns (the COUNT(DISTINCT) goes in the same query) 1×
Per-column samples SELECT DISTINCT col … LIMIT 20, one per column ≈1×, summed
Quantiles APPROX_QUANTILES of the numeric columns (standard/deep depth) ≤1×
Histograms SUM(CASE …) of the numeric columns (standard/deep) ≤1×
Rows SELECT … LIMIT 5000 for the per-row rules and the duplicates 1×
Segments GROUP BY per dimension (up to 3), with the dimension, up to 10 null columns and 3 sum columns (standard/deep, card #1255) ≤1× per dimension; with the rows only, ≤1× in total
Hour of day COUNT(*) per hour of the freshness column, over the last 24 h, only on the datasets that turned it on (standard/deep, card #1255) ≤1×
Cross count GROUP BY of two dimensions, up to 3 pairs, only when both have segments out of pattern in the same column (card #1255). Left out of the estimate: it only runs on a plan that was not degraded and if it still fits the per-scan cap, and it is added to the planned bytes ≤1× per pair

The estimate for the segments and the hour is a calculation, not a measurement: each query reads the sum of the columns it names, and the whole table is counted. It was not measured on a BigQuery account. COUNT(*) reads no columns and COUNT(DISTINCT) adds no bytes (it uses slots, which matters under capacity pricing). Correlations and co-nulls (deep), the unique rule and the SQL rules are one query each. They are left out of the estimate, but are subject to the per-query cap.

Metadata. Per table and scan, BeryX reads __TABLES__ and three INFORMATION_SCHEMA views (COLUMNS, TABLE_OPTIONS, PARTITIONS). According to Google's documentation, each query to INFORMATION_SCHEMA bills at least 10 MB on-demand. The read is cached for the duration of the scan, and the automatic monitors reuse it. Vector indexes are read per dataset, with one to four of these queries (section "BigQuery vector indexes").

Caps (fields of the connection config; without their own value, the installation's values apply):

Field Default What it does
max_bytes_per_query 50 GB (DATAVAULT_BIGQUERY_MAX_BYTES_PER_QUERY) Goes into each job as maximum_bytes_billed. BigQuery estimates the bytes before running and refuses the query without billing it. The minimum is 10 MiB (10,485,760 bytes), the minimum that BigQuery bills. If the url already carries maximum_bytes_billed, the lower of the two applies. On a clustered table BigQuery's estimate is an upper bound, and a query may be refused even if the actual bytes would have fitted.
max_bytes_per_scan 200 GB (DATAVAULT_BIGQUERY_MAX_BYTES_PER_SCAN) Cap on the per-table estimate in a scan (passes × size).
partition_window_days 7 (DATAVAULT_BIGQUERY_PARTITION_WINDOW_DAYS) Days of partitions profiled when a window is needed.

Degradation in order. Above the per-scan cap, the profile degrades, in this order:

  1. It skips the per-segment measures (nulls and sums) and the hour of day: the rows per segment stay, and the nulls of an anomaly that already fired only in the first dimension. Every degraded plan takes this step.
  2. It skips the COUNT(DISTINCT). This saves no bytes, but it saves slots.
  3. It replaces the per-column samples and the raw rows with one query each, SELECT … TABLESAMPLE SYSTEM (p PERCENT), with p calculated to read ~1 GB.
  4. It skips the segments.
  5. It skips the histograms.

Steps 2, 3 and 5 are only taken when the first five passes, on their own, already exceed the cap: the segments and the hour never degrade the profile, they are the ones that go. Step 3 also applies when a full pass already exceeds the per-query cap, because a SELECT * would be refused. If it still does not fit, a date-partitioned table moves to the partition window. A table without time partitions is refused before any query to the data, with the caps message. What was decided is stored in metrics_json.cost_guard of the table profile: the caps, scanned_bytes, estimated_bytes, planned_bytes, degraded and sample_percent. The log records scan_cost_guarded.

Partitions. BeryX reads INFORMATION_SCHEMA.COLUMNS.is_partitioning_column, TABLE_OPTIONS.require_partition_filter and PARTITIONS (rows, logical bytes and last write per partition). It profiles only the partitions of the last partition_window_days days (today included) in two cases:

  • when the table requires a partition filter (require_partition_filter = true, common practice in enterprise accounts; without this, the first COUNT(*) failed and the dataset ended up failed with no explanation);
  • when the whole table exceeds one of the caps and is partitioned by date.

The partitioning can be by a DATE/TIMESTAMP/DATETIME column or by ingestion time, with the _PARTITIONTIME pseudocolumn. The filter is coluna >= <início da janela> (column >= start of the window), with a constant, so that BigQuery prunes the partitions. The window applies to the profile and to the subsequent passes of the scan: distributions, segments, the unique rule (which then states that it did not count the whole table) and the rows.

SQL rules (expression, custom_sql) run the rule's SQL as it is. On a table with a mandatory filter, the partition filter has to be in the rule itself. Without it, or above the per-query cap, the rule gets the error in Portuguese saying what to change in the rule or in the connection, and the scan continues. Outside a scan, a one-off read of rows from a table above the per-scan cap is not refused: it goes through TABLESAMPLE.

The windowed profile follows the contract of sampled profiles (#290): the row_count is that of the whole table (sum of PARTITIONS, or __TABLES__), and the column metrics are those of the window (sampled, sample_rows). That way, volume and drift remain comparable between scans. metrics_json.cost_guard.window stores column, days, since, reason (require_partition_filter, max_bytes_per_query or max_bytes_per_scan), the number of partitions and the rows in the window. A table partitioned by integer range with a mandatory filter has no time window, and the profile is refused with a message explaining why.

Automatic monitors. table_metadata now uses INFORMATION_SCHEMA.PARTITIONS: row_count is the sum of the partitions and last_modified the last write. If the view is not readable, it uses __TABLES__. According to Google's documentation, the PARTITIONS view is still pre-GA.

Actionable errors. "Query exceeded limit for bytes billed" becomes "A tabela 'x' excede o teto de 50 GB por query desta conexão (maximum_bytes_billed): o BigQuery recusou a query sem a faturar" ("Table 'x' exceeds this connection's cap of 50 GB per query (maximum_bytes_billed): BigQuery refused the query without billing it"), followed by what to do (raise max_bytes_per_query, reduce the window or partition the table by date). "Cannot query over table … partition elimination" becomes a message about metadata permissions. The dataset ends up failed, with the reason in Portuguese in the live scan view and in the scan summary (stats.dataset_errors). A cap refusal is never swallowed by the profile's fallbacks, because that would give a "completed" profile without metrics.

Permissions. COLUMNS, TABLE_OPTIONS and PARTITIONS require bigquery.tables.get and bigquery.tables.list, already included in BigQuery Data Viewer. Without them, the profile proceeds without a window or per-partition counts. On a table with a mandatory filter, the message says which permissions are missing.

Behaviour change (upgrade). A table that read more than 50 GB in a single query is now profiled by window (if it is date-partitioned) or fails with the cap message. A table whose estimate exceeds 200 GB degrades. To keep the previous behaviour, raise the caps in the installation or in the connection.

Who accesses sensitive data (card #787). It is part of the “AI & Data Security” add-on, which is not open yet: until then, the /data-security/* routes answer 404. POST /data-security/source-grants/collect (admin) reads the IAM bindings in INFORMATION_SCHEMA.OBJECT_PRIVILEGES, in the connection's region (region, eu by default). The view only takes one object per query, so BeryX queries each dataset in the catalogue and then each table, the most sensitive first, up to 100 queries per read and 4 at a time. A read lasts 60 s at most. With several BigQuery connections in the workspace, the reads share 150 s between them, so that the request ends before Cloud Run's 300 s. A query already started ends at the connection's job_timeout_ms. Each INFORMATION_SCHEMA query bills at least 10 MB. A binding on a dataset applies to all its tables. The connection's account needs bigquery.datasets.get and bigquery.tables.getIamPolicy. It only reads: BeryX never changes a binding.

  • What the view does not show: it only has the bindings set on the dataset or table itself. Bindings inherited from the project, the folder and the organisation are left out (a roles/bigquery.dataViewer granted on the project, for example), and the screen says so next to the connection (limitations: inherited_not_included). A group (group:) or a domain (domain:) stays as a single principal, because its members are in Google's directory, outside the view (groups_not_expanded).
  • Incomplete read: a dataset in another region, one the account cannot read, a name BeryX cannot put into the SQL safely, the objects beyond the 100 queries and the ones the time limit left out are left unread. The tables of a dataset that did not answer are left unread too, without being queried. The read then comes out as cut (truncated). A table left unread shows as unread, “Not reached by this read”, even with the dataset's bindings in view: those of the table itself are missing. Before the first answer, there are never more than three queries started: if those three fail, the read stops and says which permissions are missing.
  • Who counts: user: and serviceAccount: are users; allUsers and allAuthenticatedUsers count as public access; roles/bigquery.dataEditor, roles/bigquery.dataOwner, roles/bigquery.admin, roles/editor and roles/owner count as «can change». A custom role does not count as a write: the view does not say which permissions it has. What is stored and who sees it is in the PostgreSQL section, «Who accesses sensitive data».

Cost of a scan on Snowflake, Databricks and Redshift

Profiles on these three warehouses carry BigQuery's cost guard (card #1085), with their own caps and no partition window. Before the first query on the data, BeryX reads the table size from the catalogue and estimates the profile's bytes over the same passes.

Source Size read Degraded sample Installation caps
Snowflake BYTES from INFORMATION_SCHEMA.TABLES (empty for a view) SAMPLE SYSTEM (p) SEED (s), ordered by the HASH of the seed and the columns DATAVAULT_SNOWFLAKE_MAX_BYTES_PER_QUERY, DATAVAULT_SNOWFLAKE_MAX_BYTES_PER_SCAN
Databricks sizeInBytes from DESCRIBE DETAIL (Delta only) LIMIT n without ORDER BY DATAVAULT_DATABRICKS_MAX_BYTES_PER_QUERY, DATAVAULT_DATABRICKS_MAX_BYTES_PER_SCAN
Redshift size from SVV_TABLE_INFO, in 1 MB blocks LIMIT n without ORDER BY DATAVAULT_REDSHIFT_MAX_BYTES_PER_QUERY, DATAVAULT_REDSHIFT_MAX_BYTES_PER_SCAN
  • Caps. By default, 10 TB per query and 40 TB per table and scan. The connection overrides them with max_bytes_per_query and max_bytes_per_scan, in bytes (minimum 1 MiB). An invalid value is refused when the connection is created.
  • Above the per-scan cap, the profile degrades in BigQuery's order: no per-segment measures or hour of day, no COUNT(DISTINCT), row sample, no segments, no histograms. Databricks has TABLESAMPLE, but it picks row by row and reads every file, and Redshift has no TABLESAMPLE: on both, the degraded sample is the first rows the source returns. On a table up to ~1 GB, the sampled pass would read the whole table: there is no sampling step, and the usual seeded sample stays.
  • Above the per-query cap, the table is refused before any query on the data. None of these sources stops a query by its bytes, and the aggregates read the whole table. The dataset ends up failed, with the reason in the scan summary.
  • Monthly cap. With the size known and the table above ~1 GB, the sampling step of the connection's monthly cap uses the same sample: SAMPLE SYSTEM on Snowflake and the first rows on Databricks. Redshift has no computed cost, so it has no monthly cap.
  • What is stored. metrics_json.cost_guard keeps the caps, the size, the estimates and the steps (degraded), plus sample_percent (Snowflake) or sample_method: "head" (Databricks and Redshift). The sample used shows in the sample badge, next to the columns. On Snowflake it carries the scan's seed, and the badge shows it.
  • Without the size (a view, a non-Delta table, or no permission on the catalogue), the profile runs as before, with the monthly cap too. Bytes only approximate the cost: Snowflake bills credits for warehouse time, Databricks bills DBUs, and a provisioned Redshift cluster costs the same with or without the scan.
  • Grants. Redshift reads the size from SVV_TABLE_INFO (GRANT SELECT ON svv_table_info, already asked for the counts). SQL Server now reads the size too, from sys.dm_db_partition_stats (VIEW DATABASE STATE, VIEW DATABASE PERFORMANCE STATE on SQL Server 2022). Oracle reads it from DBA_SEGMENTS (GRANT SELECT_CATALOG_ROLE TO datavault_ro) and, without that role, from USER_SEGMENTS, which only shows the user's own tables. Oracle has no ALL_SEGMENTS. On these two, only the size: there is no cost guard.

Databricks

What you need: an active SQL Warehouse, a Personal Access Token (PAT) and the warehouse's HTTP path.

Step by step:

  1. PAT: in the workspace, top right corner → User Settings → Developer → Access tokens → Generate new token. Copy the token (it is only shown once). Preferably use a user/service principal with read-only access to the catalogs to be analysed.
  2. HTTP path: SQL Warehouses → (your warehouse) → Connection details → HTTP path (format /sql/1.0/warehouses/<id>).
  3. Host: on the same screen, the Server hostname (e.g. adb-1234567890123456.7.azuredatabricks.net or dbc-abc12345-de67.cloud.databricks.com). You can paste it with or without https:// — it is normalised.
  4. In the wizard: host, access_token, http_path; optionally catalog and schema (Unity Catalog) to limit discovery.

Installation: pip install "datavault-backend[databricks]"

Known limitations:

  • The warehouse must be running: a stopped warehouse with auto-stop can make the first test fail with a timeout — try again after 1-2 minutes.
  • Unity Catalog permissions required: USE CATALOG, USE SCHEMA and SELECT on the tables.
  • PATs expire according to the workspace policy — renew them and update the connection.
  • The connection test tells these apart in its message: invalid token vs wrong host vs wrong http_path.

Native checks: anomaly detection (card #811). If Data Quality Monitoring anomaly detection is enabled on the schema, BeryX reads the result instead of measuring again: the system table system.data_quality_monitoring.table_results, with the freshness and completeness of each table in the connection's catalog over the last 7 days. Healthy counts as passed, Unhealthy as failed; Training, Error and Unknown have no verdict. The connection's principal needs SELECT on that system table; without it, the collection says what is missing and the scan carries on without the native checks. Details under «Native platform checks», in the Snowflake section.

Who accesses sensitive data (card #787). It is part of the “AI & Data Security” add-on, which is not open yet: until then, the /data-security/* routes answer 404. POST /data-security/source-grants/collect (admin) reads system.information_schema.table_privileges for the connection's catalog, with each principal's privileges on each table, including those inherited from the catalogue and the schema, which the inherited_from column marks. It also reads each table's owner in information_schema.tables (table_owner), which comes in as OWNERSHIP. It asks for no new privileges. It only reads: BeryX never changes a grant.

  • What the view does not show: the information schema only shows the objects the connection's principal can see. According to the Databricks documentation, a principal with MANAGE on an object sees only its own grants on it in this view. The snapshot is a minimum, not the full list, and the screen says so next to the connection (limitations: visible_to_principal_only). A group stays as a single principal, because its members are in the account, outside the information schema (groups_not_expanded).
  • Who counts: an email is a user; an application id (UUID) is a service principal and counts as a user; the account users group counts as public access; the other names are groups. MODIFY, ALL PRIVILEGES, MANAGE and OWNERSHIP count as «can change». What is stored and who sees it is in the PostgreSQL section, «Who accesses sensitive data».

AI Search indexes (card #1026). On each scan, BeryX reads the AI Search catalogue (the API paths are still vector-search) with the connection's token, only by GET and through a closed list of three paths: GET /api/2.0/vector-search/endpoints, GET /api/2.0/vector-search/indexes?endpoint_name=… and GET /api/2.0/vector-search/indexes/{name}, one per index, because the list does not carry the specification (app/infra/connectors/databricks_workspace.py). It never calls query, query-next-page or scan, which return rows and vectors. The budget is the engineering scan's: 400 requests, 120 seconds and 500 indexes.

  • DELTA_SYNC index with customer vectors (embedding_vector_columns): the source table column gets the vector mark with the dimension (embedding_dimension), the managed method and no model, and leaves the read like the vector columns of the section «Vector columns in Snowflake, Oracle, SQL Server and MySQL»: it keeps only its rows and nulls.
  • DELTA_SYNC index with managed embeddings (embedding_source_columns): the vectors stay in the index, and the source table only has the text. The text column gets the mark with no dimension, with the embedding_model_endpoint_name as the source gives it, and is still read. That name is a serving endpoint's, which may serve another model: the API returns it with embedding_model_kind: "serving_endpoint", and the model page says «Serving endpoint», not «Model». For the rest of the product the column is still text: the data diff compares it, and the sensitivity of vector indexes (card #1018) does not count it as a vector column, so the table asks for no declared origin and the text goes through the normal PII detection.
  • DIRECT_ACCESS index: it has no source table, and its vectors can only be read through query or scan. It does not become a dataset and marks no column.
  • The method stays managed, because the API does not expose the algorithm. Each index's status.indexed_row_count goes to source_metrics.vector_search.indexes in the source table's profile.
  • An index matches the table by the full name of the source table (source_table), with the connection's catalog or, without it, the session's current_catalog().
  • Without permission: a 401, 403 or 404 on a list or an index does not stop the scan. What was not read goes to source_metrics.vector_search.skipped, and an exhausted budget to truncated. Without the AI Search catalogue, nothing proves an ARRAY<FLOAT> is an embedding: the column is still read, and the value guard of the section «Embeddings in other sources» keeps it out of what is stored and what goes to the LLM.
  • Who queries the index: the Databricks documentation requires SELECT on the AI Search index itself. The grants snapshot reads those of the Delta table that carries the vector mark, not the index's: in the comparison between the index and the origin (card #1227), the pair never comes out parity and the reason is index_search_unread.
  • Permission: the Databricks documentation says querying an index needs SELECT on it, but does not say what GET /indexes/{name} needs, and the trial with a real account has not run yet. Until then, what the token cannot read shows up in skipped.

Nested types. databricks-sqlalchemy reflects array, map and struct as VARCHAR. BeryX corrects them with the full_data_type of information_schema.columns, so an ARRAY<STRING> column becomes nested and keeps no samples, minimum or maximum, instead of the ndarray's raw text. The correction from VARCHAR to array<…> does not open a schema change. An ARRAY<FLOAT> with no index does not prove it is an embedding and is still read.

Running in your Databricks (optional, ADR 0005 step B)

To measure whole-row duplicates, checks and Cramér's V on the full table without bringing rows out of the workspace, BeryX can submit the public package beryx-profiler as a one-time run in your account. The job reads the tables and returns only aggregated metrics over HTTPS to the BeryX API.

Status: does not run in scans yet. The package, the Jobs API client and the ingestion exist in the code, but no scan submits the job yet; until then, in Databricks too, row rules and duplicates use the sample described in Security. The rest of this section describes how it works.

  • Declared footprint: an ephemeral run (runs/submit, does not create a persistent Job) named beryx-profiler <id>, visible in the history. Nothing is uploaded to DBFS, Volumes or workspace files; the code comes from PyPI, and pip only installs the wheel with the version and SHA-256 we pinned. Without that pinned hash, the run is not submitted. The job never writes data.
  • Dedicated credential (config remote_jobs, encrypted with Fernet, never returned by the API): token of a service principal — not the warehouse PAT.
    "remote_jobs": {
      "token": "<token do SP>",
      "compute": {"mode": "serverless"}
    }
    
    compute.mode: existing_cluster (cluster_id), policy (policy_id, spark_version, node_type_id, num_workers?) or serverless. host and catalog are optional (by default, those of the connection).
  • Minimum SP permissions: USE CATALOG, USE SCHEMA and SELECT on the tables; on compute, CAN_ATTACH_TO on the cluster or CAN_USE on the cluster policy or serverless jobs enabled. No CAN_MANAGE, no workspace admin and no writing to catalogs.
  • Network: outbound HTTPS from the workspace to the BeryX API (DATAVAULT_API_PUBLIC_BASE_URL).
  • Run parameters: visible to anyone who can see the run in the workspace (run page and runs/get). They carry the spec, the ingestion URL and a single-use dvw_* claim code, never the token that delivers the metrics. The job generates that token and registers it with the code before reading any table. If someone else uses the code, the run fails and the metrics are discarded.
  • Cost: DBUs in your account; each run has timeout_seconds (30 min by default) and is cancelled (runs/cancel) if it exceeds it.
  • Jobs API calls (closed allowlist in the client): POST runs/submit, POST runs/cancel, GET runs/get, GET runs/get-output, GET scim/v2/Me. Any other call is blocked before it leaves BeryX.

Snowflake

What you need: a dedicated read-only user, with its own role and warehouse.

Step by step (run as ACCOUNTADMIN/SECURITYADMIN):

CREATE ROLE IF NOT EXISTS DATAVAULT_READER;
GRANT USAGE ON WAREHOUSE <wh> TO ROLE DATAVAULT_READER;
GRANT USAGE ON DATABASE <db> TO ROLE DATAVAULT_READER;
GRANT USAGE ON ALL SCHEMAS IN DATABASE <db> TO ROLE DATAVAULT_READER;
GRANT SELECT ON ALL TABLES IN DATABASE <db> TO ROLE DATAVAULT_READER;
GRANT SELECT ON FUTURE TABLES IN DATABASE <db> TO ROLE DATAVAULT_READER;
CREATE USER IF NOT EXISTS datavault_svc PASSWORD='<forte>' DEFAULT_ROLE=DATAVAULT_READER;
GRANT ROLE DATAVAULT_READER TO USER datavault_svc;

The account is the account identifier (e.g. xy12345.eu-west-1 or org-conta), visible in Admin → Accounts or in the Snowsight URL.

Wizard fields: account, user, password, database; optional schema, warehouse, role.

Installation: pip install "datavault-backend[snowflake]"

Known limitations: the warehouse consumes credits during profiling (use a dedicated XS with a short auto-suspend); without role, the user's default is used.

Actual usage and co-usage of tables (USAGEPRIO, card #715). The telemetry collection (POST /dashboard/finops/collect) reads SNOWFLAKE.ACCOUNT_USAGE.ACCESS_HISTORY: the queries per table and per day and, from the same objects grouped by QUERY_ID, the co-usage, that is, the pairs of tables, views and materialized views of the connection's database read by the same query. For co-usage only the query count of each pair is stored, never the query text. It needs the same permissions as the usage read: Enterprise edition or higher and a role with access to the SNOWFLAKE database. The view keeps 365 days.

Native checks: Data Metric Functions (card #811). The DMFs your team attached to tables already measure quality inside Snowflake. BeryX reads the result, read-only and without measuring again, from the views SNOWFLAKE.LOCAL.DATA_QUALITY_MONITORING_EXPECTATION_STATUS (the verdict of each expectation) and SNOWFLAKE.LOCAL.DATA_QUALITY_MONITORING_RESULTS (DMFs without an expectation, which measure but do not say whether they passed), in the connection's database over the last 7 days. The role needs a Snowflake application role and Enterprise edition:

GRANT APPLICATION ROLE SNOWFLAKE.DATA_QUALITY_MONITORING_VIEWER TO ROLE DATAVAULT_READER;

Native platform checks (Snowflake and Databricks). Only the table name, the check name, the columns, the aggregate value the platform computed and the verdict are read, never rows or query text. A value that is not a finite number (the NaN or infinity that an AVG over a FLOAT column can return) is left empty in the issue and in the response; the verdict still counts.

  • Issues: a failed check opens a native_check issue (warning) on the dataset, and when it passes again the issue is resolved. The check is the DMF, the columns and the expectation name: rewriting the expression (from VALUE < 10 to VALUE < 20) keeps the same issue, with the new expression in the description. An ignored issue silences that check. A check without a verdict opens or closes nothing.
  • Score: on the dataset's next scan, each verdict counts in its dimension (NULL_COUNT, NULL_PERCENT, BLANK_COUNT, BLANK_PERCENT, ROW_COUNT and Databricks completeness in completeness; DUPLICATE_COUNT and UNIQUE_COUNT in uniqueness; FRESHNESS, DATA_METRIC_SCHEDULE_TIME and Databricks freshness in timeliness; the other system DMFs, such as AVG, MIN, MAX and STDDEV, and custom DMFs in validity). The dimension keeps the minimum of what BeryX measured and the share of native checks that passed: if the only check of a dimension fails, the dimension goes to 0. The score records how many counted. The formula and how this differs from BeryX's not_null, unique and row_count_min rules, which do not count in the score, are in docs/METODOS.md, «Score de qualidade».
  • What is left out: POST /dashboard/native-checks/collect (admin, ?days= from 1 to 90) reads the checks now and answers, per connection, with the datasets the platform already watches (and each one's BeryX rules, which the platform does not run), the datasets without a native check and the connections to other sources.

Who accesses sensitive data (card #786). It is part of the “AI & Data Security” add-on: in a workspace without it, the /data-security/* routes answer 404. POST /data-security/source-grants/collect (admin) reads the grants in SNOWFLAKE.ACCOUNT_USAGE.GRANTS_TO_ROLES, with each role's privileges on the tables and views of the connection's database and the roles granted to other roles, and in GRANTS_TO_USERS, with each user's roles. It only reads: BeryX never changes a grant. The connection's role needs a Snowflake database role (or SNOWFLAKE.GOVERNANCE_VIEWER):

GRANT DATABASE ROLE SNOWFLAKE.SECURITY_VIEWER TO ROLE DATAVAULT_READER;

The ACCOUNT_USAGE views lag by up to 120 minutes: a grant given or revoked less than two hours ago may not show yet, and the read states the lag (lag_minutes). Account privileges, such as MANAGE GRANTS, do not count as access to a table. What is stored and who sees it is in the PostgreSQL section, «Who accesses sensitive data».

Dormant access (card #788). The same read crosses the grants with SNOWFLAKE.ACCOUNT_USAGE.ACCESS_HISTORY:

  • What it reads: only the tables of datasets with confidential or personal-data columns. It stores, per dataset and user with access to it, the time of the last access in the last 90 days, never the query text.
  • When in doubt, an access counts: the read asks for up to 1000 tables, those of the most sensitive datasets first. A dataset left out, or a user whose rows the read's cap cut, gets no last access and does not count as dormant (the response says access_history_truncated: true).
  • When it is dormant: a user with no reads in the 90 days up to the read. The next recertification campaign takes it as an item, with the user and the dataset, which whoever manages the grants of the dataset's domain confirms or revokes (without a domain, only an admin).
  • A read up to 7 days old: grants are only read on request, and the campaign only uses a read up to 7 days old. With an older one, no access counts as dormant, so read the grants before opening the campaign.
  • Remove in the source: revoking it, or nobody confirming it by the end of the campaign, opens the «Remove in the source» task in My tasks. BeryX does not change the grant. If nobody decides the item and a read made after the campaign opened sees the user reading the dataset, the item closes without a task.
  • Requirements: Enterprise edition or higher and a role with access to the SNOWFLAKE database. Without them, the read keeps the grants, answers access_history: "unavailable" and no access counts as dormant.
  • Other sources: for now, only Snowflake gives the per-user history. Connections to the other sources with a grants read (PostgreSQL, BigQuery, Databricks) answer access_history: "unsupported" and have no dormant access.

Shadow AI in the source (card #810). The same history shows the copilot and MCP server accounts that read classified data without going through BeryX. It is part of the “AI & Data Security” add-on: without it, the routes answer 404.

  • AI accounts: a source account is an AI account if its name has the mark of a copilot or an MCP server (COPILOT_SVC, github-copilot, glean_reader, SVC_MCP, snowflake-mcp-server), ignoring case and separators. A mark that is also a person's name, initials or a common word (claude, cursor, gemini, mcp on its own) only counts with a service-account word in the name (svc, bot, agent, api…): CLAUDE.DUPONT and mcp@acme.com are not AI accounts. An account in an agent's record is also an AI account, even without a mark.
  • Cross with the AI registry: a read of a classified dataset in the 90 days of history is only authorised if the account is in the record of an agent that MCP would let read that dataset: approved, with the go-live complete, the record's prompt, the dataset linked and a tool in the rights matrix that reaches classified data within the dataset's domains. The source does not say which tool did the read, so one is enough. Each agent's accounts are read with GET and saved with PUT /compliance/ai-agents/{agent_id}/source-accounts (admin, up to 50). The PUT replaces the whole list.
  • “Unauthorised” issue: each read outside the registry opens an unauthorized_ai issue per dataset and account, critical with personal data, with the reason: unregistered (the account is in no record), not_approved (it is in the record of a proposed or suspended agent), not_cleared (the agent is approved, but the go-live is not complete, the prompt is not the record's or no tool in the matrix reaches classified data) or outside_record (the agent can read classified data, but the dataset is not linked to its record or is outside its domains). The title and description carry the tool and the agent, never the account name, because they reach AI reports, MCP and tickets; only an admin sees the name, in GET /data-security/shadow-ai, which also gives each read's issue.
  • When it is re-evaluated: on each grants read and when an agent's accounts are saved. The issue closes when the account becomes authorised, when the dataset stops being classified, when the account leaves the record and has no mark in its name or when a later read crossed the account and no longer saw it reading. If the agent's go-live regresses, the next read opens an issue again. With the history refused it stays open. An ignored issue does not reopen.
  • In the app (card #1070): the “Shadow AI” section of the Privacy page shows each account with the connection, the provider recognised in the name, the last read of each dataset, the verdict and the linked issue. “Assign to an agent…” reads the record's accounts and saves them with the account added.
  • BeryX shows who read and does not stop anyone from reading: removing the access is done in the source.

Cortex Search services (card #1029). With the engineering scan enabled (VARREDURA_ENGENHARIA.md), BeryX lists the Cortex Search services of the connection's database with SHOW CORTEX SEARCH SERVICES IN DATABASE and runs one DESCRIBE CORTEX SEARCH SERVICE per service, up to 50 (app/infra/connectors/snowflake_engineering.py). It stores the name, the schema, the embedding model (embedding_model) and source_data_num_rows, which counts source rows, not vectors. The source query, the service URL and the indexing error are left out. BeryX never calls SEARCH_PREVIEW or the :query endpoint, which return search results.

SHOW only lists the services on which the role has some privilege. Without a grant, no service shows up and the scan stays as it was, with one more request to the source in the telemetry. Each service you want catalogued is one grant:

GRANT USAGE ON CORTEX SEARCH SERVICE <db>.<schema>.<servico> TO ROLE DATAVAULT_READER;

Mind the USAGE. It is the privilege to query the service, and Snowflake runs searches with the service owner's rights. With it, the connection's credential can query all the data the service indexed, including rows the role cannot read in the source table, for example because of a row access policy. BeryX only calls DESCRIBE, but the limit is then enforced by our code and not by the source. Snowflake has no metadata-only privilege for these services, and OPERATE also suspends and alters the service.

The DESCRIBE documentation does not say which privilege it needs. A refused DESCRIBE leaves the service with its name only, and the scan counts it under «Partial coverage». The services show up in the panel's inventory and in last_scan.search_services (GET /api/v1/connections/{id}/engineering).

In the comparison between an index and its origin (card #1227), each service the scan lists comes out unknown, with the reason service_grants_unconfirmed: the SHOW GRANTS and ACCOUNT_USAGE.GRANTS_TO_ROLES pages do not say they show these services, and BeryX does not read who has USAGE on them.

Dynamics 365 (Dataverse)

What you need: an app registration in Entra ID with a secret, and an application user in the Dataverse environment with a read profile.

Step by step:

  1. App registration: entra.microsoft.com → Identity → Applications → App registrations → New registration (e.g. datavault-reader). Note the Application (client) ID (client_id) and the Directory (tenant) ID (tenant_id) from the Overview page.
  2. Secret: in the app → Certificates & secrets → New client secret. Copy the value (client_secret) — it is only shown once.
  3. API permission (for consent): API permissions → Add a permission → Dynamics CRM → Delegated → user_impersonation → Grant admin consent. Note: for the server-to-server flow used by BeryX, what actually grants access is the next step.
  4. Application user in Dataverse (essential): admin.powerplatform.microsoft.com → Environments → (your environment) → Settings → Users + permissions → Application users → + New app user → choose the app registration → assign a security role with read on the entities to be analysed (e.g. a custom read-only role, or Basic User + read on the relevant tables).
  5. Organisation URL (org_url): the environment's address, e.g. https://a-tua-org.crm4.dynamics.com (visible in the admin center or in the browser). It can be pasted with or without https://.

Wizard fields: org_url, tenant_id, client_id, client_secret; optional entities — a list (or a comma-separated string) of entity set names (plural, e.g. accounts,contacts,leads,opportunities,incidents). Default: accounts, contacts, leads, opportunities.

Installation: pip install "datavault-backend[dynamics]"

Known limitations:

  • row_count uses OData's $count=true, which Dataverse caps at 5,000 — counts above that appear truncated.
  • Profiling is done on a sample (the first ~1,000 rows via $top), not on the whole table; null and distinct percentages are relative to the sample.
  • The Web API has throttling (request limits per user); scans of many entities may slow down.
  • Each Web API response has a 30 MB cap, and the 30 s timeout counts for the whole request. Scan rows arrive in pages of 1,000 records. A response above the cap fails with «Resposta Dataverse demasiado grande».
  • The connection test does token + WhoAmI and distinguishes: invalid secret vs wrong client_id/tenant_id vs missing application user in the environment (403).
  • The connection test message goes to the connection's last error, which every workspace member sees. Since card #610 it goes through the same filter as the SQL connectors: the client_secret value and the password of an org_url with user:password@ come out as ***. Proof: backend/tests/test_dynamics_connection_redaction.py.

Confluence / Jira (Atlassian Cloud, document source)

Two document sources on the same Atlassian Cloud account (email + API token), the same credentials as the Jira ticket integration in Notifications. There are no tables and no tabular scans: content comes in through the Documents button (or POST /connections/{id}/documents).

Credentials — on the customer side:

  1. A dedicated Atlassian account (e.g. datavault@empresa.pt) with read access only: View permission on the Confluence spaces to be analysed and Browse projects on the Jira projects to be read.
  2. With that account, at https://id.atlassian.com/manage-profile/security/api-tokens → Create API token. Copy the token (ATATT…), which is only shown once. The connector authenticates with Basic auth (email + token) at the site address.
  3. In the wizard: site (e.g. a-tua-org.atlassian.net, with or without https://), the account's email, the api_token and, optionally, the space (Confluence, space_key) or the project (Jira, project_key). Through the API, Jira also accepts jql.

Confluence — how it works: lists the current pages of the space (without space_key, all the pages the account can see), 50 per request, up to the analysis limit (200 by default, maximum 1,000). Each page is a document confluence/<id>/<título>.html with the body in storage format (HTML) and the date of the latest version. Cap of 5 MB per page. Signals: off by default, because internal documentation does not go to the LLM unless someone asks for it. mine_signals: true in the configuration turns them on.

Jira — how it works: searches via GET /rest/api/3/search/jql (the legacy /search responds 410). The effective JQL is project = <project_key> combined with the jql from the configuration, ordered by updated DESC (or by the ORDER BY of the jql). Without a project or JQL, it uses updated >= -30d. At most 500 issues per analysis, paginated by nextPageToken. Each issue is a document jira/<CHAVE>/<resumo>.txt with summary, status, labels, description (ADF → text) and the 30 most recent comments, these with the name of the commenter. Cap of 2 MB per issue (the text is cut). Signals: on by default, because that is what the source exists for. Each issue goes through the SIGNALS pipeline (pre-filter by DQ glossary → extraction → linking to the catalogue → idempotent upsert per issue) and the signal links to https://<site>/browse/<CHAVE>. mine_signals: false turns them off.

Connection test diagnostics: Confluence reads GET /wiki/rest/api/space?limit=1 and Jira GET /rest/api/3/myself (the message says which account it authenticated with). 401 = email or token rejected (in Jira also 403, which includes missing permissions), 404 = wrong site, space or JQL. A response that is not JSON (an SSO, proxy or maintenance page) has its own message. In Jira, so do 429 (rate limit) and 410 (discontinued endpoint).

Security: only GETs, through the ReadOnlyHttpClient (anti-SSRF + DNS pinning), to the given site, which also goes through the guard when the connection is created. The project key is validated (^[A-Z][A-Z0-9_]{0,9}$) before it enters the JQL. Page ids and issue keys are validated before they enter the URL.

Installation: none — both connectors only use httpx, which is a base dependency. They ship in the production image.

Known limitations:

  • Atlassian Cloud only: the paths are the Cloud ones (/wiki/rest/api, /rest/api/3), and Server/Data Center are left out.
  • In Confluence, pages only: blog posts, attachments and comments are not read.
  • In Jira, 500 issues and 30 comments per issue in each analysis. A 429 from Jira is not retried: during the listing it fails the analysis; when reading an issue it skips that issue.
  • Validation status: fake_transport only (see the matrix above). There is no proof yet against a real Atlassian instance.

SharePoint / Teams (Microsoft Graph, document source)

Registration decision: ADR 0003, option A — the app is registered by the customer in their own tenant, with the least privilege possible (Sites.Selected). The files of a Teams channel live in the team's SharePoint site: a team site counts as a site. Teams messages are out of scope.

What you need: someone with the Cloud Application Administrator role (or Privileged Role Administrator) for the consent and a SharePoint Administrator (or site owner) for the per-site grant.

Step by step:

  1. Entra ID → App registrations → New registration (single tenant, no redirect URI). Note the Application (client) ID and the Directory (tenant) ID.
  2. API permissions → Microsoft Graph → Application → Sites.Selected → Grant admin consent. Do not use Sites.Read.All or Files.Read.All.
  3. Certificates & secrets → New client secret (validity ≤ 12 months). Certificate: card GRAPH-CERT.
  4. Grant read to the app on each site you want: Graph POST /sites/{site-id}/permissions with roles: ["read"] (Graph Explorer) or Grant-PnPAzureADAppSitePermission -Permissions Read.
  5. In the wizard: site URLs (one per line, e.g. https://a-tua-org.sharepoint.com/sites/Qualidade), tenant_id, client_id, client_secret and, optionally, a folder inside each library (folder). Through the API, also drive_names (list of libraries to include).

Installation: pip install "datavault-backend[sharepoint]" (msal, the same library as Dynamics).

How it works: document source — there are no tables and no tabular scans. The Documents button walks through the libraries of each site (subfolders up to 5 levels, @odata.nextLink pagination) and each PDF/DOCX/TXT/MD/HTML file goes into the document analysis (UNSTR). Cap of 20 MB per file, checked before the download. Office, OpenDocument, RTF and EPUB files that the analysis does not read yet (.pptx, .xlsx, .doc, .odt…) are counted by format in the same listing, without a download and without using up the limit, and the corpus says how many were left out without taking them off the score (formats counted and not read).

Security: only GETs through the ReadOnlyHttpClient (anti-SSRF guard + DNS pinning); each @odata.nextLink must point to https://graph.microsoft.com/v1.0/ (lesson A1); the download follows the 302 to *.sharepoint.com without the Authorization header. The only outbound request that does not go through that client is the token POST that msal makes to login.microsoftonline.com.

Connection test diagnostics: invalid/expired secret, wrong client_id or tenant_id (AADSTS codes), 403 = missing read grant on the site (Sites.Selected), 404 = wrong site URL. Throttling (429/503) honours Retry-After (up to 2 attempts).

Guided wizard (GRAPH-ONBOARD): in step 2 of the new connection, the Registration guide shows the 5 steps above with a textual "screen" of the portal (menus in English), the exact fields (with a copy button) and the common errors at each step. The Test access button sends the config, still unsaved, to POST /connections/check and receives one result per step, in the guide's order:

step What it proves Typical failure → guide step
fields complete fields, well-formed tenant_id and site URLs (no network) 5
dependency msal installed on the BeryX server — (BeryxTech operations)
register tenant and app registration recognised (AADSTS90002 / AADSTS700016) 1
secret client secret accepted (AADSTS7000215 invalid, AADSTS7000222 expired) 3
consent the token carries Sites.Selected in the roles claim (read without validating the signature, for diagnostics only); no roles = Grant admin consent missing; Sites.Read.All/Files.Read.All/… = excessive-privilege warning 2
site_grant (one per site) GET /sites/{host}:/{path} + visible libraries; 403 = missing read grant, 404 = wrong URL 4

A step that depends on another one that failed comes back skipped. Warnings do not block. The token and the secret never go into messages or logs (the onboarding_access_checked log carries only the workspace, the type, ok and the failed steps).

Google Drive (Drive API v3, document source)

Registration decision: ADR 0003, option A — the credential is the customer's, in their own GCP project, and BeryX always requests only the scope https://www.googleapis.com/auth/drive.readonly. The document base (limits, contract, helpers) is the same as for SharePoint: app/infra/connectors/documents.py.

Three credential modes (credentials_json), in the recommended order:

  1. Service account + sharing (default): the JSON key of an SA with no IAM roles; the customer shares the folders/Shared Drives with the SA's email as Viewer. The reach is exactly what was shared.
  2. Service account + domain-wide delegation (only if the Workspace sharing policy blocks iam.gserviceaccount.com): the same key + subject (email of the impersonated technical user). In the Admin Console → Security → API controls → Domain-wide delegation: the SA's numeric Unique ID with only drive.readonly. It is broader (it sees everything the subject sees): use a user with access only to the right folders.
  3. The customer's OAuth app: JSON "type": "authorized_user" (client_id, client_secret of the OAuth app registered in the customer's project + refresh_token of a technical user). The refresh requests only drive.readonly; if that scope was not consented to, Google refuses. An app in Testing mode has its refresh token expire in 7 days — publish it as Internal.

Any other type (e.g. external_account) is refused at creation: never ADC, never server credentials.

Step by step (mode 1):

  1. The customer's GCP project → APIs & Services → Library → enable the Google Drive API.
  2. IAM & Admin → Service Accounts → create the SA with no roles.
  3. Keys → Add key → JSON (or, later, Workload Identity Federation — card GRAPH-CERT).
  4. In Drive: Share each folder (or add a Viewer member to the Shared Drive) with the SA's email.
  5. In the wizard: the credential JSON, folders (one URL https://drive.google.com/drive/folders/<id> or id per line, up to 20), optional shared_drive_id, optional subfolder (folder, a path of names inside each root) and, only in mode 2, the impersonated user.

Installation: pip install "datavault-backend[gdrive]" (google-auth + requests, the official transport for the refresh).

How it works: document source — no tables and no tabular scans. The Documents button walks each root with files.list ('<pasta>' in parents and trashed = false, supportsAllDrives/includeItemsFromAllDrives, corpora=drive on the Shared Drive), subfolders up to 5 levels, pagination by pageToken and a cap of 500 requests. PDF/DOCX/TXT/MD/HTML files come in via files.get?alt=media; Google Docs come in exported as HTML and Google Slides as text (files.export); Sheets, Forms and shortcuts are left out. Office, OpenDocument, RTF and EPUB files that the analysis does not read yet (.pptx, .xlsx, .doc, .odt…) are counted by format in the same listing, without a download and without using up the limit, and the corpus says how many were left out without taking them off the score (formats counted and not read). Paths gdrive/<file-id>/<nome>. Cap of 20 MB per file, checked before the download when Drive declares the size (and always on the body). The prefix requested in the analysis is a subfolder inside the configured roots — the reach never goes beyond what was shared.

Security: only GETs through the ReadOnlyHttpClient (anti-SSRF guard + DNS pinning) to https://www.googleapis.com/drive/v3; pagination is a parameter, never a returned URL. Folder/file ids are validated (^[A-Za-z0-9_-]+$) before they enter the URL or the q query; subfolder names are escaped in q. The token_uri of the pasted JSON is ignored and fixed to https://oauth2.googleapis.com/token (a tampered JSON would send the signed JWT or the refresh token to another host); a universe_domain ≠ googleapis.com is refused. The only outbound request outside the Drive API is that google-auth POST. Private key, refresh token and access token never go into messages or logs.

Guided wizard and diagnostics: the Google Drive Registration guide (API → SA → key → sharing → optional delegation → fields) and Test access return one result per step:

step What it proves Typical failure
fields valid JSON (service_account/authorized_user), well-formed folders/ids, subject only with an SA (no network) incomplete JSON, a URL that is not drive.google.com/…/folders/<id>
dependency google-auth installed on the BeryX server — (BeryxTech operations)
key credential accepted by Google with drive.readonly invalid_grant (key deleted / refresh token revoked), invalid_client, invalid_scope
dwd (only with subject) delegation authorised for the Client ID unauthorized_client, user does not exist
api Google Drive API enabled in the project accessNotConfigured / SERVICE_DISABLED
share (one per folder) the root is visible and is a folder/Shared Drive 404 = not shared with the SA's email (Drive responds 404, not 403)

Throttling (429/503 and 403 userRateLimitExceeded/rateLimitExceeded) honours Retry-After (up to 2 attempts, wait ≤ 10 s).

Google Sheets (Sheets API v4, each tab is a dataset)

Each tab of a Google spreadsheet is a dataset named «spreadsheet title/tab» (card #213). The credential is Google Drive's, with the same three modes: the JSON key of a service account with the spreadsheet shared as Viewer, the same key with subject (domain-wide delegation) or the authorized_user JSON of a customer OAuth app. The same code pins the JSON's token_uri and validates the universe_domain (GoogleApiMixin, in app/infra/connectors/gdrive.py). Implementation: app/infra/connectors/gsheets.py.

Config: credentials_json, spreadsheet_ids (ids or URLs https://docs.google.com/spreadsheets/d/<id>/…, one per line, up to 20; ids ^[A-Za-z0-9_-]+$), header_row? (header row, 1 by default, up to 1000), sheets? (tab filter by name) and subject?. Creation returns 422 (netguard.GoogleSheetsConfigError) for a credential that is not service_account/authorized_user, a universe other than googleapis.com, a malformed id or URL and a header_row outside 1–1000.

Scopes: spreadsheets.readonly for the Sheets API. The modification date comes from Drive (files.get?fields=modifiedTime), which does not accept that scope: that request carries a separate token with drive.metadata.readonly. With domain-wide delegation, authorise both scopes in the Admin Console. Without the second one, or without the Drive API enabled, reading carries on and freshness is not measured.

Step by step (service account):

  1. Customer's GCP project → APIs & Services → Library → enable the Google Sheets API and, for freshness, the Google Drive API.
  2. IAM & Admin → Service Accounts → create the SA with no roles and the JSON key (as for Drive).
  3. In the spreadsheet: Share with the SA's email, role Viewer.
  4. In the wizard: credential JSON, spreadsheets (one URL or id per line), header row and, if you want, the tabs to read.

Installation: pip install "datavault-backend[gdrive]", the Drive extra (google-auth + requests). There is no new extra.

How it reads:

  • spreadsheets.get (only sheets.properties) lists the tabs. Only grid tabs (sheetType GRID) become datasets: charts and BigQuery connections have no cells. If two spreadsheets share a title, the second one gets the start of its id in the name.
  • values.get with valueRenderOption=UNFORMATTED_VALUE and dateTimeRenderOption=SERIAL_NUMBER, in blocks of 10,000 rows that never pass the grid's rowCount, up to 100,000 rows per tab (ROW_LIMIT; above that the profile says sampled). Reading stops at the first block that is entirely empty.
  • Columns: the text of the header row. An empty cell gives the column its letter (C); a repeated name gets _2. Numbers and booleans arrive typed. A spreadsheets.get with the effectiveFormat.numberFormat.type mask over the first 200 rows tells which columns are dates (DATE/DATE_TIME in the majority): there, the serial number becomes a date in the spreadsheet's time zone, and TIME cells become HH:MM:SS. Coercion and profiling (nulls, distinct values, min/max, mean, samples) are the CSV connector's (coerce_values and profile_columns), in memory: 00123 stays text.
  • row_count counts the non-empty rows below the header. Empty ones go to source_metrics.blank_rows and cells with a formula error (#N/A, #REF!…) to source_metrics.error_cells.
  • An empty tab, one without a header or one with only the header is still a dataset: the profile carries the warning in source_metrics.warnings and nothing raises.
  • Freshness: the first date column. Without one, the spreadsheet's Drive modifiedTime applies (per spreadsheet, not per tab), which is also table_metadata.last_modified.
  • Each scan has 500 HTTP requests. Once the budget runs out, the next tab fails with that message.

Security: GETs only, through the ReadOnlyHttpClient (anti-SSRF + DNS pinning), to https://sheets.googleapis.com/v4/spreadsheets and https://www.googleapis.com/drive/v3/files. The hosts are fixed in code and nothing from the config goes into them. The tab name is quoted ('Sheet1'!1:10000) and encoded in the path. The module has no values.update, append or batchUpdate: tests/test_gsheets_connector.py proves it with a fake transport that refuses POST/PUT.

Test access: Google Drive's steps, with the Sheets API:

step What it proves Typical failure
fields valid JSON, well-formed ids/URLs, header_row, subject only with an SA (no network) a URL that is not docs.google.com/spreadsheets/d/<id>
dependency google-auth installed on the BeryX server — (BeryxTech operations)
key credential accepted by Google with spreadsheets.readonly invalid_grant, invalid_client, invalid_scope
dwd (only with subject) delegation authorised for the Client ID unauthorized_client, user does not exist
api Google Sheets API enabled in the project; a warning (warn) if the Google Drive API is not (no freshness) SERVICE_DISABLED
share (one per spreadsheet) the spreadsheet is visible 403 or 404 = not shared with the SA's email

Throttling (429/503) honours Retry-After, as for Drive.

Slack and Teams — chat channels as a source of signals (CHATSIG, ADR 0008)

An extension of SIGNALS: conversation threads (message + replies) in channels chosen by the customer go into the same pipeline as Jira tickets (pre-filter by DQ glossary → Haiku or heuristic extraction → linking to the catalogue → idempotent upsert per source_ref with content_hash). Each thread is a document slack/<canal>-<ts>/… or teams/<chave>-<mensagem>/…; the corpus appears in the catalogue as documentos/canais and the signals on the Signals page. It runs with the Documents button (or POST /connections/{id}/documents).

Privacy — opt-in per channel, never DMs:

  • Only the channels listed in channels are read; without a list, the connection is refused. A path forged for another channel is refused before any request.
  • Slack: direct message ids (D…) are refused in the config; conversations.info confirms that each channel is neither a DM nor a group conversation (is_im/is_mpim) before reading messages. Bot tokens (xoxb-) only: a user token would give access to the DMs of whoever generated it.
  • Teams: team channels only (19:…@thread.tacv2); chat ids (1:1, group, meeting) are refused and no /chats endpoint is called.
  • Authors never go into the text sent to the AI (neither names nor ids); mentions of people become @utilizador. Messages from bots/apps, system messages and deleted messages are ignored — BeryX's own alerts in a channel do not turn into "complaints".
  • Limited window: lookback_days (30 by default, max. 90); up to 20 channels per connection and 100 replies per thread. mine_signals: false turns off mining while keeping the connection.

Slack — on the customer side:

  1. https://api.slack.com/apps → Create New App (from scratch) in the organisation's workspace.
  2. OAuth & Permissions → Bot Token Scopes: channels:history, channels:read and, only if there are private channels to mine, groups:history, groups:read. Never im:* or mpim:* ("Test access" warns if they are present).
  3. Install to Workspace and copy the Bot User OAuth Token (xoxb-…).
  4. In each chosen channel: /invite @nome-da-app (a bot token only reads channels it is in).
  5. In BeryX: the token, the channels (#dados-problemas, id C0… or link …/archives/C0…) and, optionally, the workspace address (a-tua-org.slack.com) for the signal links.

Teams — on the customer side (the same app registered for SharePoint will do; see ADR 0003/0008):

  1. Minimum permission: RSC ChannelMessage.Read.Group (Application), granted by the owner of each team when installing the app in that team. Tenant-wide alternative: ChannelMessage.Read.All (Application) with admin consent. No Chat.* permission.
  2. Channel messages are a Microsoft protected API: the customer submits the access request (Protected APIs in Microsoft Teams form) for the app in their tenant.
  3. In BeryX: tenant_id, client_id, client_secret and the channels — one link per line ("Get link to channel" in Teams) or <team-id>/<channel-id>.

Read-only: Slack only through read methods of the official Web API (auth.test, conversations.info|list|history|replies) via GET; Teams through GETs to Graph v1.0. Both go through the ReadOnlyHttpClient (anti-SSRF + pinning); tokens and secrets never appear in logs or errors.

Apache Kafka (topics as datasets)

What you need: the bootstrap servers and a read-only account — ACL Read + Describe on the topics to monitor and, if you want an application's lag, Describe on its consumer group. On Confluent Cloud: a service account API key with those roles (SASL_SSL + PLAIN). For Avro: the Schema Registry URL and API key (read-only).

Installation: pip install "datavault-backend[kafka]" (confluent-kafka, the official client built on librdkafka). Avro is decoded with no extra dependencies; the Schema Registry is read over HTTP.

How it works (v1, no continuous consumption): each configured topic (or, without topics, every non-internal topic — up to 200) is a dataset. Each scan reads a sample of the last sample_size messages (default 500, maximum 5000), spread across the partitions from the tail (up to 64 partitions, 30 s budget), and profiles them as rows: the top-level fields of the JSON/Avro record are columns (nested objects and lists stay as JSON text), plus _kafka_partition, _kafka_offset and _kafka_timestamp. row_count = retained messages (sum of high − low watermark).

Its own metrics (in profile_results.metrics_json.source_metrics of the table row):

  • last_message_age_seconds / latest_message_at — event freshness; the profile's latest_timestamp is the timestamp of the most recent message, so the freshness rule and the automatic monitors work with nothing special;
  • malformed_pct / malformed_reasons — messages whose value cannot be read as an object (invalid_json, not_an_object, invalid_avro, schema_not_found, schema_registry_missing, missing_schema_id, unsupported_schema_type); tombstones (null value) are counted separately in tombstones;
  • sample_lag — messages left unread at the head of the partitions when the sample finished (produced during the scan, or reading cut short by the budget; sample_timed_out);
  • consumer_group_lag — with consumer_group, the real lag of that application (high watermark − committed offset), read with OffsetFetch;
  • schema_conformity — with schema_registry_url, how many messages in the sample conform to the registered schema (checked, violations, violation_pct, reasons, schema_ids, subject); null without a registry. See "Rules on streams" below.

The automatic monitors use only watermarks (change_counter = sum of the high watermarks) and the timestamp of the last message in each partition.

Formats: value_format = auto (default: Confluent wire format → Schema Registry; otherwise JSON), json or avro. Registry JSON schemas are supported; PROTOBUF is outside v1 (it counts as malformed).

Rules on streams (card #103). Four rule types at topic level, evaluated on each scan's sample; when they fail they open issues (rule_violation, with the type in subtype) and count towards the dataset verdict (GET /datasets/{id}/verdict) exactly like the other rules — a failing critical rule gives fail.

Type Parameters Passes when Score dimension
max_event_age max_age_seconds (required), column? the most recent event in the sample is ≤ N seconds old. Without column it uses the broker timestamp (last_message_age_seconds); with column it uses the latest event time in that payload field (ISO-8601, epoch in s or ms) freshness
schema_conformity max_violation_pct? (default 0) % of messages that do not match the Schema Registry schema ≤ limit validity
required_fields fields (a list or comma-separated text; a.b for nested fields), max_violation_pct? (default 0) % of events missing any of the fields (absent or null) ≤ limit validity
max_malformed_pct max_pct (required) the sample's malformed_pct ≤ limit (tombstones do not count) validity

Schema conformity: messages in the Confluent wire format are validated against the schema of the id they carry — Avro that decodes is conformant (invalid_avro and schema_not_found are violations); JSON schemas validate the usual subset of JSON Schema (type, required, properties, additionalProperties: false, enum/const, items, anyOf/oneOf/allOf, local $ref). JSON messages without framing are validated against the latest version of the subject <tópico>-value (TopicNameStrategy), whether it is JSON Schema or Avro (fields without a default are required; extra fields are tolerated). Reasons: missing_required, type_mismatch, enum_mismatch, unexpected_field, no_branch_matched, invalid_json, invalid_avro, schema_not_found. Without a registry, or without any message that has a schema, the rule fails with the explanation in details.error (just like freshness without a timestamp). Only counters and codes leave the connector — never payloads.

Onboarding: on a topic's first scan, besides the generic rules, max_malformed_pct (≤ 1%, warning) and — if the registry validated any message — schema_conformity (0%, warning) are created.

Examples (POST /api/v1/rules, or the rules section of the GitOps YAML):

{"dataset_id": "<orders>", "rule_type": "max_event_age", "params": {"max_age_seconds": 300}, "severity": "critical"}
{"dataset_id": "<orders>", "rule_type": "max_event_age", "params": {"max_age_seconds": 900, "column": "event_time"}}
{"dataset_id": "<orders>", "rule_type": "schema_conformity", "params": {"max_violation_pct": 0.5}}
{"dataset_id": "<orders>", "rule_type": "required_fields", "params": {"fields": ["order_id", "customer.id"], "max_violation_pct": 0}}
{"dataset_id": "<orders>", "rule_type": "max_malformed_pct", "params": {"max_pct": 1}}
rules:
  - dataset: orders
    type: max_event_age
    params: {max_age_seconds: 300}
    severity: critical
  - dataset: orders
    type: required_fields
    params: {fields: [order_id, customer.id]}

Reading the result: observed is the age in seconds (max_event_age) or the observed percentage (the others); details carries source (broker_timestamp, event_timestamp on a log file, rows or profile), reasons per reason, missing_by_field per field and checked_count. max_event_age and required_fields also work outside streams (they use latest_timestamp / the column profile); schema_conformity only on streams (Kafka and Pub/Sub — see below) and max_malformed_pct also on the log files in buckets. With no rows read, required_fields measures from the profile only the fields that are profiled columns. An a.b field inside a table column, or a field of a column the profile skipped, goes into unchecked_fields and the rule is indeterminate (indeterminate, with reason), unless the measured fields already make it fail.

Security / read-only: the consumer uses assign() — it never joins a consumer group, never triggers rebalances and never commits (enable.auto.commit=false). The librdkafka config is built from an allowlist (no arbitrary property from the customer gets through: ssl.ca.location, plugins or Kerberos commands would be LFI/RCE); a custom CA only as PEM (ssl_ca_pem). Bootstrap servers, the brokers advertised in the metadata and the Schema Registry go through the anti-SSRF guard; the registry is read only by GET on the ReadOnlyHttpClient and requires https. Payloads are never logged; the metrics only store counters.

Google Pub/Sub (topics as datasets — Kafka's counterpart)

What you need: a service account JSON key from your GCP project and, on each topic to monitor, a pull subscription dedicated to BeryX with the label datavault-sampler=true:

gcloud pubsub subscriptions create datavault-orders --topic=orders \
  --labels=datavault-sampler=true --message-retention-duration=1h --expiration-period=never
gcloud pubsub subscriptions add-iam-policy-binding datavault-orders \
  --member=serviceAccount:datavault@<projeto>.iam.gserviceaccount.com --role=roles/pubsub.subscriber

Service account roles: roles/pubsub.subscriber only on the sampling subscriptions; roles/pubsub.viewer on the project (to read the subscriptions' configuration and the topics' schemas); roles/monitoring.viewer if you want the backlog of your consumers' subscriptions.

Installation: pip install "datavault-backend[pubsub]" (google-cloud-pubsub + google-cloud-monitoring, the official clients). Avro reuses the streaming base's own decoder.

Decision — how to sample without stealing messages. In Pub/Sub, reading means doing a pull on a subscription, and each subscription has its own cursor. Alternatives considered:

Option Why not
Pull on the consumers' subscription without ack The messages are held by BeryX until the ack deadline expires (a delay for the application), delivery_attempt goes up and, with a dead-letter policy, they can end up in the DLQ. It steals messages.
Snapshot + seek on the consumers' subscription Requires pubsub.snapshots.create/seek (writes in the customer's project); while sampling, the messages are held; the seek back redelivers to the consumers everything they processed in that interval (duplicates).
Dedicated sampling subscription (chosen) Each subscription receives its own copy of every message: pull + ack on it does not touch any other subscription. Cost: delivery throughput for the pulled messages only (≤ sample_size per scan); the unacknowledged backlog is discarded by retention.

The connector refuses, before any pull, subscriptions without the label datavault-sampler=true, push subscriptions, export subscriptions (BigQuery/Cloud Storage) or detached subscriptions, and two sampling subscriptions on the same topic. Seek is used, yes, but only on the dedicated subscription: before each sample it rewinds to agora − sample_window_seconds (default 3600; 0 turns it off). This discards old backlog — without it, a daily scan would sample yesterday's messages and freshness would raise false alarms — and, with retain_acked_messages or retention on the topic, it restores the window already read.

How it works: each subscription in subscriptions (id, or projects/<p>/subscriptions/<id>) gives a dataset named after the topic (schema = project). Each scan pulls up to sample_size messages (default 500, maximum 5000, 30 s budget, stops after two empty pulls) and acknowledges them; the profile, columns, rule rows and count use the same sample (a single pull per scan). Columns = top-level JSON/Avro fields, plus _pubsub_message_id and _pubsub_publish_time. row_count = messages in the sample. The automatic monitors (table_metadata) never pull — they would consume the dedicated subscription on every cycle.

Metrics (source_metrics, kind: "pubsub") — the core is the same as Kafka's (streaming.sample_metrics), so the stream rules, freshness and the onboarding suggestions work the same way:

  • latest_message_at / last_message_age_seconds — from publish_time; the profile's latest_timestamp = the most recent one;
  • malformed_pct / malformed_reasons (invalid_json, not_an_object, invalid_avro, schema_not_found, schema_unavailable, missing_schema, unsupported_schema_type); messages without data (attributes only) count in tombstones;
  • consumer_group_lag — with consumer_subscriptions (your consumers' real subscriptions), the sum of num_undelivered_messages of those that read the topic, read from Cloud Monitoring (never a pull on them); per-subscription detail in consumer_subscriptions and consumer_oldest_unacked_age_seconds;
  • schema_conformity — on topics with a Pub/Sub schema, from each message's googclient_schemaname/googclient_schemaencoding/googclient_schemarevisionid attributes: BINARY Avro that decodes is conformant; JSON is validated against that revision's Avro schema. Binary Protobuf is left out (malformed, unsupported_schema_type). null on topics without a schema — the rule explains why;
  • sampling_subscription, sample_window_start, subscription_filter (the sample respects the subscription's filter), ack_failed.

Security / read-only: it never publishes, and never creates, alters or deletes resources; the only writes are to the cursor of the dedicated subscription (ack and seek), which is checked by its label before any pull/seek. Fixed Google endpoints (no hosts taken from the config); service account key only (token_uri pinned to oauth2.googleapis.com, universe googleapis.com), never the server's ADC — validated when the connection is created. Payloads, the key and tokens are never logged.

Microsoft Fabric (SQL analytics endpoint)

What you need: an Entra ID service principal with access to the Fabric workspace, Microsoft's ODBC 18 driver on the system, and the SQL analytics endpoint of the Lakehouse/Warehouse.

Step by step:

  1. App registration + secret: same as steps 1-2 of Dynamics (you can reuse the same app) → tenant_id, client_id, client_secret.
  2. Enable service principals in Fabric: app.fabric.microsoft.com → Settings → Admin portal → Tenant settings → Developer settings → "Service principals can use Fabric APIs" → Enabled (the tenant admin can restrict it to a security group that includes the app).
  3. Workspace access: in the workspace → Manage access → + Add people or groups → add the service principal with the Viewer role (enough for reading via the SQL endpoint).
  4. Endpoint and database: in the Lakehouse/Warehouse → Settings → SQL analytics endpoint → SQL connection string — this is the server (e.g. xxxx-yyyy.datawarehouse.fabric.microsoft.com); database is the name of the Lakehouse/Warehouse as it appears in the workspace.
  5. System ODBC driver (required, in addition to the pip extra):
    • macOS: brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release && HOMEBREW_ACCEPT_EULA=Y brew install msodbcsql18
    • Debian/Ubuntu: follow Microsoft's instructions and sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18

Wizard fields: server, database, tenant_id, client_id, client_secret (optional: port, odbc_driver).

Installation: pip install "datavault-backend[fabric]" + the ODBC driver above.

Known limitations:

  • A Lakehouse's SQL analytics endpoint is read-only by nature (ideal for BeryX), but Delta data can take a few minutes to show up in the endpoint after a write.
  • System schemas (INFORMATION_SCHEMA, sys, queryinsights) are excluded from table discovery.
  • The connection requires Encrypt=yes (TLS) — BeryX sets it automatically; environments with TLS inspection may need the correct certificates on the system.
  • Without the system ODBC driver, the connection test returns the brew/apt installation instructions.
  • Without the ODBC driver (which is the case in the production image), the Delta tables and files of a Lakehouse are read through OneLake in the adls connector, with onelake_url.
  • Checksums, HLL sketches and the row sample by key hash use HASHBYTES('SHA2_256', CAST(col AS VARCHAR(max))): Fabric Warehouse has no NVARCHAR (its VARCHAR is UTF-8). That is why the checksum_dialect is fabric and data-diff does not compare Fabric checksums with those of a SQL Server (the text bytes are different). If the source refuses the hash sample, the scan uses the first rows and records sample_hash_fallback in the worker log.

SQL Server / Azure SQL / Synapse (mssql)

The source for Portuguese ERPs (Primavera, PHC, Sage) and the Microsoft mid-market. A single type covers SQL Server on-premises (2016+), Azure SQL Database/Managed Instance and Synapse (dedicated and serverless SQL pools) — all of them speak T-SQL through the same dialect.

Two authentication modes (the wizard picks one based on whether tenant_id is present):

Mode What for Driver Fields
SQL authentication SQL Server on-prem/VM, Azure SQL with a SQL login mssql+pymssql — wheels with FreeTDS built in, no system ODBC driver (works in the production image) host, port (1433), database, user, password
Entra ID service principal Azure SQL, Synapse mssql+pyodbc with Authentication=ActiveDirectoryServicePrincipal — the same path as Fabric host, database, tenant_id, client_id, client_secret (optional: port, odbc_driver)

In both: application_intent: "readonly" (optional) sends ApplicationIntent=ReadOnly, which in an Availability Group with readable replicas or in Azure SQL read scale-out routes the session to the read replica (which refuses writes and puts no load on the primary). host also accepts the Azure portal format (tcp:servidor.database.windows.net,1433). Other protocol prefixes (np:, lpc:, admin:) are refused. The anti-SSRF guard (netguard) validates the host after removing the tcp: prefix, the ,1433 port and the named instance (\\INSTANCIA), when the connection is created and again at runtime before each connection. With pymssql, a named instance only connects through a url without a port (mssql+pymssql://…@host\\INSTANCIA/base): FreeTDS connects to the validated IP of the name and asks the SQL Browser at that IP for the instance's port (UDP 1434). With a port, FreeTDS would look up the whole host\\INSTANCIA in DNS, outside the guard, and the connector refuses the connection before opening it (card #658). The host and port fields always carry a port (1433 by default): there, give the instance's port and drop the \\INSTANCIA.

Read-only login (SQL Server / Azure SQL with SQL authentication) — SQL Server has no read-only session mode equivalent to Postgres's default_transaction_read_only: the guarantee comes from the GRANTs. Create a login with db_datareader only:

-- in master (SQL Server) — on Azure SQL, in the master database of the logical server
CREATE LOGIN datavault_ro WITH PASSWORD = '<password forte>';
-- in EACH database to analyse
USE <base>;
CREATE USER datavault_ro FOR LOGIN datavault_ro;
ALTER ROLE db_datareader ADD MEMBER datavault_ro;
-- optional: row counts from the partition catalogue (without this it uses sys.partitions)
GRANT VIEW DATABASE STATE TO datavault_ro;   -- SQL Server 2022/Azure SQL: VIEW DATABASE PERFORMANCE STATE

On Azure SQL you can instead create a contained user directly in the database (CREATE USER datavault_ro WITH PASSWORD = '…') and connect as that user.

Service principal (Azure SQL / Synapse):

  1. App registration + secret: same as steps 1-2 of Dynamics (you can reuse the app) → tenant_id, client_id, client_secret.
  2. Entra admin on the server: the logical server must have an Entra ID administrator set (portal → SQL server → Microsoft Entra ID → Set admin).
  3. User in the database, connected as the Entra admin:
    CREATE USER [nome-da-app] FROM EXTERNAL PROVIDER;
    ALTER ROLE db_datareader ADD MEMBER [nome-da-app];
    
    Synapse dedicated pool: the same, in the pool's database. Synapse serverless: in the database created over the lake, and the service principal also needs to read the storage (Storage Blob Data Reader) for the views/external tables.
  4. Firewall: add BeryX's outbound IP to the firewall rules of the logical server (error 40615 = IP refused).
  5. System ODBC Driver 18 (instructions in the Fabric section) + pip install "datavault-backend[mssql,fabric]".

Not available in the production image. The BeryX image (cd.yml/gcp_deploy.sh) ships the [mssql] extra (pymssql), but not the [fabric] extra (pyodbc) nor the system ODBC Driver 18. In that installation GET /connections/types returns unavailable_modes: {"entra": "fabric"} and the wizard disables the "Entra ID" button, stating which extra is missing. When self-hosted, install both to enable the mode.

TLS: always. In Entra mode (ODBC) it sends Encrypt=yes;TrustServerCertificate=no — the certificate is verified. In SQL auth mode pymssql requests mandatory encryption (encryption=require), but the FreeTDS built into the wheels does not validate the server certificate (there is no CA configurable per connection): the session is encrypted, but not protected against a man-in-the-middle with a fake certificate. For full certificate verification use Entra ID mode (or a mssql+pyodbc:// url with a SQL login, which requires the ODBC driver).

What the connector does:

  • Discovery excludes the sys, INFORMATION_SCHEMA and guest schemas and the fixed db_* roles.
  • Profiling by T-SQL push-down: counts, nulls, distinct values, min/max, mean/standard deviation, zeros/negatives; quantiles via NTILE(20) (T-SQL's PERCENTILE_CONT only exists as a window function); bit is left out of min/max; text lengths are not computed (LEN() ignores trailing spaces — misleading numbers). varbinary is left out of distinct values/min/max; exotic types (xml, geography, sql_variant, hierarchyid) degrade to the null count without failing the scan.
  • Cheap metadata (automatic monitors): row count from sys.dm_db_partition_stats (heap/clustered index, no scan; with a db_datareader-only login it falls back to sys.partitions). Only in the mssql connector: Fabric keeps the previous behaviour (no catalogue count) because these views have not been validated on a Fabric Warehouse. sys.tables.modify_date is exposed as the last schema change — it changes with DDL, not with INSERT/UPDATE, so it is never used as data freshness; freshness comes from a time column in the table.
  • Driver query timeout (pymssql's timeout / pyodbc's Connection.timeout) taken from DATAVAULT_CONNECTOR_STATEMENT_TIMEOUT_S — there is no session statement_timeout in T-SQL.
  • Checksums and HLL sketches (data-diff/INCR) from the first 4 bytes of HASHBYTES('SHA2_256', CAST(col AS NVARCHAR(max))) (card #317). CHECKSUM is not used: it follows the collation, and in a CI collation "A" and "a" would give the same hash — a false "equal" in data-diff.
  • Row sample by primary key hash (see Row sample); without a key, the first rows in the order of the 1st column.
  • Password and client_secret never appear in error messages (they are removed even when the driver echoes the connection string).

Full url: mssql+pymssql://user:pass@host:1433/base or mssql+pyodbc://… — only with the params in the mssql dialect allow-list (table in the PostgreSQL / MySQL / SQLite section). With pymssql, connect_timeout and applicationintent=readonly are translated into the driver's kwargs. The connect_timeout is a number of seconds, above 0 and up to 120 (see the allow-list); without it, 30 s.

Out of scope: CDC, Change Tracking and sys.dm_exec_* (lineage/queries); Windows/Kerberos authentication and ActiveDirectoryPassword in the UI.

Actual usage of tables (USAGEPRIO, card #686). The telemetry collection (POST /dashboard/finops/collect) reads the seeks, scans and lookups of each table in sys.dm_db_index_usage_stats, counts only, never the query text or the data. It needs VIEW SERVER STATE (VIEW SERVER PERFORMANCE STATE on SQL Server 2022; VIEW DATABASE STATE on Azure SQL Database). The DMV is cleared when the instance starts, on AUTO_CLOSE, on detach and on a failover, so the total does not say when the reads happened. The average comes from the difference between two BeryX collections, at least 7 days apart, without the reads of BeryX's own scans. Those are measured on the same counter: each scan reads it before it starts and after it ends, and the Δ of the scan's tables counts as BeryX's. That way it discounts what the database actually counts: a TABLESAMPLE sample does not raise the counter and a parallel count(*) raises it once per process. BeryX reads outside scans (preview, issue samples) and those of other tables the rules query stay as reads by others. Reads by others made during a scan, on its tables, are discounted as if they were BeryX's. The first collection gives no level, and neither does a reset: the counter goes down or the instance start date changes. A table only becomes "unused" after 80 days in a row of collections with no reads by others. With a read replica (replica_host) or with application_intent: readonly (Availability Group, Azure SQL read scale-out), BeryX connects only to the secondary and never to the primary. The counters are the secondary's and only count the reads made on it: the collection says so and no table becomes "unused" from them. Without the privilege, the connection comes out of the collection as unavailable, with what is missing, and the previous levels stay. Query Store is not read: it links queries to tables through their text, which carries the literals when the query is not parameterised.

Oracle Database (oracle)

It is the database of many legacy ERPs, banks, telcos and the public sector. The connector uses python-oracledb in thin mode: it speaks the Oracle Net protocol in pure Python, without Instant Client or system libraries, so it works in the production image ([oracle] extra). It needs Oracle Database 12.1 or later, the thin mode minimum.

Fields: host (name or IP only), port (1521), service_name or sid, user, password and, optionally, schemas (a list, or comma-separated text). The connection always goes to the given host and port, with an explicit service or SID: the connector does not read TNS aliases, tnsnames.ora or wallets from the server. A host with a port, path, ?, ( or = (Easy Connect with parameters, a (DESCRIPTION=…) descriptor) is refused. The anti-SSRF guard validates that same host when the connection is created and again at runtime.

Read-only user. Create a user with only CREATE SESSION and SELECT on the tables to analyse. Avoid SELECT ANY TABLE, which opens every schema, including Oracle's own.

CREATE USER datavault_reader IDENTIFIED BY "<password forte>";
GRANT CREATE SESSION TO datavault_reader;
-- uma linha por tabela ou vista a analisar
GRANT SELECT ON hr.employees TO datavault_reader;
GRANT SELECT ON hr.departments TO datavault_reader;

In a schema with many tables, generate the GRANTs from the catalogue (as the schema owner or a DBA) and run the result. A table created later needs its own GRANT.

SELECT 'GRANT SELECT ON ' || owner || '.' || table_name || ' TO datavault_reader;'
FROM all_tables WHERE owner = 'HR';

Mechanical read-only. Besides the GRANTs, every connector transaction starts with SET TRANSACTION READ ONLY (the engine's begin listener). Inside it, Oracle refuses INSERT, UPDATE, DELETE and MERGE with ORA-01456, even when the user has the GRANT. DDL commits implicitly and leaves that transaction: against CREATE or DROP only the missing privilege counts, so the user must not have more than the GRANTs above. In a read-only transaction every query sees the database at the same instant. A long profile of a heavily changed table can hit ORA-01555 ("snapshot too old"), as any long consistent read can.

What the connector does:

  • Discovery: the schemas with ALL_USERS.ORACLE_MAINTAINED = 'N' plus the user's own. If ALL_USERS lacks that column, all of them except a fixed list of Oracle schemas (SYS, SYSTEM, XDB, MDSYS, CTXSYS, OUTLN, DBSNMP, AUDSYS, WMSYS, OLAPSYS, ORDSYS, LBACSYS, DVSYS, GSMADMIN_INTERNAL, APEX_* and others). With schemas, only those. Names follow the SQLAlchemy convention: an unquoted identifier, upper case in the catalogue (HR.EMPLOYEES), shows in lower case (hr.employees). Reflection quotes them; no name is interpolated into the SQL. Tables, views and materialized views come with their kind: a view gets the limited profile of views (see Keys, partitions and object type).
  • Types: NUMBER(p, 0) and INTEGER are integers. NUMBER(p, s) and NUMBER without precision are numeric (they can hold decimals) and show as NUMERIC(p, s) and NUMERIC. DATE carries a time and counts as a temporal column. CLOB, NCLOB, BLOB and LONG stay out of COUNT(DISTINCT), MIN/MAX and ORDER BY, which Oracle refuses on those types (ORA-00932, ORA-00997), and also out of LENGTH, the empty and whitespace-only counts and the not_null rule's treat_as_null: nulls are counted and the sample rows carry the value.
  • Push-down profiling: counts, nulls, distincts, min/max, mean and standard deviation (STDDEV_POP), zeros and negatives, text lengths (LENGTH, in characters); quantiles by NTILE(20). LIMIT goes out as FETCH FIRST n ROWS ONLY.
  • Cheap metadata (automatic monitors): the count is ALL_TABLES.NUM_ROWS, marked as an estimate (row_count_estimated, with LAST_ANALYZED in row_count_as_of), because it is the count from the last DBMS_STATS run and not the current one. When ALL_TAB_MODIFICATIONS is visible, the DML since that run (INSERTS + UPDATES + DELETES) serves as a write counter. Oracle records that view with a delay and clears it on every run, so its TIMESTAMP is not used as data freshness.
  • Timeout: Oracle has no session statement_timeout. The connector sets oracledb's call_timeout (per round trip to the database) from DATAVAULT_CONNECTOR_STATEMENT_TIMEOUT_S. When it expires, the driver interrupts the call on the server and raises DPY-4024, which is never retried. Only a lost connection is retried (retries table below).
  • Row sample: up to DATAVAULT_SAMPLE_FULL_SCAN_MAX_ROWS rows, the first rows in primary-key order (or by the first non-LOB column); above that, the first rows Oracle returns, with no ORDER BY, so the whole table is not sorted. This connector has no hash sampling, checksums or HLL sketches: data-diff compares only the rows read by key, and a table above DATAVAULT_PROFILE_DISTINCT_MAX_ROWS gets no approximate distinct count from a sketch. It has no push-down SQL rules either.
  • The password never appears in error messages.

TLS: the connection is TCP without TLS. This version supports neither TCPS with a wallet nor Native Network Encryption, which oracledb only has in thick mode: a server that requires NNE refuses the connection with DPY-3001. Until then, connect over a private network (VPN, interconnect).

Full url: oracle+oracledb://user:pass@host:1521/?service_name=ORCLPDB1 or oracle+oracledb://user:pass@host:1521/SID, only with service_name, sid and connect_timeout (seconds, oracledb's tcp_connect_timeout). The driver is always oracledb in thin mode. The other oracledb.connect parameters stay out: config_dir and wallet_location read files from the server, https_proxy and protocol change the destination or the transport.

Out of scope: thick mode (Instant Client), TCPS and wallets, Kerberos/RADIUS, SELECT ANY TABLE, V$SQL/AWR (query lineage) and native SAMPLE (p) sampling.

Amazon Redshift (redshift)

AWS's data warehouse, on a provisioned cluster or a Redshift Serverless workgroup. The connector uses AWS's official driver (redshift_connector) with the sqlalchemy-redshift dialect and works in the production image ([redshift] extra).

Fields: host, port (5439), database, user and password. The host is the endpoint only, with no port or database:

  • provisioned cluster: <cluster>.<id>.<região>.redshift.amazonaws.com;
  • Serverless workgroup: <workgroup>.<conta>.<região>.redshift-serverless.amazonaws.com.

On connect, a host with a port, path, ?, @ or commas is refused, with an example endpoint in the message. The anti-SSRF guard validates the host when the connection is created and again at runtime. Authentication is by database user and password only: temporary IAM credentials (GetClusterCredentials, profiles, IdP) are out of v1.

Read-only user. Create a database user with only USAGE on the schema and SELECT on the tables to analyse:

CREATE USER datavault_reader PASSWORD '<password forte>';
GRANT USAGE ON SCHEMA public TO datavault_reader;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO datavault_reader;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO datavault_reader;
GRANT SELECT ON svv_table_info TO datavault_reader;  -- contagens de linhas sem COUNT(*)

Repeat the USAGE and the SELECT grants for each schema to analyse. Without SELECT on svv_table_info the connector still works, but tables get no catalogue count (see below).

Mechanical read-only. Besides the GRANTs, every connector transaction starts with BEGIN READ ONLY (the engine's begin listener). With autocommit off, redshift_connector opens a transaction itself before the first statement, and a BEGIN READ ONLY inside it would have no effect. So the connector closes that transaction with a rollback and runs BEGIN READ ONLY with autocommit on for that statement only. Inside the read-only transaction, Redshift refuses writes. This layer has not yet been proven against a real Redshift (see Validation status): the base guarantee is the GRANTs, so the user must not have more than the ones above.

What the connector does:

  • Discovery: the inspector's schemas except pg_catalog, information_schema and pg_internal. The dialect already hides the other pg_* schemas.
  • Push-down profiling: counts, nulls, distincts, min/max, mean and standard deviation (STDDEV_POP), zeros and negatives, text lengths (LENGTH). Quantiles come from NTILE(20), one column at a time: Redshift refuses several PERCENTILE_CONT with different ORDER BY in the same query, which is how the percentile batch asks for them.
  • Cheap metadata (automatic monitors): the count comes from SVV_TABLE_INFO, marked as an estimate (row_count_estimated). It is estimated_visible_rows or, without it, tbl_rows, which also counts the deleted rows that VACUUM has not cleaned up yet. Neither is a COUNT(*). An empty table, a view or a user without SELECT on SVV_TABLE_INFO gets no catalogue count. With stats_off at 10 or more (stale planner statistics), the log gets the redshift_stats_stale warning, with the table and the value.
  • Timeout: SET statement_timeout (ms) on each new connection, from DATAVAULT_CONNECTOR_STATEMENT_TIMEOUT_S, also with autocommit on for the SET only: inside a transaction, the ROLLBACK with which the pool returns the connection would undo it. A timeout is never retried. Only a lost, reset or refused connection is retried (retries table below).
  • Row sample: Redshift has no TABLESAMPLE. Up to DATAVAULT_SAMPLE_FULL_SCAN_MAX_ROWS rows, the sample is the first rows in primary-key order (or by the first orderable column); above that, the first rows Redshift returns, with no ORDER BY, so the whole table is not sorted. This connector has no hash sampling, checksums or HLL sketches: data-diff compares only the rows read by key, and a table above DATAVAULT_PROFILE_DISTINCT_MAX_ROWS gets no approximate distinct count from a sketch. It has no push-down SQL rules either.
  • By default, the session's application_name is the scan tag, which the DBA sees in STL_CONNECTION_LOG. An application_name in the url replaces it.
  • The password never appears in error messages. The connection test explains the most common failures: login refused, TLS verification failed and endpoint unreachable (check the endpoint, the port, public access or the VPC route, and the security group).

TLS: always on and always verify-full. The connector sets ssl=True and sslmode=verify-full over whatever the url brings. redshift_connector verifies the chain with the Redshift CA bundle it ships and the system CAs, and checks the hostname. So the host must be the cluster or workgroup endpoint that is on the certificate.

Network and VPC: BeryX connects to the endpoint over the internet, from the egress IP (see the top of this guide). In production, the anti-SSRF guard refuses destinations on private networks, and private connectivity is not available yet (REDE_ALLOWLIST.md). The cluster or workgroup must be publicly accessible, with the security group opening port 5439 to the BeryX egress IP. In a self-hosted BeryX, a private VPC endpoint is only reachable with DATAVAULT_ALLOW_PRIVATE_NETWORKS=true.

Redshift Serverless: the host is the workgroup endpoint, the port is 5439 by default and the database user is created in the workgroup with the same SQL as above.

Full url: redshift+redshift_connector://utilizador:password@host:5439/dev, with the database in the path, only with sslmode=verify-full and application_name. Any other parameter is refused with 422. The other sslmode values stay out: redshift_connector silently ignores an sslmode it does not know (require, disable), and verify-ca does not check the hostname. There is no connect_timeout either, because the driver's timeout is the socket timeout and would cut every read. The dialect must be redshift, and the connector always connects through redshift_connector, whatever driver the url names.

Installation: pip install "datavault-backend[redshift]" (sqlalchemy-redshift and redshift_connector). Without the extra, the connection test says how to install it.

Out of scope: temporary IAM credentials and IdP, an sslmode other than verify-full, hash sampling, checksums and push-down SQL rules.

Actual usage of tables (USAGEPRIO, card #686). The telemetry collection (POST /dashboard/finops/collect) reads the scan steps in SYS_QUERY_DETAIL (provisioned cluster and Serverless): the distinct queries per table and per day, without those of the BeryX user, counts only and table names from pg_class. It needs ALTER USER datavault_reader SYSLOG ACCESS UNRESTRICTED: without it each user only sees their own queries. If no reads by other users show up, the connection comes out of the collection as unavailable, with both possible causes (a cluster with no queries or the missing privilege), and the previous levels stay. That way the tables do not all become cold. The SYS views keep few days (about 7). So the average per day divides by the days the view shows, not by 30, and that is the window recorded. With so few days, no table becomes "unused" from them.

MongoDB (collections as datasets)

Each collection in a database is a dataset. MongoDB does not store a schema: BeryX infers it from a random sample of the collection and measures fields with mixed types and missing fields. Implementation in app/infra/connectors/mongodb.py.

Connection: uri or fields.

Mode Fields
uri mongodb://user:password@host1:27017,host2:27017/?replicaSet=rs0 or, on Atlas, mongodb+srv://user:password@cluster0.abcde.mongodb.net/
Fields host, port? (27017), user?, password?, auth_source? (admin)

In both modes: database (the database to read), collections? (a list; empty = the database's collections, up to 200, without system.*, views and time-series) and sample_size? (documents per sample: 1,000 by default, 10,000 at most).

TLS, in both modes: tls_mode? and ssl_ca_pem?, with the Postgres and MySQL rules (TLS). Without tls_mode, the connection is verify-full: encrypted, with the server's certificate and hostname verified against certifi's public CAs. An instance with a private CA takes the CA's PEM in ssl_ca_pem. Connecting without verifying the certificate (require) or without TLS (disable) needs explicit confirmation and is recorded in the audit log.

Only these options pass from the uri: authSource, replicaSet, tls (or ssl, which must match the tls_mode: a tls=false needs the disable tls_mode), readPreference, connectTimeoutMS, serverSelectionTimeoutMS and retryReads. The Atlas string carries retryWrites, w and appName, which are accepted and dropped. Any other option refuses the connection with 422, including tlsCAFile and tlsCertificateKeyFile (they read files on the server) and directConnection.

Read-only user. Create it in the admin database, with the read role on the database to analyse only:

// mongosh, connected as an administrator
use admin
db.createUser({
  user: "datavault_ro",
  pwd: passwordPrompt(),
  roles: [{ role: "read", db: "loja" }]
})

With the user in admin, the authSource is admin, the default of the fields mode. The read role covers everything the connector reads, $collStats included.

MongoDB Atlas:

  1. Database Access → Add New Database User: password authentication and the read privilege on the database to analyse only (or the Only read any database role).
  2. Network Access → IP Access List: add BeryX's egress IP. Without it, the connection times out ("Não foi possível contactar o MongoDB").
  3. Connect → Drivers: copy the mongodb+srv://… string into the uri field, with the password from step 1.

What the connector reads (official pymongo driver):

  • ping in the connection test, with the latency, and list_collection_names in discovery;
  • a random sample through aggregate([{"$sample": {"size": N}}]), for the columns and the profile. On a collection with a vector index, a $project that excludes the embeddings follows (see MongoDB vector indexes);
  • $listSearchIndexes, once per collection, for the vector indexes; if the instance does not have it, the read carries on without it;
  • estimated_document_count for the count, from the collection's metadata and without reading documents;
  • $collStats for the size; if the user cannot read it, the profile carries on without a size;
  • list_indexes and, for freshness, one find().sort().limit(1) tied to an index by hint: one per indexed field (up to 10; in the profile, only date fields) and another for _id. Each one reads the last entry of the index. Indexes where that does not happen are left out: partial, hidden, with a collation, and wildcard, text, hashed or geo indexes;
  • find().limit() for the rows the rules read.

It calls nothing else: tests/test_mongodb_connector.py wires the connector to a fake client that records every call and fails on any other. Every aggregate first goes through the check_read_only_pipeline guard, which refuses a stage other than $sample, $collStats, $listSearchIndexes and $project, a $project with an inclusion or expressions, and a stage out of place: the first three only at the head, $project only after them. The read preference is secondaryPreferred by default (reads go to a secondary when there is one), retryWrites is off and the sample, the count and the rows find have a 60 s cap on the server (maxTimeMS); each freshness read has 5 s.

Inferred schema:

  • columns = top-level fields, in the order they appear in the sample (up to 500), with _id first and always as text;
  • type = the type of most values. Integers and decimals (int, long, double, Decimal128) count as the same number: a field with both becomes float, with no conflict;
  • nested objects and arrays come in as JSON text, as in Kafka; subfields do not become columns.

Source metrics (source_metrics, kind: "mongodb"), per field in fields:

Key What it measures
types how many values of each type the sample had
majority_type the column's type
type_conflict_pct % of non-null values with another type (e.g. "12,50" in a numeric field)
missing_pct % of documents without the field
present, missing, explicit_null the counts behind the percentages
distinct how many distinct values the sample had, of every type

fields_with_type_conflicts lists the fields with conflicts. estimated_document_count, storage and newest_insert_at (the time of the most recent _id ObjectId) complete the metrics. The column metrics (min/max, mean, lengths) are those of the majority type, over the sample. null_count counts the documents without the field and the explicit null values; a value of another type does not count as null, it counts in type_conflict_pct. distinct_count counts the present values of every type, by type and value, like a MongoDB unique index: 1 and 1.0 are the same value, 1 and "1" are two. Nulls and distinct values thus share the same basis, and a fully distinct key with a few values in text does not show up with repeats in the unique rule.

Count and sample. row_count comes from estimated_document_count and the profile marks it as an estimate (row_count_estimated) and as sampled (sample_rows). When the sample reads the whole collection (fewer documents than sample_size), the count is exact and the profile is not sampled.

Freshness. In a sampled profile, the maximum of an indexed date field comes from the index, exact, and replaces the sample's maximum (the sample's value stays in exact_column_metrics). In the automatic monitors, last_modified is the most recent of those maxima and the time of the most recent _id ObjectId; dates more than 24 h in the future (deadlines, expiry dates) are left out. Without date indexes, the rules' freshness comes from the sample's maximum.

Security:

  • the uri never reaches the driver: mongodb_target, in app/infra/connectors/netguard.py, extracts hosts, credentials and options, and the connector opens the MongoClient with that result only;
  • every host goes through the anti-SSRF guard when the connection is created and again before every connection. On a mongodb+srv://, BeryX resolves the SRV record, refuses targets outside the cluster's domain and validates each target; from the TXT record it only takes authSource and replicaSet;
  • pymongo resolves each name through the guard (netguard.guarded_getaddrinfo, card #564): a single resolution per connection, refused if any address is internal, and the driver connects to the addresses of that resolution without going back to DNS. A name that switches to the internal network between validation and connection (DNS rebinding) never gets to open a socket. This applies to every connection the driver makes, monitoring included. TLS still verifies the certificate against the name. A pymongo older than 4.12 is refused, because it lacks the point where the guard goes in;
  • the members the replica set announces go through the same guard: the driver's monitoring only contacts them, without credentials, if the resolution passes; operations, and with them authentication, only go to the members the guard accepts (server_selector). If a member lands on a blocked destination, the connection is closed and refused;
  • local sockets are always refused, also with DATAVAULT_ALLOW_PRIVATE_NETWORKS=true: in the uri and the host, a path (/tmp/mongodb-27017.sock) or a host ending in .sock, with or without a port, which pymongo would connect to over a Unix socket without resolving the name; inside the driver, a .sock member announced by the replica set never gets to open a socket, not even in monitoring, which contacts it before the server_selector (card #602);
  • with verify-full, pymongo receives tlsCAFile with the certifi bundle or with the customer's CA, written to a temporary 0600 file that is deleted on close() (tls.mongodb_tls_args). The uri's tlsCAFile is still refused, because it would read a file on the server;
  • documents never go to the logs.

Out of scope: views and time-series collections, subfields as columns, change streams and X.509, LDAP or Kerberos authentication (authMechanism is outside the accepted options).

Salesforce

What you need: a user (ideally read-only), password and security token.

Step by step:

  1. Security token: while signed in → avatar → Settings → My Personal Information → Reset My Security Token — it arrives by email. (If the organisation uses trusted IP ranges, the token may not be required, but the connector always asks for it.)
  2. Recommended: an integration user with a read-only Permission Set on the objects to analyse.
  3. domain: login (production) or test (sandbox).

Wizard fields: username, password, security_token, domain.

Installation: pip install "datavault-backend[salesforce]"

Known limitations: the MVP exposes the Account, Contact, Lead and Opportunity sObjects; basic profiling (counts via SOQL, no per-column metrics); it consumes the org's API calls.

Error messages (card #611). The connection test message goes to the connection's last error. When no object in the scan is analysed, the connector's last error goes to the scan's error. Workspace members see both. simple-salesforce puts the requested URL and the response body in the error, so these messages go through the SQL connectors' filter (card #590): the value of the password, the security_token and the open session's token comes out as ***. The password also comes out like that in the form the login sends it, escaped with html.escape (an & becomes &amp;). Proof: backend/tests/test_salesforce_connection_redaction.py.

Permission parity with the warehouse (card #817). It is part of the “AI & Data Security” add-on, like card #786. An admin declares who a registered agent is on each connection: its Salesforce username and its role or user in the warehouse (PUT /data-security/agent-principals). POST /data-security/agent-parity then reads, over SOQL, only configuration objects and never records: User, PermissionSetAssignment (the permission sets, the profile's included, and “View All Data”), ObjectPermissions (reading the object and “View All”), FieldPermissions (FLS) and EntityDefinition.InternalSharingModel (the organisation-wide sharing default). The object's describe says which fields have FLS. For each object linked by lineage to a warehouse table, it compares this with the latest warehouse grants snapshot (card #786). The warehouse is a PostgreSQL, Snowflake, BigQuery or Databricks connection. GCS and S3 buckets are left out, because their snapshot is the IAM of the whole bucket and does not say who reads each table. The verdict is warehouse_wider when the agent's role reads the table and, in Salesforce, the agent does not read the object, does not see every record (private OWD and no “View All”) or FLS hides fields that the warehouse has as columns. It is source_wider in the opposite case, but only when the snapshot proves that the warehouse denies access. A row for the agent's role proves the read. Its absence only proves a denial in a snapshot without limits, such as the PostgreSQL and Snowflake ones. The BigQuery and Databricks snapshots are a minimum: in BigQuery the bindings inherited from the project, the folder and the organisation are left out, in Databricks whatever the connection's principal cannot see, and in both the group members (the codes are in each one's section). An agent without a row in these snapshots gets unknown, and the pair says why in warehouse.limitations, with the codes of GET /data-security/source-grants. In BigQuery, the principal is declared with or without the member type in front (serviceAccount:, user:). The verdict is also unknown when the Salesforce read stops at the first 500 permission sets (source.truncated) and does not open the whole object, or when the only possible difference is fields hidden by FLS and the catalogue does not have the warehouse table's columns. Which records the sharing rules open to the agent is not computed: with a private OWD it sees a subset, and the response says so (sharing_rules_not_resolved). The describe runs with the connection's credential and only returns the fields it can see (fields_visible_to_connection_only). The response gathers in limitations the limits of the compared connections, on both sides. Principal names reach the logs and the audit trail only pseudonymised. The connection's user needs to read those configuration objects, which a profile with “View Setup and Configuration” grants. On the agent page (card #1071), the “Permissions across systems” section shows an admin who the agent is on each connection and what is missing for the comparison (GET /compliance/ai-agents/{agent_id}/permission-parity, without reading any source), and compares that agent only (POST …/permission-parity/check). Each unknown pair says why in unknown_reason. Proof: backend/tests/test_agent_permission_parity.py.

CSV

What you need: a local (or mounted) directory with .csv files — each file is treated as a table.

Wizard fields: path (directory).

Installation: works without extras (stdlib); pip install "datavault-backend[csv]" adds pandas to split the text faster. The types are the same with and without pandas.

How the file is read (card #289, in app/infra/connectors/csv_file.py):

  • Encoding: the BOM decides first (UTF-8 or UTF-16, Excel's "Unicode Text"). Without a BOM, it tries utf-8 → cp1252 → latin-1. A latin-1 file whose only non-ASCII characters are accented letters is also valid cp1252 and is reported as cp1252, with the same text.
  • Delimiter: decided by csv.Sniffer over the first 64 KiB, only among , ; tab and |. When there is no verdict (a single-column file), it stays ,. The encoding and the delimiter are kept in the table profile (file_format, e.g. {"delimiter": ";", "encoding": "cp1252"}).
  • Types: the coercion is BeryX's, not pandas' (app/infra/connectors/profiling.py). A value only becomes an integer if it has no leading zeros ("0" yes, "08001" no), so postcodes, SKUs, NIF (Portuguese tax number) and phone numbers stay text. Only the unquoted empty field is NULL: N/A and - are values and stay visible in the profile. As in Postgres' COPY … CSV, an unquoted empty field is NULL and a quoted "" is empty text (empty_count), on Python 3.12 or later (the Docker image uses 3.13; on 3.11 the reader cannot tell them apart and both count as NULL); in a file whose header is fully quoted and that has no unquoted empty field, the writer quoted everything and "" counts as NULL. In a numeric, date or boolean column, '' is always NULL (app/infra/connectors/csv_file.py, parse_csv_lines and coerce_table). GCS/S3 read CSV files with the same reader. NaN/inf in a numeric column count as float, with nan_count kept separate from nulls. Dates only in ISO-8601, and either all with a time zone or all without; a column that mixes the two stays text, because no time zone is inferred. The literals true/false (True, TRUE…) are booleans.
  • Caps: the profile reads up to DATAVAULT_CSV_PROFILE_MAX_ROWS rows (1,000,000) and DATAVAULT_CSV_PROFILE_MAX_BYTES bytes (256 MB). Beyond that, the profile covers the first rows and states sampled and sample_rows (the UI shows "profile on a sample of N rows").
  • Row sample (row rules, duplicates; card #317): one row in every k of those the profile reads, starting from semente mod k — it spreads across the part of the file that is read instead of staying in the first 5,000.

Known limitations: Portuguese decimals (1.234,56) and dd/mm/aaaa dates stay text (no locale is inferred; the profile's format mask describes them). Numbers with more than ~16 significant digits lose precision (float). In a CSV an empty string cannot be told apart from NULL. The case-by-case detail is in the adversarial corpus.

Excel (.xlsx/.xlsm in the file connectors)

It is not a connector type: the csv, gcs, s3, adls and sftp connectors also read .xlsx and .xlsm files. Each worksheet is a dataset named <ficheiro>.xlsx#<folha> (e.g. vendas.xlsx#Vendas; in buckets, with the relative path in front, as for CSV). Hidden sheets are included and the profile says hidden; chart sheets have no cells and are left out. Implementation in app/infra/connectors/excel_file.py.

Installation: pip install "datavault-backend[excel]" (openpyxl and defusedxml; the Docker image already has it). Without the extra, Excel files show up in discovery and are left out with the warning "instala datavault-backend[excel]" in the note; the connection's other files are still read.

How the sheet is read:

  • Values: openpyxl opens the workbook with read_only=True (rows are streamed and reading stops at the row cap) and data_only=True, that is, with the value Excel calculated the last time it saved each formula.
  • Formulas without a cached value: a workbook generated by code that Excel never opened stores formulas without a result. Those cells count as nulls and the profile adds them up in formula_cells_without_cache (in source_metrics, per column and with a warning). Opening the file in Excel and saving it again stores the values.
  • Header: the first non-empty row. An empty header cell takes the name of the column to its left (a header merged over several columns) and repeated names get _2, _3 (Valor, Valor_2). With no name to the left, or after the last column with a header, the name is the column letter (A). A column with no name and no value at all is left out: a stray cell in XFD3 gives one column, not 16,384 empty ones. A sheet with more than 1000 columns with a name or values comes in with only the first 1000, with a warning in the profile.
  • Types: cells already carry Excel's type (number, date, boolean, text) and go through the same coercion and the same profile as the CSV connector. A decimal with a Portuguese format (#,##0.00) is a number and a dd/mm/aaaa date is a date, because the format only changes how it is displayed. A number stored as text (1.234,56) stays text, as in CSV. Cells with a formula error (#N/A, #REF!…) are values and go to error_cells.
  • Caps: the CSV connector reads up to DATAVAULT_CSV_PROFILE_MAX_ROWS rows per sheet and buckets and SFTP up to 100,000. Beyond that the profile covers the first rows (sampled) and the row_count is what the sheet declares in its <dimension>, flagged row_count_estimated (it counts formatted empty rows).

Memory guard: an .xlsx is a zip, so its size is checked before opening it. A file above 50 MB is left out with a warning in discovery. For the parts openpyxl reads whole (shared strings, styles), the cap is 256 MB uncompressed, going by the size the zip declares, and a part that expands more than 500 times above 64 MB is refused as a zip bomb. With defusedxml, an XML with entity declarations is refused, something Excel never writes.

Known limitations: .xls (Excel 97–2003, binary) is not read and stays out of discovery: save it as .xlsx. Formulas that depend on other workbooks (keep_links) are not followed, only the cached value counts. The lock file Excel leaves next to a workbook open on a share (~$vendas.xlsx) stays out of discovery. In the document connectors (SharePoint, Google Drive) Excel files stay out: a spreadsheet is not a document corpus. The document analysis counts them among the formats it does not read.

Google Cloud Storage / Amazon S3 (files as tables)

Data lake in object storage. Each *.parquet, *.csv or *.csv.gz file under bucket/prefix is a table, named after its path relative to the prefix (without the extension), and so is each sheet of an *.xlsx (Excel). Event and log files (*.jsonl, *.ndjson, *.log and the same in .gz) are tables too, with one line per event (see below). CSV files are read as in the CSV connector: encoding and delimiter from the start of the file (64 KiB), dtype=str in pandas and the same type coercion. The same file gives the same profile on disk and in a bucket. Parquet files keep their native types. Text columns are called text in this connector. Shared implementation in app/infra/connectors/object_storage.py (fsspec).

Credentials always explicit (A2): either the customer's credential, or anonymous: true for public buckets. Without either, the connection is refused: BeryX never uses the server's own credentials (Cloud Run ADC, boto chain). anonymous must be a boolean ("false" as text is refused).

Google Cloud Storage — on the customer's side:

  1. In the Google Cloud console: IAM & Admin → Service Accounts → Create service account (e.g. datavault-reader), with no project-level roles.
  2. On the bucket: Permissions → Grant access to the service account with Storage Object Viewer (roles/storage.objectViewer), which lists and reads objects and writes nothing.
  3. On the service account: Keys → Add key → Create new key → JSON.
  4. In the wizard: bucket (without gs://), optional prefix (e.g. gold/vendas) and the full content of the JSON in the "Service account JSON" field (it is sent as service_account_info). For a public bucket, tick "Anonymous access" and leave the key blank.

With credentials, step 2 of the new connection shows the Google Cloud Registration guide and the Test access button (see the BigQuery section).

Amazon S3 (and compatible services) — on the customer's side:

  1. A read-only IAM user (or role with access keys), with a policy along these lines:
    {
      "Version": "2012-10-17",
      "Statement": [
        {"Effect": "Allow", "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::<bucket>"},
        {"Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::<bucket>/<prefixo>/*"}
      ]
    }
    
  2. Security credentials → Create access key → access_key_id and secret_access_key.
  3. In the wizard: bucket, optional prefix, the two keys (or "Anonymous access" for public AWS Open Data buckets), optional region (e.g. eu-west-1) and optional endpoint_url for S3-compatible services (MinIO, Cloudflare R2, …).

Fields: bucket, prefix?, max_files? (200 by default) and the credentials above. protocol is not configurable: a gcs connector only speaks gcs/gs and an s3 one only s3 (without this, file or http would give local reads or SSRF).

Installation: pip install "datavault-backend[gcs]" or pip install "datavault-backend[s3]" (both are in the production image). PDFs for document analysis also need the [documents] extra; scanned PDFs (with no text layer) need the [ocr] extra and the system's Tesseract (all three are in the production image).

Who reads the bucket (card #789). It is part of the “AI & Data Security” add-on, like reading the grants of databases (see BigQuery). POST /data-security/source-grants/collect (admin) reads the permissions of the bucket itself, only with GET requests through the http_guard (anti-SSRF guard and response cap), and never changes them. A binding on the bucket applies to every dataset of the connection. It needs privileges beyond reading the files:

  • GCS: storage.buckets.get (public access prevention, iamConfiguration.publicAccessPrevention) and storage.buckets.getIamPolicy (the bindings), granted to the service account on the bucket, for instance in a custom role. With prevention enforced, allUsers and allAuthenticatedUsers do not count; with inherited they count, because BeryX does not read the organization policy.
  • S3: s3:GetBucketPublicAccessBlock, s3:GetBucketPolicyStatus, s3:GetBucketAcl and s3:GetBucketPolicy on arn:aws:s3:::<bucket>, in requests signed with SigV4. The AllUsers and AuthenticatedUsers groups of the ACL are public, unless IgnorePublicAcls is on; the policy's * is public when S3 says the policy is public and the bucket does not have RestrictPublicBuckets. A wrong region is retried once with the region S3 gives.
  • Anonymous access: no requests. If BeryX reads the bucket without credentials, anyone can read it, and the public principal (allUsers/AllUsers) goes into the snapshot.

What is not on the bucket itself stays out: the Google project, folder and organization IAM, the IAM policies of the AWS account's identities, the AWS account's public access block and the ACLs of each object. An Allow statement counts whatever its conditions, and a Deny does not take access away: the snapshot shows too much access, never too little. A dataset with personal data in a bucket anyone can read opens a “Personal data in a public bucket” deviation in the RoPA drift.

Known limitations:

  • Discovery lists at most max_files files (200 by default), in alphabetical order of path. Parquet/CSV files take the cap first and event and log files only after them, so a new .log never takes the place of a dataset already in the catalogue. An event file with the name of a Parquet/CSV file (app.jsonl next to app.csv) is left out; between two event files with the same name (app.jsonl and app.jsonl.gz) the first in alphabetical order stays.
  • The profile reads the first 100,000 rows of each file (for a Parquet file, only the pages that hold those rows). The column metrics (nulls, distinct values, mean, deviation, samples) come from that sample, not from the whole file, and the profile says sampled/sample_rows when the file went on further — each column carries from_sample (the UI shows "profile on a sample of N rows"). It profiles at most 120 columns (DATAVAULT_PROFILE_MAX_COLUMNS), chosen by the wide-table priority; the catalogue keeps all of them.
  • The row_count is always for the whole file, even in a sampled profile: the row_count_min rule, the volume monitor and the row_count_drop drift see the real number. Parquet: num_rows from the footer, without reading data; when every row group has statistics, the nulls (any type) and the min/max (integers, floats, timestamps and dates) of each column become exact and the column lists them in exact_metrics — strings keep the sample's min/max (writers truncate those statistics). CSV/CSV.GZ: a second streaming pass (csv.reader; cells with line breaks inside quotes count as one row) up to DATAVAULT_OBJECT_STORAGE_COUNT_MAX_BYTES (512 MB, measured on every read in the file's bytes and, for a .gz, also in the decompressed bytes — a highly compressible .gz expands thousands of times and the count stops at the first measurement that passes the ceiling, even in the middle of a row); above that the count is extrapolated from the observed ratio (rows counted × file size ÷ file bytes consumed — for a .gz, the compressed bytes that the inflate consumed) and the profile says row_count_estimated (the UI shows "estimated row count"; the volume drift says so in its description). Files that the sample reads whole get no second read; a truncated or corrupt .gz, or a cell over 64 Mi characters, after the sample does not fail the profile (the count stops there and stays estimated). The count raises the field limit of the worker's csv module to 64 Mi characters (process-wide; it stays raised). Note: in Parquet float columns pandas merges NaN with NULL in the sample — with statistics in the footer, null_count counts only NULL.
  • Distinct values, the mean, zeros and value samples still come from the sample. So anything that compares them with the volume uses the rows read, not the whole file's row_count. That is the case for a column's unique rule, key suggestions, the profile's alerts and semantic types, the synthetic data generator and the rule estimate in the browser. In a Parquet file with exact nulls from the footer, the column keeps the sample's nulls in sample_null_count. Without this basis, a unique key in a file over 100,000 rows showed up full of repeats (method).
  • A CSV that is ASCII in the first 64 KiB and cp1252 further on fails on read with the pandas message, instead of silently swapping characters.
  • Parquet and CSV files over 2 GB are refused at profiling ("Partition the source"). Event and log files have no such cap: they are streamed only up to the line cap.
  • The sample of a CSV or .csv.gz also stops at 32 MiB of text and at 5 million cells (rows × header columns: the 100,000 rows fit up to 50 columns). For a .gz the 32 MiB are counted after decompression, because the 2 GB cap is on the file in the bucket and a highly compressible .gz expands far beyond it. Above either cap the profile says sampled and the row_count comes from the second pass. A first line over 32 MiB is not a header and that file's profile fails.
  • The sample of a Parquet file has the same caps of 32 MiB and 5 million cells, counted on the values once expanded. Above a cap the profile says sampled and the row_count comes from the footer.
    • Column groups: pyarrow only holds the pages and dictionaries of the columns it is reading. So the columns are read in groups, one at a time and with the same rows, and each group fits in the page, dictionary and batch caps below. A group joins adjacent columns, and the leaves of a struct, list or map stay in the same one. A wide table gives more groups, not an error. If a column's name does not let pyarrow read it alone (a repeated name, or "a.b" next to a struct "a" with a child "b"), the file is read in a single group.
    • Pages: before anything is decompressed, the pages a group will read must fit in 128 MiB. What counts is the compressed and decompressed bytes their headers declare, plus 1 KiB per page. In a nested column, 16 bytes per value count too. In a dictionary page, what counts is the bytes pyarrow allocates for each declared entry: 20 for text, plus a copy of the values. The footer total does not count, because pyarrow does not check it against the pages.
    • Nested columns (lists, maps, embeddings): the rows of each page are counted from the repetition levels, so a large row group only weighs the pages of the first rows.
    • Plan: to decide the rows, the sample keeps what it read from the page headers and, in a nested text or FIXED_LEN_BYTE_ARRAY column, where each row starts. For each column it keeps at most 5 million divided by the leaf columns, in pages and in rows. With such a nested column, the sample's cells count by leaf columns (a struct with 40 text lists counts as 40 columns). A column with more pages than that (one-row pages) stops at the rows of those pages. The plan walks at most 65,536 column chunks (row groups × leaf columns): with row groups of few rows, the sample keeps the ones that fit. All of this leaves memory before pyarrow reads.
    • Text: read as a dictionary. A highly compressible column (a single dictionary value repeated on every row) stops at 32 MiB instead of expanding in the worker's memory. Only the rows that fit go back to the file's type.
    • Dictionaries: reading text as a dictionary adds a pyarrow hash table, with up to 160 bytes per dictionary entry and per value of a PLAIN page. The columns of a group add up under a cap of their own, 128 MiB. A column that passes that cap alone is read without a dictionary (in a struct, the heaviest leaf). If the Arrow schema stored in the file declares the column as a dictionary, pyarrow always reads it that way, and the file is refused.
    • Batches: each batch pyarrow reads from a group fits in 32 MiB counting what the values take once decoded. A fixed-width value (FIXED_LEN_BYTE_ARRAY) takes its width even when it comes from a dictionary. Text that pyarrow does not read as a dictionary counts by the largest value in its dictionary or the largest DELTA_BYTE_ARRAY page. That is the case for DELTA_BYTE_ARRAY and DELTA_LENGTH_BYTE_ARRAY pages (what Parquet v2 writers produce), for the Arrow JSON extension, for a DECIMAL in BYTE_ARRAY and for the columns over the dictionary cap. In a nested column, it counts for every value in the row.
    • When it fails: that file's profile fails, naming the column, if a column's first row does not fit alone in a group: pages over 128 MiB, or a row that can pass 32 MiB once decoded. It also fails if the first row passes 32 MiB summed over the columns, if the schema declares a row wider than 32 MiB, if a column has a type whose size the sample cannot measure or if the dictionaries the stored schema declares in a column pass 128 MiB. Without pyarrow, reading fails too, instead of loading the whole file.
  • Parquet footer: before reading data, pyarrow reads the whole footer, at hundreds of bytes per schema field and per column chunk (row group × leaf column), and the 2 GB cap does not limit it: 20,000 row groups × 60 columns take 1.1 GiB. So the footer is walked first, without pyarrow (parquet_footer.py), and what pyarrow would allocate must fit in 128 MiB: 2 KiB per schema field, 1 KiB per column chunk and 16 bytes per byte of the file's key_value_metadata, where the Arrow schema that pyarrow decodes is stored. A footer with a list that declares more elements than it holds, or elements of another type, is refused, because pyarrow reserved the whole list by its declared size. Above the cap, that file's sample and row count fail, with the column chunks and schema fields counted up to there. Then pyarrow reads the footer from the bytes that were walked and does not request it from the bucket again, which could return a different one. An encrypted footer (PARE) is refused, because the reader does not decrypt it.
  • No cheap automatic monitors: there is no catalogue metadata. Freshness comes from the file's first temporal column.
  • Each scan makes GET requests and transfers data from the bucket, and the cloud provider charges for them.
  • The S3 endpoint_url goes through the anti-SSRF guard. In the SaaS it must be a public endpoint; a MinIO on a private network is only reachable when self-hosted with DATAVAULT_ALLOW_PRIVATE_NETWORKS=true.

Event and log files (card #183): .jsonl, .ndjson, .log, .jsonl.gz, .ndjson.gz and .log.gz (archived webhooks, access logs, application logs). Each line is an event, read in this order: JSON, syslog (RFC 5424 and RFC 3164), nginx/apache (combined and common) and logfmt key=value (at least two pairs). A line that fits none of them counts as malformed, with the reason (invalid_json, not_an_object, unparseable, line_too_long above 1 MiB). Logs in the default format of Python's logging or of log4j (2026-10-09 10:00:00,123 INFO app: …) fit none of them: every line counts as unparseable and the max_malformed_pct rule always fails. To measure them, the application has to write its logs as JSON or logfmt. A timestamp that falls outside the years 1 to 9999 in UTC (9999-12-31T23:59:59-03:00, for example) or carries an offset of 24 hours or more does not make the line malformed: the event counts, without a readable timestamp. In an access log the date is part of the format, so such a date makes the line count as unparseable. The columns come from the event keys, as in a Kafka topic: the first 1,000 distinct keys, in the order they appear (columns_capped says whether there were more). Cloud Logging exports to GCS are .json files and are not read: a .json file in a bucket may hold one event per line or a whole document. Implementation in app/infra/connectors/event_files.py.

  • Reading: the first DATAVAULT_LOGFILE_MAX_LINES lines (50,000 by default), in 64 KiB blocks and with .gz decompressed as a stream: the file is never held whole in memory. Reading also stops at 256 MiB decompressed or after 30 s. If the file went on, the profile says sampled and the line count is extrapolated from the bytes read (row_count_estimated). A .gz truncated after lines were read does not fail the profile: reading stops there.
  • Metrics (source_metrics with kind: "logfile"): dominant format, lines read, % malformed and reasons, % of lines with a readable timestamp, % of line pairs in chronological order, largest gap between events (seconds), distribution by level (debug, info, warning, error, critical and other for a level that is not recognised), number of distinct key sets (more than one points to a schema change between app versions), the 20 most frequent message templates with the count of each and pii_kinds, the number of messages with each kind of personal data (email, NIF with a valid check digit, Portuguese IBAN and mobile number, payment card passing Luhn).
  • Templates: a template is the message with digits → <n>, UUID → <uuid>, hexadecimal → <hex>, IP → <ip> and email → <email>. People's names and the rest of the text stay as they are: "Pagamento recusado para Maria Santos" is left unchanged. With real samples in prompts (the default mode), the root-cause diagnosis sends the templates to Claude, like the column samples. With synthetic samples, the AI gets only the counts, without the text.
  • Rules: the stream rules apply as in a topic (max_malformed_pct, max_event_age, required_fields). max_event_age and the dataset's freshness use the most recent event in the lines read. In a file larger than the read cap, those are the first lines, and a file that grows at the bottom looks older than it is (the same happens with a CSV). Onboarding suggests max_malformed_pct at 1%. schema_conformity does not apply: a file has no registered schema.
  • Personal data: when messages carry personal data, the scan opens a log_pii automatic monitor issue (warning) with only the counts per kind. Once marked "ignored", it does not reopen on that dataset.
  • UI: the dataset detail shows the "Log file" panel with the metrics, the levels as bars and the template table.

Documents in the same bucket: PDF, DOCX, TXT, MD and HTML files under the prefix are not tables. They go through document analysis (Documents button, UNSTR), with a ceiling of 50 MB per document. .doc, .pptx, .odt, .rtf, .epub and the other formats that the analysis does not read yet are counted by format in the listing, without opening them, and the corpus says how many were left out without taking them off the score (formats counted and not read). .xlsx and .xlsm stay out of the count because here they are tables; .xls and .xlsb are counted. SFTP and ADLS follow this rule.

Scanned PDFs (local OCR, card #418): a PDF with no text layer goes through OCR in the worker (the image's Tesseract 5, Portuguese, English and Spanish), page by page, with a page ceiling (DATAVAULT_DOCUMENTS_OCR_MAX_PAGES, 50) and a per-document deadline (DATAVAULT_DOCUMENTS_OCR_TIMEOUT_SECONDS, 180 s), within a per-scan budget (DATAVAULT_DOCUMENTS_OCR_SCAN_BUDGET_SECONDS, 3 h). The document is marked with the method and the average confidence, and the corpus opens the problem "N documents read by OCR". OCR is local: the document does not leave the installation, and nothing is written back to the bucket. This applies to every document source (GCS, S3, SharePoint, Google Drive, Confluence). Without OCR installed, the PDF stays out of the index with "needs OCR" (method).

Images in the same bucket (card #182): with include_images: true on the connection (the "Include images in the document analysis" box in the wizard; off by default), JPEG, PNG, WebP, GIF, TIFF and BMP files also go through document analysis. This applies to GCS, S3, SharePoint and Google Drive. Each image is profiled in the worker with Pillow only, no GPU and no LLM: format, width × height, corrupt or truncated file, EXIF (whether there is GPS, the capture date and the device make and model, never the serial number), SHA-256 and a 64-bit dHash. The corpus gets an images block with exact duplicates (SHA-256) and near duplicates (dHash within DATAVAULT_IMAGE_NEAR_DUP_HAMMING bits, 8 by default), formats, resolutions, % with GPS, % corrupt and the age by EXIF against the file date. It opens the problems image_corrupt, image_near_duplicates and image_gps_pii. A photo with GPS coordinates is personal location data, so the open or acknowledged problem blocks readiness for RAG and for training, also in the data policy's min_ai_readiness rule. An image above DATAVAULT_IMAGE_MAX_PIXELS (50 MP) is not decoded and is marked "too large". Pixels and EXIF text do not go to the database, the LLM or the logs, and the dataset's "Images" section shows metrics only, with no thumbnails. Without the [images] extra (Pillow, which the production image already has through the [ocr] extra), images count as not analysable and the scan still completes. Images and documents share the limit of the analysis request (200 by default, up to 1000). On GCS and S3, the cut follows the alphabetical order of the paths; on SharePoint and Drive, the listing order. To keep images from pushing documents out, raise the limit or point the prefix at a folder with images only.

Azure Blob Storage / ADLS Gen2 (files as tables)

Data lake in Azure: Blob Storage and ADLS Gen2 (accounts with a hierarchical namespace), including the storage account of a Synapse workspace and the external locations of Databricks on Azure. The adls connector (AdlsConnector in app/infra/connectors/object_storage.py) is the GCS and S3 code on top of adlfs, with the fsspec protocol abfs. The container plays the bucket: each Parquet, CSV or .csv.gz file under container/prefix is a table, and so is each sheet of an .xlsx (Excel). Event and log files, documents (PDF, DOCX, TXT, MD, HTML), OCR, images (include_images) and limitations follow the GCS and S3 section.

One credential, always explicit (A2). The connection carries exactly one of these: the account key (account_key), a SAS token (sas_token), a service principal (tenant_id + client_id + client_secret) or anonymous: true for public containers. With none, or with two, creation is refused with 422. BeryX never uses the server's credentials. adlfs always receives anon=True, so without a credential it stays anonymous and never falls back to DefaultAzureCredential (managed identity, Azure CLI, environment variables). The connector refuses to connect if the server has an AZURE_STORAGE_* variable set that adlfs would read instead of the connection's credential, such as AZURE_STORAGE_CONNECTION_STRING. Error messages give only the names of fields and variables, never the value.

Service principal (recommended) — on the customer's side:

  1. In Entra ID: App registrations → New registration (e.g. datavault-reader) and, under Certificates & secrets, a client secret with an expiry date.
  2. On the container: Access Control (IAM) → Add role assignment → Storage Blob Data Reader for the app. The role lists and reads blobs and writes nothing. Assigned on the container, not the account, the app does not see the other containers.
  3. In the wizard: the storage account (account_name, the part before .blob.core.windows.net), the container, the optional prefix and, under «Service principal (Entra ID)», the ID of the tenant, the application ID and the secret.

SAS token: generate it on the container (Shared access tokens) with only the Read and List permissions and an expiry date, and paste the token (it starts with sv= and includes sig=), not the URL. When it expires, the connection test and the scans fail until you paste a new one.

Account key: it works, but the key gives full access to the account, writes included. The connector only reads (find, info and open('rb')); a service principal or a SAS limit what a leaked credential allows.

Public container: «Acesso anónimo» (anonymous access), for containers with the Container access level. The «Feriados públicos — Azure Open Datasets» preset uses it.

Sovereign clouds: endpoint_suffix accepts core.windows.net (the default), core.usgovcloudapi.net (Azure US Government) and core.chinacloudapi.cn (Azure China, 21Vianet), and refuses anything else. The host is always <account_name>.blob.<endpoint_suffix>, and the service principal asks the Entra ID of the same cloud for the token.

Azurite (development and CI): endpoint_url (e.g. http://127.0.0.1:10000/devstoreaccount1) points the connector at the emulator. It is accepted only with DATAVAULT_ALLOW_PRIVATE_NETWORKS=true; in production it is refused with 422. With endpoint_url, the credential is the key, the SAS or anonymous access.

Fields: account_name, container, prefix?, max_files? (200 by default), include_images?, endpoint_suffix? and one credential; in OneLake, onelake_url and the service principal instead of the account, the container and the prefix. protocol is not configurable: abfs, abfss and az are ignored (the connector always speaks abfs) and any other value is refused.

Installation: pip install "datavault-backend[adls]" (adlfs, which brings azure-storage-blob and azure-identity, plus pandas and pyarrow). It ships in the production image. Without the extra, the connector answers with the pip instruction.

Microsoft Fabric OneLake: OneLake speaks the ADLS Gen2 and Blob Storage APIs on its own host, the same for the whole tenant: the account is always onelake, the container is the workspace and the path starts at the item, as in <lakehouse>.Lakehouse/Tables (Microsoft Learn, "Connecting to Microsoft OneLake", read on 2026-10-29). adls reads it without the ODBC driver of the fabric connector, so it works in the production image (AdlsConnector with app/infra/connectors/onelake.py).

  1. In Entra ID, the same app registration of a service principal (step 1 above). OneLake only accepts Entra ID tokens: there is no account key and no anonymous access.
  2. In Fabric, the tenant admin turns on Users can access data stored in OneLake with apps external to Fabric (OneLake tenant settings, read on 2026-10-29).
  3. Give the app read access to the item, and only that: share the lakehouse with the ReadAll permission (the DefaultReader role of OneLake security gives it read access to the data) or add it to the workspace as Viewer with a OneLake security role that reads the tables. The Contributor, Member and Admin roles also write (Data security in OneLake, read on 2026-10-29).
  4. Create the connection through the API: the new connection wizard does not have the onelake_url field yet and asks for the account and the container. The request is POST /api/v1/connections with {"name": "…", "connector_type": "adls", "config": {"onelake_url": "…", "tenant_id": "…", "client_id": "…", "client_secret": "…"}}. onelake_url takes the ABFS URL of the folder (in Fabric, the folder's Properties), for example abfss://<workspace>@onelake.dfs.fabric.microsoft.com/<lakehouse>.Lakehouse/Tables; the https://onelake.dfs.fabric.microsoft.com/<workspace>/<lakehouse>.Lakehouse/Tables form also works. The ABFS URL does not accept spaces in the workspace name: in that case use the GUIDs of the workspace and of the item (OneLake requires both), as in abfss://<workspace-guid>@onelake.dfs.fabric.microsoft.com/<item-guid>/Tables. Both are in the portal URL.

The host of onelake_url must be exactly onelake.dfs.fabric.microsoft.com or onelake.blob.fabric.microsoft.com: lowercase, no port, no trailing dot and nothing before or after it. The regional endpoints (<region>-onelake…) and any other host are refused with 422. The connector always connects to onelake.blob.fabric.microsoft.com, a constant in the code, and never to the text the customer wrote. The anti-SSRF guard validates that host before the token is requested. With onelake_url, the fields account_name, container, prefix, endpoint_suffix, endpoint_url, account_key and sas_token are refused: the account, the workspace and the folder come from the URL.

Data residency: the connector always uses the global endpoint. Microsoft warns that, with the global endpoint, the data of a workspace in another region can leave that region during endpoint resolution, and points to the regional endpoint (https://<region>-onelake.dfs.fabric.microsoft.com) for those who need to keep it in the region (Microsoft Learn, "Connecting to Microsoft OneLake", "Data residency" section, read on 2026-10-29). BeryX does not accept the regional endpoints yet: a customer with that requirement, in the EU for example, should know this before connecting OneLake.

Delta tables (OneLake only): a directory with _delta_log/ is one dataset, named after the directory (Tables/vendas gives Tables__vendas); the Parquet files inside it are no longer separate datasets. The connector reads the log, from the latest checkpoint, and uses only the active files of the latest version. Files already removed and not yet deleted by VACUUM are left out (app/infra/connectors/delta_log.py). Partition columns come from the log, in the schema type. The row count adds up the numRecords of each file's statistics and, where they are missing, reads the Parquet footer (app/infra/connectors/delta_tables.py). The sample reads the active files in path order and has the limits of a standalone Parquet, 32 MiB and 5 million cells, for the whole table: each file is read with what the previous ones left, and partition columns count as cells. The profile says file_format = {"format": "delta", "version": "<N>"}. Standalone Parquet, CSV and Excel files (in Files/, for example) are read as in the other accounts.

The connector refuses, with a message, a table it cannot read without giving wrong rows:

  • Delta reader above version 3;
  • reader features other than columnMapping, deletionVectors, timestampNtz and vacuumProtocolCheck;
  • column mapping in the name or id modes;
  • active deletion vectors (run OPTIMIZE on the table, or read it through fabric, which needs the ODBC driver and is not in the production image);
  • v2 checkpoints (with a UUID in the name);
  • a log file outside the table directory;
  • more than 150 thousand active files, a checkpoint with more than 384 MiB uncompressed in the columns the connector reads, more than 256 MiB of commits after the latest checkpoint, or more than 1000 commits. The log is read in batches and line by line, and these limits bound the memory the read takes in the worker; the message asks for an OPTIMIZE or a checkpoint on the table (app/infra/connectors/delta_tables.py).

A file that disappears between reading the log and reading the data, as after a VACUUM, gives a transient error, and the next scan reads the new version. The test against a real Fabric has not been done yet: the proofs use an in-memory OneLake and a fake transport (backend/tests/test_onelake_connector.py).

Synapse: in a Synapse workspace, point adls at the storage account of the workspace and at the file system holding the files; the SQL pool tables are read through mssql.

Network: an account with a firewall (Networking → Enabled from selected virtual networks and IP addresses) must accept BeryX's egress IP (see the top of this guide).

SFTP (partner and bank file drops)

Banks, logistics partners, insurers and EDI networks deliver files into an SFTP folder. The sftp connector (SftpConnector in app/infra/connectors/sftp.py) reads that folder with the GCS and S3 code, on top of the fsspec protocol sftp (paramiko). The root_path folder plays the bucket: each Parquet, CSV or .csv.gz file under root_path/prefix is a table, and so is each sheet of an .xlsx (Excel), as are event and log files. PDF, DOCX, TXT, MD and HTML go to the document analysis. Reading, OCR, images (include_images) and limitations follow the GCS and S3 section.

"Today's file did not arrive". Each file's modification date (the mtime from the SFTP stat) is the last modification the automatic monitors store on every scan. When the partner replaces the same file on each delivery (e.g. pagamentos.csv), the freshness monitor learns the delivery cadence and opens an issue when the next one is late. A file with the date in its name (pagamentos_20261009.csv) is a new dataset on each delivery, with a single date, and that monitor does not see the delay.

Pinned server key. host_key_fingerprint is the SHA256 fingerprint of the server key, in the format OpenSSH prints:

ssh-keyscan -t ed25519 sftp.parceiro.example | ssh-keygen -lf -
# 256 SHA256:… sftp.parceiro.example (ED25519)

Confirm the value with the partner through another channel: ssh-keyscan asks the server itself and does not prove it is the right one. The wizard accepts the whole line or just the SHA256:…. The connector compares it with the key the server presents, before authenticating. If it does not match, the connection drops without sending the password or reading data, and the connection test names the key type the server presented. paramiko negotiates the Ed25519 key first; on a server without one, use -t ecdsa or -t rsa. If the partner only gives you the RSA or ECDSA fingerprint of a server that also has Ed25519, paste the whole ssh-keygen -lf line, which ends with the type (e.g. (RSA)): the connector then negotiates only keys of that type. In production (DATAVAULT_ENV=prod) the field is required and creating the connection without it is rejected with 422. Outside production, a connection created through the API without the field accepts the key unverified, and the connection test shows the fingerprint the server presented; the wizard always asks for it. The MD5 format is not accepted.

Only the connection's credential. The connection carries password or the private key in PEM (private_key_pem, with passphrase if it is encrypted), never both. Paste the key content, which starts with -----BEGIN: a file path is rejected with 422. The connector never reads the BeryX server's known_hosts, keys or SSH agent. It accepts Ed25519, ECDSA and RSA keys. Error messages name only the fields.

Read-only, inside root_path. The connector lists folders, runs stat and opens files in rb. Writing, deleting, renaming, creating folders and downloading to the BeryX server's disk are blocked in the connector's own filesystem. root_path is an absolute path (e.g. /outbound) and prefix a subfolder of it, both without ... Every folder listed and every file read or queried (stat) must sit inside root_path, also after the server resolves links: a prefix that is a link pointing outside is refused. Symbolic links are neither listed nor opened.

On the partner's side (or your team's):

  1. A user just for BeryX, locked to the delivery folder and read-only. In OpenSSH: ChrootDirectory for the folder and ForceCommand internal-sftp -R (-R puts the SFTP server in read-only mode). On a managed SFTP service, a read-only policy for that user.
  2. A credential for that user. With a key, generate a pair just for this (ssh-keygen -t ed25519 -f datavault_sftp), put the .pub in the user's authorized_keys and paste the private key into the wizard.
  3. The server key fingerprint (above).
  4. If the server filters by IP, allow BeryX's egress IP (see the top of this guide).

Network: host is only the name or the IP, without sftp://, port or path, and the port is an integer (22 by default). The anti-SSRF guard checks the name and each resolved IP before opening the socket, and paramiko connects to the IP that passed the guard. In production, private networks and loopback are rejected; the cloud metadata endpoint is always rejected.

Fields: host, port?, username, password or private_key_pem (+ passphrase?), host_key_fingerprint, root_path, prefix?, max_files? (200 by default), include_images?. protocol is not configurable: only sftp; fsspec's ssh alias and any other value are rejected.

Installation: pip install "datavault-backend[sftp]" (paramiko, plus pandas and pyarrow). It ships in the production image. Without the extra, the connector answers with the pip instruction.

FTPS and FTP are not supported. fsspec's ftp protocol does not do TLS reliably, and FTP without TLS sends the password in the clear. Ask a partner that only has FTPS for SFTP or a bucket.

PostgreSQL / MySQL / SQLite

  • PostgreSQL (postgres, postgres extra): create a read-only user (GRANT CONNECT ON DATABASE, GRANT USAGE ON SCHEMA, GRANT SELECT ON ALL TABLES IN SCHEMA ...). Fields: host, port, database, user, password, or a full url.
  • MySQL/MariaDB (mysql, mysql extra): GRANT SELECT ON <db>.* TO 'datavault'@'%';. Same fields as Postgres.
  • SQLite (sqlite, included): path to the .db file — meant for tests and demos, not for production.

Read replica (Postgres, MySQL and SQL Server): replica_host and replica_port (optional) put all of BeryX's connections on the replica, with the same credentials and no fallback to the primary. Details in DBA.md.

Connection test message (card #590). In the SQL connectors (Postgres, MySQL/MariaDB, SQLite, Snowflake, BigQuery, Databricks, Fabric, SQL Server, Oracle and Redshift), the driver's error goes through a filter before it reaches the test result and the connection's last error, which every workspace member sees. The values of the config's password, tokens and secrets, the whole url and the url's password, both decoded and percent-encoded, come out as ***. In pairs such as password=… or PWD=… the value goes, a ://user:password@ DSN loses the password and a PEM block goes entirely. The host and the user stay, because they say where the connection failed. Proof: backend/tests/test_connection_message_redaction.py.

Read errors (card #612). The same filter runs on the errors the SQL connectors return when listing tables and columns, reading a table's structure, reading and counting rows, computing checksums, evaluating an SQL rule or a remediation's trial run and reading the FinOps telemetry of Snowflake, Databricks and BigQuery. These errors reach the result of table discovery, the scan's error and the rules' result. In rules, the error's first line goes through the filter before the literal mask, which cuts at an unclosed quote and at 300 characters. Proof: backend/tests/test_sql_read_error_redaction.py, with a guard that fails an exception text outside the filter in an SQL connector's method.

Password inside the url (card #630). It completes card #629's filter on the connection's last error. The password inside a url or uri also comes out as *** when the error repeats it on its own, both as written (percent-encoded) and decoded. This covers the exception of any step of the connection test: decrypting the config, regenerating the demo source, instantiating the connector or the test itself. If the config does not decrypt, there are no values to look for and the patterns remain: the ://user:password@ DSN, pairs such as password=… and PEM blocks. Proof: backend/tests/test_connection_last_error_redaction.py.

Actual usage of tables on Postgres (USAGEPRIO, card #686). The telemetry collection (POST /dashboard/finops/collect) reads the sequential and index scans of each table in pg_stat_user_tables, counts only, never the query text or the data. It needs no privilege beyond GRANT CONNECT: the statistics views are public. The counters survive a clean restart, and pg_stat_database.stats_reset stays empty until the first pg_stat_reset() (Postgres 15+), so the database does not say since when they count. The average comes from the difference between two BeryX collections, at least 7 days apart, without the reads of BeryX's own scans. Those are measured on the same counter: each scan reads it before it starts and after it ends, and the Δ of the scan's tables counts as BeryX's. That way it discounts what the database actually counts: a TABLESAMPLE sample does not raise the counter and a parallel count(*) raises it once per process. BeryX reads outside scans (preview, issue samples) and those of other tables the rules query stay as reads by others. Reads by others made during a scan, on its tables, are discounted as if they were BeryX's. The first collection gives no level, and neither does a reset: the counter goes down or stats_reset changes. A table only becomes "unused" after 80 days in a row of collections with no reads by others. With a read replica (replica_host), BeryX connects only to the replica and never to the primary. The counters are the replica's and only count the reads made on it: the collection says so and no table becomes "unused" from them. With track_counts off, the connection comes out of the collection as unavailable and the previous levels stay. pg_stat_statements is not read: it links a query to tables through its text, which carries the literals.

Who accesses sensitive data (card #786). It is part of the “AI & Data Security” add-on: in a workspace without it, the /data-security/* routes answer 404. POST /data-security/source-grants/collect (admin) reads who has access to each table from the pg_catalog catalogue: the ACL of each table, view, materialized view and foreign table (pg_class.relacl; without an explicit ACL the owner's default applies), the members of each role (pg_auth_members) and who can log in and who is a superuser (pg_roles). It needs no privilege beyond GRANT CONNECT, because any user of the database can read these views. information_schema.role_table_grants does not work: it only shows the grants that BeryX's user, or a role it is a member of, gave or received. With a read-only user it showed only that user's own (proof in backend/tests/test_source_grants.py, on the CI Postgres). Each grant reaches whoever receives it and the role's members, direct or through intermediate roles. Superusers and members of pg_read_all_data and pg_write_all_data count on every table. A grant on a table counts even without USAGE on the schema: when in doubt it shows too much access, not too little.

  • What is stored: one row per dataset and principal (user, role or PUBLIC), with the privileges and the roles they come through, replaced on each read of the connection. Up to 50,000 rows fit per connection, the most sensitive datasets first; the rest marks the read as cut (truncated). A connection that fails keeps the previous read. An incomplete read replaces the snapshot all the same: what it did not reach has no rows until the next read.
  • Cross-check with sensitivity: GET /data-security/source-grants (admin, ?min_level=confidential or pii) lists the datasets with confidential or personal-data columns, from the classification and the PII detected in the last profile, and who accesses them at the source. A dataset from a source without grant reading shows as unsupported and one from a connection not yet read, or created after the read, as not_collected. Without rows, a dataset only shows as none_visible after a complete read; after an incomplete one it shows as unread. datasets_with_public_access only counts what was read, and datasets_unread says how many datasets in the list remain unknown.
  • Personal data: only admins see the names of the source's users and roles. Logs only get a pseudonym, none goes to an LLM, and they leave with the connection, the dataset and the workspace. A read older than 90 days is deleted.

TLS (Postgres and MySQL/MariaDB)

Since card #449, every Postgres or MySQL connection has a tls_mode:

tls_mode What it does How it is chosen
verify-full Encrypts the connection and verifies the server's certificate and hostname. Without TLS, or with a certificate that does not match, the connection does not open. Default for new connections.
require Encrypts the connection, but accepts any certificate. An intermediary can pass itself off as the source. Explicit confirmation (tls_downgrade_confirmed: true in the API, a dialog in the wizard). It is recorded in the audit log as connection_tls_downgraded, with only the name, the type and the mode.
disable Connects without TLS: credentials and data travel in clear text. The same confirmation, and it is also recorded in the audit log.
  • Server CA (ssl_ca_pem). Without it, the certificate must come from a public CA (the Mozilla bundle, via certifi). RDS, Cloud SQL, Azure Database and internal CAs are private: paste the CA certificate in PEM (text that starts with -----BEGIN CERTIFICATE-----). A bundle with several CAs also works, up to 256 KB, which is enough for the RDS global bundle. The PEM is encrypted with the rest of the config and never appears in the API, the logs or the audit log. It is only accepted with verify-full. File paths and private keys are refused with 422.
  • Drivers. In Postgres, libpq receives sslmode and sslrootcert. A custom CA goes into a temporary 0600 file, which lives as long as the engine and is deleted at the end. libpq's sslrootcert=system is not used: the image's psycopg2-binary embeds a libpq 17 with an OpenSSL that looks for the system CAs in a folder from the wheel's build that does not exist. In MySQL, PyMySQL (≥ 1.2) receives an SSLContext with the CA in memory and refuses to connect if the server does not announce TLS. With tls_mode, the connection always uses the connector's official driver (postgresql:// or postgresql+psycopg2://; mysql+pymysql:// or mariadb+pymysql://).
  • Full url. The URL's sslmode is only accepted if it is the same as the tls_mode. allow, prefer and verify-ca are refused: the first two fall back to clear text without warning and the third does not check the hostname. sslrootcert, sslcert and sslkey remain outside the allow-list.
  • Read replica. With verify-full, the replica's certificate must be valid for the replica_host.
  • MongoDB (#211). MongoDB connections have the same tls_mode, the same ssl_ca_pem and the same confirmation. There are no MongoDB connections from before the rule: without tls_mode, they connect with verify-full. pymongo receives tls and tlsCAFile (the certifi bundle or the custom CA in a 0600 file) and, with require, tlsAllowInvalidCertificates and tlsAllowInvalidHostnames. The uri's tls must match the tls_mode. Details in the MongoDB section. Proof: backend/tests/test_mongodb_tls.py (driver options, API and audit log) and backend/tests/test_mongodb_tls_docker.py, against the compose's mongodb-tls (tls profile, TLS only, with the postgres-tls certificate).
  • Connections created before #449. They have no tls_mode and keep the old behaviour: libpq in prefer and PyMySQL in "preferred" mode, which encrypt if the server allows it, without verifying, and can fall back to clear text. The app shows them as "TLS not verified", and the API returns tls_mode: null and tls_verified: false. To verify them, recreate the connection. Changing the default for these connections is the owner's decision (ENCRIPTACAO_RESIDENCIA.md §8).
  • Public sources in the gallery. The RNAcentral Postgres and the Ensembl MySQL do not accept TLS. The Rfam MySQL uses the self-signed certificate that MySQL generates. The presets come with disable and require, and the app asks for the same confirmation before connecting them.
  • Proof. backend/tests/test_connector_tls.py covers the kwargs per mode and PyMySQL with real TLS against a fake MySQL server. backend/tests/test_postgres_tls_docker.py runs against a Postgres with a self-signed certificate: the postgres-tls service in docker-compose.connectors.yml, in the matrix's docker tier.

Mechanical guarantees (beyond the GRANTs): Postgres sessions open with default_transaction_read_only=on and SQLite with mode=ro. A full url must use the connector's own dialect (e.g. postgresql://… in a postgres connector) and only accepts the query params in the dialect's allow-list (any other is refused with 422, pointing to the structured fields; the rule is also applied at runtime to connections already saved):

Dialect Allowed query params
postgresql sslmode (only verify-full, require or disable, the same as the tls_mode), application_name, connect_timeout
mysql / mariadb charset, connect_timeout, read_timeout
sqlite mode=ro, uri=true
snowflake warehouse, role, application, login_timeout, network_timeout
bigquery location, arraysize, list_tables_page_size, maximum_bytes_billed
databricks http_path, catalog, schema
mssql (Fabric, SQL Server/Azure SQL/Synapse) driver (ODBC Driver 17/18 for SQL Server), Authentication (ActiveDirectoryServicePrincipal/ActiveDirectoryPassword), Encrypt (enabled), TrustServerCertificate=no, ApplicationIntent=ReadOnly (this value only), connect_timeout
oracle service_name, sid, connect_timeout
redshift sslmode (verify-full only), application_name

Left out, among others: host/hostaddr, options, local_infile, init_command, odbc_connect, credentials_path and authenticator.

connect_timeout ceiling (card #666): in postgresql, mysql/mariadb, mssql and oracle, the connect_timeout is a number of seconds, above 0 and up to 120. Anything else (0, negative, above 120 or text) is refused with 422 when the connection is saved and also at runtime. The url's server belongs to whoever creates the connection and can hold the socket until that time runs out, in an API thread. With 0, libpq and FreeTDS wait forever. In SQL Server with pymssql, the connect deadline also stays under the ceiling, even without the refusal (_freetds_login_timeout). Snowflake is left out: the driver connects to a vendor domain. In Postgres without a connect_timeout (structured fields, or a url without the key), the connector gives libpq 30 s (PG_CONNECT_TIMEOUT_S, card #708), which used to wait forever. libpq counts that time per address: with several pinned IPs, it can wait that many times over.

Connection test limited per workspace (card #707): POST /connections/{id}/test connects to the source from the API, and a server that accepts the TCP connection and never answers holds the thread until the driver's timeout (in Postgres without connect_timeout, the 30 s of card #708). So the test runs in an executor of its own (backend/app/domain/catalog/probe_pool.py), outside the threads the rest of the API shares. Each API instance has connection_test_max_threads threads (8 by default) and each workspace takes at most connection_test_max_concurrent_per_workspace (2). A slot is only freed when the thread ends, even if the HTTP request has dropped. Table discovery (POST /connections/{id}/discover) connects to the same server, so it takes one of these slots from start to end; the discovery the scan runs in the worker is left out. On top of that, for the test only, there is a window of connection_test_rate_limit_requests tests per workspace in each connection_test_rate_limit_window_s (30 in 60 s), added up across members and tokens. Above any of the three, the API answers 429 with Retry-After and the rate-limit body (code: rate_limited), before any connection, and the connection stays as it was. The limit_scope says which of the three: connection_test_workspace, connection_test_platform or connection_test_rate. Proof: backend/tests/test_connection_test_capacity.py.

Destination revalidated on connect (card #339): every host and URL in the config goes back through the anti-SSRF guard before the connection is opened, once per engine (BaseConnector.assert_destination_allowed), and not only when the connection is saved. A connection saved before a new rule, or a name that has since started resolving to the internal network (DNS rebinding), is refused before any TCP connection. The name is resolved once and, if any of the IPs (IPv4 or IPv6) is internal, the connection is refused. The scan marks the dataset as failed with the reason "Destino de conexão não permitido neste ambiente: '' ()", without the IP. Where the driver allows it, the connector connects only to the validated IPs, in the resolver's order (if the first refuses the connection, it tries the next), and the driver does not resolve the name again:

Dialect Destination
PostgreSQL (psycopg2, psycopg) the validated IPs go in hostaddr and host keeps the name, repeated once per IP: libpq connects to the IPs and verifies the certificate against the name
MySQL/MariaDB (pymysql) the TCP socket is opened to the first validated IP that accepts the connection and PyMySQL keeps the hostname, against which TLS still verifies the certificate
Oracle (oracledb thin) the driver resolves the name through the guard (netguard.guarded_getaddrinfo, card #647) and connects to the addresses validated in that resolution. The destination of a listener redirect also goes through the guard. The connector connects without TLS: see Oracle
Redshift (redshift_connector) and Databricks the driver resolves the name through the guard (netguard.guarded_getaddrinfo, card #647) and connects to the addresses validated in that resolution. TLS still verifies the certificate against the name: Redshift always connects with verify-full and Databricks over HTTPS. On Databricks, the guard sits in urllib3 and covers every connection to the connection's host, for the whole session
SQL Server (pymssql) FreeTDS resolves the name in C code, out of the guard's reach. It connects to the validated IP of a [host] section with host = <IP>, in a private file it reads before any other configuration (resolution_guard.freetds_pinned_connect, card #658), and sends the name in LOGIN7, which is what Azure SQL reads to route the connection. For a named instance (host\\INSTANCIA), the section is the host's, and FreeTDS asks the SQL Browser at that IP for the port. FreeTDS splits the port at the last : and the instance at the last \\, and compares the section with the server exactly as it arrives: a server for which it would look up a name other than the validated host (two \\, spaces around the host, an IPv6 without a port) is refused before connecting (resolution_guard.freetds_server_name). The destination of a routing the server sends (the routing ENVCHANGE of Azure SQL's Redirect policy) FreeTDS resolves and connects to without going through the section or the guard. After the login, the IP at the other end of the socket goes through the guard before pymssql reads the reply to the first batch, and a connection to an internal destination is cut off there (resolution_guard.freetds_peer_check, card #663): the socket and the login at that destination have already happened, BeryX's queries never reach it. FreeTDS has no hook that stops that connection, so after a routing the internal destination, the closed port, the refused login and the name that does not resolve all get the same refusal, without the driver's error, which told which case it was (resolution_guard._freetds_checked_connect, card #664). The routing is detected in the DB-Library error handler, by the «address,port» FreeTDS puts in place of the server. With private networks allowed, the driver's error goes through. The time until the refusal also told the outcome: FreeTDS bounds each wait by login_timeout, not the total, and a server that delays its replies stretches the login as far as it likes. So the connect runs in a thread with a fixed deadline, login_timeout plus 2 s (resolution_guard._freetds_checked_connect, card #665). A routing's refusal is raised at the end of the deadline, and a connection still running at that moment gets the same refusal, because the routing may already have happened. A closed port, a filtered destination and a live service take the same time, however much the public server delays its replies. A connection past the deadline carries on in FreeTDS until it gives up and is closed if it completes. A login_timeout of 0, negative or unreadable gets the default, 30 s: with 0, FreeTDS would wait forever
Fabric and SQL Server with Entra ID (pyodbc) revalidation before each new pool connection, and not only when the engine is created. msodbcsql resolves the name in C code and does not pin the IP. pyodbc and msodbcsql are not in the production image
Snowflake, BigQuery (url) and other Postgres/MySQL drivers revalidation only: the driver resolves the name again on connect
S3 (endpoint_url), Azure (Azurite endpoint_url) and Dynamics 365 (org_url) revalidation when the filesystem or the client is opened (Dynamics pins the IP on each request through the ReadOnlyHttpClient)
MongoDB (pymongo) the driver resolves each name through the guard (netguard.guarded_getaddrinfo, card #564) and connects to the addresses validated in that resolution; see MongoDB

With private networks blocked (production), a host that does not resolve is refused (netguard.check_host, card #564), when the connection is created and on each revalidation: accepting it let the driver resolve it later, without the guard, and the name could meanwhile point to the internal network. In the Snowflake and BigQuery url, the "host" is the account and the project, not a network name: it still goes through the guard, but it does not have to resolve. The drivers with a pinned IP (psycopg2, psycopg, pymysql and pymssql) also refuse a path (local Unix socket) and a comma-separated list of hosts: the guard would not have validated the destination the driver was going to connect to. With DATAVAULT_ALLOW_PRIVATE_NETWORKS=true (development), the local socket and a name that does not resolve connect as before, without a pinned IP.

Standard deviation: computed by the native function STDDEV_POP (Postgres, MySQL/MariaDB, BigQuery, Snowflake, Databricks, Oracle, Redshift) or STDEVP (SQL Server, Azure SQL, Synapse, Fabric). In SQLite it is a Python aggregate registered on each connection: exact for integers and Welford for the rest, in the same query as the other aggregates. The old formula E[x²] − E[x]² in floating point cancelled itself out in high-magnitude columns and returned 0.0 for an epoch-millis column with a spread of 100 (the correct value is 28.9). It remains only as a fallback for unknown dialects. A mean or deviation that the source returns as NaN/±Inf (e.g. float8 with 'NaN' in Postgres) is shown as "unknown" in the profile.

Statement timeout and retries

DATAVAULT_CONNECTOR_STATEMENT_TIMEOUT_S (120 s) is the maximum time of each query on every SQL source. The source cancels the query on the server, so a runaway aggregate does not keep the warehouse running until the vendor's limit (2 days on Snowflake). Each dialect receives it its own way (app/infra/connectors/timeouts.py, card #346):

Source How the limit reaches the source
PostgreSQL -c statement_timeout in the connection options
MySQL SET SESSION max_execution_time (ms) on each new connection, plus PyMySQL's read_timeout 30 s above the longest session limit
MariaDB SET SESSION max_statement_time (s) on each new connection (MariaDB has no max_execution_time), plus the same read_timeout
Snowflake STATEMENT_TIMEOUT_IN_SECONDS in the session_parameters, next to the QUERY_TAG
Databricks SET STATEMENT_TIMEOUT on each new session
BigQuery job_timeout_ms in the client's default QueryJobConfig, next to maximum_bytes_billed
SQL Server (pymssql) timeout in the connect_args
SQL Server (pyodbc) and Fabric each connection's Connection.timeout. The timeout of pyodbc's connect is the login timeout
Oracle oracledb's call_timeout (ms) on each new connection. It counts per round trip to the database; when it expires, the driver interrupts the call on the server (DPY-4024)
Redshift SET statement_timeout (ms) on each new connection, with the driver's autocommit on for the SET only (inside a transaction, the pool's ROLLBACK would undo it)

With 0, no dialect gets a limit. SQL rules and the remediation rehearsal change the session limit only for their query and restore the connection's limit at the end. A MySQL, MariaDB or Databricks that refuses the SET (old version) still connects, with the server's limit, and logs connector_statement_timeout_unsupported.

MySQL with no server limit. max_execution_time only exists from MySQL 5.7.8, and PyMySQL's read_timeout counts per socket read: a reply that arrives bit by bit never triggers it. In a session that refuses the SET on MySQL or MariaDB, with PyMySQL, each query also has a real-time limit, equal to the read_timeout. Past it, BeryX closes the socket and the connection leaves the pool. The query may keep running on the server until it ends, because BeryX does not send KILL. That query, or one that passes the read_timeout, is not retried. If it fails the dataset, the scan records the reason: in the error, when no dataset finishes, or in dataset_errors, next to the dataset that failed.

Reading views. Lineage reads the SQL of each view on every scan, and these are many fast queries that no per-query limit cuts. MySQL treats each database as a schema: a connection with database reads only that one, like discovery. On SQL sources, except Oracle, the read stops after BERYX_CONNECTOR_VIEW_DEFINITIONS_BUDGET_S (300 s; 0 turns it off). The scan carries on, view lineage stays as it was and view_definitions_indisponivel goes to the log.

Retries. A transient source error used to leave the dataset failed in that scan and a gap in the drift and anomaly history. Now a table's profile, incremental profile, rows, metadata and count are retried up to DATAVAULT_CONNECTOR_RETRY_ATTEMPTS times (3), waiting up to 2 s and 4 s (exponential, at most 30 s, with jitter). Only what is transient in each dialect is retried (app/infra/connectors/retry.py):

Source Retries
PostgreSQL SQLSTATE 08xxx, 57P01/57P02/57P03 (failover), 53300 (no free connections), 40001/40P01 (conflict on a replica, deadlock)
MySQL/MariaDB 2003, 2006, 2013 (except the read_timeout), 1040, 1213
BigQuery rateLimitExceeded, backendError, internalError, HTTP 429/500/502/503
Snowflake 390114 (session token expired) and a suspended or resuming warehouse
Databricks warehouse starting, TEMPORARILY_UNAVAILABLE
SQL Server/Fabric ODBC SQLSTATE 08xxx and Azure SQL's transient errors (1205, 40197, 40501, 40613, 49918–49920)
Oracle only a connection that SQLAlchemy reports as lost: ORA-00028, ORA-03113, ORA-03114, ORA-03135, ORA-01033, ORA-02396, DPY-1001 and DPY-4011
Redshift only a lost connection: one that SQLAlchemy reports as lost and those in the "All" row
All connection reset or refused by the other side

Timeouts are never retried (the query cancelled for time would cost the same again), nor authentication and permission errors, BeryX's own refusals (bytes cap, destination refused by the anti-SSRF guard) or a configuration error. SQLite never retries. A dataset's retries add up to at most DATAVAULT_CONNECTOR_RETRY_BUDGET_S (60 s, waits and repeated attempts): once the budget runs out, the dataset fails with the last error. Each retry is logged as connector_retry with the scan's correlation_id, the attempt and only the error's class name (the driver message may carry data). When there were retries, the scan summary keeps the total in retries. An error solved by a retry does not count towards the connection's circuit breaker.

Vector indexes (pgvector)

A table, view or materialized view with a vector, halfvec or sparsevec column is a vector index in the catalogue: a dataset like any other, with an owner, domain, lineage, trust and links to agents. Domains and arrays of these types count too.

The type, the dimension and the indexes that cover the column come from pg_catalog, with no new privilege. The index method of any extension counts: hnsw and ivfflat from pgvector, diskann from pgvectorscale and vchordrq from VectorChord, which becomes other (next section). Postgres's own methods do not count: the btree that pgvector accepts compares vectors, it does not search for neighbours. The type appears without the schema, for example vector(1536), even with the extension outside the search_path. Catalogue search filters these datasets with the "Vector index" facet (GET /catalog/search?vector_index=hnsw, with the values in the next section), and the page of a model or agent shows the index it consumes.

Embeddings never leave the source. These columns stay out of the row sample, checksums, distributions, data diff and duplicate matching, so they do not reach an LLM either. The profile stops at rows and nulls, counted with count(CASE WHEN coluna IS NOT NULL THEN 1 END), and a not_null rule on the column keeps running. The examples of a SQL rule and metrics check the type of the result columns with a LIMIT 0 before reading a row: examples come back without the vector columns, and a metric that would return one is refused. The check sees the result type, so a custom_sql that casts the column to text (embedding::text) gets through, and its examples are masked like those of any rule.

Sensitivity comes from the sources. BeryX does not read the vectors, so the sensitivity of an index is only as good as the declared lineage. An admin declares the origins on the index page (POST /api/v1/lineage/vector-origins), and the vector columns inherit the pii or confidential level from them, only upwards. With no origin, the index shows the gap "Origin not declared". The text and metadata columns next to the vector column go through normal PII detection. The rules and limits are in SEGURANCA.md.

Who reads the index and not the origin (card #1227). In the "AI & Data Security" add-on, each declared origin is compared with the index in the latest grants snapshot: if there are principals with SELECT on the index and without it on the origin, the pair comes out index_wider, and a classified origin opens a vector_index_access issue. In PostgreSQL and Snowflake the snapshot declares no limits, and the verdict can come out parity. Pairs across different connections, MongoDB and Weaviate indexes and sources without a grants snapshot stay unknown, with the reason. The rules and limits are in SEGURANCA.md.

Without the extension nothing changes: a user type named vector is a type like any other, and rule results are not checked. With pg_extension closed, BeryX confirms in pg_type that the database has no types with these names, and the rest stays the same.

With the catalogue unreadable and a type with one of these names in pg_type, BeryX cannot tell which columns are vectors and stops reading those of unknown type: SQLAlchemy's NullType and the types that are not system types, read from pg_attribute, with their domains and arrays. Without pg_attribute, it stops reading whatever information_schema reports as USER-DEFINED or ARRAY. Those columns keep only their nulls and the type reflection gives them, the one a read without this guard gives. A column already catalogued as a vector keeps its mark and its type.

A column already catalogued with the NULL type becomes vector(1536) on the next scan without opening a schema change. The same goes for the DOMAIN type of a domain over a vector, for the USER-DEFINED of information_schema and for the ARRAY of an array of these types. The exception only applies against a vector type: from NULL to text there is a schema change, as on any other column.

The vector index mark

A vector column carries a mark in columns_json with the type, the dimension and the methods of the indexes that cover it. The Postgres connector writes it, since card #1024 so do the Snowflake, Oracle, SQL Server and MySQL ones, since #1028 the BigQuery one, since #1026 the Databricks one, from the AI Search indexes, and since #1027 the MongoDB one. The Postgres, BigQuery, Databricks and MongoDB ones read the indexes, and since #1030 so do the Oracle and SQL Server ones. On Snowflake and MySQL the mark has no methods, and the column answers the facet as none. Each source gives the same method a different name, and BeryX normalises it (app/domain/catalog/vector_marks.py) to one of the values of the "Vector index" facet:

Value Name in the source
hnsw hnsw (pgvector, Qdrant, Weaviate, MongoDB, Milvus) and INMEMORY_NEIGHBOR_GRAPH_HNSW (Oracle)
ivfflat ivfflat (pgvector) and IVF_FLAT (Milvus)
ivf IVF (BigQuery) and NEIGHBOR_PARTITIONS_IVF (Oracle)
tree_ah TREE_AH (BigQuery)
diskann DiskANN (SQL Server and Azure SQL), DISKANN (Milvus) and diskann (pgvectorscale)
flat flat (Weaviate and MongoDB) and FLAT (Milvus)
managed AUTOINDEX (Milvus and Zilliz) and the Databricks AI Search indexes, which do not say the algorithm
other Any other name, such as vchordrq from VectorChord
none The column has no index, the connector does not read the source's indexes yet, or the index view could not be read

The comparison ignores case and the difference between _, - and spaces, and only accepts ASCII names. A method the list does not know becomes other: the dataset stays in the facet and in the count, and never turns into none.

The mark also keeps the distance metric (metric) and the embedding model (embedding_model) as the source declares them, and the API returns them in vector_columns (GET /catalog/ai-agents/{agent_id}). The model only exists when the source itself generates the embeddings, and it is never inferred from the dimension: 1,536 dimensions do not prove a model. Without one, the page of a model or agent shows "Model not declared by the source". On pgvector BeryX does not read the metric yet, which lives in the index operator class, and the extension does not store the model. On Oracle, ALL_INDEXES has no metric. A mark saved before card #1025 reads as it was, with no metric and no model.

The namespaces, tenants and partitions of an index are counted in source_metrics.vector_partitions, with only the kind and the number ({"kind": "namespace", "count": 12}). The names are not stored, because in a multi-tenant SaaS the name of a tenant can be that of a customer. The connector only passes the number (vector_partitions in app/infra/connectors/base.py), and when it saves the profile BeryX drops anything in that entry beyond the kind and the number.

Vector columns in Snowflake, Oracle, SQL Server and MySQL

In these engines, the source type proves the column holds embeddings, and the scan stops reading it, as with pgvector. Each dialect says which columns they are (app/infra/connectors/vector_catalog.py):

Source Column type Dimension Type in the BeryX catalogue
Snowflake VECTOR(FLOAT, 768), reflected by snowflake-sqlalchemy In the type. On a table without DATA_TYPE_ALIAS, from SHOW COLUMNS, which needs no warehouse VECTOR(FLOAT, 768)
Oracle VECTOR, reflected by SQLAlchemy without a dimension ALL_TAB_COLUMNS.VECTOR_INFO VECTOR
SQL Server and Azure SQL vector, which the dialect does not know (NullType) sys.columns.vector_dimensions vector(768)
MySQL and MariaDB vector(768), which the dialect does not know: reflecting the table fails, and the columns come from information_schema, where the type is vector information_schema.COLUMNS.COLUMN_TYPE vector(768)

The column stays out of the row sample, aggregates, distributions, segments, checksums and duplicate matching. The profile stops at rows and nulls, and a not_null rule on the column keeps running. The examples of a SQL rule and metrics check the result columns with a SELECT that returns no rows. A column goes if it has the name of a vector column the scan has already read, or the driver's vector type (Snowflake, MySQL and Oracle: pymssql returns the vector as text). The check only runs once the scan has found a vector column. A custom_sql over another table with vectors the scan has not read only has the value guard (section "Embeddings in other sources").

With the catalogue unreadable on SQL Server, the columns of unknown type (NullType) stay out, with the NULL type. On MySQL, information_schema already says vector: without COLUMN_TYPE, the column stays out with the mark and the vector type, without the dimension. A column catalogued as NULL becomes vector(768) without opening a schema change. Before #1024, the scan catalogued the MySQL column and the Snowflake column without DATA_TYPE_ALIAS as TEXT, the approximate type of the fallback, and the MySQL inventory as vector. The right type opens a schema change once. The daily inventory marks the columns whose type is written VECTOR(…) and the MySQL ones, which reach it through the read of each table. On SQL Server, the mark comes with the scan.

Oracle and SQL Server vector indexes (card #1030). On a table with vector columns, the scan also reads its vector indexes, with one query per table and scan (oracle_vector_indexes and mssql_vector_indexes in app/infra/connectors/vector_catalog.py):

Source View What the mark keeps
Oracle ALL_INDEXES with INDEX_TYPE = 'VECTOR', and ALL_IND_COLUMNS for the column The method, from INDEX_SUBTYPE: INMEMORY_NEIGHBOR_GRAPH_HNSW becomes hnsw and NEIGHBOR_PARTITIONS_IVF becomes ivf
SQL Server and Azure SQL sys.vector_indexes, and sys.index_columns for the column The method, from vector_index_type (DiskANN becomes diskann), and the metric, from distance_metric, as the source writes it

Both views show the indexes of the tables the account already reads, with no new privilege. BeryX does not read Oracle's V$VECTOR_INDEX, which only exists in some services. Neither view gives the embedding model.

Vector indexes are in preview on SQL Server 2025. If the view does not exist or the account cannot read it, the column stays out of the read with its type and dimension, has no methods and answers the facet as none. The scan carries on, and the log records vector_indexes_indisponivel with the error type, without the driver message. The daily inventory does not read the indexes: they come with the scan.

Duplicate groups. Groups stop comparing the column, and an exact group that compared it gets a new signature (#939). The status moves to the new signature, which is computed from the group's stored sample, without the column: an ignored or merged group stays ignored or merged. Two groups that only the vector told apart become one. If they had the same status, it moves. If not, the new group is open and the old ones stay as they were. A group with no stored sample, which retention and migration 4d3e237628a0 clear, comes back to the queue once, and the old one keeps its status.

BigQuery vector indexes

BigQuery has no vector type: an embedding is an ARRAY<FLOAT64> or, with autonomous generation, a STRUCT<result ARRAY<FLOAT64>, status STRING>. Only a vector index proves that the column holds embeddings. The scan reads three INFORMATION_SCHEMA views per dataset (app/infra/connectors/bigquery_vectors.py):

View What it gives
VECTOR_INDEX_COLUMNS The index column (index_column_name)
VECTOR_INDEX_OPTIONS The method (index_type: IVF or TREE_AH, which the mark stores as ivf and tree_ah) and the metric (distance_type, as the source writes it)
VECTOR_INDEXES coverage_percentage and unindexed_row_count, which go to source_metrics.vector_index in the table profile

The model only comes from a column generated by AI.EMBED: the endpoint => '…' in INFORMATION_SCHEMA.COLUMNS.generation_expression or, without it, the model => '…'. With embeddings computed outside the table (ML.GENERATE_EMBEDDING, for example), the model stays undeclared. The dimension stays empty, because the catalogue does not give it. The column type in the BeryX catalogue does not change, so the mark does not open a schema change.

Cost. According to Google's documentation, each query to INFORMATION_SCHEMA bills at least 10 MB on-demand and is not cached. BeryX reads the indexes once per dataset and scan, on the first table of that dataset the scan reads (the profile or the automatic monitors' snapshot). A dataset without indexes costs one query, to VECTOR_INDEX_COLUMNS. A dataset with indexes costs four: the three views and generation_expression. Each query counts 10 MB in the scan cost (stats_json.monitoring_cost, card #814). A refused query does not count, because BigQuery does not bill it. Outside a scan, table discovery reads the indexes once per dataset.

What leaves the read. The indexed column leaves like the vector columns of Snowflake, Oracle, SQL Server and MySQL: it stays out of the row sample, aggregates, distributions, segments, checksums and duplicate matching, and the SQL of those queries does not name it. In a BigQuery table an ARRAY is never NULL, because a null array is stored empty: the profile keeps 0 nulls without the count, which would read the whole column. An autonomous-generation STRUCT can be NULL, and the null count reads it once. The examples of SQL rules come back without the column once the scan has seen it.

No index, or no permission. An ARRAY<FLOAT64> without an index is still read, because nothing proves it is an embedding, and the value guard (section "Embeddings in other sources") keeps it out of what is stored. The three views need bigquery.tables.get or bigquery.tables.list, already in BigQuery Data Viewer and BigQuery Metadata Viewer. Without them, the scan goes on and the column is read as before. A column already catalogued with the mark keeps it, like the declared structure.

MongoDB vector indexes

On a collection with a MongoDB Vector Search index, the scan reads the index definition through the $listSearchIndexes stage and stops reading the embeddings (app/infra/connectors/mongodb_search.py). For each vector field, the column's mark carries the dimension (numDimensions), the method (indexingMethod: hnsw when the index does not declare it, or flat, both with their own value in the "Vector index" facet) and the metric (similarity). With two indexes on the same path, the mark keeps the methods and metrics of both. Each index also goes in source_metrics.vector_search_indexes, with the name, status, queryable and, per field, the path (path), the quantisation (quantization) and what the mark carries.

  • The vector paths stay out of both document reads. The sample becomes [{"$sample": {"size": N}}, {"$project": {"embedding": 0}}]. $sample stays at the head, because with another stage before it the server stops using the pseudo-random cursor and reads the collection. The rows find carries the exclusion of the paths or, with requested fields, their inclusion without the vector paths.
  • A top-level path (embedding) stays only in the catalogue, with the vector(768) type and the vector mark. With no values read there are no nulls, so it has no profile, and a rule on it is left unevaluated, because the column stayed out of the table's profile.
  • A nested path (meta.vetor) marks the top-level field (meta), which is still read without that path. Data comparison still compares the field, without the vector; a top-level path stays out of it, like the vector columns of the other sources.
  • An autoEmbed field points at the text MongoDB generates the embeddings from, which live in the search process and not in the document. The text is still read and carries the embedding_source mark from card #1026, with no dimension, with the method and the model (model), like the text of a Databricks managed index. The model page shows it, and for the rest of the product the field is still text: data comparison compares it (app/domain/quality/data_diff_service.py), and the sensitivity of vector indexes (card #1018) does not count it as a vector column. A field with both vector and autoEmbed paths keeps the vectors mark.
  • A collection without a vector index is read with the same pipeline as before. An array of numbers without an index is still read as JSON text, and the guard in the next section takes it out of what is stored.
  • On an instance without MongoDB Search (outside Atlas and Community 8.2 or later) or without the listSearchIndexes action, the stage fails: the scan carries on as before, and the log records mongodb_search_indexes_indisponivel with the error type only. The read role has the action.

Embeddings in other sources

Outside pgvector, the vector types of Snowflake, Oracle, SQL Server and MySQL and the BigQuery, Databricks AI Search and MongoDB indexes, the scan reads the embeddings column like any other: a BigQuery ARRAY<FLOAT64> without a vector index arrives as a list, a Databricks ARRAY as an ndarray, a Parquet list<float> and an array in a CSV as text, a MongoDB array without a vector index as a list and a BLOB of float32 as bytes. The column type is not enough to recognise them: Parquet comes in as text, and a Databricks array<float> with no AI Search index does not prove it is an embedding. So BeryX recognises them by value (app/infra/serialization.py): a list, an array or a text with 32 numbers or more, inside a subdocument or an array of vectors, and a binary value of 32 bytes or more.

Rules, the profile and duplicates read the real value and decide as before. Only what is stored and what goes to the LLM changes:

  • the column's profile is stored without a sample, minimum or maximum, like a nested column's;
  • in a duplicate group's sample and in the suggestions context, the value becomes {"omitted": "vector", "length": 768}. A MongoDB subdocument or array of vectors goes out whole;
  • a rule example (pattern, in_reference_set) shows <vector:768>, and values outside the list add up in that entry;
  • the column stays out of segments, so a volume jump does not use it in the drill-down, and it gives no accepted-values or normalisation suggestions;
  • the model only receives scalar values from example rows.

An array with fewer than 32 values (coordinates, an RGB colour) and a BINARY(16) key stay as they are. A hexadecimal text only counts in a binary-type column.

Wide tables

Each aggregate is a scan of the column, and in a warehouse it is billed. So a table with more than DATAVAULT_PROFILE_MAX_COLUMNS columns (120) profiles only 120. Until card #289 these were the first 120 and the dataset's catalogue kept only those: in a 300-column SAP/CRM table, 180 disappeared from the catalogue and the schema change monitor (SCHEMACHG) was blind to them. Now:

  • the catalogue keeps every column, read in the same pass as the profile (without a second trip to the source);
  • the profiled columns are chosen by priority: keys (PK, id, *_id), date/time columns, names with personal data (email, nif, iban, telefone, …) and then schema order. The choice is deterministic and stable between scans, and it is the same in the incremental profile. It lives in app/infra/connectors/profiling.py;
  • the table profile records profiled_columns, skipped_columns and column_count (the catalogue). The UI shows "120 of 300 columns profiled" and marks the rest as "not profiled";
  • the schema diff compares full catalogues. The schema_change issue of a wide table says how many columns were profiled and that the diff covers the whole catalogue. On the first scan after this version the previous profile does not yet have the snapshot of the catalogue, and the diff compares only the columns that profile saw. This way ~180 false "new" columns do not appear, and the issue's note explains it.

Row sample by dialect

Rules that need rows (pattern, required_fields) and duplicates read up to 5,000 rows per table (ROW_FETCH_LIMIT, always below the source's maximum sampling); label quality reads with the same method, up to its own ceiling. Since card #317 those rows are a sample chosen by the source itself, with a fixed seed per dataset — the same from scan to scan, so that duplicate clusters and pattern violations do not open and close without the data changing. SELECTs only:

Source How it samples Repeats with the same seed
PostgreSQL TABLESAMPLE BERNOULLI (p) REPEATABLE (s); above DATAVAULT_SAMPLE_FULL_SCAN_MAX_ROWS (25 M), TABLESAMPLE SYSTEM (blocks) yes
BigQuery TABLESAMPLE SYSTEM (p PERCENT) — only the sampled blocks are billed no (BigQuery has no REPEATABLE)
Snowflake SAMPLE SYSTEM (p) SEED (s) yes
Databricks TABLESAMPLE (p PERCENT) REPEATABLE (s) yes
MySQL/MariaDB, SQLite, SQL Server/Azure SQL/Synapse/Fabric WHERE hash(chave primária#s) mod 10⁶ < k, ordered by the hash (up to the same 25 M ceiling) yes
no primary key, a view, or native sample refused the first rows in order of the 1st column (no ordering above the ceiling and in warehouses) only with ordering
CSV, GCS, S3 one row in every k of those the profile reads yes

p comes from the profile's row_count (~1.5× the limit, trimmed in Python by the row hash); a view or foreign table in PostgreSQL refuses TABLESAMPLE and the sample falls back to the first rows, with the sample_native_fallback event in the worker log. The profile records the method in metrics_json["sample"] (method, rows, fraction, seed, deterministic) and the app shows it in a badge next to the columns; the duplicates issue and the issues of the pattern and validity rules say so in their text. A manual scan with "New sample" (resample in POST /scans) uses another seed for that scan only.

The profile's sample_values (up to 20 per column, for semantic types and PII detection) come from one sample of 1,000 rows by the same method, instead of one SELECT DISTINCT … LIMIT 20 per column: the SQL profile runs 2 + ⌈colunas/10⌉ queries per table, where it used to run 1 + ⌈colunas/10⌉ + colunas (in a 120-column table, 120 extra queries; in BigQuery, 120 billed reads). Some columns go back to ask for their values separately: those that are almost all NULL and those with few categories that the sample did not see in full, so that the accepted-values proposal does not miss a rare category. With the BigQuery cost guard degraded, none of them does. In the incremental profile the sample stays within the new window and is never TABLESAMPLE, which runs before the WHERE and would read the whole table: it goes by the key hash or by the first rows by the temporal column. The 32-bit hash per dialect (hashtext, CRC32, dv_hash, FARM_FINGERPRINT, HASH, xxhash64, HASHBYTES) also serves the data-diff checksums and the HLL sketches of the incremental profile, which now exist in BigQuery, Snowflake, Databricks and SQL Server. The text the hash reads is faithful to the value. In BigQuery, ARRAY, STRUCT, JSON and BYTES go through TO_JSON_STRING. In SQL Server and Fabric, datetime, float, money and binaries go through CONVERT with an explicit style, because CAST lost seconds and digits. A column that the source cannot write as text gets no checksum, and the data-diff compares it via the sample. Details and limitations in Methods › Sampling.

Keys, partitions and object type

Since card #347 BeryX reads what the source declares about each object. It reads only the catalogue, never data, at discovery and on every scan. A part the account cannot read stays empty and the scan goes on.

Source Object type Primary and foreign keys Partitions and clustering
PostgreSQL table (partitioned ones too), view, materialized view and foreign table (external), through the SQLAlchemy inspector inspector —
MySQL/MariaDB, SQLite, SQL Server, Fabric table and view, through the inspector inspector —
BigQuery INFORMATION_SCHEMA.TABLES.table_type TABLE_CONSTRAINTS, KEY_COLUMN_USAGE and CONSTRAINT_COLUMN_USAGE COLUMNS.is_partitioning_column and clustering_ordinal_position
Snowflake INFORMATION_SCHEMA.TABLES.TABLE_TYPE inspector CLUSTERING_KEY (plain names only: an expression such as TO_DATE(ts) is left out)
Databricks table and view, through the inspector inspector DESCRIBE DETAIL (partitionColumns, clusteringColumns)

In BigQuery, Snowflake and Databricks the keys are informational: the source does not enforce them. BeryX uses them as a key, never as proof of uniqueness (the unique rule measures it).

Permissions. None new. In BigQuery the INFORMATION_SCHEMA views require bigquery.tables.get and bigquery.tables.list, already included in BigQuery Data Viewer. That is up to five queries per dataset and scan (MATERIALIZED_VIEWS only if the dataset has materialized views, CONSTRAINT_COLUMN_USAGE only if it has foreign keys), each billed at least 10 MB.

Where it shows. The catalogue shows the type next to the name (views, materialized views, external tables) and the «PK», «partition» and «clustering» marks on the columns. The API returns kind on each dataset and primary_key, partition and clustering on each column of the detail. The unique rule suggested on the first scan sits on the declared primary key; the names (id, *_id) remain the fallback. A declared foreign key becomes a declared edge in the lineage, ahead of the naming convention. The data-diff uses the base's primary key when the request has no key_columns, and the matching key suggestion puts first the primary key both sources declare with the same names.

Views and external tables. Every query to a view runs its SQL in full, and every query to an external table reads the files. By default they profile at basic. The COUNT(*) query runs over the whole object and also returns the minimum and maximum of the date and time columns: the count stays exact, because the volume monitors compare it between scans, and freshness comes from the most recent row, not from the first rows read. The other aggregates and the samples come only from the first 100,000 rows, without COUNT(DISTINCT), and above that the profile says sampled. In an insert-only table the first rows are almost always the oldest: nulls, empty text, sentinels, numeric ranges and samples of the new rows go unmeasured. When a large view moves from the full profile to the limited one, its metrics may jump once on the next scan. In BigQuery LIMIT does not reduce the bytes billed for a view, and the connection's maximum_bytes_billed cap still refuses a query that exceeds it. For the full profile, an admin sets the dataset's depth to standard or deep in Datasets → Bulk operations; basic keeps the limited profile.

Materialized views. They profile as tables. In the automatic monitors, freshness (last_modified) is the last refresh: MATERIALIZED_VIEWS.last_refresh_time in BigQuery and refreshed_on from SHOW MATERIALIZED VIEWS in Snowflake.

Adversarial profiling corpus

The cases below are not exotic; they are the day-to-day of a Portuguese or Spanish ERP. The corpus exists so that we can say "trust the numbers" with proof. It lives in backend/tests/fixtures/adversarial/ and has two parts: a generator (build_corpus.py, with each case's data and each column's declared SQL type) and the expectations, one YAML per case in cases/. The format is in the folder's README.md. The test backend/tests/test_adversarial_corpus.py generates the corpus in a temporary directory, profiles each case through the CSV connector (on the pandas and stdlib paths, which must agree) and through SQLite, and compares with the YAML. The tolerances are explicit: rel=1e-9 by default and abs=1e-6 on the epoch standard deviation. Every profile in the corpus must also save as strict JSON.

Case What it proves
bom_utf8, bom_utf16 Excel BOM (UTF-8 and UTF-16 LE): no  in the name of the first column
ponto_e_virgula_cp1252, tab_latin1, latin1_bytes_c1 ;, tab and | + cp1252/latin-1; the profile states delimiter/encoding
aspas_e_quebras, uma_coluna quotes, delimiters and line breaks inside fields; Sniffer with no verdict
zeros_a_esquerda 08001, 000123, 0034… stay text; "0" is an integer
decimais_pt_e_datas_pt, sentinelas, vazio_vs_null 1.234,56, 31/12/2024, N/A, -, 9999-12-31; empty vs NULL
nan_inf NaN/±Inf: nan_count, left out of the mean and the samples, JSON without NaN
fusos_mistos, dst_lisboa, datas_futuras naive vs aware (the CSV profile used to crash), 01:30 duplicated on 2026-10-25 in Lisbon, dates in 2099
decimal_38_10, bigint_extremos, epoch_millis numeric precision; stddev matches statistics.pstdev to 1e-6
nfc_nfd "José" composed and decomposed
tabela_vazia, uma_linha, coluna_toda_null limits: 0 rows, 1 row (deviation 0), a column with only NULL
tabela_larga_300 300 columns: catalogue with 300, 120 profiled by priority
identificadores_reservados, sem_pk, vista Order Details, columns select/order/group, a table without a PK, a view

Recorded (and not fixed) limitations. Each YAML states in known_limitations what the current behaviour does not solve yet:

  • PT decimals and dd/mm/aaaa dates stay text;
  • 9999-12-31 and future dates go into the column's maximum and into the latest_timestamp that the connector returns (freshness no longer uses them: since card #292 the domain leaves those columns out of the choice of freshness column and raises the future_timestamps alert);
  • NFC and NFD count as distinct values;
  • the two 01:30s of the clock change are the same value without a time zone;
  • DECIMAL(38,10) loses precision in float and in SQLite's REAL;
  • SQLite stores NaN as NULL, so nan_count is only measured in files.

First scan after this version (transition). File columns (CSV, GCS, S3) whose type was wrong change once: integer to string/text for codes with leading zeros or with sentinels, and text to datetime for ISO dates in buckets. SCHEMACHG records it as type_changed. It is not suppressed, because the previous type was wrong and the issue documents the correction.

How #207 runs the same corpus against real sources. The real per-connector validation matrix (#207) reuses CASES and the YAML files without copying them:

  1. Load: for each case with the SQL target, it creates the table with each column's sql_type translated into the dialect. For example, INTEGER → bigint/BIGINT/INT64; REAL → double precision/DOUBLE/FLOAT64; DECIMAL(38,10) → numeric(38,10)/DECIMAL(38,10)/BIGNUMERIC; TIMESTAMP → timestamp/DATETIME/DATETIME. Then it inserts the same rows with driver parameters, never by interpolation. Postgres 16 and MySQL 8 run in the docker-compose.connectors.yml of the matrix's docker job; BigQuery runs in the sandbox tier, with the DATAVAULT_MATRIX_BIGQUERY_* secrets.
  2. Profile: runs with the real connector (postgres, mysql, bigquery), via profile_table, as in a scan.
  3. Comparison: the test_adversarial_corpus.py runner already merges all with the target's section. #207 adds postgres:, mysql: and bigquery: sections to the YAML files, only with what changes per dialect: type names, the exact precision of numeric(38,10), the NaN that Postgres stores in float8, and the nan_count via native SQL, which is in #207's scope. The rest (all) must pass as it is.
  4. What only a real source proves: the native STDDEV_POP in the epoch_millis case (Postgres, MySQL, BigQuery) and the information_schema fallback with CAST(:s AS CHAR) on a real MySQL. Until this version CAST(:s AS TEXT) failed on MySQL and reflection silently fell back to []. Today only the text of the query is covered by a test. Lossless reading of DECIMAL(38,10) is also still missing.

SAP

The sap connector (card #212) reads SAP S/4HANA and SAP Gateway through the OData services, v2 and v4, that SAP itself publishes. Each entity set of the service is a table. It sits on the common OData base (app/infra/connectors/odata.py), the same as the generic OData connector and Dynamics 365. The SAP-specific part is in app/infra/connectors/sap.py.

Service URL (base_url): the root of an OData service, always over https. Each connection reads one service; to read another, create another connection.

  • On-premise (SAP Gateway): https://<host>/sap/opu/odata/sap/API_BUSINESS_PARTNER. The last segment is the technical name of the service.
  • S/4HANA Cloud: https://<tenant>-api.s4hanacloud.ondemand.com/sap/opu/odata/sap/API_BUSINESS_PARTNER.

Authentication (auth):

  • basic (the default): username and password of a communication user dedicated to BeryX.
  • oauth2_client_credentials: token_url, client_id, client_secret and scope (optional). The token request goes only to the token_url, which must be https and goes through the anti-SSRF guard.
  • api_key: api_key and api_key_header (optional; APIKey by default, the header of the SAP Business Accelerator Hub sandbox). It is the mode for trying things out against the sandbox.

The none mode (no credentials) is refused for sap. The password, the client_secret and the api_key are never shown back and never appear in logs.

Other fields:

  • sap_client (optional): the SAP client, with three digits (e.g. 100). It goes as sap-client=100 on every request.
  • entity_sets (optional): a list, or comma-separated text, of the entity sets to read (e.g. A_BusinessPartner,A_BusinessPartnerAddress). By default, all of those in $metadata, up to 200.
  • sample_size (optional): rows in the profile sample, from 1 to 5000 (1000 by default).

Authorisations — on the customer's side:

  1. On-premise: activate the service in Gateway (transaction /IWFND/MAINT_SERVICE) and give the communication user a role with the S_SERVICE authorisation for that service. In the back end, the role only needs display authorisations on the data the service exposes.
  2. S/4HANA Cloud: create a communication arrangement for the communication scenario that exposes the service, with a communication user, and use that user's credentials in the basic mode.

Connection test: test_connection reads $metadata and asks for one row ($top=1) of the first entity. When it fails, it says what to fix:

SAP response Diagnosis
401 User and password, or the mode's credentials, refused
403 The user lacks the service's S_SERVICE authorisation
404 Service not activated in Gateway (/IWFND/MAINT_SERVICE) or wrong URL
400, with sap_client Wrong SAP client (sap-client)

Read-only: requests to the service are GET only, through the ReadOnlyHttpClient (anti-SSRF guard and DNS pinning). The connector never asks for the CSRF token (X-CSRF-Token: Fetch), which SAP only requires for writes. With oauth2_client_credentials, the only POST is the token request, to the token_url.

Columns, count and sample:

  • Columns and types come from $metadata (EDMX), with the Edm types mapped to BeryX's.
  • The row count comes from the service: $inlinecount=allpages in OData v2, $count in v4 and, if the response does not carry the count, GET <EntitySet>/$count.
  • Column metrics are computed on a sample of sample_size rows ($top, with $format=json), as in Dynamics: null and distinct percentages are relative to the sample.
  • v2 /Date(…)/ dates and Edm.DateTimeOffset values become UTC. Edm.Int64 and Edm.Decimal, which v2 sends as text, become numbers. This applies to the profile and to the rows that scans read (odata.py: convert_value, row_value). In the rows, Edm.Decimal stays an exact Decimal, as in the SQL connectors.
  • Pagination follows __next (v2) and @odata.nextLink (v4) only when the link has the same origin (scheme, host and port) as the base_url. A link to another origin is refused.
  • The connector asks for rows in blocks of 1,000 ($top). If the service serves a block in smaller pages (Northwind uses pages of 20 and of 500), the connector follows the links. When the whole block has arrived, it asks for the next one with $skip, up to sample_size (in the profile) or the scan's row limit (odata.py: _collect).

Validation on save (422): base_url missing or not https, unknown auth or none, missing authentication fields, sap_client without three digits, token_url not https, invalid api_key_header, invalid names in entity_sets and sample_size outside 1 to 5000.

Installation: no extra. The connector only uses the base dependencies (httpx).

Network: in production, the anti-SSRF guard refuses destinations in private networks. An on-premise Gateway must be reachable over https from BeryX's egress IP (see the top of this guide).

Out of scope: a direct connection to the HANA database (hdbcli). BeryX reads SAP through the OData services.

Process integration with SAP and Salesforce

"Does it integrate with our SAP?" — the short answer:

  • We read SAP S/4HANA and SAP Gateway over OData, Salesforce, Dynamics 365 and the databases of ERPs that run on SQL Server — Primavera, PHC and Sage. Other OData v2 and v4 services are read through the generic OData connector.
  • We never write to the ERP or the CRM, nor do we install plugins inside SAP or Salesforce: that would mean giving up read-only access. The fix comes out in SQL/PySpark or as a Pull Request, for your process to approve and apply.
  • We do not validate the record at the moment it is saved (inside the SAP or Salesforce transaction): we measure what was saved, in the next scan. Validating at the point of entry, with writes, is the territory of MDM and quality suites (SAP MDG, Informatica).

OData (generic)

The odata connector (card #212) reads OData v2 and v4 services that have no connector of their own in BeryX: a company's internal OData services or public services. Each entity set is a table. It is the base of SAP (app/infra/connectors/odata.py) and behaves the same way: GET only, columns from $metadata, count from the service, profile on a sample and pagination only within the same origin as the base_url. The connection test reads $metadata and asks for one row of the first entity.

Fields:

  • base_url (https): the root of the service, where <base_url>/$metadata answers (e.g. https://services.odata.org/V2/Northwind/Northwind.svc).
  • auth: none by default, for public services with no credentials. The basic, oauth2_client_credentials and api_key modes take the same fields as SAP.
  • sap_client, entity_sets and sample_size: as in SAP.

Limits: only the entity sets declared in the root $metadata (odata.py: parse_metadata, list_tables). A path through another entity, such as Company('…')/Customers, is left out. Business Central has not been validated.

Public services: with auth none, such as the OData.org reference services, https://services.odata.org/V2/Northwind/Northwind.svc/ (v2) and https://services.odata.org/TripPinRESTierService/ (v4). They are the odata sources in the connector matrix (public tier).

Validation on save (422): the same as SAP, except that none is accepted.

Installation: no extra (httpx).

Dedicated connectors: for the Dynamics 365 Dataverse use dynamics, and for SAP use sap.

REST/JSON API (generic)

The rest_api connector (card #269) reads REST APIs and microservices that return JSON and have no connector of their own. Each configured GET endpoint is a dataset, profiled on a sample (app/infra/connectors/rest_api.py). The connection test asks for the first page of the first endpoint.

Fields:

  • base_url (https): the root of the API, with no query (e.g. https://api.example.com/v1).
  • auth: none by default; bearer with token; basic with username and password; api_key with api_key in a header of its own (api_key_header, X-API-Key by default). The key never goes in the query: a secret in the URL ends up in proxy logs.
  • endpoints: the list of endpoints, each a path (/users) or an object with path, name?, records_path?, params?, pagination?, total_path? and contract_path?. The name is the dataset name; without it, it comes from the path.
  • records_path: where the list sits in the payload, in simple JSONPath ($.data, $.data.items[*]). Without it, the list is the payload itself or the first usual key holding objects (data, items, results, records, value, entries).
  • pagination: type = none, offset (offset_param and limit_param), page (page_param, page_start 0 or 1), cursor (cursor_path in the body and cursor_param in the request) or link (Link header with rel="next", or next_path in the body); page_size up to 1000. It applies to every endpoint and each endpoint can have its own.
  • total_path: where the API states the total of records (e.g. $.meta.total); without it, the row count is what the sample read.
  • allowed_hosts: extra hosts that pagination links may point to (e.g. a CDN). They get the requests without the credential.
  • sample_size (1000 by default, at most 5000) and max_pages (50 by default, at most 500): caps on reading each endpoint.

How it reads: GET only, through the ReadOnlyHttpClient (anti-SSRF with DNS pinning). Reading stops when a page comes back empty or short, when a cursor repeats, after max_pages pages or when the sample is full (rest_api.py: _collect). The top-level fields of each record are the columns; nested objects and lists stay as JSON text in the rows and take the object or array type in the catalog.

Host allowlist: every request, including pagination links and each hop of a redirect, only goes out to the base_url host (at the same origin) or to a host in allowed_hosts; any other destination is refused before the request (rest_api.py: _check_host). The credential only goes to the base_url origin. An allowlist host that resolves to an internal IP is still blocked by the anti-SSRF guard.

API contract: with contract (an OpenAPI 3.x or Swagger 2.0 document, in JSON or YAML), each profile compares the schema of the endpoint's GET 200 response (the contract_path, or the path itself) with the sample records, field by field, nested ones included (morada.cidade). The scan opens a schema_change issue with source contract and the downstream impact when there is drift: a required field that came in no record ("removed"), a field the contract does not declare ("new") or a type outside the declared one (app/infra/connectors/api_contract.py; app/domain/scans/schema_changes.py: record_contract_drift). An optional field missing from the sample does not count, and neither does a sample with no records. The schema of one record is reached through the path the list came from: the records_path, or the one detection picked ($.data in a {"data": […]} envelope) (rest_api.py: locate_records). Only the document's own $ref are followed: the contract never makes the connector fetch anything. A $ref cycle, as in a tree, is cut where it loops back, and each schema is read only once. Reading has caps: 64 levels of nested allOf/anyOf/oneOf and 1,000,000 steps, where every element walked counts (a property, a required name or a type entry copied, a $ref hop, a paths, content or messages key), even when several schemas share it through a $ref or a YAML anchor (api_contract.py: _SchemaReader). YAML merge keys (<<) copy at most 1,000,000 pairs (api_contract.py: _ContractLoader). On Kafka topics, the same contract takes an AsyncAPI 2.x or 3.x document and compares the payload of the channel message named after the topic (kafka.py: _contract_check).

Validation on save (422): base_url in https and with no credentials in the URL, auth mode and the mode's fields, paths that start with / with no .. or query, simple JSONPath, a known pagination type (cursor needs cursor_path), an api_key_header that is not a protocol header, allowed_hosts with host names only, integer caps and a contract readable within the reading caps, with every schema read already on save (api_contract.py: validate_contract). On a Kafka topic, a contract that is not AsyncAPI, or that goes past those caps, also gives 422.

Installation: no extra (httpx).

Limits: no OAuth2 or session cookies, and no search POST (an API that only lists through POST is left out). The Link header read is the RFC 8288 one.

Weaviate

The weaviate connector (card #1031) reads the schema and the count of a Weaviate instance, in the Cloud or self-hosted, and never reads an object or a vector. Each collection is a dataset (app/infra/connectors/weaviate.py).

Fields:

  • url (https): the cluster address (e.g. https://<cluster>.weaviate.cloud). The path, query and fragment are dropped, and the connector connects to the root (normalize_url).
  • api_key: the API key, sent in the Authorization: Bearer header, only to the origin of the url. Without a key, requests go unauthenticated.

What it reads: only these GET requests, from a closed list (ALLOWED_PATHS): /v1/meta, /v1/users/own-info, /v1/schema, /v1/schema/{class}, /v1/schema/{class}/tenants and /v1/nodes/{class}?output=verbose. A request outside the list is refused before it leaves (path_allowed), so /v1/objects, /v1/graphql, /v1/batch and /v1/aggregate are never requested. The connector's transport (ClosedListTransport) checks every request that leaves and refuses any redirect, even to a path on the list: the HTTP client would follow it with the key.

Columns: one per named vector, with the vector index mark, and one per schema property. In an older collection, with no named vectors, the unnamed vector is called default, as in the official client. A vector with the name of a property gets the _vector suffix. The mark carries:

  • the method, from vectorIndexType. hnsw and flat have their own facet value, and dynamic and hfresh give other;
  • the metric, from vectorIndexConfig.distance;
  • the dimension, only when the vectorizer block declares it (dimensions). With customer vectors it stays undeclared;
  • the model, only when the vectorizer declares it: model in text2vec-openai and modelId in text2vec-google, among the modules in MODEL_KEYS. With customer vectors (none), with a module outside the list or with the model in the container image (text2vec-transformers), the model stays undeclared and is never deduced.

Count: the sum of objectCount per shard, from /v1/nodes/{class}?output=verbose (object_count). Each shard counts once, even with replicas on other nodes, and the count is marked as estimated, because Weaviate updates it with a delay. A shard not loaded (loaded: false) or without objectCount, or a tenant without a shard on any node, leaves the count unknown, not zero (row_count_unknown). In that case the row_count_min rule is not evaluated, the volume stays out of anomalies and drift, and the dataset has no row count.

Tenants: only the number, in the profile's vector_partitions entry. The tenant names are not stored.

Rules: there is no per-column profile and no rows: fetch_rows refuses. A rule on a column, such as a not_null on a vector, is indeterminate, with no issue and outside the score.

Minimum role: with RBAC, a custom role with read_collections, read_nodes and read_tenants, without read_data. With this role, Weaviate lets the schema and the count be read and refuses the objects. The connection test reads the key's own roles from /v1/users/own-info (reads_objects) and warns when it has read_data or manage_data, or one of the built-in roles viewer, admin and root. When Weaviate does not say the key's roles, the test says it did not check. On a self-hosted instance without RBAC, only the connector enforces the limit.

Validation on save (422): the url must have a host, use https and carry no credentials. The SSRF guard validates the host of the URL the connector normalises, the same one it connects to (config_host). On each request, the ReadOnlyHttpClient validates the destination again, with IP pinning. The config is stored encrypted with Fernet and cannot be edited: changing the url means creating another connection, with the key in the same request.

Installation: no extra (httpx).

Still to test: the trial on a real instance, with a role without read_data, unloaded shards and inactive tenants, is for the owner to approve.

Tickets (Jira, Linear, ServiceNow, Azure DevOps, GitHub, GitLab)

This is not a data source: it is the way out to the team's ticket tool. BeryX creates the ticket from an issue, incident or suggestion (the «Create ticket» button, bulk tickets and the assistant card) and keeps the link on the entity. The integration is set up in Notifications → Tickets (admin). «Test connection» validates the config as saving does and reads the provider's targets without creating anything (POST /notification-channels/tickets/connection-test). The six providers meet the same TicketProvider contract (app/infra/tickets/base.py: validate_config, create, get_status, list_targets) and are listed in app/infra/tickets/registry.py.

Provider kind API and body Authentication Targets (list_targets) Suggested priority Status (get_status)
Jira Cloud jira REST v3 (/rest/api/3/issue), body in ADF Basic (email + API token) projects and issue types (project/search?expand=issueTypes) in the ticket body the issue's statusCategory
Linear linear GraphQL (issueCreate), body in markdown personal API key teams (teams) priority field (1 urgent … 4 low) the issue's state.type
ServiceNow servicenow Table API (/api/now/table/{tabela}): incident, problem, sn_customerservice_task or another Basic (integration account) or OAuth client credentials active assignment groups (sys_user_group) urgency and impact (ServiceNow computes the priority) the record's state and active
Azure DevOps Boards azure_devops REST wit/workitems/${tipo} with JSON Patch, description in HTML PAT (Work Items: Read & write) the project and its work item types (wit/workitemtypes) in the work item body the work item's System.State
GitHub Issues github REST POST /repos/{owner}/{repo}/issues, body in markdown token (fine-grained PAT with Issues: write) or the git integration's GitHub App the repository (GET /repos/{owner}/{repo}, checks that issues are on) in the body; labels datavault and data-quality the issue's state (open/closed)
GitLab Issues gitlab REST v4 POST /projects/{id}/issues, description in markdown token (PRIVATE-TOKEN, scope api) or the git integration's the project (GET /projects/{id}, checks that issues are on) in the body; labels datavault and data-quality the issue's state (opened/closed)

Writes: each provider writes to create the ticket. During sync (card #381), Jira, Linear and ServiceNow (card #255) also comment on an already linked ticket (comment, on by default) and, with transition in the integration's policy, close or reopen it, only for tickets in the integration's project (Jira) or team (Linear) and, in ServiceNow, for records BeryX created or that belong to the integration's assignment group. Apart from the comment and the status (in ServiceNow, with the incident's resolution code and notes), none edits other fields. Two POSTs do not write: Linear reads through GraphQL queries and ServiceNow in OAuth mode exchanges the credentials for a token at POST /oauth_token.do.

ServiceNow both ways (card #255): app/infra/tickets/servicenow.py.

  • Critical incident → INC. The automation rule (card #197) opens the record in the integration's table (incident by default, or problem). The rule's project is the assignment group and its configuration_item is the CI (cmdb_ci), both by sys_id. Without them, the config's assignment_group and cmdb_ci apply. Every record created carries correlation_display = BeryX.
  • Field allowlist. The config can add fixed values to creation in extra_fields, only in these fields: category, subcategory, contact_type, caller_id, business_service, service_offering, company and location. Reference fields take the sys_id. A field outside the list gets 400 on save. Reads ask only for sys_id, number, state, active, assignment_group and correlation_display: BeryX never reads the record's text, author or comments.
  • ServiceNow → BeryX. The status arrives by polling (state and active, at the policy's interval, 15 min by default); there are no inbound ServiceNow webhooks. In incident, states 6, 7 and 8 count as closed; in problem, 106 and 107; in any table, active=false too. A rule's INC closed in ServiceNow leaves the issue acknowledged in BeryX (ack_on_close), never resolved. A ticket linked by hand resolves it when it closes.
  • BeryX → ServiceNow. The comment is an internal note (work_notes), in a PATCH to the record. With transition, resolving in BeryX resolves the incident: state 6, with the config's close_code («Solution provided» by default) and a close_notes. Reopening in BeryX puts a resolved incident back in progress (state 2). A closed (7) or cancelled (8) one is not reopened. If an instance rule turns the change down without an error, the status stays as it was. Transitions are for the incident table only: in the others, the state model belongs to the instance and BeryX only comments.
  • Integration account permissions: read sys_user_group and the table, create records and write work_notes, state, close_code and close_notes.

Security: the config is encrypted with Fernet (TicketIntegration.config_encrypted) and the API never returns it. The host the customer configures (the Jira site, the ServiceNow instance, the Azure DevOps Server base_url, the GitHub Enterprise or GitLab self-managed api_url) goes through the anti-SSRF guard on save and on every request, with IP pinning and no redirects (app/infra/network/outbound.py). Errors carry an excerpt of the provider's response without the credentials, and the providers write no logs (app/infra/tickets/http.py).

Timeouts and retries: each request has 20 s. Reads (targets, status and the OAuth token) try up to 3 times on 429 and 5xx, waiting 0.5 s and 1 s, or the Retry-After up to 5 s. Creation is not repeated, because after a 5xx the ticket may already exist. A 429 on creation goes up with the Retry-After and bulk tickets retry with their own backoff (app/domain/integrations/ticket_bulk.py).

GitHub and GitLab with the git integration: instead of its own token, the config can carry git_integration_id. The token (or the GitHub App) and the api_url then come from the git integration of the same workspace and the same provider, and its repository is the default.

Fix Pull Request (GitHub, GitLab, Azure DevOps Repos)

This is not a data source: it is the way out for an approved fix to the customer's git repository. An accepted suggestion goes out as a Pull Request (the «Open PR» button, admin only and with the plan's git_remediation feature): a new datavault/fix-* branch, one commit with the SQL, the PySpark and the dbt test in the mapped folders, and the PR for human review. There is never a push to the base branch. The merge moves the suggestion to applied and the next scan confirms it as verified. The integration is set up in Notifications → Git repository (admin), and «test» reads the repository without writing anything.

Provider kind Repository API Authentication PR status
GitHub github org/repo REST v3: tree, commit and new ref through the Git Data API, then POST /pulls fine-grained token (Contents and Pull requests) or GitHub App the PR's merged and state
GitLab gitlab group/project REST v4: POST /repository/commits with start_branch, then POST /merge_requests project access token (scope api, Developer role) the merge request's state
Azure DevOps Repos azure_devops org/project/repo Git REST API with api-version=7.1: POST /refs, POST /pushes and POST /pullrequests PAT (Code scope: Read & write) the PR's status: completed is merged, abandoned is closed

Azure DevOps Repos (card #1206): app/infra/git/azure_devops.py. Requests go to {api_url}/{org}/{project}/_apis/git/repositories/{repo}. The api_url is https://dev.azure.com by default; on Azure DevOps Server it is the URL up to the collections (https://server/tfs) and the collection takes the organisation's place. Project and repository names may have spaces and accents (they are encoded in the URL). The PR comes from three writes, none of them to a ref that already exists:

  • POST /refs creates the new ref on the base branch's commit, with a zero oldObjectId (create only);
  • POST /pushes puts the commit on that ref, only if it is still on the base commit (oldObjectId). A ref left over by a failed push, still on the base commit, is reused; on another commit, the request is refused;
  • POST /pullrequests opens the PR with the datavault and data-quality labels. The description goes up to 4000 characters: if it is longer, the middle is cut and the art. 50 labelling stays.

The status arrives by polling (GET /pullrequests/{id}, at most every 10 minutes) or through the suggestion's «Refresh status». PR review (check and comment) and code issues stay on GitHub and GitLab: on Azure DevOps a code issue is a work item, created through Tickets (Azure DevOps Boards).

Security: the token, the PAT or the GitHub App key are encrypted with Fernet before saving (GitIntegration.token_encrypted) and the API never returns them; provider errors come out without them. The host the customer configures (GitHub Enterprise, GitLab self-managed, Azure DevOps Server) goes through the anti-SSRF guard on save and on every request, with IP pinning and no redirects (app/infra/git/client.py). On Azure DevOps, the guard validates the repository URL, built by the same function the provider uses (repo_url). The integration cannot be edited: changing the URL or the repository means removing it and creating it again, with the credential. Each provider only makes the requests on its allowlist (app/infra/git/base.py), with no DELETE, merge or write to an existing ref.

Who can invoke a model (Amazon Bedrock)

Card #1020. It is not a data connector: the reference lives on the agent record, and the read comes from the IAM of the customer's AWS account. Bedrock models have no resource policy, so who can invoke comes only from IAM. Evaluation in quem-invoca-modelos.md.

It is part of the “AI & Data Security” add-on: in a workspace without it, the four routes (…/cloud-reference and …/invokers) answer 404. With it, it also needs the plan with compliance, like the rest of the agent registry.

  • Reference on the record: PUT /api/v1/compliance/ai-agents/{agent_id}/cloud-reference (admin) saves the account (12 digits), the region, the ARN of the foundation model, inference profile or application inference profile, the principal the agent invokes the model with (principal_arn) and the reader role (reader_role_arn), in the same account. BeryX generates an ExternalId per agent and returns it in external_id: it goes in the role's trust policy. The role and the ExternalId are encrypted with Fernet. Changing the account, the region or the ARN without sending the role again returns 422 (reader_role_required).
  • Credential: a role with an ExternalId, which BeryX assumes with sts:AssumeRole from the runtime's AWS identity (app/infra/aws_identity.py, the same as BYOK 3). The session shows in the customer's CloudTrail as beryx-iam-read-<agent_id>. The role's policy is capped by the managed SecurityAudit. Never ReadOnlyAccess, which reads S3 and CloudWatch Logs content.
  • What is read: POST /api/v1/compliance/ai-agents/{agent_id}/invokers/collect (admin) calls only three IAM actions, all reads: GetAccountAuthorizationDetails (users, roles, tags and trust policies), SimulatePrincipalPolicy (per principal, bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream on the model ARN, which also authorise Converse and ConverseStream) and ListServiceSpecificCredentials (Bedrock's long-term API keys). The IAM API goes by POST, signed with SigV4, to the fixed host iam.amazonaws.com, with the anti-SSRF guard and the pinned IP (app/infra/aws_iam.py). BeryX never writes to IAM and never reads the model invocation logging, S3 or CloudWatch.
  • Cap: up to 300 simulated principals and 150 s per read. A read cut short says how many principals were left to evaluate (unread_principals, status partial): never “nobody can invoke”.
  • Gaps: GET /api/v1/compliance/ai-agents/{agent_id}/invokers (admin) gives each principal that can invoke, with the gaps from the cross-check against the record: not_agent (not the record's principal_arn), public (the role's trust policy admits *), api_key (long-term API key) and no_owner (no owner tag).
  • Limits (limitations): short-term API keys cannot be listed (short_term_keys_not_listed); the bedrock-mantle endpoint accepts keys that denying bedrock:CallWithBearerToken does not block (mantle_endpoint_not_covered); SimulatePrincipalPolicy does not evaluate RCPs (rcp_not_evaluated).

It shows who can invoke; it does not stop anyone from invoking.

Who invoked a model (Amazon Bedrock)

Card #1035. The same reference and the same reader role as the snapshot of who can invoke, with one more action: cloudtrail:LookupEvents, which SecurityAudit already has. InvokeModel, InvokeModelWithResponseStream, Converse and ConverseStream are CloudTrail management events: they are in the Event history without the customer turning anything on and at no cost, for the last 90 days. Also in the “AI & Data Security” add-on and only for admins.

  • What is read: POST /api/v1/compliance/ai-agents/{agent_id}/invocations/collect (admin) calls only LookupEvents, with EventSource bedrock.amazonaws.com, in the record's region and since the last read. It goes by POST with the X-Amz-Target of LookupEvents, signed with SigV4, to the fixed host cloudtrail.<região>.amazonaws.com, with the region validated before the URL is formed, the anti-SSRF guard and the pinned IP (app/infra/aws_cloudtrail.py). The session shows in the customer's CloudTrail as beryx-trail-read-<agent_id>.
  • What counts: only the four invocation events for the record's model, and only the AwsApiCall ones: streaming calls have a second AwsServiceEvent event, which would count twice. Only the count per pseudonymised principal, model (requestParameters.modelId) and day is kept. The principal of a role session is the role ARN (sessionIssuer); the session name, which can be a person's email, the IP and the rest of the event are never kept. A call with an errorCode counts in errors, not as an invocation.
  • The record's model: it counts by the id, by the ARN and by the system inference profiles of the same foundation model, by id or by ARN (prefixes us., eu., apac., au., jp., in. and global.). That is how recent Claude models are invoked on demand. With the record on the foundation-model, a call to eu.anthropic.claude-… counts, and the other way round. An application inference profile only counts when it is the record's reference: its id does not say the model, and GetInferenceProfile is not on the closed list.
  • What is never read: Bedrock's model invocation logging (CloudWatch Logs and the S3 prefix BedrockModelInvocationLogs/), which keeps the requests and the responses. The reader has a closed list of one action, and the role's policy has neither logs:GetLogEvents nor s3:GetObject (the latter only on the prefix of the model artifact, if the customer turns on the artifact scan, card #1287).
  • Delay: CloudTrail delivers events “within an average of about 5 minutes”, with no guarantee. The read keeps how far it is complete (seen_until): the end of the interval minus 15 minutes. Nothing inside that margin is counted or cross-checked: it goes into the next read.
  • Limit: LookupEvents accepts 2 requests per second, per account and per region, and returns 50 events per page. A read goes through at most 100 pages; beyond them it is cut short (truncated, status partial) and says the interval left to read (pending_from to pending_to), which the next read reads first.
  • Gaps: GET /api/v1/compliance/ai-agents/{agent_id}/invocations (admin) gives the invocations seen per principal and per day, with seen_until and seen_from. seen_from follows the 90-day retention: it moves to the first day kept and, with no read for more than 90 days, starts again at the next read. not_agent: the principal is not the record's principal_arn, the #1020 gap. outside_snapshot: the principal is not in the snapshot of who can invoke, and the snapshot is out of date. The ARN only shows when the snapshot or the record has it; the others show by pseudonym. Zero events give “Invocations seen: 0” with the “seen until”, not “no invocations”.
  • Limits (limitations): inference through the bedrock-mantle endpoint is a data event and is not included (mantle_endpoint_not_covered); nor are asynchronous invocations (async_invocations_not_covered).

It shows who invoked; it does not stop anyone from invoking.

Who can invoke and who invoked an endpoint (Amazon SageMaker AI)

Card #1037. The record with provider aws_sagemaker and the endpoint ARN (arn:aws:sagemaker:<região>:<conta>:endpoint/<nome>, in the record's account and region), with the same reader role and the same ExternalId as Bedrock. Also in the “AI & Data Security” add-on and only for admins.

  • Who can: the same IAM read (app/infra/aws_iam.py), with sagemaker:InvokeEndpoint and sagemaker:InvokeEndpointAsync on the endpoint ARN. InvokeEndpointWithResponseStream is authorised by sagemaker:InvokeEndpoint. SageMaker has no resource policies and no API keys of its own: ListServiceSpecificCredentials is not called, and the only limitation is rcp_not_evaluated.
  • Who invoked: only with the data events of the AWS::SageMaker::Endpoint resource turned on in a trail. They are not in the Event history, so the trail is read from S3 (app/infra/aws_s3_trail.py): DescribeTrails and GetEventSelectors say which trail records them and where it delivers, and ListObjectsV2 and GetObject read only under AWSLogs/<conta>/CloudTrail/. Only the InvokeEndpoint* events of the record's endpoint count, with Bedrock's count, pseudonyms, 15-minute margin and gaps. Files are read newest first. Those delivered between 16 minutes before and 15 minutes after the end of the read are always read, because a cut among them would leave nothing complete, up to 600; after them, at most 300 more. With more files, the read is cut short and says what was left to read, and each following read takes 300 more of the files left. With more than 600 files in those 31 minutes, the read fails with too_many_files and counts nothing.
  • No record: with no trail recording those data events, GET …/invocations gives status no_record and the page says “no record”, not “no invocations”. no_record_reason says why: no_data_events (no trail records them) or organization_trail (only an organisation trail records them, or the member account cannot see its selectors), and then the page says that trail is not read, not that no trail records them. Organisation trails deliver to AWSLogs/<org>/<conta>/ and are not read (organization_trails_not_read); event selector filters beyond the resource type are not evaluated (selector_filters_not_evaluated).
  • What is never read: SageMaker's Data Capture (the request and response payloads, in S3) and Bedrock's model invocation logging, which can sit in the same bucket. No S3 request leaves with a key outside the CloudTrail prefix, and a listed key outside it stops the read (key_outside_prefix).
  • Role policy: Bedrock's, plus this one. s3:GetObject stays on the prefix only, never on the whole bucket. s3:ListBucket belongs to the bucket, so the s3:prefix condition limits it to the same prefix. If the trail encrypts with SSE-KMS, the role also needs kms:Decrypt on the trail's key.
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["cloudtrail:DescribeTrails", "cloudtrail:GetEventSelectors"],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": "s3:ListBucket",
      "Resource": "arn:aws:s3:::<bucket-do-trail>",
      "Condition": {"StringLike": {"s3:prefix": "AWSLogs/<conta>/CloudTrail/*"}}
    },
    {
      "Effect": "Allow",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::<bucket-do-trail>/AWSLogs/<conta>/CloudTrail/*"
    }
  ]
}
  • Cost to the customer: SageMaker data events are paid to CloudTrail, 0.10 USD per 100,000 events. The ListObjectsV2 and GetObject requests are made by the customer's role and paid in their S3. BeryX never turns on a trail or an event selector.

It shows who can invoke and who invoked; it does not stop anyone from invoking.

Who can change the model (SageMaker AI, Bedrock, Vertex AI and Databricks)

Card #1274. On SageMaker AI, the same record as card #1037 (provider aws_sagemaker and the endpoint ARN), with the same reader role and the same ExternalId. Also in the “AI & Data Security” add-on, with compliance in the plan. It has no read route of its own: it runs right after each read of who can invoke (POST /api/v1/compliance/ai-agents/{agent_id}/invokers/collect or the scheduled read), with the same credentials. A failure here leaves the previous snapshot, and the who-invokes one stays as it came out.

  • The chain (app/infra/aws_model_change.py): DescribeEndpoint (the EndpointConfigName), DescribeEndpointConfig (the ModelName of each variant, up to 10), DescribeModel (the ModelDataUrl of each container, including those of an inference pipeline and the AdditionalModelDataSources, the image and the ModelPackageName), DescribeModelPackage (the ModelApprovalStatus, CreatedBy and LastModifiedBy) and GetModelPackageGroupPolicy (the resource policy of the registry group). SageMaker goes by POST (JSON 1.1) to api.sagemaker.<região>.amazonaws.com, and X-Amz-Target only accepts these five. Then, on the artifact's bucket, GetBucketPolicy and GetBucketAcl, only by GET to ?policy and ?acl, never with an object key. The hosts are formed after the region and the bucket name are validated, with the anti-SSRF guard and the pinned IP (http_guard). The registry version is only read in the endpoint's account and region.
  • Who can change it: the SimulatePrincipalPolicy of the who-invokes read (app/infra/aws_iam.py), per principal, on three targets: the artifact object (s3:PutObject and s3:DeleteObject, up to 3 artifacts per read), the endpoint (sagemaker:UpdateEndpoint and sagemaker:UpdateEndpointWeightsAndCapacities) and the registry version (sagemaker:CreateModelPackage and sagemaker:UpdateModelPackage). The same caps: 300 principals and 150 s. These six actions are only simulated: they do not go into the role's policy.
  • Gaps: GET /api/v1/compliance/ai-agents/{agent_id}/changers gives the counts per category (artifact_write, endpoint_update, registry_write) and the gaps: artifact_bucket_open (the bucket's policy or ACL lets anyone or another account write), registry_policy_open (the registry group's policy does too), unapproved_version (the served model does not come from an Approved version) and changer_not_in_sheet (whoever can change it is not the record's principal_arn and has no owner tag equal to the record's owner). On this route, the ARNs, the artifact URI and the image only go to admins, and other members see the counts. The Annex IV sheet shows whoever reads it the URI, the image and the approval status of each variant.
  • Not read (unread): permission_missing (the role lacks the action), bucket_name_unsupported (a bucket with dots in its name: the *.s3.<região>.amazonaws.com certificate covers only one level), bucket_other_region, artifact_not_s3, read_failed and truncated (more than 10 variants or 3 artifacts). A bucket with no policy (NoSuchBucketPolicy) is not a refusal.
  • Limits (limitations): the model file is not opened (model_file_not_scanned); the simulation evaluates neither RCPs (rcp_not_evaluated) nor resource policies, and whoever writes only through them shows in the *_open gaps, not in the counts (resource_policy_grants_not_counted).
  • Role policy: the one of card #1020, plus this one. SecurityAudit (version v95, read on 2026-11-21), which serves as the ceiling, already has six of them, through sagemaker:Describe* and s3:GetBucket*. sagemaker:GetModelPackageGroupPolicy is not in it: without it, the registry group's policy stays unread (permission_missing) and the rest of the read goes on. None reads an object, and the role does not need s3:GetObject on the artifact's bucket.
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "sagemaker:DescribeEndpoint",
        "sagemaker:DescribeEndpointConfig",
        "sagemaker:DescribeModel",
        "sagemaker:DescribeModelPackage",
        "sagemaker:GetModelPackageGroupPolicy"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": ["s3:GetBucketPolicy", "s3:GetBucketAcl"],
      "Resource": "arn:aws:s3:::<bucket-do-artefacto>"
    }
  ]
}
  • Amazon Bedrock: on an aws_bedrock record with the ARN of a custom (custom-model/…) or imported (imported-model/…) model of the account, GetCustomModel gives the training data and GetImportedModel the artifact, and the buckets are read as above. The simulation covers only the object (s3:PutObject and s3:DeleteObject). A foundation model or an inference profile asks for nothing (provider_managed_model). The role needs two more actions, read-only:
{
  "Effect": "Allow",
  "Action": ["bedrock:GetCustomModel", "bedrock:GetImportedModel"],
  "Resource": "*"
}
  • Vertex AI: on a gcp_vertex record with an endpoint, the reader SA of card #1038 reads the endpoint and the served model on the location's host and the artifact's bucket (app/infra/gcp_model_change.py), and the Policy Analyzer runs one query per target (the endpoint, the model and the bucket), each against the scope's daily cap. The SA needs four more permissions, in a custom role: aiplatform.endpoints.get, aiplatform.models.get, storage.buckets.get and storage.buckets.getIamPolicy (on the artifact's bucket or on the project). The bucket's projectNumber is read too: with the project as the queries' scope, a bucket in another project leaves who writes to the artifact "not read" (bucket_other_project). roles/cloudasset.viewer on the organisation already covers the queries and the buckets of its other projects. A publisher model asks for nothing (provider_managed_model).
  • Databricks: on a databricks record with a serving endpoint, the connection's token reads, by GET only (app/infra/connectors/databricks_serving.py), the endpoint list (the config.served_entities), the endpoint's ACL, GET /api/2.1/unity-catalog/models/{nome} and the served version, the permissions on function, on the schema and on the catalog, and the schema's and the catalog's owner (GET /api/2.1/unity-catalog/schemas/{c.s} and GET /api/2.1/unity-catalog/catalogs/{c}, who count among those who register versions). The token needs CAN_VIEW on the endpoint (or to see it in the list) and USE CATALOG, USE SCHEMA and BROWSE (or EXECUTE) on the model, to read the owner and the storage_location; USE CATALOG and USE SCHEMA also cover the catalog's and the schema's owner. Storage managed by Unity Catalog is not read: who writes to the artifact stays "not read".
  • Not read yet: on an Azure OpenAI record, the status is not_supported. BeryX never writes to the customer's account.

It shows who can change the model; it does not stop anyone from changing it.

Who can invoke and who invoked a model (Databricks)

Card #1036. The same record, the same snapshot and the same counts as Bedrock, with the Databricks connection that already exists: the token reads the REST API only with GET and runs SQL on the system tables. Also in the “AI & Data Security” add-on and only for admins. Assessment in quem-invoca-modelos.md, section “Databricks Model Serving”.

  • Reference on the record: PUT /api/v1/compliance/ai-agents/{agent_id}/cloud-reference (admin) with provider databricks, the connection (connection_id, a Databricks connection in the workspace), the Databricks workspace ID (workspace_id, the o= in the URL) and the model (resource_name): the serving endpoint name, catálogo.esquema.nome of the model service, or system.ai.<nome> for pay-per-token models. principal_arn is the email or the application ID the agent invokes with. Changing the connection, the workspace or the model deletes the previous snapshot and counts.
  • Who can, on a legacy serving endpoint: GET /api/2.0/serving-endpoints (the ID by name) and GET /api/2.0/permissions/serving-endpoints/{id}. The CAN_QUERY and CAN_MANAGE levels count, both invoke, direct or inherited (via says where from). CAN_VIEW does not invoke.
  • Who can, on a Unity Gateway model service: EXECUTE (or ALL_PRIVILEGES) through GET /api/2.1/unity-catalog/permissions/model_service/{nome}, and also on the schema and the catalog, which the object inherits (…/permissions/schema/{catálogo.esquema} and …/permissions/catalog/{catálogo}). The docs only show the PATCH on the model service path: the GET is left to the test plan. The owner of a custom model service invokes and is not in the permissions (owner_not_listed).
  • system.ai: “By default, all account users have EXECUTE on system.ai”. account users (and the workspace users group) shows as access for everyone, with the public gap. Without reading the system.ai schema, what the docs say counts.
  • Groups: a group is a single principal, without members (groups_not_expanded), as in the grants.
  • Incomplete read: a 403 on one read does not end it. Which one was missing is said (serving_endpoints_denied, endpoint_acl_denied, uc_permissions_denied), and the snapshot comes out partial, never “nobody can invoke”. The docs do not say which permission reads an endpoint's ACL: they only say changing it needs CAN_MANAGE.
  • Who invoked: POST /api/v1/compliance/ai-agents/{agent_id}/invocations/collect (admin) first reads system.ai_gateway.usage, only the columns workspace_id, service_type, service_name, endpoint_name, requester, requester_type, event_time and status_code. It filters on the record's workspace_id, because the table holds the whole account, and on the service_type MODEL_SERVICE and MODEL_PROVIDER_SERVICE: requests to MCP services are not model invocations. It aggregates by requester and UTC day, and keeps the count per pseudonymised principal, service and day. A status_code of 400 or more counts in errors.
  • As a fallback, on a legacy serving endpoint: system.serving.endpoint_usage, only with workspace_id, served_entity_id, requester, request_time and status_code, and the endpoint's served_entity_id values taken from system.serving.served_entities (only served_entity_id, workspace_id and endpoint_name). It is read only for an endpoint without rows in system.ai_gateway.usage. Once the Unity Gateway table has rows for the endpoint, it is no longer read: the docs do not say whether a request goes into both, and this way it never counts twice. The legacy page says “Only account admins have permission to view or query”: if the connection's credential cannot read it, the read says endpoint_usage_denied and carries on. BeryX does not ask for an account admin credential.
  • What is never read: the inference tables, in both generations, which keep the raw request and response (turned on from the start in agents deployed with mlflow.deploy()). In system.ai_gateway.usage, the columns ip_address, url, user_agent, request_tags, session_metadata, endpoint_metadata, mcp_metadata and routing_information. In system.serving.endpoint_usage, the columns usage_context and client_request_id. The SQL names its columns and never uses SELECT * (app/infra/connectors/databricks_serving.py).
  • Delay: “Records are typically available within one hour”. The read keeps how far it is complete (seen_until): now minus 2 hours. What arrives later goes into the next read.
  • Limit: up to 20,000 aggregated rows per read. Beyond them, the read stops at the last complete day and comes out partial, and the next one starts on that day.
  • No record: both tables only have rows with usage tracking turned on (usage_tracking_required). Without rows for the service, the page says “no record”, not “no invocations”.

Privileges to grant the connection's service principal, by a metastore admin: USE CATALOG on the system catalog, USE SCHEMA and SELECT on the system.ai_gateway schema. By default, only someone who is both account admin and metastore admin reads system.ai_gateway.usage. For who can, CAN_VIEW on the endpoint is what the test plan expects to be enough.

Cost for the customer: Unity Gateway usage tracking is paid, per 1 KB of payload, and only charged when turned on. The usage tracking page for legacy endpoints gives it no price. The queries run on the connection's warehouse.

It shows who can invoke and who invoked; it does not stop anyone from invoking.

Who can invoke and who invoked a model (Vertex AI)

Card #1038. The Bedrock counterpart for a model in the customer's Vertex AI, with the same snapshot, the same gaps and the same routes. The reference stays on the agent's record, and the reads come from Policy Analyzer and from the Data Access audit logs of their project (app/infra/gcp_model_access.py, app/domain/compliance/model_access_gcp.py). Also in the “AI & Data Security” add-on and for admins only.

  • Reference on the record: PUT /api/v1/compliance/ai-agents/{agent_id}/cloud-reference (admin) with provider gcp_vertex: the project (account_id), the location (region), the endpoint (projects/…/locations/…/endpoints/…) or the publisher model (projects/…/locations/…/publishers/…/models/…) in resource_arn, the email of the SA or user the agent invokes with (principal_arn), the organisation (organization_id) and the reader SA (reader_service_account). BeryX generates a verification token per agent and returns it in external_id: it goes in the reader SA's description. The SA, the organisation and the token are encrypted with Fernet. Changing the project, the location, the model or the organisation without sending the SA again gives 422 (reader_role_required).
  • Credential: the customer's reader SA, impersonated without a key (generateAccessToken, 15 minutes, in memory only) from the runtime identity (app/infra/gcp_identity.py), like Dataplex and BYOK 4. The BeryxTech principal needs roles/iam.serviceAccountTokenCreator on it, and the SA needs to read itself (roles/iam.serviceAccountViewer), so that BeryX can check the token in the description. Roles: roles/cloudasset.viewer on the organisation and roles/logging.privateLogViewer on the project. roles/logging.privateLogViewer reads the Data Access logs of every service in the project: what limits the read to Vertex AI is BeryX's filter.
  • Who can: POST /api/v1/compliance/ai-agents/{agent_id}/invokers/collect (admin) calls analyzeIamPolicy with the aiplatform.endpoints.predict permission on the endpoint (for a publisher model, on the project) and the organisation as scope, which brings the bindings inherited from the folder and the organisation. Without the role on the organisation (PERMISSION_DENIED), the read falls back to the project and comes out with inherited_not_included. Groups are not expanded (groups_not_expanded). Gaps: not_agent, public (allUsers or allAuthenticatedUsers) and conditional (a binding with a condition counts, and says so). Each row says in via where the binding is.
  • Policy Analyzer cap: above 20 queries per organisation per day, Google Cloud requires Security Command Center Premium or Enterprise. BeryX makes at most 10 per organisation per day (DAILY_QUERY_CAP), and a read stopped by the cap comes out with daily_query_cap and keeps the previous snapshot. Each query counts in the scope it reads. A query that Google refuses (the SA does not have the role in that scope, the organisation or the project) does not count, so a record with another customer's organisation or project does not spend that customer's cap. Agents of the same model in the workspace share the query of the day (reused), and reading the same agent again on the same day makes no query either.
  • Who invoked: POST /api/v1/compliance/ai-agents/{agent_id}/invocations/collect (admin) calls entries.list only with the project's logName cloudaudit.googleapis.com%2Fdata_access, protoPayload.serviceName="aiplatform.googleapis.com" and the inference methods Predict, RawPredict, GenerateContent and StreamGenerateContent, and asks only for the fields protoPayload.authenticationInfo.principalEmail, protoPayload.methodName, protoPayload.resourceName and timestamp. It counts only the entries for the record's model, per pseudonymised principal, model and day, as in Bedrock. One request per second per project (60 per minute), at most 30 pages of 1000 entries per read, and the first read goes back 30 days. The last 15 minutes are left for the next read.
  • What is never read: request-response logging to BigQuery, online prediction logging and the endpoint's container logs. The filter only matches data_access, resourceNames is only the project, and a test fails if the filter changes.
  • No record: Data Access logs are off by default. With no entry for the model, GET …/invocations gives status no_record with the no_record_reason no_data_access_entries, and the page says “no record”, not “no invocations”: logging turned off and nobody invoking cannot be told apart. Requests in express mode leave no log for the customer (express_mode_not_logged), and neither does a principal exempted in the Data Access configuration (exempt_principals_not_logged).
  • Cost for the customer: turning on Data Access logs costs USD 0.50 per GiB ingested, after 50 GiB free per project per month, with 30 days in the _Default bucket (Google Cloud Observability pricing page, read on 2026-11-07 in assessment #1019). BeryX never turns a log on.
  • Limits (limitations): Policy Analyzer reads neither deny policies nor Principal Access Boundary (deny_policies_not_evaluated, principal_access_boundary_not_evaluated).

It shows who can invoke and who invoked; it does not stop anyone from invoking.

Who can invoke a deployment (Azure OpenAI)

Card #1039. The record with provider azure_openai, the subscription, the resource group, the Microsoft.CognitiveServices/accounts account and the deployment, kept as the deployment's resource ID, and the objectId the agent invokes with, in principal_arn. Also in the “AI & Data Security” add-on and only for admins. Who invoked stays out: Microsoft's docs do not say whether the RequestResponse log carries the caller's identity, and the evaluation's test plan answers that first.

  • Credential: an app (service principal) of the customer, with no secret, through workload identity federation. The app has a federated credential with the issuer https://accounts.google.com, the subject from the response (federation_subject, the BeryxTech runtime SA) and the agent's audience (federation_audience, api://AzureADTokenExchange/beryx-<32 hex>). BeryX keeps only the tenant, the client id and the audience, encrypted with Fernet, and exchanges a Google ID token with that audience for an app-only token at login.microsoftonline.com (app/infra/azure_identity.py). Changing the subscription, the resource group, the account or the deployment without sending the tenant and the client id again is refused (azure_reader_required).
  • Audience per agent: the issuer and the subject are the same for every BeryX customer. The audience is not: BeryX generates it when the tenant and the client id are saved and generates a new one when either changes (app/domain/compliance/model_invokers_azure.py). The app only gives a token to the agent whose audience is on its federated credential, and another workspace pointing at the same tenant and the same app does not get one. A tenant or an app that does not exist, or an app with no matching federated credential, all give the same code, federation_refused, so the response does not say which apps trust BeryX.
  • Own role, assigned on the OpenAI resource: only these three reads. Not Reader on a resource group, which also reads Application Insights, where Foundry tracing lives.
{
  "Name": "BeryX Azure OpenAI permissions reader",
  "IsCustom": true,
  "Actions": [
    "Microsoft.Authorization/roleAssignments/read",
    "Microsoft.Authorization/roleDefinitions/read",
    "Microsoft.CognitiveServices/accounts/read"
  ],
  "NotActions": [],
  "DataActions": [],
  "NotDataActions": [],
  "AssignableScopes": ["/subscriptions/<subscription>"]
}
  • Names, optional: the Directory.Read.All application permission in Microsoft Graph. Without it, the snapshot shows the objectId, a pseudonym the customer's admin resolves in Entra ID, and the names_not_resolved limitation.
  • What is read: POST /api/v1/compliance/ai-agents/{agent_id}/invokers/collect (admin) only makes GET requests, through the ReadOnlyHttpClient, to the fixed host management.azure.com (app/infra/azure_rbac.py): the resource, for properties.disableLocalAuth; the roleAssignments with $filter=atScope(), which brings the assignments on the resource and above (resource group, subscription, management group); and each role's definition, read on the resource. With Directory.Read.All, each objectId's name at graph.microsoft.com/v1.0/directoryObjects/{id}. Every request, redirects and nextLink included, goes through a closed list of paths.
  • Who can through Entra ID: whoever holds a role whose dataActions, minus the notDataActions, cover an inference action on a deployment (chat/completions, completions, embeddings, audio, realtime, search, the Responses API…), wildcards included. Contributor and Owner have no dataActions and do not invoke this way.
  • The key bypasses the roles: with disableLocalAuth false or missing, the resource key gives full access without a role. The snapshot shows the key row (…/accounts/<conta>#keys, api_key gap) and whoever has listKeys in actions, directly or by wildcard (Contributor and Owner, with *, and Cognitive Services User), with the list_keys gap. With disableLocalAuth true, neither. BeryX never calls listKeys.
  • Limit: ARM allows 250 reads refilled at 25 per second, per subscription and per service principal. One read makes at most 200, waits for the Retry-After of a 429 (up to 30 seconds per request and 60 per read; beyond that it fails with read_deadline_exceeded and the previous snapshot stays) and reads up to 20 pages of assignments and 60 distinct roles. Beyond that, it is cut short and counts the principals left to evaluate. These also come with the snapshot: groups count as one principal, without the members (groups_not_expanded); deny assignments are not read (deny_assignments_not_read); assignment conditions are not evaluated and count as access (conditions_not_evaluated); and PIM eligible assignments are not listed (pim_eligible_not_read).
  • What is never read: the keys themselves (listKeys), Foundry tracing in Application Insights, API Management's LLM logs and the Responses API and Assistants history. A request outside the closed list does not leave, and a test fails if the connector tries one.
  • Personal data: objectIds and names are the customer's data. Only the pseudonym goes to the logs, and no path sends them to an LLM. Names only come out in the admin API, and the snapshot expires 90 days after the read, like Bedrock's.

It shows who can invoke; it does not stop anyone from invoking.

The model artifact scan (Amazon S3 and Google Cloud Storage)

Card #1287. It is not a data connector: it is an exception to the rule of reading the posture only, off by default. An admin turns it on for an agent with an Amazon Bedrock, SageMaker AI or Vertex AI reference, and BeryX then reads the model file, by byte ranges, with the reader role or service account the record already has. It is part of the “AI & Data Security” add-on (without it, the routes answer 404) and needs the plan with compliance.

  • Turning it on: PUT /api/v1/compliance/ai-agents/{agent_id}/artifact-scan (admin) with enabled and up to 10 artifact_uris: s3://bucket/chave on Bedrock and SageMaker AI, gs://bucket/objeto on Vertex AI. The event goes to admin_events (model_artifact_scan_enabled, with the cloud and how many URIs, without the URIs). enabled: false deletes the verdicts. S3 buckets with dots in the name are not read (the virtual-host TLS does not cover them).

  • New permission, on the prefix only: on S3, s3:GetObject on the artifact prefix, on the record's reader role (it serves HeadObject and GetObject with Range); if the bucket encrypts with SSE-KMS, also kms:Decrypt on the key. On GCS, storage.objects.get on the artifact's bucket (with an IAM condition on the prefix, if you want), on the reader service account. Without it, the artifact stays “not read” (permission_missing) and the rest of the register is unchanged.

    {"Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::<bucket>/<prefixo-do-modelo>/*"}
    
  • What is read: POST /api/v1/compliance/ai-agents/{agent_id}/artifact-scan/collect (admin), or the scheduled read every 24 hours, on the model_artifact_scan.requested queue. On S3, HEAD and GET with Range and If-Match to https://<bucket>.s3.<região>.amazonaws.com/<chave>, signed with SigV4 and always with x-amz-expected-bucket-owner (the record's account); on GCS, the metadata objects.get and the content one (alt=media, ifGenerationMatch, Range) on storage.googleapis.com. All through the anti-SSRF guard with the IP pinned (app/infra/model_artifact_reader.py). The session shows in the customer's CloudTrail as beryx-artifact-scan-<agent_id>.

  • Only the bytes that matter: the header of a safetensors file, the 24 bytes of a GGUF file, the end of the file, the central directory and the .pkl members of a PyTorch zip (ZIP64 included), the opcodes of a pickle. Tensors are never requested. Ceilings per artifact: 64 MiB, 512 requests, 2 million opcodes and 120 s. An artifact with the same version (ETag or generation) only gets the HEAD.

  • Nothing is deserialised: the opcodes are read without running the pickle (app/domain/compliance/model_artifact_pickle.py).

  • Verdict: safe_format, pickle_clean, pickle_dangerous (with the call names) or not_read (with the reason), in GET /api/v1/compliance/ai-agents/{agent_id}/artifact-scan (admin) and on the Annex IV sheet, without the URI.

  • What stays "not read" because of the URI or the format: a folder is not read, because the scan reads objects and listing a prefix would need s3:ListBucket (or storage.objects.list), which is not requested (prefix_not_listed, with no request at all). Folders are a URI ending in "/" (SageMaker AI's S3Prefix always ends that way), the s3Uri of a model imported into Bedrock and Vertex AI's artifactUri, which each one's documentation says are the folder of the model files (re-read on 24/11/2026). To read the files of a folder, list them one by one (for example …/model.safetensors). A model.tar.gz (SageMaker AI's ModelDataUrl) stays tar_gz_not_supported: a gzip file cannot be read by ranges, and reaching a tar member would mean decompressing the weights that come before it.

It shows what the file would do when loaded; it does not stop it from loading, and it does not detect backdoors in the weights.

What exists in the cloud without a record (AI registry)

Card #1194. The reverse of “who invokes”: instead of starting from the record, it reads what exists in the customer's cloud, with the same credentials, and shows in the AI registry what has no record. Also in the “AI & Data Security” add-on and only for admins. Official listings only, confirmed in each provider's documentation on 2026-11-19 (app/infra/aws_ai_inventory.py, app/domain/compliance/ai_discovery.py). BeryX never installs anything in the customer's cloud nor writes to it.

  • Sources: one per credential that already exists. The reader role of a Bedrock or SageMaker AI record reads its account and region; the reader SA of a Vertex AI record, the project and the location; the reader app of an Azure OpenAI record, the account; each Databricks connection, its workspace; and each Snowflake connection, the Cortex account parameters, with no listing (card #1272). With several records on the same source, the credential of the most recently changed record counts; retired ones do not.
  • AWS: POST /api/v1/compliance/ai-inventory/sources/{source_id}/collect (admin) calls SageMaker AI's ListEndpoints (POST to api.sagemaker.<região>.amazonaws.com, JSON 1.1), Bedrock's ListCustomModels, ListImportedModels and ListProvisionedModelThroughputs (GET to bedrock.<região>.amazonaws.com) and Bedrock Agents' ListAgents (POST to bedrock-agent.<região>.amazonaws.com/agents/, 10 per page). It also reads LookupEvents with the EventSource bedrock.amazonaws.com, the same as card #1035, only to count invocations per model and per day, without who invoked. The session shows in the customer's CloudTrail as beryx-discovery-<agent_id>, with the record's same role and ExternalId.
  • Vertex AI: endpoints.list of the project and the location, on the <localização>-aiplatform.googleapis.com host, with fields asking only for the name, the date and the names of the deployed models. The global location does not list endpoints (location_not_listable).
  • Azure OpenAI: GET {conta}/deployments?api-version=2024-10-01 on ARM, and its nextLink, through the same closed list of paths as card #1039.
  • Databricks: GET /api/2.0/serving-endpoints. From an external model only the provider and the name come out, never the configuration, which carries the secret references. The pay-per-token ones Databricks creates (databricks-…, with foundation_model only) do not count, and the read says how many (system_endpoints).
  • What is never read: requests, responses, Bedrock's model invocation logging, SageMaker's Data Capture, Vertex AI's prediction logs and Databricks' inference tables. Each reader has a closed list of requests, the hosts are formed only after validating the region or the location, and each one goes through the anti-SSRF guard with the IP pinned (http_guard).
  • Left to read: a refused listing does not end the read: it says which one was missing and why. permission_missing (the permission below is missing), truncated (it passed the page cap), deadline (the 45 s of the AWS listings) or the cloud's code. A refused credential comes out in error_code, and the earlier observations stay.
  • In the cloud, without a record: GET /api/v1/compliance/ai-inventory (admin) gives each resource with the account or project, the region, the name, the first and last sighting and, on Bedrock, the invocations of the last 30 days. A model invoked without a record comes first: it is the strongest signal. A resource has a record when a record points to it (on Bedrock, also through a system inference profile of the same foundation model) or was born from it. A resource the complete listing no longer brings stops being present, and observations expire 90 days after the last one.
  • Create record: POST /api/v1/compliance/ai-inventory/observations/{observation_id}/register, with the name the person confirms. The record starts as “proposed”, with the model and, when it can have one, the cloud reference, saved through the PUT …/cloud-reference path and with the source's credential (the same ExternalId, the same verification token, the same audience), only at the same destination. Bedrock agents and custom, imported or provisioned-throughput models have no read of who invokes: the record starts without the reference.
  • Ignore: POST /api/v1/compliance/ai-inventory/observations/{observation_id}/ignore, with the reason (3 to 500 characters), which stays in the audit trail (ai_observation_ignored). …/reopen shows it again.
  • Coverage: observed with a record ÷ observed, per observation source: the AI clouds, shadow AI in the sources (card #810) and the Trust API consumers, with each one's last read and what was left to read. Never “complete inventory”: “X of Y of what BeryX observed”. The same count goes to the control matrix (AI-INVENTORY) and to the board pack, counts only.
  • In the demo: nothing reads the cloud. Marolva's discoveries are synthetic, saved through the same path (app/domain/demo/ai_inventory_seed.py).

Permissions to add to each credential, read in the providers' documentation on 2026-11-19:

  • AWS, to the reader role of card #1020. SecurityAudit, which serves as the ceiling, already has them, all at the “List” level and without resource-level permissions:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "sagemaker:ListEndpoints",
        "bedrock:ListCustomModels",
        "bedrock:ListImportedModels",
        "bedrock:ListProvisionedModelThroughputs",
        "bedrock:ListAgents"
      ],
      "Resource": "*"
    }
  ]
}
aws iam put-role-policy --role-name <role-de-leitura> --policy-name beryx-ai-discovery --policy-document file://beryx-ai-discovery.json
  • Vertex AI, to the reader SA of card #1038: aiplatform.endpoints.list, in a custom role. roles/aiplatform.viewer also has it, but it reads data (features, examples, RAG corpora) and does not fit.
gcloud iam roles create beryxAiDiscovery --project=<projeto> --title="BeryX descoberta de IA" --permissions=aiplatform.endpoints.list --stage=GA
gcloud projects add-iam-policy-binding <projeto> --member='serviceAccount:<sa-de-leitura>' --role='projects/<projeto>/roles/beryxAiDiscovery' --condition=None
  • Azure OpenAI, to the custom role of card #1039: Microsoft.CognitiveServices/accounts/deployments/read in Actions. With the updated role in JSON (the one above, with the new action and the role's Id):
az role definition update --role-definition @beryx-leitor-azure-openai.json
  • Databricks: nothing new. The list brings the endpoints on which the connection's token has at least CAN_VIEW; the others are not seen.

Shows what exists; changes nothing in the customer's cloud.

AI controls (card #1271). In the same read of an Azure OpenAI or Vertex AI source, with the same credential, BeryX reads the AI controls and shows the findings in the AI registry, each with the fix to copy (app/infra/azure_ai_posture.py, app/infra/gcp_ai_posture.py, app/domain/compliance/ai_control_posture.py). REST references read on 2026-11-20. The fix is a set of az or gcloud commands: BeryX does not apply it. On Azure, the deployment and the filter policy change through GET, jq and PUT (a deployment's PATCH only accepts sku and tags), and a system policy (Microsoft.*) gives rise to a custom one, created from it.

  • Azure OpenAI / Foundry: GET {conta} (publicNetworkAccess, networkAcls.defaultAction, disableLocalAuth, encryption.keySource), GET {conta}/deployments (each deployment's model.name and raiPolicyName), GET {conta}/raiPolicies?api-version=2024-10-01 (the Jailbreak, Protected Material Text/Code and category filters, with enabled and blocking; a filter the policy does not list stays unproven, unknown) and GET {conta}/providers/Microsoft.Insights/diagnosticSettings?api-version=2021-05-01-preview (whether the Audit or RequestResponse categories are on, and the destination type, never the id). The system policy Microsoft.DefaultV2 counts as blocking jailbreaks, as the documentation describes it; another policy the list does not return stays unread.
  • Google (Model Armor and Agent Platform, the aiplatform.* API): the Model Armor templates in the location (GET modelarmor.<localização>.rep.googleapis.com/v1/projects/{p}/locations/{l}/templates), the project's floor setting (GET modelarmor.googleapis.com/v1/projects/{p}/locations/global/floorSetting: the Agent Platform integration, integratedServices and aiPlatformFloorSetting, only exists on the project), the endpoints with fields asking only for the network, Private Service Connect, whether there is a KMS key and the predictRequestResponseLoggingConfig without the destination, and the effective Data Access logs: POST …/v1/projects/{p}:getIamPolicy does not return what is inherited, so POST …/v3/folders/{id}:getIamPolicy and …/v3/organizations/{id}:getIamPolicy of the folder and organization above are read too (through GET cloudresourcemanager.googleapis.com/v3/projects/{p} and /v3/folders/{id}) and DATA_READ and the exemptions are merged. Of each getIamPolicy only auditConfigs is read (of the exempted members, only the count).
  • Findings: deployment without content filters (the policy read has hate, sexual, self-harm and violence at enabled: false; the fix turns them back on with GET, jq and PUT of the policy, or moves the deployment to Microsoft.DefaultV2 if the policy is a system one), without a jailbreak filter (enabled: false) or with the filter only annotating (enabled: true, blocking: false). A deployment without raiPolicyName has the default policy (filtering: default_presumed), and embeddings, Whisper, transcription and speech deployments do not go through the filtering system (not_applicable, learn.microsoft.com/azure/ai-foundry/openai/concepts/content-filter, read on 2026-11-20): none gives a filter finding. Of the account: key authentication on, public access or no customer-managed key, and request logs off; an account read without properties stays unread (malformed_response). On Google: no template in the location, template without the prompt injection and jailbreak filter, floor setting missing or inspect-only, public endpoint or without CMEK, Data Access logs of aiplatform.googleapis.com off or with exemptions.
  • Unread is not a finding: a refused read stays in controls.unread, with the code. The Data Access logs are the union of the levels: on at the organization counts as on for the project. If no level read turns them on and the folder or organization refuse getIamPolicy, the state is null (inheritance_not_read) and BeryX does not say they are off. The floor setting is decided by the project's only: refused, it stays not_read. In a location without Model Armor, the host modelarmor.<localização>.rep.googleapis.com does not resolve: the templates stay host_not_allowed, with no request, and the discovery and the other controls are read anyway. An unexpected failure of the controls read stays in their error_code and never takes the discovery down.
  • What is never read: the keys (listKeys), threads, messages, request logs and the BigQuery of the endpoints' request logging. Nor Model Armor's sanitizeUserPrompt, which would carry the prompt.

Permissions to add, read in the providers' documentation on 2026-11-20:

  • Azure, to the custom role of card #1039, in Actions: Microsoft.CognitiveServices/accounts/raiPolicies/read and Microsoft.Insights/diagnosticSettings/read (Microsoft.CognitiveServices/accounts/read and …/deployments/read are already there). The Reader role on the account has all four.
az role definition update --role-definition @beryx-leitor-azure-openai.json
  • Google, to the reader SA of card #1038, in a custom role on the project: modelarmor.templates.list, modelarmor.templates.get, modelarmor.floorSettings.get, resourcemanager.projects.get, resourcemanager.projects.getIamPolicy and aiplatform.endpoints.list. For the inherited Data Access logs, resourcemanager.folders.get and resourcemanager.folders.getIamPolicy on the folder and resourcemanager.organizations.getIamPolicy on the organization (roles/iam.securityReviewer has them); without them, the logs stay “not read” when the project does not turn them on.
gcloud iam roles create beryxAiControls --project=<projeto> --title="BeryX controlos de IA" --permissions=modelarmor.templates.list,modelarmor.templates.get,modelarmor.floorSettings.get,resourcemanager.projects.get,resourcemanager.projects.getIamPolicy,aiplatform.endpoints.list --stage=GA
gcloud projects add-iam-policy-binding <projeto> --member='serviceAccount:<sa-de-leitura>' --role='projects/<projeto>/roles/beryxAiControls' --condition=None

AI controls on Databricks and Snowflake (card #1272). With the connection the workspace already has, with no new credential, in the same read of the AI registry source (app/infra/connectors/databricks_serving.py, app/infra/connectors/snowflake_ai_posture.py, app/domain/compliance/ai_control_posture.py). References read on 2026-11-21.

  • Databricks: GET /api/2.0/serving-endpoints/{name} of each customer endpoint the discovery list brought, up to 100. From ai_gateway (which the documentation calls “AI Gateway (legacy)”), the input and output guardrails (safety, pii.behavior, and the deprecated invalid_keywords and valid_topics; in Public Preview), inference_table_config, rate_limits and usage_tracking_config; from config, only auto_capture_config (the legacy inference table). Agent endpoints (task agent/…) only have inference tables, so they give no guardrails or rate limit finding; guardrails are only asked of chat and completions endpoints (llm/v1/chat, llm/v1/completions). Permission: nothing new, the same CAN_VIEW as the list.
  • Snowflake: one source per Snowflake connection, with no listing: SHOW PARAMETERS LIKE 'AI_SETTINGS' IN ACCOUNT (Cortex AI Guardrails, Enterprise Edition, with mode BLOCK or LOG), SHOW PARAMETERS LIKE 'CORTEX_ENABLED_CROSS_REGION' IN ACCOUNT, SHOW GRANTS ON ACCOUNT (who has USE AI FUNCTIONS or a USE AI FUNCTION <nome>, up to 5000 rows) and SELECT CURRENT_REGION() (the account's region, to compare cross-region inference with its geography). None needs a warehouse. The documentation read does not say which privilege each SHOW needs: a refusal stays unread, with its code, and the others are read.
  • Findings: chat endpoint without guardrails (high); inference table on (medium; high if the grants snapshot shows account users reading it; outside the snapshot, the grants stay uncrossed); endpoint without rate limits (medium); usage tracking off (low: without it, “who invoked” has no rows); cross-region inference on in an account with datasets with personal data (high); account guardrails only logging (LOG, high) or off (medium: they need cross-region inference); PUBLIC with USE AI FUNCTIONS (low: it is the default since 20/02/2026).
  • The fix to copy: on Databricks, databricks serving-endpoints get … | jq '.ai_gateway | …' and put-ai-gateway with the object read (the PUT replaces the whole ai_gateway), or the inference table's SHOW GRANTS ON TABLE and REVOKE SELECT; on Snowflake, the parameter's ALTER ACCOUNT or the REVOKE from PUBLIC. BeryX does not apply it.
  • What is never read: the rows of the inference tables, the Unity Gateway service policies (Unity Gateway is generally available, says the Databricks page of 17/11/2026; the service policies are in Beta, are attached only through the UI and have no read API in the documentation read on 2026-11-21), the AI_SETTINGS text (only the state) and the Cortex Guard of AI_COMPLETE, which is an option of each call. The controls screen says these two.

Model version (card #1339). In the who-can-invoke read of each Azure OpenAI or Bedrock record, with the same credential, BeryX reads the version the cloud serves, the upgrade option and the lifecycle, and compares them with the record (app/infra/azure_model_version.py, app/infra/aws_model_lifecycle.py, app/domain/compliance/model_versions.py). Official methods read on 2026-11-23. Metadata only: none of the reads returns requests, responses or logs.

  • Azure OpenAI / Foundry: GET {conta}/deployments?api-version=2024-10-01 (the same list as the inventory, and its nextLink; from the record's deployment, model.name, model.version and versionUpgradeOption: OnceNewDefaultVersionAvailable, OnceCurrentVersionExpired or NoAutoUpgrade, learn.microsoft.com/en-us/rest/api/aiservices/accountmanagement/deployments/get) and GET {conta}/models?api-version=2024-10-01 (from the served version, lifecycleStatus and deprecation.inference; from the model, the version with isDefaultVersion, learn.microsoft.com/en-us/rest/api/aiservices/accountmanagement/accounts/list-models). The models path joined the closed list of card #1039; the single deployment stays outside it.
  • Amazon Bedrock: GET bedrock.<região>.amazonaws.com/inference-profiles/{id} (GetInferenceProfile: the models[].modelArn of an inference profile, system or application; the model is read here, not from the id prefix, docs.aws.amazon.com/bedrock/latest/APIReference/API_GetInferenceProfile.html) and GET bedrock.<região>.amazonaws.com/foundation-models/{modelId} (GetFoundationModel: modelLifecycle, with status ACTIVE or LEGACY and legacyTime, publicExtendedAccessTime and endOfLifeTime, …/API_GetFoundationModel.html and …/API_FoundationModelLifecycle.html), signed with SigV4 (service bedrock) and with the session beryx-model-version-<agent_id> in the customer's CloudTrail.
  • Not read: a refused read stays in unread (permission_missing, resource_not_found, model_not_listed, several_models) and is never a finding. SageMaker AI, Vertex AI and Databricks are not read: SageMaker AI has no provider version, Google publishes Gemini retirement dates only in its documentation (docs.cloud.google.com/vertex-ai/generative-ai/docs/learn/model-versions) and the Databricks serving endpoint pins the Unity Catalog version (entity_version), with no automatic upgrade or end of life in the API (docs.databricks.com/api/workspace/servingendpoints/get).

Permissions to add, read in the providers' documentation on 2026-11-23:

  • Azure, to the custom role of card #1039, in Actions: Microsoft.CognitiveServices/accounts/models/read (…/deployments/read is already there). The Reader role on the account has both.
az role definition update --role-definition @beryx-leitor-azure-openai.json
  • AWS, to the reader role of card #1020: bedrock:GetInferenceProfile and bedrock:GetFoundationModel, both at the «Read» access level.
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["bedrock:GetInferenceProfile", "bedrock:GetFoundationModel"],
      "Resource": "*"
    }
  ]
}
aws iam put-role-policy --role-name <role-de-leitura> --policy-name beryx-model-version --policy-document file://beryx-model-version.json

AI controls on AWS (card #1270). In the same read of an AWS source, with the card's read role and ExternalId, BeryX reads the configuration of the account's and region's AI controls (app/infra/aws_ai_posture.py, findings in app/domain/compliance/ai_control_posture_aws.py). Bedrock and SageMaker AI API Reference read on 2026-11-19. Read only, through a closed list of requests, with the same client as the inventory (SigV4, the region's three hosts, the IP pinned by the anti-SSRF guard).

  • Bedrock: ListGuardrails (every page, through nextToken) and the GetGuardrail of the version each agent uses (or the DRAFT): the PROMPT_ATTACK filter on input, the content categories, PII, denied topics and grounding, each blocking (BLOCK), only detecting (action NONE), off (strength NONE, enabled set to false, or absent) or unproven (the action was not read). Each agent's guardrailConfiguration comes from ListAgents. ListEnforcedGuardrailsConfiguration says whether the account enforces a guardrail on every invocation in the region, and GetModelInvocationLoggingConfiguration whether invocation logging is on, where it goes (S3 or CloudWatch, with the bucket name, CloudWatch's large data one too) and whether it stores the text.
  • SageMaker AI: for each endpoint the inventory listed (up to 50), DescribeEndpoint, DescribeEndpointConfig and the DescribeModel of the variants' models: network isolation, VPC, the volume's KMS key and data capture.
  • Findings: agent without a guardrail, guardrail without a prompt-attack filter or with it only detecting, guardrail that only detects, account without an enforced guardrail (the fix is the IAM block with the bedrock:GuardrailIdentifier condition key), invocation logging off, logging that stores the prompts' text, and endpoint without network isolation or VPC. Each one carries the fix to copy (aws commands or the policy block). BeryX does not apply it.
  • Not read is not a finding: a refused read stays in controls.unread (permission_missing or the AWS code) and does not stop the others. A guardrail with an unproven filter does not count as "detect only".
  • Who reads the logging destination: the finding for logging that stores the text crosses the logging bucket with the buckets' grants snapshot (card #789; app/domain/compliance/ai_log_destination.py). If the bucket is one of the workspace's S3 connections on AWS (no endpoint_url, or an amazonaws.com host) with the snapshot read, the finding says how many principals read it and whether it is public, with the link to "Who accesses the source" (Privacy, "AI & Data Security" tab). Without that connection, or without the snapshot, it says "not read", never zero; the CloudWatch log group is always "not read". There is no new read: only what the snapshot already has, and only counts. The principals' names and the bucket's name do not go to the logs or to the posture report.
  • What the configuration does not say: whether a given call carried a guardrail (on InvokeModel and Converse the guardrail goes in the request), whether a filter catches an attack, and whether the logs reach their destination. The "account without an enforced guardrail" finding only comes with all three proofs: no guardrail enforced on the account, no AWS Organizations effective BEDROCK_POLICY (DescribeEffectivePolicy; no organization counts as none) and no IAM policy in the account (inline or customer-managed, from the GetAccountAuthorizationDetails the #1020 role already has) with the bedrock:GuardrailIdentifier condition key on an invoke action. Any of the three unread, or the IAM read cut short, gives no finding. Only the count leaves the IAM read.
  • What never leaves the reader: the agents' instruction and promptOverrideConfiguration, the SageMaker containers' Environment, image and ModelDataUrl, and the guardrails' definitions, examples and messages. Nor the invocation logs or Data Capture.

Permissions to add to the #1020 read role, all at "Read" or "List" level:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "bedrock:ListGuardrails",
        "bedrock:GetGuardrail",
        "bedrock:ListEnforcedGuardrailsConfiguration",
        "bedrock:GetModelInvocationLoggingConfiguration",
        "sagemaker:DescribeEndpoint",
        "sagemaker:DescribeEndpointConfig",
        "sagemaker:DescribeModel",
        "organizations:DescribeEffectivePolicy"
      ],
      "Resource": "*"
    }
  ]
}
aws iam put-role-policy --role-name <role-de-leitura> --policy-name beryx-ai-controls --policy-document file://beryx-ai-controls.json

Only for the prompt check (a record option, SEGURANCA.md § "An agent's prompt"), two more, at "Read" level, scoped to the agent: bedrock:GetAgentAlias and bedrock:GetAgentVersion. GetAgentVersion returns the instruction: BeryX computes its SHA-256 and discards the text.

aws iam put-role-policy --role-name <role-de-leitura> --policy-name beryx-prompt-check --policy-document '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":["bedrock:GetAgentAlias","bedrock:GetAgentVersion"],"Resource":"arn:aws:bedrock:<region>:<account-id>:agent*/<agent-id>*"}]}'

Agents on the platforms (card #1273). In the same read of an AWS or Azure OpenAI source, with the same credential, BeryX reads what each agent's configuration says it can do: the tools, the knowledge bases and what sits behind them, the network and the identity (app/infra/aws_agent_config.py, app/infra/azure_agent_config.py, app/domain/compliance/ai_platform_agents.py). Operations and permissions re-read in the providers' documentation on 2026-11-23. Read-only, through closed lists of requests, with the anti-SSRF guard and the pinned IP.

  • Bedrock Agents (bedrock-agent.<região>): GetAgent (the model, the execution role, the memory), ListAgentActionGroups and GetAgentActionGroup of the DRAFT version, the working configuration (the Lambda executor and the system tools AMAZON.CodeInterpreter, ANTHROPIC.Computer, ANTHROPIC.Bash and ANTHROPIC.TextEditor), ListAgentKnowledgeBases, GetKnowledgeBase, ListDataSources and GetDataSource (on S3, the bucket and the inclusionPrefixes; on SharePoint, the sites; on Confluence, Salesforce and the web, the hosts). An alias may serve a version older than DRAFT.
  • AgentCore (bedrock-agentcore-control.<região>, signing name bedrock-agentcore): ListAgentRuntimes and GetAgentRuntime (the networkMode, PUBLIC or VPC, the inbound authorizer and the role), ListGateways and GetGateway (the authorizerType and the policy engine mode, ENFORCE or LOG_ONLY) and ListGatewayTargets and GetGatewayTarget (the type, the host of an MCP_SERVER target, with the port if it is not 443 (the path and the query stay out: they may carry the server's key), and the credentialProviderType). Runtimes and gateways enter the inventory like the other resources. A runtime's code belongs to the customer: its tools are not visible. AgentCore is not in every Bedrock region: where the control plane host does not resolve, runtimes and gateways stay host_not_allowed, with no request, and the Bedrock agents are read anyway.
  • Microsoft Foundry: GET {conta}/projects?api-version=2025-06-01 on ARM and, in each project, GET https://{subdomínio}.services.ai.azure.com/api/projects/{projeto}/agents?api-version=v1 and …/connections?api-version=v1, with the token for the https://ai.azure.com audience: the model, the tools (mcp, code_interpreter, computer_use_preview, azure_ai_search…) and the connections they depend on, with the credential type and never the value.
  • Microsoft Entra Agent ID: GET /v1.0/servicePrincipals/microsoft.graph.agentIdentity and, for each identity, GET …/microsoft.graph.agentIdentity/owners (only how many). Sponsors can only be listed with AgentIdentity.ReadWrite.All, a write permission BeryX does not ask for: they stay unread (write_permission_required).
  • What is never stored: Bedrock's instruction and promptOverrideConfiguration and Foundry's instructions (the SHA-256 is computed in memory and would only be kept with the #1270 record option, which today exists only for Bedrock agents), the values of environmentVariables, the headers and authorization of an MCP tool, the tools' OpenAPI schema, the curatedQueries and the parsingPrompt. Threads, messages and invocations are never requested.
  • Findings: the agent runs code or controls a computer; the runtime on a public network; the gateway without authentication (NONE) or with the policy engine only logging (LOG_ONLY); an MCP target with a static credential (API_KEY, or fixed headers); an agent identity without owners (the sponsors are left unread); and, what BeryX adds, the knowledge base over a bucket and prefix the S3 connector already classified with personal data, without the record linking those datasets. The dataset matches by the object path (the connector swaps / for __ in the name, and here that is undone), and only an S3 connection to AWS (no endpoint_url, or on an amazonaws.com host) counts: a MinIO or R2 bucket with the same name is another bucket. “Create record” links them with the inference role and returns the MCP servers the configuration states. What was not read gives no finding: the refusal stays in agents.unread, once per operation, and a network failure ends the agents read without taking the discovery down. An agent whose detail, tools and knowledge bases were refused does not count as read: with everything unread, the posture report says "not read", without counts. A list cut at the ceiling (action groups above 30, knowledge bases above 10, a Foundry project's agents above 200, connections above 100) is marked.
  • Left unread, with the reason: Google's Agent Engine (opaque_code_not_read: the code ships in a package, without the list of tools), Databricks agents (no_read_api) and Snowflake Cortex Agents (snowflake_agents_not_read: the Snowflake connection is already an AI registry source, only for the Cortex controls; SHOW AGENTS and SHOW MCP SERVERS are not read yet, and an agent's tools only come in DESCRIBE AGENT, together with the instructions; re-read on 24/11/2026 at docs.snowflake.com/en/sql-reference/sql/show-agents). The platforms that are read say what each source's latest read read (agent_platforms): read, partly read (with what was left unread) or not read (with the reason: the cloud's, no_source with no source of that cloud in the registry, never_read with the source not read yet).

Permissions to add, read on 2026-11-23:

  • AWS, to the reader role of card #1020, all at the “List” or “Read” level:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "bedrock:GetAgent",
        "bedrock:ListAgentActionGroups",
        "bedrock:GetAgentActionGroup",
        "bedrock:ListAgentKnowledgeBases",
        "bedrock:GetKnowledgeBase",
        "bedrock:ListDataSources",
        "bedrock:GetDataSource",
        "bedrock-agentcore:ListAgentRuntimes",
        "bedrock-agentcore:GetAgentRuntime",
        "bedrock-agentcore:ListGateways",
        "bedrock-agentcore:GetGateway",
        "bedrock-agentcore:ListGatewayTargets",
        "bedrock-agentcore:GetGatewayTarget"
      ],
      "Resource": "*"
    }
  ]
}
aws iam put-role-policy --role-name <role-de-leitura> --policy-name beryx-ai-agents --policy-document file://beryx-ai-agents.json
  • Azure, to the custom role of card #1039: Microsoft.CognitiveServices/accounts/projects/read in Actions, and Microsoft.CognitiveServices/accounts/AIServices/agents/read and Microsoft.CognitiveServices/accounts/AIServices/connections/read in DataActions. The reference describes the first data action as “Read agents, threads, and messages”: the permission is wider than the use, and BeryX never requests threads or messages. To the reader app, the Microsoft Graph application permission AgentIdentity.Read.All, with an administrator's consent.
az role definition update --role-definition @beryx-leitor-azure-openai.json

Lineage from the system tables (card #1179)

A table written by a notebook, a job or an INSERT … SELECT gets its parent in /linhagem, read from what the warehouse itself records. It runs on every scan of the connection, after view lineage, over the system tables and only through SELECT (app/infra/connectors/system_lineage.py):

  • Databricks: system.access.table_lineage and system.access.column_lineage, for the connection's catalog (as source or as target);
  • Snowflake: SNOWFLAKE.ACCOUNT_USAGE.ACCESS_HISTORY, with the OBJECTS_MODIFIED and the BASE_OBJECTS_ACCESSED of each write and, per column, the baseSources of each written column; views come from SNOWFLAKE.ACCOUNT_USAGE.OBJECT_DEPENDENCIES. Only the connection's database, from the configuration or from the url (…/ANALYTICS/PUBLIC);
  • BigQuery: INFORMATION_SCHEMA.JOBS_BY_PROJECT, from the referenced_tables to the destination_table of the jobs that write (INSERT, MERGE, UPDATE, CREATE_TABLE_AS_SELECT), outside the anonymous _… datasets of SELECT results. Data Lineage API lineage still comes in through the catalog import (Dataplex) and, on the same pair, takes precedence over this one.

What is kept: each edge, at the grain the source gives (table and, on Databricks and on Snowflake writes, column), the system and system table it came from, and the last time the source showed it. Only object and column names: never the query text nor who ran it. A name that is not a BeryX dataset stays as an external node; the parent may sit in another connection of the same workspace and the same system (a Snowflake RAW.PUBLIC.ORDERS does not match a Postgres public.orders) and matches once that connection discovers it. Aggregation happens in the warehouse, with the BERYX_SYSTEM_LINEAGE_WINDOW_DAYS window (30 days) and the BERYX_SYSTEM_LINEAGE_MAX_ROWS cap (5000 rows per system table).

Stale: an edge that stops appearing in the window is marked stale (dotted line in /linhagem) and is only removed after two windows. When the row cap is hit, only the date marks it.

Precedence: on the same pair, the declared derivation, the view SQL one, the dbt one and the catalog one take precedence. The view SQL one and the dbt one also when they arrive after the warehouse one (the dbt import from CI, after the first scan). The name-inferred one and the OpenLineage one give way to it, and the inferred one's column («via cliente_id») moves to it. A foreign key in the source is a reference, not a derivation, and stays beside it. Columns keep the name the dataset profile gives them (Amount, not amount), so the impact of a change follows from the warehouse into the views.

Permissions: without them, the scan goes on without this lineage and the log only records the error type.

-- Databricks (Unity Catalog)
GRANT USE CATALOG ON CATALOG system TO `<principal>`;
GRANT USE SCHEMA ON SCHEMA system.access TO `<principal>`;
GRANT SELECT ON TABLE system.access.table_lineage TO `<principal>`;
GRANT SELECT ON TABLE system.access.column_lineage TO `<principal>`;
-- Snowflake
GRANT DATABASE ROLE SNOWFLAKE.GOVERNANCE_VIEWER TO ROLE <role>;
GRANT DATABASE ROLE SNOWFLAKE.OBJECT_VIEWER TO ROLE <role>;
# BigQuery: bigquery.jobs.listAll on the project (BigQuery Resource Viewer includes it)
gcloud projects add-iam-policy-binding <project> \
  --member="serviceAccount:<sa>@<project>.iam.gserviceaccount.com" \
  --role="roles/bigquery.resourceViewer"

Cost and delay: each scan runs one to three aggregated queries, billed like the others on the connection's warehouse. Snowflake's ACCESS_HISTORY and OBJECT_DEPENDENCIES require Enterprise edition and can lag by up to 3 hours; ACCESS_HISTORY covers the whole account, and the database is filtered in the SQL itself.

Interop

ODCS contracts ↔ datacontract-cli (DCSPEC)

The ODCS v3.1 contract that BeryX exports (GET /datasets/{id}/contract.yaml, domain/contracts/service.py) is verified against datacontract-cli, the reference tool of the Bitol ecosystem. The verification is optional and does not run in the normal CI:

  • Local suite backend/tests/test_interop_datacontract.py (marked slow): exports the contract of a fixture dataset with every rule type, runs the CLI and re-imports the result with our importers (domain/rules/importers.py). Without the datacontract binary the tests are skipped.

    python -m venv /tmp/dc && /tmp/dc/bin/pip install -r backend/requirements-interop.txt
    cd backend && DATACONTRACT_BIN=/tmp/dc/bin/datacontract python -m pytest -m slow tests/test_interop_datacontract.py
    
  • CI job .github/workflows/interop.yml (workflow_dispatch only, with the CLI version as input): installs the CLI in an isolated venv and runs the suite with DATACONTRACT_REQUIRED=1 (a missing binary fails instead of skipping). Run it before raising ODCS_API_VERSION or touching the ODCS export/import.

datacontract-cli is a DEV-only dependency (requirements-interop.txt, pinned): it brings its own versions of pydantic/sqlglot, so it stays in a separate venv and never goes into the production image.

Result (datacontract-cli 1.2.1, ODCS v3.1.0) — criterion: lossless round-trip on the fields we support.

Step Result
datacontract lint Valid against the ODCS v3.1.0 JSON Schema.
import odcs → export odcs Lossless: the re-imported document is the same as the original (the CLI only reorders keys and wraps long lines). Extracted rules, skipped and compare_contract_to_schema identical.
Export → reimport in BeryX Recovers not_null, unique, pattern, row_count_min and freshness, with the tolerance as a percentage (mustBeLessOrEqualTo, unit: percent) and the values treated as null (missingValues). range travels as a type: sql check (the standard has no range metric) and comes back as range. SQL rules also travel as type: sql, with the exact rule in customProperties, and come back the same (card #1192).
tenant, domain, dataProduct, team (card #148) Valid and lossless in the round-trip. team uses the v3.1.0 object ({members: [...]}); the bare v3.0 array also passes lint, but is deprecated.
Data product bundle (GET /domains/{id}/contract) The CLI reads one contract per file (a YAML with several documents gives "found another document"). The suite splits the bundle and each contract passes lint and the import/export odcs round-trip without loss.
Data product SLA (card #181) availability (unit: percent), retention (unit: d), generalAvailability and datavault.observedHistoryDays pass lint and the round-trip without loss. The reimport into BeryX does not turn them into rules: it lists them in skipped ("SLA do data product: declara-o no domínio").

Incompatibilities found

  1. Our bug, fixed: the latency SLA exports element: <schema>.<tabela> (physicalName) and the ODCS importer read the dot as tabela.coluna — the freshness rule came back tied to a column that does not exist (encomendas). The importer now recognises name/physicalName before extracting the column (regression test in test_rule_interop.py).
  2. export sodacl (CLI): invalidValues with arguments.pattern comes out as invalid_count(col) = 0 without the regex — the pattern is lost. The sql check (range) comes out as a user-defined SodaCL metric (our SodaCL importer declares it in skipped) and the latency SLA is not emitted. nullValues, duplicateValues, required and rowCount survive. A limit in unit: percent comes out as a row count: 5 % gives missing_count(col) <= 5.0, so check the tolerance in the generated SodaCL.
  3. export dbt-models (CLI): only emits not_null, and only from required; nullValues, with or without a tolerance, and duplicateValues do not become constraints. Without servers in the contract, the data_type values come out in the CLI's default dialect (NUMBER, TIMESTAMP_TZ) — for dbt, prefer our contract.dbt.yml, which maps from logicalType and emits unique.
  4. Table in the conversion: the CLI's SodaCL uses the physicalName (vendas.encomendas) and dbt/SQL uses the name (encomendas). Dataset matching on import accepts both, but it is worth knowing which one appears in each artefact.
  5. Logical types: we export TIMESTAMP as logicalType: date (the physicalType keeps the real type). ODCS v3.1 has timestamp; it was not changed here because compare_contract_to_schema and the dbt mapping depend on the current value — a candidate for its own card.

Cross-system lineage: permissions (card #1180)

The hops between systems are read only with official, read-only methods. Three ask for nothing new and Looker needs one permission, only for the columns:

  • Fivetran and Airbyte: each pipeline's source table comes from the calls the sync already makes (GET /v1/connections/{id}/schemas in Fivetran, GET /v1/connections in Airbyte, which carries the streams in the listing itself). Set the source connection in the pipeline mapping (source_connection_id) so the edge links two datasets. Without it, the source stays as an external node, apart from the destination even when both tables have the same name (public.orders on both sides) and apart from another pipeline's source.
  • Unity Catalog: the lineage it already reads (GET /api/2.0/lineage-tracking/table-lineage) now matches the datasets of the workspace's other connections by qualified name, only when there is a single candidate. The ones that do not match stay as external nodes linked to the table that reads them, outside the customer's OpenLineage.
  • Tableau: the columns of each upstream table come from the upstreamColumns of each data source's fields, in a separate read-only Metadata API query (POST /api/metadata/graphql). If it fails or stops at the page cap, the sync is not partial and the columns already recorded on each link stay.
  • Looker: the columns come from the explore's fields (GET /api/4.0/lookml_models/{model}/explores/{explore}), in the ${TABLE}.coluna references of the base view's dimensions and measures. Looker only returns the fields' SQL to users with see_lookml on the model: give that permission to the API key's user (Admin › Roles, in the permission set of their role). Without it, lineage stays at table level.

The Power BI scanner needs a new tenant permission. The integration's service principal must be in an Entra ID security group:

az ad group create --display-name beryx-powerbi-scanner --mail-nickname beryx-powerbi-scanner
az ad group member add --group beryx-powerbi-scanner --member-id <object id do service principal>

Then, in the Power BI admin portal (Tenant settings › Admin API settings), turn on these three settings for that group only:

  • Service principals can access read-only admin APIs;
  • Enhance admin APIs responses with detailed metadata;
  • Enhance admin APIs responses with DAX and mashup expressions.

The Entra ID application must not have Power BI API permissions that need admin consent: with them, Microsoft refuses the admin APIs to the service principal.

BeryX calls POST /v1.0/myorg/admin/workspaces/getInfo (it requests the scan and changes nothing in the tenant), GET …/scanStatus/{id} and GET …/scanResult/{id}. The warehouse table comes from the M expression of each table in the model; a native query (Value.NativeQuery) gives no table. Without the permission (401/403), the sync reads the rest and the lineage_manual note says what is missing; the link from the model to the warehouse stays in asset_mappings. A scan that does not finish (past the deadline, Failed, 429/5xx or no result) is lineage left unread: the sync is partial (partial_results note), the warehouse links and the columns already recorded stay, and the next sync requests the scan again. A manual mapping takes precedence over what the scanner read.