---
title: "UpdateOrganizationPolicies"
method: POST
path: "/gitpod.v1.OrganizationService/UpdateOrganizationPolicies"
tags: ["gitpod.v1.OrganizationService"]
---

# UpdateOrganizationPolicies

`POST /gitpod.v1.OrganizationService/UpdateOrganizationPolicies`

Updates organization policy settings.

 Use this method to:
 - Configure editor restrictions
 - Set environment resource limits
 - Define project creation permissions
 - Customize default configurations

 ### Examples

 - Update editor policies:

   Restricts available editors and sets a default.

   ```yaml
   organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
   allowedEditorIds:
     - "vscode"
     - "jetbrains"
   defaultEditorId: "vscode"
   ```

 - Set environment limits:

   Configures limits for environment usage.

   ```yaml
   organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
   maximumEnvironmentTimeout: "3600s"
   maximumRunningEnvironmentsPerUser: "5"
   maximumEnvironmentsPerUser: "20"
   ```

## Request body

- GitpodV1UpdateOrganizationPoliciesRequest
  - `agentPolicy` GitpodV1UpdateOrganizationPoliciesRequestUpdateAgentPolicy
    - `allowedAgentIds` string[] — 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` GitpodV1CodexOpenAIModel[] — 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` GitpodV1CodexReasoningEffort[] — 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` GitpodV1CodexServiceTier[] — 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.
    - `codexModelPolicy` GitpodV1CodexModelPolicy — CodexModelPolicy controls per-model availability for Codex.
      - `modelStates` object — model_states maps CodexOpenAIModel enum names to explicit policy states. Missing entries are treated as allowed.
    - `commandDenyList` string[] — command_deny_list contains a list of commands that agents are not allowed to execute
    - `conversationSharingPolicy` 'CONVERSATION_SHARING_POLICY_UNSPECIFIED' | 'CONVERSATION_SHARING_POLICY_DISABLED' | 'CONVERSATION_SHARING_POLICY_ORGANIZATION' — ConversationSharingPolicy controls how agent conversations can be shared.
    - `goalModeDisabled` boolean, nullable — goal_mode_disabled controls whether Codex goal mode is disabled for the organization.
    - `maxSubagentsPerEnvironment` integer, nullable — 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).
    - `mcpDisabled` boolean, nullable — mcp_disabled controls whether MCP (Model Context Protocol) is disabled for agents
    - `scmToolsAllowedGroupId` string, nullable — 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).
    - `scmToolsDisabled` boolean, nullable — scm_tools_disabled controls whether SCM (Source Control Management) tools are disabled for agents
  - `allowLocalRunners` boolean, nullable — allow_local_runners controls whether local runners are allowed to be used in the organization
  - `allowedEditorIds` string[] — allowed_editor_ids is the list of editor IDs that are allowed to be used in the organization
  - `archiveEnvironmentsAfter` string, regex — A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".
  - `defaultEditorId` string, nullable — default_editor_id is the default editor ID to be used when a user doesn't specify one
  - `defaultEnvironmentImage` string, nullable — default_environment_image is the default container image when none is defined in repo
  - `deleteArchivedEnvironmentsAfter` string, regex — A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".
  - `disableFromScratch` boolean, nullable — disable_from_scratch controls whether non-admin users can create blank environments without a Git or URL initializer.
  - `editorVersionRestrictions` object — editor_version_restrictions restricts which editor versions can be used. Maps editor ID to version policy with allowed major versions.
  - `maxPortAdmissionLevel` 'ADMISSION_LEVEL_UNSPECIFIED' | 'ADMISSION_LEVEL_OWNER_ONLY' | 'ADMISSION_LEVEL_EVERYONE' | 'ADMISSION_LEVEL_ORGANIZATION' | 'ADMISSION_LEVEL_CREATOR_ONLY' — Admission level describes who can access an environment instance and its ports.
  - `maximumEnvironmentLifetime` string, regex — A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".
  - `maximumEnvironmentLifetimeStrict` boolean, nullable — maximum_environment_lifetime_strict controls whether environments past their lockdown_at timestamp are blocked from starting.
  - `maximumEnvironmentTimeout` string, regex — A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".
  - `maximumEnvironmentsPerUser` string, nullable — maximum_environments_per_user limits total environments (running or stopped) per user
  - `maximumRunningEnvironmentsPerUser` string, nullable — maximum_running_environments_per_user limits simultaneously running environments per user
  - `membersCreateProjects` boolean, nullable — members_create_projects controls whether members can create projects
  - `membersRequireProjects` boolean, nullable — members_require_projects controls whether environments can only be created from projects by non-admin users
  - `organizationId` string, uuid, required — organization_id is the ID of the organization to update policies for
  - `portSharingDisabled` boolean, nullable — 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.
  - `requireCustomDomainAccess` boolean, nullable — 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.
  - `restrictAccountCreationToScim` boolean, nullable — 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.
  - `securityAgentPolicy` GitpodV1UpdateOrganizationPoliciesRequestUpdateSecurityAgentPolicy — UpdateSecurityAgentPolicy contains security agent configuration updates
    - `crowdstrike` GitpodV1UpdateOrganizationPoliciesRequestUpdateCrowdStrikeConfig — UpdateCrowdStrikeConfig contains CrowdStrike Falcon configuration updates
      - `additionalOptions` object — additional_options contains additional FALCONCTL_OPT_* options as key-value pairs
      - `cidSecretId` string, uuid, nullable — cid_secret_id references an organization secret containing the Customer ID (CID)
      - `enabled` boolean, nullable — enabled controls whether CrowdStrike Falcon is deployed to environments
      - `image` string, nullable — image is the CrowdStrike Falcon sensor container image reference
      - `tags` string, nullable — tags are optional tags to apply to the Falcon sensor
    - `customAgents` GitpodV1CustomSecurityAgent[] — custom_agents contains custom security agent definitions. Callers must read-then-write the full list.
      - `description` string — description is a human-readable description of what this agent does
      - `enabled` boolean — enabled controls whether this custom agent is deployed to environments
      - `envMappings` GitpodV1CustomAgentEnvMapping[] — env_mappings maps script placeholders to organization secret names, resolved to secret values at runtime.
        - `name` string — name is the environment variable name used as a placeholder in the start command.
        - `secretName` string — secret_name is the name of the organization secret whose value populates this placeholder.
      - `id` string — id is a unique identifier for this custom agent within the organization. Server-generated at save time if empty.
      - `name` string — name is the display name for this custom agent
      - `startCommand` string — start_command is the shell script that starts the agent
  - `securityPolicyId` string, uuid, nullable — security_policy_id assigns a Veto Exec SecurityPolicy 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. Set this field to an empty string to clear the default assignment.
  - `vetoExecPolicy` GitpodV1VetoExecPolicy — VetoExecPolicy defines the policy for blocking or auditing executable execution in environments.
    - `action` 'KERNEL_CONTROLS_ACTION_UNSPECIFIED' | 'KERNEL_CONTROLS_ACTION_BLOCK' | 'KERNEL_CONTROLS_ACTION_AUDIT' — KernelControlsAction defines how a kernel-level policy violation is handled.
    - `enabled` boolean — enabled controls whether executable blocking is active
    - `executables` string[] — executables is the list of executable paths or names to block
    - `safelist` string[] — 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.
  - `vetoFilePolicy` GitpodV1VetoFilePolicy — VetoFilePolicy defines path and block-device file controls in environments.
    - `blockDevices` GitpodV1VetoFileBlockDevicesPolicy — VetoFileBlockDevicesPolicy defines block-device open control.
      - `action` 'KERNEL_CONTROLS_ACTION_UNSPECIFIED' | 'KERNEL_CONTROLS_ACTION_BLOCK' | 'KERNEL_CONTROLS_ACTION_AUDIT' — KernelControlsAction defines how a kernel-level policy violation is handled.
      - `enabled` boolean — enabled controls whether opening block devices is denied or audited.
    - `enabled` boolean — enabled controls whether file policy materialization is active.
    - `paths` GitpodV1VetoFilePathPolicy — VetoFilePathPolicy defines path-based file-content access control.
      - `defaultEffect` 'KERNEL_CONTROLS_ACTION_UNSPECIFIED' | 'KERNEL_CONTROLS_ACTION_BLOCK' | 'KERNEL_CONTROLS_ACTION_AUDIT' — KernelControlsAction defines how a kernel-level policy violation is handled.
      - `defaultSurface` 'VETO_FILE_SURFACE_UNSPECIFIED' | 'VETO_FILE_SURFACE_ACCESS' | 'VETO_FILE_SURFACE_CONTENT_MUTATION' | 'VETO_FILE_SURFACE_CONTENT_READ' — VetoFileSurface defines which file operation classes a path entry targets.
      - `entries` GitpodV1VetoFilePathEntry[] — entries is the list of per-path file policies.
        - `effect` 'KERNEL_CONTROLS_ACTION_UNSPECIFIED' | 'KERNEL_CONTROLS_ACTION_BLOCK' | 'KERNEL_CONTROLS_ACTION_AUDIT' — KernelControlsAction defines how a kernel-level policy violation is handled.
        - `path` string — path is the absolute file path to match.
        - `surface` 'VETO_FILE_SURFACE_UNSPECIFIED' | 'VETO_FILE_SURFACE_ACCESS' | 'VETO_FILE_SURFACE_CONTENT_MUTATION' | 'VETO_FILE_SURFACE_CONTENT_READ' — VetoFileSurface defines which file operation classes a path entry targets.
        - `trackChanges` boolean — track_changes enables WATCH_* responder-refresh events for this entry.
  - `webBrowserDisabled` boolean, nullable — web_browser_disabled controls whether users can open the built-in web browser from environment pages. This does not affect VS Code Browser.

## Response `200`

Success

- GitpodV1UpdateOrganizationPoliciesResponse

## Other responses

- `default` — Error

---

[API](https://skmtc.net/gitpod-io/apis/gitpod-v1.md) · [All operations](https://skmtc.net/gitpod-io/apis/gitpod-v1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gitpod-io/gitpod-v1/revisions/44d50c2ac284/schema)
