scikit-learn Governance Score
The foundational ML library has zero secrets but no structural enforcement.
Overall Score: 18/100 (Grade: F)
Key Findings
No Hook Enforcement [CRITICAL]
Zero enforcement hooks. AI agents can modify safety-critical estimators used in medical diagnostics, insurance underwriting, and financial modeling without structural gatekeeping.
Hidden Test Structure [CRITICAL]
Zero test files at root. Tests exist in sklearn/tests/ and sklearn/cluster/tests/ following Python convention, but governance tools cannot easily discover or assess coverage.
No CLAUDE.md or Agent Instructions [HIGH]
AGENTS.md is present (early awareness) but no enforcement-level instructions. AI agents contributing to safety-critical ML code have no project-specific context about estimator interface requirements.
Why scikit-learn's Governance Score Matters
scikit-learn is the most widely used machine learning library in production, powering everything from medical diagnostics to financial risk models. With 60,000+ GitHub stars, it is foundational infrastructure for AI/ML pipelines across every industry. Its governance posture directly affects the safety and reliability of millions of downstream applications.
The good news: scikit-learn has zero potential hardcoded secrets, the best security hygiene in our audit portfolio. The bad news: it has zero enforcement hooks, no AI agent instructions, and a test structure that -- while thorough -- is invisible to governance tools that scan at the repository root level.
Enforcement Ladder Analysis
scikit-learn follows idiomatic Python conventions with tests distributed across package directories (sklearn/tests/, sklearn/cluster/tests/, etc.). While this is good software engineering, it creates a governance visibility gap: automated tools scanning at the root level see zero tests, making the project appear ungoverned when it actually has substantial coverage.
The absence of L5 hooks is the critical gap. scikit-learn's estimators are used in high-stakes decisions -- credit scoring, medical diagnosis, insurance pricing. Any AI agent modifying estimator code can do so without structural validation. The 21 GitHub Actions workflows provide L3 automation, but nothing blocks a dangerous commit before it reaches CI.
What This Means for Teams Using scikit-learn
scikit-learn's estimator API is one of the most stable in the Python ecosystem. The governance risk is not in using scikit-learn -- it is in modifying or extending it without structural safeguards. If your team contributes to scikit-learn or builds custom estimators:
- Add pre-commit hooks that validate estimator interface compliance (fit/predict/transform signatures)
- Create CLAUDE.md documenting the estimator API contract for AI agent contributors
- Implement root-level test orchestration so governance tools can discover the full test suite
- Add deprecation tracking to manage the 490 dead code markers systematically
EU AI Act Compliance Impact
scikit-learn powers high-risk AI systems in healthcare, finance, and employment. Organizations using scikit-learn estimators in EU AI Act-regulated contexts need to ensure their own governance layer compensates for the library's 15% compliance readiness. The strongest gap is in Article 9 (Risk Management) and Article 17 (Quality Management), where automated validation of model behavior is essential for compliance.
Recommendations
Immediate (Week 1): Create CLAUDE.md with estimator interface requirements and API design patterns (1 hour). Add 3 pre-commit hooks for safety-critical estimator paths (2 hours). Add root-level test orchestration pointing to embedded test structure (30 minutes).
Short-term (Month 1): Deploy L5 enforcement hooks for safety-critical estimator paths. Set up violation tracking for API contract violations. Implement deprecation cleanup plan for 490 dead code markers.
Strategic (Quarter): Build enforcement ladder documentation linking estimator governance to EU AI Act requirements. Establish automated regression testing for estimator behavior boundaries. Implement autoresearch optimization (50-100 iterations) to tune enforcement rules.
Raw Scan Data
EU AI Act Readiness
Estimated compliance readiness based on enforcement posture, documentation, and automated quality controls. EU AI Act enforcement begins August 2, 2026.
See how your project compares
Run our free governance scanner on your own repository and get an instant enforcement posture score.
Scan Your Repository