@apth as I understand it, the "personality" is just a trained text prediction property. Claude seems to have a lot of meta-processes analyzing it's own thinking process, so it picks up on when things are getting hostile or suspicious. There's actually some evidence that Anthropic is using weights to encourage specific styles of responses, so that calm, thoughtful and polite are "easier" pathways than anxious or hostile ones.
https://www.anthropic.com/research/emotion-concepts-function