Amazon on Tuesday began rolling out Alexa Guard to all Echo devices, including older models that didn't originally get the feature when it was launched late last year.

Alexa Guard automatically listens for things like breaking glass and can alert you if it suspects someone is breaking into your home. If you have an ADT or Ring alarm system, it can also automatically set off the alarm. The feature was announced during Amazon's big Alexa event last September.

Alexa Guard is free but still needs to be manually activated by you. It requires you to first speak "Alexa, I'm leaving" to activate Guard on your Echo and to force Alexa to begin listening for more than just the "Alexa" wake word.

If an Echo hears a window break, it can send you an alert to your phone along with a live video feed if you have an Echo with a camera on it, like the Echo Show. An alert includes a 10-second audio recording of the glass breaking and anything else the Echo heard, but it otherwise doesn't listen unless you speak Alexa again.

It will also send alerts if a smart smoke alarm or carbon monoxide alarm goes off. If you configure it, Guard can also automatically turn on smart lights at certain times while you're away, and it will automatically turn them on and off on a schedule as if you're home.

"Alexa uses machine learning to determine the right lighting activity for your home based on lighting usage across customers," Amazon said.

Amazon said it "hired licensed contractors to break real glass in a testing lab," to help prevent false positives and to detect the actual sound of breaking glass. "This team broke hundreds of different windows, in different sizes, including single pane and double pane, with a variety of instruments including crow bars, hammers, bricks, baseball bats, and more," the company explained in an email to CNBC.

If you subscribe to ADT or use Amazon's Ring alarm system, Guard can automatically send alerts to professionals so that authorities arrive if a break-in is detected. If you don't have these systems, Alexa Guard won't call the police, it'll just notify you of a potential break-in.

Here's how to set it up:

Open the Alexa app on your phone.

Tap the menu button on the top left.

Choose "Settings."

Choose "Guard."

Tap "Set up Guard."

Tap "Add" to detect smart smoke alarms and carbon monoxide detectors in your home.

Tap "Add" to activate smart alerts for detecting the sound of broken glass.

Choose "Add" again to activate smart lighting.

Enter your zip code, so smart lighting knows when to turn on.

Choose "Confirm."

Now just speak "Alexa, I'm leaving" to activate Guard when you leave the house.