Skip to content

security: verify model artifacts before deserialization - #13

Merged
cr-shah merged 1 commit into
codex/security-trusted-hostsfrom
codex/security-model-integrity
Oct 25, 2026
Merged

cr-shah merged 1 commit into
codex/security-trusted-hostsfrom
codex/security-model-integrity

Conversation

@cr-shah

@cr-shah cr-shah commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Trained models previously reached joblib deserialization without verification. Require MODEL_ARTIFACT_SHA256 from trusted deployment configuration, verify both metadata and model bytes, then deserialize the exact verified snapshot. Pin changes also invalidate the API model cache.

Training emits artifact.sha256 for controlled promotion. The runtime never trusts that sidecar. Existing trained deployments must regenerate artifacts and configure the new pin on both API and worker before upgrading; demo mode is unaffected. Compose wiring and deployment instructions are included.

Verification: 191 pytest tests passed; Ruff checks passed; independent review found no actionable issues. Tests cover model/metadata tampering, executable pickle rejection before loading, file replacement races, cache pin changes, and API/worker parity.

Depends on #12. One commit relative to its base. Merge order: #10 → #11 → #12 → this PR. Retarget to main after prerequisites land; preserve ancestry with merge commits.

@cr-shah
cr-shah merged commit a3a0214 into codex/security-trusted-hosts Oct 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant