It has a built in lock that blocks the front spokes, an alarm and I use a $200 chain lock around the frame to fix it to something.
The only defense is storing your bike inside. And then you get karens on the owners corp whinging that you aren't allowed to take bikes inside. Who also don't give two shits when your bike gets stolen from the basement bike storage.
Not any more. A new generation of locks have an abrasive-filled plastic layer that aggressively wears down angle grinder discs. They aren't completely immune to angle grinders, but the better locks will take 20 minutes and multiple cutting discs to defeat.
https://www.cyclingweekly.com/group-tests/wrecked-and-rated-...
For my $250 deductible I basically just get a nice upgrade to the latest version / a brand new ebike for ~$200 / year.
The peace of mind alone with insurance (and a really nice lock) have fully mitigated this for me. I've been leaving my ~$2k ebike locked up all over San Francisco for ~3 years without it being stolen. (My first beater bike was a POS locked up in my apartments secure bike storage and it was stolen after I owned it for ~9 days so I figured I couldn't double down on the bad luck).