# Enforce Model Schema Signatures with MLflow
Production machine learning services frequently crash when incoming JSON payloads contain unexpected column names, missing features, or corrupted data types. MLflow solves this via model signatures (`infer_signature`), which bind input feature schemas and output prediction shapes directly into the logged model artifact.
### Task
Write a function `build_model_signature(X_train: pd.DataFrame, model, sample_size: int = 10)` that:
1. Takes a training feature DataFrame `X_train` and a fitted scikit-learn classifier `model`.
2. Generates predictions on a sample slice `X_train.head(sample_size)`.
3. Invokes `mlflow.models.infer_signature` to infer and return the schema `ModelSignature` object.