Consider a situation where an agent A (e.g., a judge) decides agent’s B status (e.g., pretrial detention) based on a prediction of agent’s B expected outcome if selected (e.g., pretrial misconduct). If agent A sets different thresholds and/or makes biased estimations of the expected outcomes for certain groups, then agent A is said to be engaged in taste-based discrimination (i.e., prejudice). A prominent approach for testing for taste-based discrimination is the outcome test, which suggests that, in the absence of taste-based discrimination, success rates at the margin should be equivalent across groups (e.g., marginally released defendants should have equal pretrial misconduct rates). This approach is robust to standard concerns but its implementation induces an additional difficulty: the identification of marginal individuals. In this paper, we propose a new way of implementing the outcome test –the Prediction-Based Outcome Test (P-BOT)– that uses the predicted status to identify marginally selected individuals. We show that even in the presence of omitted variables in the selection equation, a ranking based on the propensity score identifies the ranking of individuals’ expected proximity to the margin among the selected, so the empirical challenge of the test is reduced to a prediction problem. The relative performance of the P-BOT depends on the availability of good predictors, something that can be directly assessed by the econometrician. Notably, the P-BOT does not impose strong structural assumptions nor relies on the availability of instruments. We use the P-BOT to test for taste-based discrimination in pretrial detentions against the main ethnic group in Chile, the Mapuche, using nationwide administrative data. We find strong evidence of taste-based discrimination against Mapuche defendants. We assess the relative performance of the P-BOT and alternative approaches, and discuss the test’s interpretation in more general versions of the model, sketching a new taxonomy of taste-based discrimination.