Who bears responsibility when you behave badly

A note for Lesson no. 4, "Your Brain Predicts (Almost) Everything You Do," in Seven and a Half Lessons About the Brain by Lisa Feldman Barrett.
Some context from page 81 is:

If your brain doesn’t merely react to the world but actively predicts the world and even sculpts its own wiring, then who bears responsibility when you behave badly? You do.

The appendix adds:

Some material on this topic comes from my 2018 TED Talk, “You Aren't at the Mercy of Your Emotions—Your Brain Creates Them."

Lisa Feldman Barrett, "You Aren't at the Mercy of Your Emotions — Your Brain Creates Them," 2018

See also