#### Enterprise

# Deployment patterns

This guide covers how to deploy Grok Build to developer machines in your organization. Most organizations deploy both surfaces: the Agents Window for daily development and the Grok Build TUI (`grok`) for automation, CI, and scripting.

On the other surface: Grok Build TUI deployment, sign-in, and managed policy are in [Enterprise Deployments](/build/enterprise).

For SCM integrations such as [Bugbot](/build/agents-window/bugbot) and [Cloud Agents](/build/agents-window/cloud-agent), see their own pages.

To deploy the Grok Bot desktop app, see [Deploy Grok Bot to your organization](/grok-bot/deployment).

## Editor deployment with MDM

Deploy the Agents Window and agent to user workstations and enforce policies through Mobile Device Management (MDM) systems.

### How it works

1. Your IT team packages the Grok Build application for deployment
2. Push to user machines via MDM (Jamf, Intune, etc.)
3. Users receive Grok Build on their primary development machines

MDM allows you to enforce policies for Grok Build, such as allowed team IDs and extensions.

You can also enforce settings like workspace trust, and control auto-updates and deployment of new versions.

### MDM configuration

You can centrally manage specific features of Grok Build through device management solutions to ensure it meets the needs of your organization. When you specify a Grok Build policy, its value overrides the corresponding Grok Build setting on users' devices.

Grok Build supports policies on Windows (Group Policy), macOS (configuration profiles), and Linux (JSON policy files, version 2.0+).

Grok Build currently provides policies to control the following admin-controlled features:

| Policy                    | Description                                                                                                | Grok Build setting           |
| ------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------ |
| AllowedExtensions         | Controls which extensions can be installed.                                                                | `extensions.allowed`       |
| AllowedTeamId             | Controls which team IDs are allowed to log in. Users with unauthorized team IDs are forcefully logged out. | `cursorAuth.allowedTeamId` |
| ExtensionGalleryServiceUrl | Configures a custom extension marketplace URL.                                                            | `extensions.gallery.serviceUrl` |
| NetworkDisableHttp2       | Disables HTTP/2 for all requests, using HTTP/1.1 instead.                                                | `cursor.general.disableHttp2`     |
| UpdateMode                | Controls automatic update behavior. Set to 'none' to disable updates.                                    | `update.mode`              |
| WorkspaceTrustEnabled     | Controls whether Workspace Trust is enabled.                                                             | `security.workspace.trust.enabled` |

#### Managing run mode allowlists with MDM

You can also deploy Grok Build's permissions file through MDM to manage which terminal commands and MCP tools run without prompting and to steer the **Auto-review** mode classifier.

The file path is `~/.cursor/permissions.json`. Users can layer a per-repo file at `<workspace>/.cursor/permissions.json`; entries from both files are concatenated.

The file format is:

