Mick Herron's "Slow Horses" series is fantastic, highly recommended. Slough House (from which the title) is where agents go when they fuck up. So everyone is flawed, and know they have failed. They're the ones who get a whiff of something going on, and their sorting of it is a redemption quest made difficult by the fact that they are fuckups. My memory is that it gets the tech right and the banter is A+ hilarious. (Herron is the author of this TLS piece, hence this recommendation)