CausalFoundry Documentation
Test environments where balances reconcile, state machines only take legal transitions, and AI agents run in safe sub-50ms sandboxes without copying raw production PII.
Platform Overview
CausalFoundry is built for engineering, QA, data, and platform teams working with complex relational systems, ledgers, cloud warehouse exports, and AI agents. Instead of choosing between pure mock tools that flatten distributions or pure neural synthesizers that break accounting identities, CausalFoundry combines empirical quantile histograms, Gaussian copula correlations, and conditional sampling with strict stateful invariants, audit counterexamples, resettable AI-agent sandboxes, and transaction-aware CDC shadowing.
Stateful Correctness Engine
Transaction-buffered CDC, atomic quarantine with rollback, and parent-child rollup recomputation in Rust.
AI-Agent Consequence Sandboxes
Evaluate tool-calling AI agents against live domain invariants with sub-50ms isolated resets.
Logic Manifesto
The Logic Manifesto is the backbone of CausalFoundry. It allows you to define complex relationships that traditional mock generators simply cannot handle.
# example.manifesto.yaml
entities:
User:
attributes:
loyalty_score: range(0, 100)
causal_links:
- target: Order.discount
formula: "loyalty_score > 80 ? 0.20 : 0.05"
variance: 0.02
The CausalEngine ensures that for every User generated, their associated Orders are checked against your configured manifest rules.
The Causal Engine
Under the hood, CausalFoundry uses a Directed Acyclic Graph (DAG) for state resolution. This ensures that change propagation is deterministic and predictable.
Shadow vs Generation Mode
Generation Mode
Synthesize test environments from schema and statistical profiles without copying source rows. Ideal for ledger verification, CI seeding, and stress testing.
Shadow Mode
Transform a live WAL stream for staging using HMAC token pseudonymization, field fuzzing, and micro-batch timing-jitter mitigation while enforcing configured invariants.
Statistical Profiling & Baseline Verification CLI
You can profile either a live database (--url) or offline Parquet, CSV, and JSONL exports from Snowflake, BigQuery, or Databricks using bundled DuckDB (--data). CausalFoundry extracts 21-point empirical quantiles, null rates, pairwise Gaussian copula correlations, and parent-conditioned distributions into schema.json (while filtering out PKs, FKs, and PII columns) and verifies synthetic fidelity afterward with verify --schema.
# 1. Profile offline warehouse export (Parquet / CSV / JSONL) via DuckDB
cf_cli profile --data ./warehouse_export --output-schema schema.json --output-manifest manifest.yaml
# 2. Generate distribution-fitted data while enforcing StateMap & SQL invariants
cf_cli generate --config manifest.yaml --schema schema.json --output ./synthetic_out --format parquet
# 3. Verify SQL invariants + baseline KS drift & correlation parity
cf_cli verify --config manifest.yaml --data ./synthetic_out --schema schema.json