The first sentence of the New Pauly's page on prison sentences puts it well: "Neither Greek nor Roman law is familiar with prison sentences as punitive detention in the modern sense." There's little that can really be added to that besides providing examples for particular incidents and crimes--there are so many of these that I don't think it's worth doing here. In both Athenian law (and the legal systems, to the extent we know them, of other cities) and Roman law imprisonment was only temporary, and generally followed trial. One was condemned, imprisoned briefly, and then sentence was executed (in most crimes requiring imprisonment the penalty was death). In most cases before trial the accused was free, which allowed him the right to flee into exile, a fundamental right of both the Athenian and Roman citizen legal process. Only in very rare circumstances would the accused be confined before trial, such as in the case of the Catilinarians, whose crime, had they ever reached trial, would have been treason. But this sort of thing was exceptionally rare, and it is noteworthy that the Catilinarians were not confined to a public prison, but to the homes of private citizens whose duty it was to bringing them to court (though their trials never occurred). Under the Twelve Tables creditors could imprison their debtors, a statute that soon lapsed, but this was not the sort of prison sentence that we would recognize, a punishment in itself, but more of a means towards an end, the payment of the debt. In most ancient legal codes criminal cases were generally punished by death (Athens technically had no set punishments, but serious enough crimes were usually voted to be subject to death or exile). In civil offenses Roman law generally sentenced the surrender of goods, loss of certain rights, etc. Imprisonment had no place in such a legal system, which was not corrective in nature. The possibility of corrective punishment was not unknown in antiquity, however, at least theoretically. In the Protagoras the titular character points out that punishment is not carried out to change the committed wrong, since that is in the past, and it doesn't seem reasonable to punish for revenge. So why, asks Protagoras, do we punish at all? He raises the suggestion of educating the criminal not to wrong again, but no ancient legal code provided for corrective punishment in serious cases.