> ## Documentation Index
> Fetch the complete documentation index at: https://tbd-6fc993ce-hypeship-docs-chrome-policy-on-demand.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# custom chrome policies

> Apply Chrome enterprise policies to every browser in a reserved pool

Browser pools accept an optional [`chrome_policy`](/api-reference/browser-pools/create-a-browser-pool#body-chrome-policy) object that applies [Chrome enterprise policies](https://chromeenterprise.google/policies/) to every browser in the pool. The same field is also available on on-demand browsers — see [Chrome policies](/browsers/chrome-policy) for the general reference, supported keys, and on-demand usage.

## Setting chrome policies on a pool

Pass a `chrome_policy` object when [creating](/browsers/pools/overview#create-a-pool-of-reserved-browsers) or [updating](/browsers/pools/overview#update-a-pool) a pool. Keys are Chrome policy names and values are the corresponding settings.

<CodeGroup>
  ```typescript Typescript/Javascript theme={null}
  import Kernel from '@onkernel/sdk';

  const kernel = new Kernel();

  const pool = await kernel.browserPools.create({
    name: "my-configured-pool",
    size: 5,
    chrome_policy: {
      HomepageLocation: "https://kernel.sh",
      HomepageIsNewTabPage: false,
      ShowHomeButton: true,
      NewTabPageLocation: "https://kernel.sh/docs",
      RestoreOnStartup: 4,
      RestoreOnStartupURLs: ["https://kernel.sh"],
      BookmarkBarEnabled: true,
      ManagedBookmarks: [
        { toplevel_name: "Company Resources" },
        { name: "Dashboard", url: "https://example.com/dashboard" },
        { name: "Documentation", url: "https://example.com/docs" },
        {
          name: "Tools",
          children: [
            { name: "Jira Board", url: "https://example.com/jira" },
            { name: "Slack", url: "https://example.com/slack" },
            { name: "GitHub PRs", url: "https://example.com/github" },
            { name: "Runbooks", url: "https://example.com/runbooks" }
          ]
        }
      ]
    }
  });
  ```

  ```python Python theme={null}
  from kernel import Kernel

  kernel = Kernel()

  pool = kernel.browser_pools.create(
      name="my-configured-pool",
      size=5,
      chrome_policy={
          "HomepageLocation": "https://kernel.sh",
          "HomepageIsNewTabPage": False,
          "ShowHomeButton": True,
          "NewTabPageLocation": "https://kernel.sh/docs",
          "RestoreOnStartup": 4,
          "RestoreOnStartupURLs": ["https://kernel.sh"],
          "BookmarkBarEnabled": True,
          "ManagedBookmarks": [
              {"toplevel_name": "Company Resources"},
              {"name": "Dashboard", "url": "https://example.com/dashboard"},
              {"name": "Documentation", "url": "https://example.com/docs"},
              {
                  "name": "Tools",
                  "children": [
                      {"name": "Jira Board", "url": "https://example.com/jira"},
                      {"name": "Slack", "url": "https://example.com/slack"},
                      {"name": "GitHub PRs", "url": "https://example.com/github"},
                      {"name": "Runbooks", "url": "https://example.com/runbooks"}
                  ]
              }
          ]
      }
  )
  ```
</CodeGroup>

## Updating policies on an existing pool

You can update `chrome_policy` on an existing pool. Pass `discard_all_idle: true` to immediately replace all idle browsers with the new policy configuration.

```json theme={null}
{
  "chrome_policy": {
    "HomepageLocation": "https://kernel.sh",
    "HomepageIsNewTabPage": false,
    "ShowHomeButton": true,
    "NewTabPageLocation": "https://kernel.sh/docs",
    "RestoreOnStartup": 4,
    "RestoreOnStartupURLs": ["https://kernel.sh"],
    "BookmarkBarEnabled": true,
    "ManagedBookmarks": [
      {"toplevel_name": "Company Resources"},
      {"name": "Dashboard", "url": "https://example.com/dashboard"},
      {"name": "Documentation", "url": "https://example.com/docs"},
      {
        "name": "Tools",
        "children": [
          {"name": "Jira Board", "url": "https://example.com/jira"},
          {"name": "Slack", "url": "https://example.com/slack"},
          {"name": "GitHub PRs", "url": "https://example.com/github"},
          {"name": "Runbooks", "url": "https://example.com/runbooks"}
        ]
      }
    ]
  },
  "discard_all_idle": true
}
```

## Available policies

See [Chrome policies](/browsers/chrome-policy#example-policies) for a reference of commonly used policy keys. Any policy listed in the [Chrome Enterprise policy documentation](https://chromeenterprise.google/policies/) can be used in the `chrome_policy` object.
