Unpacking the architecture, the logic, and the "why" behind the Factory for Verifiable Data.
Yes—CausalFoundry combines statistical distribution fitting with deterministic enforcement of your approved invariants.
Pure tabular ML generators match average shapes but break accounting sums and state machines; pure mock tools obey foreign keys but flatten production skews. CausalFoundry handles both layers together:
With fuzz_factor: 0.0, CausalFoundry tracks your profiled empirical quantiles and pairwise correlations closely (scored via KS distance and correlation parity) for representative staging and analytics pipeline testing. When you raise fuzz_factor or enable chaos scenarios, it intentionally exercises edge cases and failure paths.
Static mock fixtures and masked production snapshots suffer from rapid decay: they test narrow happy paths and fail to exercise edge cases. CausalFoundry supports a configurable 80/15/5 Operational Coverage Preset (controlled via fuzz_factor and scenarios):
We use a three-layer enforcement system:
A high-performance Rust memory map that tracks every entity's balance and state in real-time.
If a random generator picks an "illegal" value, the engine dynamically constrains it to the legal range.
Custom SQL invariants defined in YAML that act as the laws of physics for the generator.
All numeric, temporal, and relational generation uses a deterministic, non-neural "Glass Box" pipeline—not opaque neural generators:
During profiling, it extracts empirical quantile curves, null rates, Gaussian copula correlations, and parent-conditioned distributions (while skipping primary keys, foreign keys, and PII columns). During generation, symbolic invariants and StateMap check every emitted batch against your configured accounting, temporal, and lifecycle rules. Optional local LLMs (Question 10) run only when enabled for unstructured free-text columns such as support notes—they never control balances, keys, or relational invariants.
This is the process of forcing the engine into the "Long Tail" of distribution. In your configuration, you set a rate for specific scenarios.
When the engine "hits" that rate, it overrides its normal shadowed distribution to generate a rare event (like a $1,000,000 withdrawal). Crucially, the engine then Drills Down through the causal graph to ensure the rest of the database makes sense (e.g., creating a High Net Worth account for that transaction) so that the event isn't just a "floating" outlier, but a logically consistent part of the stream.
In release-profile benchmarks on multi-table schemas with active parent-child balance rollups and cross-table state constraints (such as the fintech ledger pack), CausalFoundry generates and validates ~980 to 1,000 rows per second per CPU core, while scaling linearly across cores and table partitions.
"Full in-memory Decimal balance tracking, dynamic overdraft clamping, and independent DuckDB analytical verification at enterprise scale."
Blindly forcing random outliers without preserving surrounding prerequisites breaks your test environment instead of finding real application bugs. If you inject a $1,000,000 withdrawal onto a randomly selected $50 balance, integration suites fail on impossible fixture data rather than genuine logic errors.
CausalFoundry checks your configured invariants when scenarios trigger and propagates upstream/downstream state (such as matching account funding or entity history) so injected edge cases stay coherent test scenarios.
In Shadow Mode, CausalFoundry constantly watches the frequency of events in your production database. As your schema evolves—new columns, changed table structures—the engine auto-introspects these changes, ensuring your seed data never "rots." It learns the distribution of real data and shadow-calibrates itself to keep the synthetic stream in sync with reality.
CausalFoundry includes cf_verify, which audits generated datasets and streams inside DuckDB. For every batch or stream window, it reports invariant pass rates alongside Entropy, Leakage, Kolmogorov-Smirnov Drift Score, and Correlation Score. Passing --schema schema.json to verify scores synthetic columns directly against your profiled production quantiles and correlation matrices.
Standard (Deterministic Rust) is the core engine used for all numeric, relational, and ledger workloads. Professional and Sovereign are optional add-ons used only when unstructured free-text columns require local language generation:
"Unconstrained statistical smoothness breaks ledger math, and happy-path cloning misses edge-case failures."
Pure statistical synthesizers (like CTGAN or diffusion models) smooth out data distributions, which means an account balance might miss by $0.01 or a refund might appear before an invoice exists. For ledger systems, that $0.01 breaks CI test suites immediately. When you want stress coverage beyond your baseline distribution, CausalFoundry provides a configurable 80/15/5 Operational Coverage Preset alongside deterministic business-rule checks:
Every emitted batch is checked against your approved symbolic invariants before hitting staging or CI.
Most AI-agent evaluation benchmarks only grade text outputs or code strings. But autonomous financial agents execute tool calls—running SQL queries, updating balances, transferring funds, or applying discounts directly against databases.
The causalfoundry sandbox commands (init, step, reset, eval) provide a stateful evaluation environment for AI agents:
UPDATE accounts SET balance = balance - 500), CausalFoundry executes the mutation and immediately runs your domain invariants. If the agent causes an overdraft or illegal state transition, the step is rejected with exact counterexamples, and state is rolled back.When migrating core banking systems, ledger architectures, or billing engines from a legacy database to a new microservice, engineering teams need to verify that both systems compute identical balances and state transitions under identical transaction workloads.
causalfoundry reconcile executes high-speed DuckDB outer joins across the legacy baseline dataset and target migration output to detect:
ABS(legacy.balance - target.balance)) against a user-specified tolerance threshold.SETTLED while target left it PENDING).profile to approve?
Manually hand-crafting dozens of SQL invariant rules is tedious. CausalFoundry provides a progressive discovery and approval pipeline:
profile): Run against a live database (--url) or offline Parquet/CSV/JSONL exports via bundled DuckDB (--data). The profiler extracts empirical quantiles, null rates, copula correlations, and conditional buckets into schema.json (filtering out PK/FK and PII columns), while emitting candidate invariants with confidence scores and counterexample counts.approve): Engineers can interactively review each candidate rule with live counterexamples in their terminal, or use --counterexample-threshold 0 in automated CI scripts to promote pristine rules directly into manifest.yaml.Generation Mode synthesizes test rows directly from aggregate empirical quantiles and Gaussian copulas without copying raw source rows. CDC Shadow Mode, by contrast, streams and transforms a live production WAL feed via TokenVault HMAC-SHA256 pseudonymization—meaning pseudonymized CDC shadow streams remain subject to GDPR/DORA governance.
To reduce timing and volume correlation when streaming CDC events (for example, matching a \$50,000 transaction at an identical millisecond timestamp), CausalFoundry's CDC privacy window (apply_cdc_privacy_window) applies two heuristic mitigations within the configured micro-batch window (note that these are practical heuristics rather than a formal mathematical anonymity guarantee):
Yes. You do not need direct JDBC/SQL wire connectors to Snowflake or BigQuery to profile warehouse data.
Export your warehouse sample to Parquet, CSV, or JSONL and point the CLI at the file or directory: cf profile --data ./warehouse_export --output-schema schema.json --output-manifest manifest.yaml. Bundled DuckDB reads those files locally, fits empirical quantiles, null rates, copula correlations, and conditional buckets without storing raw PII strings, and lets you verify generated parity afterwards with cf verify --schema schema.json.
| Feature | Masked Prod Copies / Manual Mocks | CausalFoundry |
|---|---|---|
| Invariant Preservation | Rollups drift, balance totals desync | Strict algebraic rollups & state machines |
| Privacy & Compliance | Pseudonymized copies still personal data under GDPR/DORA | Generation Mode synthesizes from quantiles without source rows; CDC Shadow Mode applies HMAC pseudonymization + timing-jitter mitigation |
| AI-Agent Evaluation | Unsafe; mutations corrupt shared staging | Sub-50ms isolated sandboxes with strict rollback |
| Audit & Evidence | Manual review or untested assumptions | DuckDB verification reports with counterexample extraction |
Test ledgers, complex applications, and autonomous AI agents with explicit business invariants and documented privacy controls.