A set of rules discovered in the latest iOS 8 beta show Apple is already taking steps to ensure sensitive user health data harvested by the upcoming HealthKit API remains private, especially as it applies to firms wanting to harness the information for targeted ad campaigns.

Ahead of Apple's expected iOS 8 launch in September, the company has restricted developers from selling or otherwise distributing sensitive data collected by the HealthKit application programming interface, which is set to debut as part of the new mobile operating system. The terms, buried in the latest iOS 8 beta's licensing agreement, were highlighted by the Financial Timeson Thursday.

According to text pulled from the license, developers may "not sell an end-user's health information collected through the HealthKit API to advertising platforms, data brokers or information resellers," and are barred from using gathered data "for any purpose other than providing health and/or fitness services."

In addition to the imposed data sharing restrictions, apps using the HealthKit API must provide privacy policies to end users.

Apple's HealthKit is a framework made available to third-party hardware and software makers that aggregates and stores harvested health data. Users have access to the metrics via iOS 8's built-in Health app, which serves as a centralized hub for viewing and sharing tracked information associated with user activity, sleep patterns and more.

Along with third-party tools, the Health app is capable of gathering data from Apple hardware like the M7 motion coprocessor found in the latest iPhone 5s. Further, the company is expected to announce a wrist-worn "iWatch" device thought to carry a host of sensors for health related monitoring.

For advertisers, the repository would be a gold mine, providing invaluable insight into how to better target ads to consumers.

Apple, however, is already looking ahead to skirt possible privacy issues. Senior executives have met with the U.S. Food and Drug Administration to discuss regulatory issues and the company is reportedly in talks with major medical records systems firms, insurers and healthcare providers eager to integrate with HealthKit.

Apple is expected to launch HealthKit as part of iOS 8 on Sept. 9, when the company will be holding a special event widely thought to feature the next-generation iPhone lineup.