The league leaders thought they had taken the lead in the second minute when Sam Baldock raced clear of the Bristol defence and put the ball away, only to be denied by the linesman's flag.
© Getty Images
Baldock had another shooting opportunity inside the box in the 10th minute, but Korey Smith produced a block and the danger was averted.
The visitors took a surprise lead in the 17th minute through Williams, who struck a clean volley into the bottom corner from Jonathan Kodjia's cross.
Chances were at a premium in the run-up to half time, but Brighton almost drew level moments before the whistle when Tomer Hemed fired a low effort towards goal, forcing Frank Fielding into an instinctive save.