The invention relates to agents for temporarily shaping keratin fibers, said agents containing: a) at least one film-forming and/or setting amphoteric polymer A and b) at least one copolymer B formed by at least one monomer B1 selected from acrylamide, methacrylamide, N-alkylacrylamide and N-alkylmethacrylamide, at least one monomer B2 selected from N-vinyllactams, at least one monomer B3 selected from quaternized N-vinylimidazoles and the monomer N-vinylimidazole. The invention also relates to the use of the agents for temporarily shaping hair and to an aerosol styling mousse that contains a corresponding agent and at least one propellant.