The Antideficiency Act makes it a two-year felony to intentionally spend money that congress did not appropriate for that purpose.
See 31 USC 1341,1342, and 1517.
This act prohibits federal agencies from obligating or expending federal funds in advance or in excess of an appropriation, and from accepting voluntary services.
The Antideficiency Act prohibits federal employees from:
making or authorizing an expenditure from, or creating or authorizing an obligation under, any appropriation or fund in excess of the amount available in the appropriation or fund unless authorized by law. 31 U.S.C. § 1341(a)(1)(A).
involving the government in any obligation to pay money before funds have been appropriated for that purpose, unless otherwise allowed by law. 31 U.S.C. § 1341(a)(1)(B).
accepting voluntary services for the United States, or employing personal services not authorized by law, except in cases of emergency involving the safety of human life or the protection of property. 31 U.S.C. § 1342.
making obligations or expenditures in excess of an apportionment or reapportionment, or in excess of the amount permitted by agency regulations. 31 U.S.C. § 1517(a).
Federal employees who violate the Antideficiency Act are subject to two types of sanctions: administrative and penal. Employees may be subject to appropriate administrative discipline including, when circumstances warrant, suspension from duty without pay or removal from office. In addition, employees may also be subject to fines, imprisonment, or both.
https://www.gao.gov/legal/appropriations-law/resources