There are actually two separate systems: the T cells and B cells. I recommend the very readable Lauren Sompayrac's "How the Immune System Works". Or google/wiki "clonal selection" and "VDJ recombination".
There's fairly recent technology to sequence these antibodies en masse, which gives you a whole load (~10^6) of these antibody DNA sequences. It's a fascinating and frustrating exercise to try and reconstruct the mutation history and families of related cells from this data.
I think in the sense you are asking, though, is that any long-lived plasma cell or memory B cell that is active will probably not change to the extent that they would attack self. I don't know off the top of my head if there are examples of this, but I can't think of any.