> [!WARNING]
> **Warning:** You're viewing the deprecated Manifest V2 version of this article. See [Manifest V3 - Protect user privacy](https://developer.chrome.com/docs/extensions/develop/security-privacy/user-privacy) for the MV3 equivalent. The Chrome Web Store no longer accepts Manifest V2 extensions. Follow the [Manifest V3 Migration guide](https://developer.chrome.com/docs/extensions/develop/migrate) to convert your extension to Manifest V3.

Users will not install an extension if it compromises their privacy or asks for more permissions
than it seems to need. Permission requests should make sense to users and be limited to the critical
information necessary to implement the extension. Extensions that collect or transmit any user data
must comply with the [user data privacy policies](https://developer.chrome.com/docs/webstore/program-policies#userdata) .

Protect and respect extension users by including these precautions to keep their identity safe.
Remember: the less data an extension can access, the less data it can accidentally leak.

## Reduce required permissions

The APIs an extension can access is specified in the permissions field of the [manifest](https://developer.chrome.com/docs/extensions/mv2/manifest). The
more permissions granted, the more avenues an attacker has to intercept information. Only the APIs
an extension depends on should be listed, and consideration should be given to less invasive
options. The less permissions an extension requests, the less permission warnings will be shown to a
user. Users are more likely to install an extension with limited warnings.

Extensions should not "future proof" access to user data by requesting permissions that they do not
currently need, but may implement in the future. Include new permissions with extension updates and
consider making them [optional](https://developer.chrome.com/docs/extensions/mv2/user-privacy#optional_permissions).

### activeTab

Extensions using host permissions to inject scripts can often substitute [`activeTab`](https://developer.chrome.com/docs/extensions/mv2/manifest/activeTab) instead.
The `activeTab` permission will grant an extension temporary access to the currently active tab,
only when the user *invokes* the extension. Access is cut off when the user navigates away from or
closes the current tab. It serves as an alternative for many uses of `<all_urls>`.

    {
      "name": "Very Secure Extension",
      "version": "1.0",
      "description": "Example of a Secure Extension",
      "permissions": ["activeTab"],
      "manifest_version": 2
    }

The activeTab permission displays no warning messages during installation.

## Opt for optional permissions

Empower users to choose which features and permissions they need from an extension by including
[optional permissions](https://developer.chrome.com/docs/extensions/reference/permissions#manifest). If a feature is not essential to the core functionality of an extension,
make it optional and move the API or domain into the `optional_permissions` field.

    {
      "name": "Very Secure Extension",
      ...
      "optional_permissions": [ "tabs", "https://www.google.com/" ],
      ...
    }

Including optional permissions allows an extension to explain why it needs a particular permission
when the user enables the relevant feature. The extension can offer the user an option to enable
features.

![A screenshot of a popup asking to enable permissions](https://developer.chrome.com/static/docs/extensions/mv2/user-privacy/image/a-screenshot-a-popup-ask-bb39fcc7a785d.png)

Clicking **Okay!** will trigger the following event in the background script.

    document.querySelector('#button').addEventListener('click', function(event) {
      // Permissions must be requested from inside a user gesture, like a button's
      // click handler.
      chrome.permissions.request({
        permissions: ['tabs'],
        origins: ['https://www.google.com/']
      }, function(granted) {
        // The callback argument will be true if the user granted the permissions.
        if (granted) {
          // doSomething();
        } else {
          // doSomethingElse();
        }
      });
    });

The user will then be prompted with the following request.

![A screenshot of optional permissions request.](https://developer.chrome.com/static/docs/extensions/mv2/user-privacy/image/a-screenshot-optional-pe-c4a199d8148b.png)

Optional permissions can also be implemented in an extension update. Doing so will make the new
feature available to users without disabling the extension, as may happen if updating with new
required permissions.

## Limit and secure user information

Only request the minimum [user data](https://developer.chrome.com/webstore/user_data) an extension needs. The less information an extension asks
from a user means less exposure if the extension is compromised.

All requested user data should be treated with care. Store and retrieve data in a secure server with
a registered domain. Always use HTTPS to connect and avoid keeping sensitive user data in the client
side of an extension as extension storage is not encrypted.