Baseball has a great many rules — written and unwritten. The unwritten rules, such things as not bunting late in a game to break up a no hitter or only using your wits to figure out what pitch will be thrown next, are generally accepted as an effort to uphold the integrity of the game.

Well, at least in games played on Little League, high school and college fields. At the pro level, things have gotten a bit murky.

That was made clear this week when it was announced that a two-month investigation found that the Houston Astros used cameras and video monitors to steal pitch signs by opposing catchers. Major League Baseball quickly imposed penalties.

On Monday MLB Commissioner Rob Manfred suspended Houston Astros Manager A.J. Hinch and General Manager Jeff Luhnow for one year each for their roles in the team’s extensive sign-stealing scheme. The Astros’ owner, Jim Crane, then went further, firing both. In addition, the Astros will be fined $5 million and lose four top draft picks.

The actions taken by Manfred were not just a message to the Astros, but to the 29 other MLB teams — using electronics to cheat will not be tolerated.

Manfred, in the nine-page report, wrote that, “At the beginning of the 2017 season, employees in the Astros’ video replay review room began using the live game feed from the center field camera to attempt to decode and transmit opposing teams’ sign sequences.”

As the season went on, Astros’ bench coach (now Red Sox manager) Alex Cora, he added, “began to call the replay review room on the replay phone to obtain the sign information.” The players on the bench then banged on a trash can to let the batter know what pitch was coming.

MLB might not be done with punishments in this case. It’s expected Cora will be suspended. Baseball is trying to get ahead of any future problems.

The rapid advances in technology (including crystal-clear resolution from TV cameras) have made it possible to get an edge. In the future, it’s only going to be easier to use technology and artificial intelligence — much of which we can’t even imagine today — to create an uneven playing field.

The punishment handed down by Manfred won’t by itself put an end to future problems, but it sends a clear signal (no need to steal this signal), that using technology to undercut the integrity of the game is not acceptable. This stern action was needed.