An agent for treating keratin-containing fibers, in particular human hair, containing in a cosmetically acceptable carrier: (a) at least one amphiphilic, cationic polymer having at least one structural unit of formula, at least one structural unit of formula, at least one structural unit of formula, and at least one structural unit of formula, where R 1 and R 4 represent, independently of one another, a hydrogen atom or a methyl group, X 1 and X 2 represent, independently of one another, an oxygen atom or an NH group, A 1 and A 2 represent, independently of one another, an ethane-1,2-diyl, propane-1,3-diyl, or butane-1,4-diyl group, R 2, R 3, R 5 and R 6 represent, independently of one another, a (C 1 to C 4) alkyl group, R 7 represents a (C 8 to C 30) alkyl group, and (b) at least one crosslinked amphiphilic, anionic polymer having at least one structural unit of formula and at least one structural unit of formula, where R 8 and R 9 represent, independently of one another, a hydrogen atom or a methyl group, R 10 represents a (C 8 to C 30) alkyl group, M + represents an equivalent of a physiologically acceptable cation, and A 3 represents a *-(CH 2 CH 2 O)x-* group, where x represents an integer from 5 to 35, a *-(CH 2 CHMeO) y -* group, where y represents an integer from 5 to 35, or a *-(CH 2 CH 2 O) x -(CH 2 CHMeO) y -* group, where the sum of x + y represents an integer from 5 to 35, and x and y are greater than zero. (a) at least one amphiphilic, cationic polymer having at least one structural unit of formula, at least one structural unit of formula, at least one structural unit of formula, and at least one structural unit of formula, where R 1 and R 4 represent, independently of one another, a hydrogen atom or a methyl group, X 1 and X 2 represent, independently of one another, an oxygen atom or an NH group, A 1 and A 2 represent, independently of one another, an ethane-1,2-diyl, propane-1,3-diyl, or butane-1,4-diyl group, R 2, R 3, R 5 and R 6 represent, independently of one another, a (C 1 to C 4) alkyl group, R 7 represents a (C 8 to C 30) alkyl group, and R 1 and R 4 represent, independently of one another, a hydrogen atom or a methyl group, X 1 and X 2 represent, independently of one another, an oxygen atom or an NH group, A 1 and A 2 represent, independently of one another, an ethane-1,2-diyl, propane-1,3-diyl, or butane-1,4-diyl group, R 2, R 3, R 5 and R 6 represent, independently of one another, a (C 1 to C 4) alkyl group, R 7 represents a (C 8 to C 30) alkyl group, and (b) at least one crosslinked amphiphilic, anionic polymer having at least one structural unit of formula and at least one structural unit of formula, where R 8 and R 9 represent, independently of one another, a hydrogen atom or a methyl group, R 10 represents a (C 8 to C 30) alkyl group, M + represents an equivalent of a physiologically acceptable cation, and A 3 represents a *-(CH 2 CH 2 O)x-* group, where x represents an integer from 5 to 35, a *-(CH 2 CHMeO) y -* group, where y represents an integer from 5 to 35, or a *-(CH 2 CH 2 O) x -(CH 2 CHMeO) y -* group, where the sum of x + y represents an integer from 5 to 35, and x and y are greater than zero. R 8 and R 9 represent, independently of one another, a hydrogen atom or a methyl group, R 10 represents a (C 8 to C 30) alkyl group, M + represents an equivalent of a physiologically acceptable cation, and A 3 represents a *-(CH 2 CH 2 O)x-* group, where x represents an integer from 5 to 35, a *-(CH 2 CHMeO) y -* group, where y represents an integer from 5 to 35, or a *-(CH 2 CH 2 O) x -(CH 2 CHMeO) y -* group, where the sum of x + y represents an integer from 5 to 35, and x and y are greater than zero.