The show employed Ian Martin as a "swearing consultant"; one of his roles is to pen the complex and creative insults used in the show.
Each episode has a credit for "the cast" under the writer credits. This is due to some of the dialogue being improvised.
The only time the BBC vetoed a line of dialogue was this line from Malcolm Tucker following the revelations about Jimmy Savile - "That's inevitable. It's as inevitable as what they'll find in Jimmy Savile's basement after he's dead."
British politicians have said that the only thing unrealistic about the show is the infamous amount of profanity, which is reportedly much worse in real life.