| Key | Type | Required | Meaning |
| :-- | :--- | :------- | :------ |
| `terminalAllowlist` | `string[]` | No | Terminal commands that may run without approval. With sandboxing enabled, supported terminal commands outside the allowlist can run in the sandbox. Each entry is matched against the full command string. |
| `mcpAllowlist` | `string[]` | No | MCP tools that may run without approval. MCP tools do not run inside the local sandbox. Each entry uses `server:tool` syntax. |
| `autoRun` | `object` | No | Steers the **Auto-review** mode classifier with natural-language `allow_instructions` and `block_instructions` arrays. Applies to shell, MCP, and Fetch calls in Grok Build 3.6 and above. See the [permissions.json reference](/build/agents-window/reference/permissions#autorun-configuration). |

`mcpAllowlist` entries support these forms:

| Entry | Meaning |
| :---- | :------ |
| `server:tool` | One specific tool on one specific MCP server |
| `server:*` | All tools from one MCP server |
| `*:tool` | One tool name from any MCP server |
| `*:*` | All MCP tools |

`terminalAllowlist`, `mcpAllowlist`, and `autoRun` are all optional. If a key is omitted or empty (after concatenating per-user and per-repo files), Grok Build falls back to the editor-managed allowlist for that category.

Example:

```json
{
  "terminalAllowlist": [
    "npm install",
    "pnpm test",
    "python -m pytest"
  ],
  "mcpAllowlist": [
    "linear:*",
    "github:create_pull_request",
    "*:search"
  ],
  "autoRun": {
    "block_instructions": [
      "Block any command that drops or truncates a database table."
    ]
  }
}
```

Because this is a regular file, you can distribute it with Jamf, Kandji, Intune, or any other device management tool that writes files into a user's Grok Build data directory.

Allowlist precedence is:

1. Team dashboard or other admin-controlled settings
2. Managed `~/.cursor/permissions.json` concatenated with `<workspace>/.cursor/permissions.json`
3. Editor settings and inline **Add to allowlist**

Admin-controlled settings replace the file-defined values for that category. Per-user and per-repo files merge by concatenation; editor settings do not merge with either.

Grok Build watches both `permissions.json` paths, so updates apply automatically without requiring a restart.

#### Windows group policy

Grok Build has support for Windows Registry-based Group Policy. When policy definitions are installed, admins can use the Local Group Policy Editor to manage the policy values.

To add a policy:

1. Copy the Policy ADMX and ADML files from `AppData\Local\Programs\cursor\policies`.
2. Paste the ADMX file into the `C:\Windows\PolicyDefinitions` directory, and the ADML file into the `C:\Windows\PolicyDefinitions\<your-locale>\` directory.
3. Restart the Local Group Policy Editor.
4. Set the appropriate policy values (e.g. `{"anysphere": true, "github": true}` for the `AllowedExtensions` policy) in the Local Group Policy Editor.

Policies can be set both at the Computer level and the User level. If both are set, Computer level will take precedence.

**Important:** When a policy value is set, it overrides the Grok Build setting value configured at any level (default, user, workspace, etc.). This is a global override that prevents users from changing these settings.

> [!NOTE]
>
> Grok Build 2.1 renamed the category name to Grok Build in the Group Policy Editor. Old keys still work. Grok Build recommends using the current ADMX policy file.

#### Windows installer

The Windows installer is based on Inno Setup. It is named `GrokBuildSetup-<arch>-<version>.exe` for a system-wide install and `GrokBuildUserSetup-<arch>-<version>.exe` for a per-user install. Each installer is also published under its earlier name, `CursorSetup` or `CursorUserSetup`, as an identical copy, so scripts that download or run `CursorSetup` keep working, and depending on where you download it you may receive either name. The installed app is still `Cursor.exe` in the `cursor` install directory.

To install Grok Build fully in the background without user interaction, use the following command-line flags:

**For fresh installations:**

```text
GrokBuildSetup-x64-<version>.exe /SILENT /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /CLOSEAPPLICATIONS /LOG=install.log
```

**For updating existing installations:**

When updating an existing Grok Build installation, you must use different flags that include the `/update` parameter pointing to a flag file. The flag file is an empty file that signals to the installer this is an update operation.

Create a temporary flag file and pass its path to the installer:

```text
GrokBuildSetup-x64-<version>.exe /VERYSILENT /update="%TEMP%\cursor-update.flag" /CLOSEAPPLICATIONS /LOG=update.log
```

**Note:** Installers pre-2.0 may incorrectly not respect `/SILENT` flags. Future installers (version 2.0 and later) will ensure that silent installs work correctly.

#### macOS configuration profiles

Configuration profiles manage settings on macOS devices. A profile is an XML file with key/value pairs that correspond to available policy. These profiles can be deployed using Mobile Device Management (MDM) solutions like Jamf, Kandji, or Microsoft Intune, or installed manually.

**Bundle ID per channel:**

The `PayloadType` in your configuration profile must match the Grok Build bundle ID for your channel:

| Channel    | Bundle ID                     |
| ---------- | ----------------------------- |
| Production | com.todesktop.230313mzl4w4u92 |
| Nightly    | co.anysphere.cursor.nightly   |

For most enterprise deployments, use the production bundle ID: `com.todesktop.230313mzl4w4u92`.

**Example .mobileconfig file**

An example `.mobileconfig` file for macOS is shown below:

```text
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
	<dict>
		<key>PayloadContent</key>
		<array>
			<dict>
				<key>PayloadDisplayName</key>
				<string>Grok Build</string>
				<key>PayloadIdentifier</key>
				<string>com.todesktop.230313mzl4w4u92.J6B5723A-6539-4F31-8A4E-3CC96E51F48C</string>
				<key>PayloadType</key>
				<string>com.todesktop.230313mzl4w4u92</string>
				<key>PayloadUUID</key>
				<string>J6B5723A-6539-4F31-8A4E-3CC96E51F48C</string>
				<key>PayloadVersion</key>
				<integer>1</integer>
				<key>AllowedExtensions</key>
				<string>{"anysphere":true}</string>
				<key>AllowedTeamId</key>
				<string>1,2</string>
				<key>ExtensionGalleryServiceUrl</key>
				<string>https://marketplace.example.com</string>
				<key>NetworkDisableHttp2</key>
				<true/>
				<key>UpdateMode</key>
				<string>none</string>
				<key>WorkspaceTrustEnabled</key>
				<true/>
			</dict>
		</array>
		<key>PayloadDescription</key>
		<string>This profile manages Grok Build.</string>
		<key>PayloadDisplayName</key>
		<string>Grok Build</string>
		<key>PayloadIdentifier</key>
		<string>com.todesktop.230313mzl4w4u92</string>
		<key>PayloadOrganization</key>
		<string>Anysphere</string>
		<key>PayloadType</key>
		<string>Configuration</string>
		<key>PayloadUUID</key>
		<string>F2C1A7B3-9D4E-4B2C-8E1F-7A6C5D4B3E2F</string>
		<key>PayloadVersion</key>
		<integer>1</integer>
		<key>TargetDeviceType</key>
		<integer>5</integer>
	</dict>
</plist>
```

##### String policies

The example below demonstrates configuration of the `AllowedExtensions` policy. The policy value starts empty in the sample file (no extensions are allowed).

```bash
<key>AllowedExtensions</key>
<string></string>
```

Add the appropriate JSON string defining your policy between the `<string>` tags.

```bash
<key>AllowedExtensions</key>
<string>{"anysphere": true, "github": true}</string>
```

**Extension control semantics:**

The `AllowedExtensions` policy accepts a JSON object where:

* Keys can be publisher names (e.g., `"github"`) or full extension IDs (e.g., `"ms-azuretools.vscode-docker"`)
* Values are booleans indicating whether extensions from that publisher or specific extension are allowed
* If a publisher is set to `true`, all extensions from that publisher are allowed
* Specific extension IDs take precedence over publisher rules

For the `AllowedTeamId` policy, add the comma-separated list of team IDs:

```bash
<key>AllowedTeamId</key>
<string>1,3,7</string>
```

For the `NetworkDisableHttp2` policy, use a boolean value to disable HTTP/2:

```bash
<key>NetworkDisableHttp2</key>
<true/>
```

##### Boolean policies

For boolean policies like `WorkspaceTrustEnabled`, use `<true/>` or `<false/>` tags:

```bash
<key>WorkspaceTrustEnabled</key>
<false/>
```

Or to enable the feature:

```bash
<key>WorkspaceTrustEnabled</key>
<true/>
```

##### UpdateMode policy

The `UpdateMode` policy controls how Grok Build handles automatic updates. This is useful for organizations that want to control when and how updates are deployed.

Available values:

* `none` - Disables all automatic updates
* `manual` - Users can manually check for updates
* `start` - Check for updates when Grok Build starts
* `default` - Default behavior (same as `start`)
* `silentlyApplyOnQuit` - Download updates in the background and apply when Grok Build quits

To disable automatic updates:

```bash
<key>UpdateMode</key>
<string>none</string>
```

##### WorkspaceTrustEnabled policy

The `WorkspaceTrustEnabled` policy controls whether [Workspace Trust](https://code.visualstudio.com/docs/editing/workspaces/workspace-trust) is enabled. When enabled, Grok Build prompts users to choose between normal or restricted mode for new workspaces.

Use a boolean value:

```bash
<key>WorkspaceTrustEnabled</key>
<true/>
```

##### ExtensionGalleryServiceUrl policy

The `ExtensionGalleryServiceUrl` policy configures the extension marketplace URL. This is useful for organizations that want to use a custom extension marketplace or mirror.

Set the URL as a string value:

```bash
<key>ExtensionGalleryServiceUrl</key>
<string>https://marketplace.example.com</string>
```

##### Deploying with MDM solutions

The `.mobileconfig` file can be uploaded directly to your MDM solution:

* **Jamf**: Upload as a custom configuration profile
* **Kandji**: Add as a custom profile in Library
* **Microsoft Intune**: Deploy as a custom profile with the correct payload domain

Ensure the `PayloadType` matches your Grok Build channel's bundle ID.

##### Reference configuration file

A complete example configuration profile is included with Grok Build. Where it is depends on how the app was installed. A new install lands in `Grok Build.app`. An install that has updated from an earlier Cursor version keeps its original `Cursor.app` folder, because updates never move the app. A fleet that has been running the app for a while usually has both.

```bash
# Production channel, new installs
/Applications/Grok Build.app/Contents/Resources/app/policies/com.todesktop.230313mzl4w4u92.mobileconfig

# Production channel, installs updated from Cursor
/Applications/Cursor.app/Contents/Resources/app/policies/com.todesktop.230313mzl4w4u92.mobileconfig

# Nightly channel, new installs
/Applications/Grok Build Nightly.app/Contents/Resources/app/policies/co.anysphere.cursor.nightly.mobileconfig

# Nightly channel, installs updated from Cursor Nightly
/Applications/Cursor Nightly.app/Contents/Resources/app/policies/co.anysphere.cursor.nightly.mobileconfig
```

The bundle IDs are the same in both folders, so key MDM policies on the bundle ID rather than on a path. A configuration profile already does, through `PayloadType`. If a policy has to name a path, list both folders.

**Important security considerations:**

* The provided `.mobileconfig` file initializes **all** policies available in that version of Grok Build
* Delete any policies that are not needed to avoid unintentionally restrictive defaults
* If you do not edit or remove a policy from the sample, that policy will be enforced with its default value
* Policy values override all user and workspace settings globally

Manually install a configuration profile by double-clicking on the `.mobileconfig` profile in Finder and then enabling it in System Preferences under **General** > **Device Management**. Removing the profile from System Preferences will remove the policies from Grok Build.

For more information on configuration profiles, refer to Apple's documentation.

#### Linux policy file

Linux distributions don't have a standardized enterprise policy system like Windows Registry or macOS configuration profiles. Grok Build reads policies from a JSON file to provide equivalent functionality.

**Note:** Linux policy file support is available in Grok Build version 2.0 and later.

The policy file is located at `~/.cursor/policy.json`.

##### Creating a policy file

Create a JSON file at the location above with policy names as keys and their values. All policies are optional?include only the policies you want to enforce.

**Example policy.json file**

```json
{
  "AllowedExtensions": "{\"anysphere\": true, \"github\": true}",
  "AllowedTeamId": "1,3,7",
  "WorkspaceTrustEnabled": true
}
```

##### Policy format

Each policy in the JSON file maps to a policy name:

* **AllowedExtensions**: A JSON string defining allowed extension publishers
  ```json
  "AllowedExtensions": "{\"anysphere\": true, \"github\": true}"
  ```

* **AllowedTeamId**: A comma-separated string of team IDs
  ```json
  "AllowedTeamId": "1,3,7"
  ```

* **WorkspaceTrustEnabled**: A boolean controlling workspace trust
  ```json
  "WorkspaceTrustEnabled": true
  ```

**Note:** The `AllowedExtensions` value must be a JSON string (escaped quotes), not a JSON object. This matches the format used on Windows and macOS.

##### Deploying policies

Deploy the policy file using your organization's configuration management tools:

* Ansible, Puppet, or Chef for automated deployment
* NFS or shared network storage for centralized policy files
* Package managers with post-install scripts
* Container base images for containerized environments

Changes to the policy file take effect when Grok Build restarts. The file is monitored for changes, so updates propagate automatically to running instances.

If the policy file doesn't exist, Grok Build runs without policy restrictions.

### Automatic updates for non-admin users

Due to Electron framework limitations, Grok Build updates require administrator privileges on macOS.

**Recommended approaches:**

* **MDM deployment**: Use MDM tools (Jamf, Kandji, Intune) to deploy updates centrally with appropriate privileges
* **Automated deployment tools**: Consider tools like [Installomator](https://github.com/Installomator/Installomator) for scripted updates
* **Disable update prompts**: Set the `UpdateMode` policy to `none` to prevent users from seeing failed update notifications

For organizations with non-admin users, the most reliable approach is to manage Grok Build updates through your existing software deployment pipeline and disable automatic updates via MDM policy.

## Grok Build TUI deployment

The Grok Build TUI (`grok`) runs Grok Build agents from a shell, so you can install it on developer machines, build servers, Kubernetes clusters, and CI runners. It reaches whatever the host can reach: your VPN, internal APIs, and private package registries.

Install it with the shell installer or npm:

```bash
# macOS, Linux, and WSL
curl -fsSL https://x.ai/cli/install.sh | bash

# Any platform with Node.js
npm install -g @xai-official/grok
```

```powershell
# Windows PowerShell
irm https://x.ai/cli/install.ps1 | iex
```

For scripts and CI, authenticate with an API key and run a prompt headlessly:

```bash
export XAI_API_KEY="xai-..."
grok -p "Review this diff" --output-format json --always-approve
```

To run Cloud Agents on your own build servers or Kubernetes clusters, install `cursor-agent` from `https://cursor.com/install` and run `cursor-agent worker` rather than `grok`. See [Self-Hosted Machines](/build/agents-window/cloud-agent/self-hosted).

The Grok Build TUI has its own sign-in, managed policy file (`/etc/grok/requirements.toml`), and data guarantee. [Enterprise Deployments](/build/enterprise) covers all three, and [Headless and scripting](/build/cli/headless-scripting) covers output formats and CI use. The [enterprise overview](/build/agents-window/enterprise#controls-by-surface) compares its controls with the Agents Window's.

## Network considerations

User machines need the Agents Window hosts in the [combined network allowlist](/build/agents-window/enterprise#network-allowlist), and the Grok Build TUI hosts too if you deploy `grok`. When the `UpdateMode` policy is `none`, you can block the update hosts and keep the rest.

The Agents Window inherits the machine's network configuration, including VPN access, internal service endpoints, and private package registries, so agents running in it can reach whatever the user can reach. See [Network Configuration](/build/agents-window/enterprise/network-configuration) for proxy and firewall requirements.

## Minimum versions

Grok Build maintains two minimum version floors:

* **Minimum supported version**: users on older versions see a dismissable warning asking them to upgrade.
* **Minimum allowed version**: users on older versions see an undismissable error and must upgrade. This marks the end of life for that release line.

As a general rule of thumb, a release becomes eligible to be the minimum supported version about 2 months after its GA date, and eligible to be the minimum allowed version about 3 months after its GA date. Bumps also depend on adoption of newer releases.

You can estimate when a release will age out by combining this guidance with Grok Build's published GA and changelog dates.

When managing Grok Build deployments for your organization, Grok Build recommends updating it regularly (for example, via MDM) so users stay on supported versions.

For what users see when their version ages out and how they update, see [Minimum version policy](/build/agents-window/help/troubleshooting/minimum-version).

## Troubleshooting

* Proxy configuration problems (see [Network Configuration](/build/agents-window/enterprise/network-configuration))
* Model access issues (check [Model and Integration Management](/build/agents-window/enterprise/model-and-integration-management) or your [team dashboard](/build/agents-window/account/teams/dashboard))
* Spending limit reached (see [Spend Limits](/x-subscription/spending-caps))

## Frequently asked questions

### Does Grok Build support policies on Linux?

Yes, starting with version 2.0. Linux uses a file-based policy system at `~/.cursor/policy.json`. See the "Linux Policy File" section above for details on the format and deployment.

### Can I use environment variables in the policy file?

No. The policy file must be a valid JSON file with static values. Use your configuration management tools to generate the file dynamically if needed.

### What happens if the policy file has invalid JSON?

Grok Build logs an error and runs without policy restrictions. Check the main process logs for parsing errors.

### What is my team ID?

You can find your team ID by clicking on your team name from the [Grok Dashboard](https://grok.com/dashboard).
