NEW YORK — Facebook is prohibiting developers from using the massive amount of data it collects on users for surveillance. This includes using such data to monitor activists and protesters.

“Today we are adding language to our Facebook and Instagram platform policies to more clearly explain that developers cannot ‘use data obtained from us to provide tools that are used for surveillance,’” Rob Sherman, Facebook’s deputy chief privacy officer, wrote on the company’s privacy page.

Facebook says it has already taken action against developers who created or marketed tools meant to be used for surveillance. It says it wants to “be sure everyone understands the underlying policy and how to comply.”

Last fall, the American Civil Liberties Union obtained records that Facebook and Facebook-owned Instagram provided user data access to Geofeedia, which offers a monitoring product marketed to law enforcement. The product was used by police to track racially charged protests in Oakland, Calif., and Baltimore.

Get Breaking News Delivered to Your Inbox

The ACLU said at the time that while both Instagram and Facebook cut off access after finding out about this, Facebook did not have a “public policy specifically prohibiting developers” from taking user data for surveillance.

The new prohibition states that developers — who get access to user data from Facebook to create apps — should protect “the information you receive from us against unauthorized access, use, or disclosure. For example, don’t use data obtained from us to provide tools that are used for surveillance.”

The ACLU report says the data the companies provided to Geofeedia included only public posts, not those that users restricted to just friends or in some other way. But such access to Facebook data is still valuable to third parties because it would be very difficult to collect and comb through all that material on their own.

According to the ACLU, Facebook had provided Geofeedia with access to a data feed called the “Topic Feed API,” which is supposed to be a tool for advertisers. But Geofeedia could use it to obtain a feed of public Facebook posts that mentioned a specific topic, place or event — for example, “monitor hashtags used by activists and allies, or target activist groups as ‘overt threats,’” Matt Cagle, attorney for the ACLU of Northern California, wrote last October. Facebook terminated this access nearly a month earlier after being notified about it by the ACLU.