N.Y. Criminal Procedure Law § 580.30
1. A defendant against whom a criminal action is pending in a court of record of this state, and who is confined in a federal prison or custody either within or outside the state, may, with the consent of the attorney general of the United States, be produced in such court for the purpose of criminal prosecution, pursuant to the provisions of: