Galatians 3:23-25

23 Now before the time for this trusting faithfulness came, we were imprisoned in subjection to the system which results from perverting the Torah into legalism, kept under guard until this yet-to-come trusting faithfulness would be revealed.

24 Accordingly, the Torah functioned as a custodian until the Messiah came, so that we might be declared righteous on the ground of trusting and being faithful.

25 But now that the time for this trusting faithfulness has come, we are no longer under a custodian.