This study investigates the predictors of incarceration among a cohort of Hungarian primary school students aged 14-15, followed until they are 23-24 years old. We analyze how school quality (including mean test performance and peer characteristics), exclusionary practices, and school/student non-compliance affect the likelihood of incarceration, time spent in prison, and recidivism. Employing linear (OLS) and non-linear (logit, Poisson) models, as well as clustering methods to assess career-path heterogeneity, we identify several key school-level variables as strong indicators of future legal conflicts. The sample comprises 50% of all eighth-graders who were obliged to take a basic competencies test in 2008, with about 1% incarcerated at least once over the next nine years. The predicted probability of incarceration is 0.5% for boys in low-status, well-performing schools, but it increases to 1.0% in low-status, poorly performing schools (at the mean/baseline of other regressors). Absence on the test day raises the risk to 2.8%, and in schools with high grade repetition rates and insufficient support services, the likelihood rises to 8.1%. Although these factors may not directly cause delinquency (some being arguably endogenous), they highlight symptoms associated with a higher risk of criminal behavior, providing valuable insights for targeted interventions by parents and school authorities.