After negotiations that excluded the National Rifle Association and rival gun-control groups, the Reagan administration and police organizations have agreed to a compromise boosting chances for a ban on undetectable plastic guns.

Although differences over plastic gun legislation have triggered a new and ferocious gun-control fight in Congress, sponsors of rival bills said Tuesday's breakthrough could be a unifying force for lawmakers on all sides.Police organizations and gun-control advocates have insisted that a minimum amount of metal be required in a gun to ensure detection by the magnetometers used in airport and building security systems.

The NRA has insisted that there should be no government-established metal standard, only a general requirement that any gun be detectable by existing equipment.

The compromise takes the law enforcement approach and sets a minimum metallic standard.

Joseph A. Morris, director of the Justice Department's office of liaison, confirmed the agreement and said he hoped "everyone can claim victory."

Despite these optimistic comments, however, the general approach adopted in the compromise has been attacked bitterly in past NRA statements as an attempt to take guns from law-abiding citizens.