Strict Mode¶
Strict mode enforces regulatory compliance requirements for production audits.
Overview¶
GlassAlpha offers two levels of strict mode:
- Quick Strict Mode (
--strict): Suitable for development and testing - Full Strict Mode: Required for production audits and regulatory submission
Quick Strict Mode¶
Enable with the --strict flag:
What it enforces:
- Configuration validation against audit profile
- Random seed must be explicitly set
- All warnings treated as errors
What it allows:
- AUTO preprocessing (no artifact required)
- Missing data schema (inferred from dataset)
- Default configuration values
When to use:
- Development and testing
- Iterating on model configurations
- Quick validation before production
Full Strict Mode¶
Required for production audits and regulatory submission.
Requirements:
- Preprocessing Artifact: Saved preprocessing pipeline with hash verification
- Data Schema: Explicit schema file (no inference)
- Explicit Seeds: All random operations seeded
- Profile Specification: Explicit audit profile
- Version Pinning: Use
constraints.txtfor dependencies
Enable full strict mode:
# Set preprocessing artifact and schema in config
glassalpha audit --config production.yaml --output report.html --strict
When to use:
- Production audits for regulatory review
- Compliance documentation
- Audit trail for governance
- When byte-identical reproducibility is required
Comparison¶
| Feature | Quick Strict | Full Strict |
|---|---|---|
| Preprocessing | AUTO allowed | Artifact required |
| Data schema | Inferred OK | Explicit required |
| Seeds | Must be set | Must be set |
| Warnings | Treated as errors | Treated as errors |
| Defaults | Allowed | Must be explicit |
| Reproducibility | Single run | Long-term |
Auto-Enabling Strict Mode¶
Strict mode automatically enables when:
- Config filename matches
prod*.yamlorproduction*.yaml - Running in CI environment (GitHub Actions, GitLab CI, etc.)
GLASSALPHA_STRICT=1environment variable set
Transition Path¶
Step 1: Development (No Strict Mode)¶
Step 2: Testing (Quick Strict)¶
Step 3: Production (Full Strict)¶
# 1. Create preprocessing artifact
python scripts/create_preprocessing_artifacts.py
# 2. Create data schema
glassalpha data validate --create-schema
# 3. Run audit with full strict mode
glassalpha audit --config production.yaml --output audit.html --strict
Troubleshooting¶
"Quick strict mode enabled - NOT for production audits"¶
Problem: You enabled --strict but haven't met full strict requirements.
Solution: Add preprocessing artifact and data schema to your config.
"Missing data schema in strict mode"¶
Problem: Full strict mode requires explicit schema.
Solution: Add data.schema to your config:
"AUTO preprocessing not allowed in strict mode"¶
Problem: Full strict mode requires saved preprocessing artifact.
Solution: Save your preprocessing pipeline:
Then reference it in config: