docs/enterprise/add_new_policy.md
Chrome exposes a different set of configurations to administrators. These configurations are called policy and they give administrators more advanced controls than the normal users. With different device management tools, an administrator can deliver these policies to many users. Here is the help center article that talks about Chrome policy and its deployment.
Usually you need a policy when
Launching a new feature. Create a policy so that the admin can disable or enable the feature for all users.
Deprecating an old feature. Create a policy to give enterprise users more time to migrate away from the feature.
To read more about best practices for shipping enterprise friendly features, please read this article.
ℹ️️ An AI agent (e.g., Gemini CLI) can help you write your policy YAML, map it to a pref, and write tests. Add the policy-creation skill, then ask your agent to create a policy.
Example for Gemini CLI:
shgemini skills link agents/skills/policy-creation
.group.details.yaml file
with the caption and description of the group. This group is used for
documentation and policy template generation, so it is recommended to
group policies in meaningful groups.PolicyName.yaml under the appropriate policy group.
Please use policy.yaml to start off your policy.
dynamic_refresh
and supported_on) right. More details on the fields can be found in
policy.yaml.If you are adding multiple policies that are closely related and interact with each other, you should put them in policy atomic group. An atomic policy group is used in the Chromium code and affects how policies are applied. When enabled by the admin, this ensures that policies from an atomic group get their values from the same source and are not a mix of policies from multiple sources. This feature is controlled by the policy PolicyAtomicGroupsEnabled.
Create a policy_atomic_groups.yaml file in the group where you added the
policies if it does not already exist.
You may use policy_atomic_groups.yaml as reference.
per_profile attribute in the
YourPolicyName.yaml. We also strongly encourage developers to
register the prefs with Profile Prefs if possible, because
this gives admin more flexibility of policy setup.kSimplePolicyMap in
configuration_policy_handler_list_factory.cc. If the policy needs additional verification or processing, please
implement a ConfigurationPolicyHandler to do so.chrome://settings, the
associated option should be disabled when the policy controlling it is
managed.
dynamic_refresh if possible.
components/policy/proto/chrome_device_policy.proto. Please note
that all proto fields are optional.chrome/browser/ash/policy/core/device_policy_decoder.{h,cc}
for the new policy.chrome/browser/policy/<area>_policy_browsertest.cc or with the policy
implementation. For example, a network policy test can be put into
chrome/browser/net. Ideally, your test would set the policy, fire up
the browser, and interact with the browser just as a user would do to
check whether the policy takes effect.Software\Policies\Chromium (for Chromium builds) or
Software\Policies\Google\Chrome (for Google Chrome branded builds). If
you want to test policy refresh, you need to use group policy tools and
gpupdate; see
Windows Quick Start.Please read life of a policy for more information.
For Googlers only: The Cloud Policy will be maintained by the Admin console team. See instructions here on how to update the Cloud Policy.
Once the policy is added or modified, nothing else needs to be taken care of by the Chromium developers. However, there are a few things that will be updated based on the yaml file. Please note that there is no ETA for everything listed below.
future_on flag can disable policy on Beta of Stable channel only if the
policy value is copied to PrefService in Step 3 of Adding a new policy.