The U.S. government is battling pirates, not the old-fashioned kind but a new breed of electronics thieves who steal computer secrets and copy video games.

The U.S. International Trade Commission, which usually finds itself ruling on imports of products like shoes, cars and fasteners, recently made its first ruling barring foreign video games after finding they infringed on an American copyright. The complaint, filed against 21 firms who were importing versions of a game called Galaxian, also marked the first time the ITC had moved against a product because of infringement of a copyright rather than a patent.

The video games, the likes of Asteroids, Space Invaders and Pac Man, have become a national craze, with coin-operated machines in arcades and many restaurants.

The video pirates found that by buying a video game and dissecting it, they could get the circuit board and reproduce the electrical circuitry that controls the display. Then, with a small machine that operates like a tape recorder, they could get a few tiny computer chips in the original game, its "brains," to spill out the computer program that makes the game run.

Because they avoided all the costs of developing the game, the pirates could undersell legitimate games and take away some of their business, which is estimated at $1.5 billion in sales annually.

Policing the pirates is sometimes difficult because of the way the copyright laws work. Video games are different from other copyrighted materials like films and books because the games depend on the player -- every play is different.

The problem of pirating is complicated by the rapid turnover of games in the industry. Michael L. Sherrard, an attorney for the Atari Co., which makes some of the games, said most new games reach their peak three months after they are introduced, and may be passe after a year. Thus, it may be difficult to shut down a pirate's game while the game is still popular.

The ITC case arose after Midway Manufacturing Co., of Franklin Park, Ill., purchased U.S. rights to the coin-operated Galaxian game from a Japanese developer in late 1979. The game, which became tremendously popular in both Japan and the United States, features attacking "aliens" that the player tries to hit with missiles from his defense ship.

Soon after Midway purchased the game rights, similar games started appearing from other companies, some of them from foreign countries. Some were named Galaxian; others were called Galaxy or Alien. In several cases, the style of lettering was the same as on Midway's Galaxian game. Midway then filed a complaint with the ITC asking that the foreign versions be barred from this country. It also sought action against the domestic pirates through the courts.

Because it is very difficult to prove that the game was copied, the ITC required Midway to show only that the other games were "substantially similar" to Galaxian. This June, the ITC formally agreed with Midway and excluded those video games from importation.

The ITC now is considering another request from Midway, this time to bar almost 70 imitators of its latest games, Pac Man and Rally-X. The imitators are either not changing the name or are using such names as Puc-Man and Racing-X, said Herbert C. Shelley, an attorney in the Washington firm of Plaia, Schaumberg & Taubman, which is representing Midway.

Partly because of the threat posed by pirates, 13 major video game manufacturers this year formed the Amusement Device Manufacturers Association, based in Chicago, said David W. Maher, counsel to the group.