An agent for treating keratin-containing fibers, in particular human hair, containing (a) from 1 to 20 wt.% of at least one crosslinked, amphiphilic, anionic polymer comprising at least one structural unit of the formula and at least one structural unit of the formula, in which R 1 and R 2 represent, independently of one another, a hydrogen atom or a methyl group, R 3 represents a (C 8 to C 30) alkyl group, M + represents a physiologically acceptable cation, and A 1 represents a group *-(CH 2 CH 2 O) x -*, in which x represents an integer from 5 to 35, a group *-(CH 2 CHMeO) y -*, in which y represents an integer from 5 to 35, or a group *-(CH 2 CH 2 O) x -(CH 2 CHMeO)y-*, in which the sum of x + y represents an integer from 5 to 35 and x and y are greater than zero, and (b) from 1 to 20 wt.% of at least one non-crosslinked, anionic polymer comprising at least one structural unit of the formula and at least one structural unit of the formula, in which R 4 and R 5 represent, independently of one another, a hydrogen atom or a methyl group, and M + represents a physiologically acceptable cation, and (c) from 1 to 40 wt.% of at least one setting, non-ionic polymer from the group of non-ionic polymers having at least one structural element of the formula in which R' represents a hydrogen atom, an alkyl group or an alkanoyl group, preferably an acetyl group, of homopolymers and non-ionic copolymers of N-vinylpyrrolidone, or of non-ionic copolymers of isobutene, in a cosmetically acceptable carrier, based on the weight of said agent in each case. (a) from 1 to 20 wt.% of at least one crosslinked, amphiphilic, anionic polymer comprising at least one structural unit of the formula and at least one structural unit of the formula, in which R 1 and R 2 represent, independently of one another, a hydrogen atom or a methyl group, R 3 represents a (C 8 to C 30) alkyl group, M + represents a physiologically acceptable cation, and A 1 represents a group *-(CH 2 CH 2 O) x -*, in which x represents an integer from 5 to 35, a group *-(CH 2 CHMeO) y -*, in which y represents an integer from 5 to 35, or a group *-(CH 2 CH 2 O) x -(CH 2 CHMeO)y-*, in which the sum of x + y represents an integer from 5 to 35 and x and y are greater than zero, and R 1 and R 2 represent, independently of one another, a hydrogen atom or a methyl group, R 3 represents a (C 8 to C 30) alkyl group, M + represents a physiologically acceptable cation, and A 1 represents a group *-(CH 2 CH 2 O) x -*, in which x represents an integer from 5 to 35, a group *-(CH 2 CHMeO) y -*, in which y represents an integer from 5 to 35, or a group *-(CH 2 CH 2 O) x -(CH 2 CHMeO)y-*, in which the sum of x + y represents an integer from 5 to 35 and x and y are greater than zero, (b) from 1 to 20 wt.% of at least one non-crosslinked, anionic polymer comprising at least one structural unit of the formula and at least one structural unit of the formula, in which R 4 and R 5 represent, independently of one another, a hydrogen atom or a methyl group, and M + represents a physiologically acceptable cation, and R 4 and R 5 represent, independently of one another, a hydrogen atom or a methyl group, and M + represents a physiologically acceptable cation, and (c) from 1 to 40 wt.% of at least one setting, non-ionic polymer from the group of non-ionic polymers having at least one structural element of the formula in which R' represents a hydrogen atom, an alkyl group or an alkanoyl group, preferably an acetyl group, of homopolymers and non-ionic copolymers of N-vinylpyrrolidone, or of non-ionic copolymers of isobutene, in a cosmetically acceptable carrier, based on the weight of said agent in each case. of non-ionic polymers having at least one structural element of the formula in which R' represents a hydrogen atom, an alkyl group or an alkanoyl group, preferably an acetyl group, of homopolymers and non-ionic copolymers of N-vinylpyrrolidone, or of non-ionic copolymers of isobutene,