Lamb claimed she wrote the phrase (with dashes ‘mad—bad—and dangerous to know’) in her private journal for 1812; but nobody has actually seen it there—according to Paul Douglass, Lady Caroline Lamb; a biography [(Palgrave 2004), 104] ‘the phase may have been created later’. The actual source for the quotation is Lady Morgan's Memoirs (W H Allen 1862) [ii: 202]. Morgan quotes a letter from Lamb, many years after the actual encounter:
Lady Westmoreland knew him [Byron, of course] in Italy. She took on her to present him. The women suffocated him. I heard nothing of him, till one day Rogers (for he, Moore, and Spencer, were all my lovers, and wrote me up to the skies — I was in the clouds) — Rogers said, 'You should know the new poet/ and he offered me the MS. of "Childe Harold " to read. I read it, and that was enough. Rogers said, ' he has a club foot, and bites his nails.' I said, ' If he was ugly as AEsop I must know him.' I was one night at Lady Westmoreland's; the women were all throwing their heads at him. Lady Westmoreland led me up to him. I looked earnestly at him, and turned on my heel. My opinion, in my journal was, 'mad — bad — and dangerous to know.'It’s a great phrase: the opening heavy stressed spondee underlined by its own rhyme, and followed by an iamb, and then three skipping unstressed syllables ending in a final stress (technically this last foot is a quartus paeon). It has the prosodic virtue of a kind of unspooling or unwinding rhythm, mimicking a sense of firmness giving way, before the irresistible Byronic charm. A great phrase: probably too good to have been anything other than an afterthought.