> ## Documentation Index
> Fetch the complete documentation index at: https://ona.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Organization Policies

> Gets organization policy settings by organization ID.

`Unary` · [`Organizations`](/docs/api-reference/generated/organization/overview)

Gets organization policy settings by organization ID.

Use this method to:

* Retrieve current policy settings for an organization
* View resource limits and restrictions
* Check allowed editors and other configurations

### Examples

* Get organization policies:

  Retrieves policy settings for a specific organization.

  ```yaml theme={null}
  organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
  ```

## Endpoint

```text theme={null}
POST /api/gitpod.v1.OrganizationService/GetOrganizationPolicies
```

Send a Bearer token as described in [Authentication](/docs/api-reference#authenticate-requests). If your organization uses a custom management-plane domain, replace `https://app.ona.com` with that domain.

## Request example

<CodeGroup>
  ```bash cURL theme={null}
  export ONA_HOST=https://app.ona.com
  export ONA_API_KEY=<your-token>

  curl --request POST \
    --url "$ONA_HOST/api/gitpod.v1.OrganizationService/GetOrganizationPolicies" \
    --header "Authorization: Bearer $ONA_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
    "organizationId": "<organization-id>"
  }'
  ```

  ```python Python theme={null}
  import gitpod.v1.organization_pb2 as organization_pb2
  from ona_sdk import create_client_from_env

  ona = create_client_from_env()
  request = organization_pb2.GetOrganizationPoliciesRequest(
      organization_id="<organization-id>",
  )
  response = ona.services.organization.get_organization_policies(request)
  print(response)
  ```

  ```typescript TypeScript theme={null}
  import { create } from "@bufbuild/protobuf";
  import { createClientFromEnv } from "@gitpod/sdk";
  import { GetOrganizationPoliciesRequestSchema } from "@gitpod/sdk/gitpod/v1/organization_pb";

  async function main() {
    const ona = createClientFromEnv();
    const request = create(GetOrganizationPoliciesRequestSchema, {
      organizationId: "<organization-id>",
    });
    const response = await ona.services.organization.getOrganizationPolicies(request);
    console.log(response);
  }

  main().catch(console.error);
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"log"

  	"connectrpc.com/connect"
  	"github.com/gitpod-io/gitpod-sdk-go/sdk"
  	gitpodpb "github.com/gitpod-io/gitpod-sdk-go/v1"
  )

  func main() {
  	ona, err := sdk.NewFromEnv()
  	if err != nil {
  		log.Fatal(err)
  	}

  	request := connect.NewRequest(&gitpodpb.GetOrganizationPoliciesRequest{
  		OrganizationId: "<organization-id>",
  	})
  	response, err := ona.Services.Organization.GetOrganizationPolicies(context.Background(), request)
  	if err != nil {
  		log.Fatal(err)
  	}
  	fmt.Println(response.Msg)
  }
  ```

  ```json Request body theme={null}
  {
    "organizationId": "<organization-id>"
  }
  ```
</CodeGroup>

## Request

`gitpod.v1.GetOrganizationPoliciesRequest`

| Field            | Type   | Required | Description                                                                                                             |
| ---------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| `organizationId` | string | Yes      | organization\_id is the ID of the organization to retrieve policies for Constraints: `required=true, string.uuid=true`. |

## Response

`gitpod.v1.GetOrganizationPoliciesResponse`

| Field      | Type                                                          | Required | Description                   |
| ---------- | ------------------------------------------------------------- | -------- | ----------------------------- |
| `policies` | [OrganizationPolicies](#type-gitpod-v1-organization-policies) | Yes      | Constraints: `required=true`. |

## Related types

<a id="type-gitpod-v1-agent-policy" />

<Accordion title="AgentPolicy">
  AgentPolicy contains agent-specific policy settings for an organization

  `gitpod.v1.AgentPolicy`

  | Field                          | Type                                                                     | Required | Description                                                                                                                                                                                                                                  |
  | ------------------------------ | ------------------------------------------------------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `mcpDisabled`                  | boolean                                                                  | Yes      | mcp\_disabled controls whether MCP (Model Context Protocol) is disabled for agents Constraints: `required=true`.                                                                                                                             |
  | `commandDenyList`              | array of string                                                          | Yes      | command\_deny\_list contains a list of commands that agents are not allowed to execute Constraints: `required=true`.                                                                                                                         |
  | `scmToolsDisabled`             | boolean                                                                  | Yes      | scm\_tools\_disabled controls whether SCM (Source Control Management) tools are disabled for agents Constraints: `required=true`.                                                                                                            |
  | `scmToolsAllowedGroupId`       | string                                                                   | No       | scm\_tools\_allowed\_group\_id restricts SCM tools access to members of this group. Empty means no restriction (all users can use SCM tools if not disabled).                                                                                |
  | `conversationSharingPolicy`    | [ConversationSharingPolicy](#enum-gitpod-v1-conversation-sharing-policy) | No       | conversation\_sharing\_policy controls whether agent conversations can be shared                                                                                                                                                             |
  | `maxSubagentsPerEnvironment`   | integer                                                                  | No       | max\_subagents\_per\_environment limits the number of non-terminal sub-agents a parent can have running simultaneously in the same environment. Valid range: 0-10. Zero means use the default (5). Constraints: `int32.gte=0, int32.lte=10`. |
  | `allowedAgentIds`              | array of string                                                          | No       | allowed\_agent\_ids contains the agent IDs users may select when the codex\_rollout feature flag is enabled. Empty means all agents are allowed.                                                                                             |
  | `allowedCodexModels`           | array of [CodexOpenAIModel](#enum-gitpod-v1-codex-open-ai-model)         | No       | **Deprecated.** Deprecated: use codex\_model\_policy. This legacy allowlist cannot distinguish omitted from intentionally empty on update requests. Empty means all Codex models are allowed.                                                |
  | `allowedCodexReasoningEfforts` | array of [CodexReasoningEffort](#enum-gitpod-v1-codex-reasoning-effort)  | No       | allowed\_codex\_reasoning\_efforts contains the Codex reasoning efforts users may select when the codex\_rollout feature flag is enabled. Empty means all Codex reasoning efforts are allowed.                                               |
  | `allowedCodexServiceTiers`     | array of [CodexServiceTier](#enum-gitpod-v1-codex-service-tier)          | No       | allowed\_codex\_service\_tiers contains the Codex service tiers users may select when the codex\_rollout feature flag is enabled. Empty means all Codex service tiers are allowed.                                                           |
  | `goalModeDisabled`             | boolean                                                                  | No       | goal\_mode\_disabled controls whether Codex goal mode is disabled for the organization.                                                                                                                                                      |
  | `codexModelPolicy`             | CodexModelPolicy                                                         | No       | codex\_model\_policy contains explicit per-model Codex availability states. Missing policy or missing model entries mean allowed.                                                                                                            |
</Accordion>

<a id="type-gitpod-v1-editor-version-policy" />

<Accordion title="EditorVersionPolicy">
  EditorVersionPolicy defines the version policy for a specific editor

  `gitpod.v1.EditorVersionPolicy`

  | Field             | Type            | Required | Description                                                                                                                                                           |
  | ----------------- | --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `allowedVersions` | array of string | No       | allowed\_versions lists the versions that are allowed If empty, we will use the latest version of the editor Examples for JetBrains: `["2025.2", "2025.1", "2024.3"]` |
</Accordion>

<a id="type-gitpod-v1-organization-policies" />

<Accordion title="OrganizationPolicies">
  `gitpod.v1.OrganizationPolicies`

  | Field                               | Type                                                                          | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
  | ----------------------------------- | ----------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `organizationId`                    | string                                                                        | Yes      | organization\_id is the ID of the organization Constraints: `required=true, string.uuid=true`.                                                                                                                                                                                                                                                                                                                                                                                    |
  | `maximumEnvironmentTimeout`         | duration string                                                               | No       | maximum\_environment\_timeout controls the maximum timeout allowed for environments in seconds. 0 means no limit (never). Minimum duration is 30 minutes (1800 seconds). Constraints: `cel.expression=this == duration('0s') \|\| this >= duration('1800s'), cel.id=maximum_environment_timeout, cel.message=value must be 0s (no limit) or at least 1800s (30 minutes)`.                                                                                                         |
  | `membersRequireProjects`            | boolean                                                                       | Yes      | members\_require\_projects controls whether environments can only be created from projects by non-admin users Constraints: `required=true`.                                                                                                                                                                                                                                                                                                                                       |
  | `membersCreateProjects`             | boolean                                                                       | Yes      | members\_create\_projects controls whether members can create projects Constraints: `required=true`.                                                                                                                                                                                                                                                                                                                                                                              |
  | `allowedEditorIds`                  | array of string                                                               | Yes      | allowed\_editor\_ids is the list of editor IDs that are allowed to be used in the organization Constraints: `required=true`.                                                                                                                                                                                                                                                                                                                                                      |
  | `defaultEditorId`                   | string                                                                        | Yes      | default\_editor\_id is the default editor ID to be used when a user doesn't specify one Constraints: `required=true`.                                                                                                                                                                                                                                                                                                                                                             |
  | `allowLocalRunners`                 | boolean                                                                       | Yes      | allow\_local\_runners controls whether local runners are allowed to be used in the organization Constraints: `required=true`.                                                                                                                                                                                                                                                                                                                                                     |
  | `maximumRunningEnvironmentsPerUser` | 64-bit integer string                                                         | Yes      | maximum\_running\_environments\_per\_user limits simultaneously running environments per user Constraints: `required=true`.                                                                                                                                                                                                                                                                                                                                                       |
  | `maximumEnvironmentsPerUser`        | 64-bit integer string                                                         | Yes      | maximum\_environments\_per\_user limits total environments (running or stopped) per user Constraints: `required=true`.                                                                                                                                                                                                                                                                                                                                                            |
  | `defaultEnvironmentImage`           | string                                                                        | Yes      | default\_environment\_image is the default container image when none is defined in repo Constraints: `required=true`.                                                                                                                                                                                                                                                                                                                                                             |
  | `portSharingDisabled`               | boolean                                                                       | Yes      | port\_sharing\_disabled controls whether user-initiated port sharing is disabled in the organization. System ports (VS Code Browser, agents) are always exempt from this policy. Constraints: `required=true`.                                                                                                                                                                                                                                                                    |
  | `deleteArchivedEnvironmentsAfter`   | duration string                                                               | No       | delete\_archived\_environments\_after controls how long archived environments are kept before automatic deletion. 0 means no automatic deletion. Maximum duration is 4 weeks (2419200 seconds). Constraints: `duration.lte.seconds=2419200`.                                                                                                                                                                                                                                      |
  | `agentPolicy`                       | [AgentPolicy](#type-gitpod-v1-agent-policy)                                   | Yes      | agent\_policy contains agent-specific policy settings Constraints: `required=true`.                                                                                                                                                                                                                                                                                                                                                                                               |
  | `maximumEnvironmentLifetime`        | duration string                                                               | No       | maximum\_environment\_lifetime controls for how long environments are allowed to be reused. 0 means no maximum lifetime. Maximum duration is 180 days (15552000 seconds). Constraints: `duration.lte.seconds=15552000`.                                                                                                                                                                                                                                                           |
  | `requireCustomDomainAccess`         | boolean                                                                       | Yes      | require\_custom\_domain\_access controls whether users must access via custom domain when one is configured. When true, access via app.gitpod.io is blocked. Constraints: `required=true`.                                                                                                                                                                                                                                                                                        |
  | `editorVersionRestrictions`         | map of string to [EditorVersionPolicy](#type-gitpod-v1-editor-version-policy) | No       | editor\_version\_restrictions restricts which editor versions can be used. Maps editor ID to version policy, editor\_version\_restrictions not set means no restrictions. If empty or not set for an editor, we will use the latest version of the editor                                                                                                                                                                                                                         |
  | `securityAgentPolicy`               | [SecurityAgentPolicy](#type-gitpod-v1-security-agent-policy)                  | No       | security\_agent\_policy contains security agent configuration for the organization. When configured, security agents are automatically deployed to all environments.                                                                                                                                                                                                                                                                                                              |
  | `restrictAccountCreationToScim`     | boolean                                                                       | Yes      | restrict\_account\_creation\_to\_scim controls whether account creation is restricted to SCIM-provisioned users only. When true and SCIM is configured for the organization, only users provisioned via SCIM can create accounts. Constraints: `required=true`.                                                                                                                                                                                                                   |
  | `vetoExecPolicy`                    | [VetoExecPolicy](#type-gitpod-v1-veto-exec-policy)                            | No       | veto\_exec\_policy contains the veto exec policy for environments.                                                                                                                                                                                                                                                                                                                                                                                                                |
  | `maximumEnvironmentLifetimeStrict`  | boolean                                                                       | No       | maximum\_environment\_lifetime\_strict controls whether environments past their lockdown\_at timestamp are blocked from starting.                                                                                                                                                                                                                                                                                                                                                 |
  | `maxPortAdmissionLevel`             | [AdmissionLevel](#enum-gitpod-v1-admission-level)                             | No       | max\_port\_admission\_level caps the maximum admission level a user-opened port may use. UNSPECIFIED means no cap (any AdmissionLevel value is allowed). System ports (VS Code Browser, agents) are exempt. The legacy port\_sharing\_disabled field, when true, takes precedence and blocks all user-initiated port sharing.                                                                                                                                                     |
  | `webBrowserDisabled`                | boolean                                                                       | Yes      | web\_browser\_disabled controls whether users can open the built-in web browser from environment pages. This does not affect VS Code Browser. Constraints: `required=true`.                                                                                                                                                                                                                                                                                                       |
  | `disableFromScratch`                | boolean                                                                       | Yes      | disable\_from\_scratch controls whether non-admin users can create blank environments without a Git or URL initializer. Constraints: `required=true`.                                                                                                                                                                                                                                                                                                                             |
  | `vetoFilePolicy`                    | [VetoFilePolicy](#type-gitpod-v1-veto-file-policy)                            | No       | veto\_file\_policy contains veto-file policy for environments.                                                                                                                                                                                                                                                                                                                                                                                                                    |
  | `securityPolicyId`                  | string                                                                        | No       | security\_policy\_id references the Veto Exec SecurityPolicy assigned to newly created environments. The public GA contract accepts policies that use only SecurityPolicy.Spec.executables. Assignment validates materializability and rejects unsupported executable selectors or effects. If empty, new environments have no SecurityPolicy by default. Constraints: `ignore=1, string.uuid=true`.                                                                              |
  | `archiveEnvironmentsAfter`          | duration string                                                               | No       | archive\_environments\_after controls how long stopped environments remain inactive before archival. Enterprise only. Must be a whole number of days. Minimum duration is 1 day (86400 seconds). Maximum duration is 30 days (2592000 seconds). Constraints: `cel.expression=int(this) % int(duration('86400s')) == 0, cel.id=archive_environments_after_whole_days, cel.message=value must be a whole number of days, duration.gte.seconds=86400, duration.lte.seconds=2592000`. |
</Accordion>

<a id="type-gitpod-v1-security-agent-policy" />

<Accordion title="SecurityAgentPolicy">
  SecurityAgentPolicy contains security agent configuration for an organization.
  When enabled, security agents are automatically deployed to all environments.

  `gitpod.v1.SecurityAgentPolicy`

  | Field          | Type                         | Required | Description                                               |
  | -------------- | ---------------------------- | -------- | --------------------------------------------------------- |
  | `crowdstrike`  | CrowdStrikeConfig            | No       | crowdstrike contains CrowdStrike Falcon configuration     |
  | `customAgents` | array of CustomSecurityAgent | No       | custom\_agents contains custom security agent definitions |
</Accordion>

<a id="type-gitpod-v1-veto-exec-policy" />

<Accordion title="VetoExecPolicy">
  VetoExecPolicy defines the policy for blocking or auditing executable execution in environments.

  `gitpod.v1.VetoExecPolicy`

  | Field         | Type                                                           | Required | Description                                                                                                                                                                                     |
  | ------------- | -------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `enabled`     | boolean                                                        | No       | enabled controls whether executable blocking is active                                                                                                                                          |
  | `executables` | array of string                                                | No       | executables is the list of executable paths or names to block                                                                                                                                   |
  | `action`      | [KernelControlsAction](#enum-gitpod-v1-kernel-controls-action) | No       | action specifies what action kernel-level controls take on policy violations                                                                                                                    |
  | `safelist`    | array of string                                                | No       | Output only. Executable paths that are protected by the safelist and cannot be blocked by the denylist. Populated by the server from the built-in default safelist. Ignored on update requests. |
</Accordion>

<a id="type-gitpod-v1-veto-file-policy" />

<Accordion title="VetoFilePolicy">
  VetoFilePolicy defines path and block-device file controls in environments.

  `gitpod.v1.VetoFilePolicy`

  | Field          | Type                       | Required | Description                                                     |
  | -------------- | -------------------------- | -------- | --------------------------------------------------------------- |
  | `enabled`      | boolean                    | No       | enabled controls whether file policy materialization is active. |
  | `paths`        | VetoFilePathPolicy         | No       | paths controls path-based file-content access.                  |
  | `blockDevices` | VetoFileBlockDevicesPolicy | No       | block\_devices controls block-device open access.               |
</Accordion>

<a id="enum-gitpod-v1-admission-level" />

<Accordion title="AdmissionLevel">
  Admission level describes who can access an environment instance and its ports.

  | Value                          | Number | Description                                                                                                                                                       |
  | ------------------------------ | -----: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `ADMISSION_LEVEL_UNSPECIFIED`  |      0 |                                                                                                                                                                   |
  | `ADMISSION_LEVEL_OWNER_ONLY`   |      1 | **Deprecated.** ADMISSION\_LEVEL\_OWNER\_ONLY means the environment can only be accessed by the creator. Deprecated: Use ADMISSION\_LEVEL\_CREATOR\_ONLY instead. |
  | `ADMISSION_LEVEL_EVERYONE`     |      2 | ADMISSION\_LEVEL\_EVERYONE means the environment (including ports) can be accessed by everyone.                                                                   |
  | `ADMISSION_LEVEL_ORGANIZATION` |      3 | ADMISSION\_LEVEL\_ORGANIZATION means the environment (including ports) can be accessed by all members of the organization.                                        |
  | `ADMISSION_LEVEL_CREATOR_ONLY` |      4 | ADMISSION\_LEVEL\_CREATOR\_ONLY means the environment (including ports) can only be accessed by the user who created the environment.                             |
</Accordion>

<a id="enum-gitpod-v1-codex-open-ai-model" />

<Accordion title="CodexOpenAIModel">
  CodexOpenAIModel is the static allowlist of concrete OpenAI models that the
  Codex app runtime can select through Ona's Codex picker.

  | Value                                     | Number | Description     |
  | ----------------------------------------- | -----: | --------------- |
  | `CODEX_OPEN_AI_MODEL_UNSPECIFIED`         |      0 |                 |
  | `CODEX_OPEN_AI_MODEL_GPT_5_5`             |      1 |                 |
  | `CODEX_OPEN_AI_MODEL_GPT_5_4`             |      2 |                 |
  | `CODEX_OPEN_AI_MODEL_GPT_5_4_MINI`        |      3 | **Deprecated.** |
  | `CODEX_OPEN_AI_MODEL_GPT_5_3_CODEX`       |      4 | **Deprecated.** |
  | `CODEX_OPEN_AI_MODEL_GPT_5_3_CODEX_SPARK` |      5 | **Deprecated.** |
  | `CODEX_OPEN_AI_MODEL_GPT_5_2`             |      6 | **Deprecated.** |
  | `CODEX_OPEN_AI_MODEL_GPT_5_6_SOL`         |      7 |                 |
  | `CODEX_OPEN_AI_MODEL_GPT_5_6_TERRA`       |      8 |                 |
  | `CODEX_OPEN_AI_MODEL_GPT_5_6_LUNA`        |      9 |                 |
</Accordion>

<a id="enum-gitpod-v1-codex-reasoning-effort" />

<Accordion title="CodexReasoningEffort">
  CodexReasoningEffort is the static allowlist of reasoning efforts supported
  by the Codex app runtime.

  | Value                                | Number | Description |
  | ------------------------------------ | -----: | ----------- |
  | `CODEX_REASONING_EFFORT_UNSPECIFIED` |      0 |             |
  | `CODEX_REASONING_EFFORT_LOW`         |      1 |             |
  | `CODEX_REASONING_EFFORT_MEDIUM`      |      2 |             |
  | `CODEX_REASONING_EFFORT_HIGH`        |      3 |             |
  | `CODEX_REASONING_EFFORT_EXTRA_HIGH`  |      4 |             |
  | `CODEX_REASONING_EFFORT_MAX`         |      5 |             |
  | `CODEX_REASONING_EFFORT_ULTRA`       |      6 |             |
</Accordion>

<a id="enum-gitpod-v1-codex-service-tier" />

<Accordion title="CodexServiceTier">
  CodexServiceTier is the static allowlist of service tiers supported by the
  Codex app runtime.

  | Value                            | Number | Description |
  | -------------------------------- | -----: | ----------- |
  | `CODEX_SERVICE_TIER_UNSPECIFIED` |      0 |             |
  | `CODEX_SERVICE_TIER_FAST`        |      1 |             |
</Accordion>

<a id="enum-gitpod-v1-conversation-sharing-policy" />

<Accordion title="ConversationSharingPolicy">
  ConversationSharingPolicy controls how agent conversations can be shared.

  | Value                                      | Number | Description |
  | ------------------------------------------ | -----: | ----------- |
  | `CONVERSATION_SHARING_POLICY_UNSPECIFIED`  |      0 |             |
  | `CONVERSATION_SHARING_POLICY_DISABLED`     |      1 |             |
  | `CONVERSATION_SHARING_POLICY_ORGANIZATION` |      2 |             |
</Accordion>

<a id="enum-gitpod-v1-kernel-controls-action" />

<Accordion title="KernelControlsAction">
  KernelControlsAction defines how a kernel-level policy violation is handled.

  | Value                                | Number | Description                                                             |
  | ------------------------------------ | -----: | ----------------------------------------------------------------------- |
  | `KERNEL_CONTROLS_ACTION_UNSPECIFIED` |      0 | KERNEL\_CONTROLS\_ACTION\_UNSPECIFIED defaults to BLOCK.                |
  | `KERNEL_CONTROLS_ACTION_BLOCK`       |      1 | KERNEL\_CONTROLS\_ACTION\_BLOCK denies the operation.                   |
  | `KERNEL_CONTROLS_ACTION_AUDIT`       |      2 | KERNEL\_CONTROLS\_ACTION\_AUDIT logs the operation without blocking it. |
</Accordion>
