We prove that Boolean functions on $S_n$ whose Fourier transform is highly concentrated on the first two irreducible representations of $S_n$ are close to being unions of cosets of point-stabilizers. We use this to give a natural proof of a stability result on intersecting families of permutations, originally conjectured by Cameron and Ku, and first proved by David Ellis. We also use it to prove a ‘quasi-stability’ result for an edge-isoperimetric inequality in the transposition graph on $S_n$, namely that subsets of $S_n$ with small edge-boundary in the transposition graph are close to being unions of cosets of point-stabilizers.