Artificial intelligence (AI), and algorithms more broadly, hold great promise for making our criminal justice system more efficient, equitable, and just. Many of these systems are already in place today, assisting with tasks such as risk assessment and case management. In the popular media, these tools have been compared to dystopian science-fiction scenarios run awry. But while these comparisons may succeed in luring readers, the reality of how AI is used in the criminal justice context-at least in its current form-is a bit more mundane. The courts are not at the precipice of replacing jurists with black-robed robots or arresting people before they commit a crime. However, there are real concerns about how effectively and transparently these systems operate, or how they might subtly distort outcomes, without adequate scrutiny. This article contends that AI can play a critical role in achieving fairer and more efficient pretrial and jail systems, in particular through risk assessment software. Unlike other applications of risk assessment AI, such as for sentencing or parole, pretrial applications have relatively simple goals, involve fewer complex legal questions, and have outcomes that are quicker and easier to measure. Thus, it is likely that the pretrial and jail stages will be the testbed for broader deployment of AI technology in the justice system. Of course, AI will not (and should not) supplant human judgment any time soon. A machine cannot yet read a defendant's demeanor or assess the full context of facts the way an experienced judge can. But AI can counter certain human biases and, if deployed in a transparent manner, can help advise judges in ways that will produce better outcomes-such as reduced crime rates and lower jail populations. This article will differentiate between the various types of algorithms and explain current capabilities, as well as give an overview of current pretrial and jail system trends. Next, we give a brief overview of the history of risk assessment tools, their current uses in the pretrial and jail systems, and the potential for further reform using more advanced algorithms. In addition, the article will discuss the relevant legal framework as well as governance capabilities across state, municipal, and federal jurisdictions. We then will attempt to consider the most prominent critiques of algorithms in the jail system, especially in risk assessment. Finally, the article will look at potential policy and legal solutions for the effective stewardship and deployment of algorithms in the pretrial and jail systems.