The United States is a party to the 1967 Protocol Relating to the Status of Refugees, and Article 1, paragraph 1 of that protocol incorporates Articles 2-34 of the 1951 Convention Relating to the Status of Refugees. Article 31, paragraph 1 of the 1951 Refugee Convention says:
Contracting States shall not impose penalties, on account of their illegal entry or presence, on refugees who, coming directly from a territory where their life or freedom was threatened in the sense of article 1, enter or are present in their territory without authorization, provided they present themselves without delay to the authorities and show good cause for their illegal entry or presence.
Arguably, criminal prosecution is such a "penalty" that states should not be able to impose on refugees (or people who claim to be refugees until their claim is denied) for illegal entry if they promptly turned themselves in and requested asylum after entering.