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

# 更新组织安全 Profile

> 更新组织自有的安全 Profile。省略的字段
保持不变；显式传入 null 会清除 net_policy / mcp_config。

更新组织所属的安全 Profile。正在运行的会话会沿用其上次启动或唤醒时解析出的限制；更改会立即对新会话生效，现有会话则在下次恢复时生效。

## 权限

需要使用在组织级别拥有 `ManageSecureModeProfiles` 权限的[服务用户](https://docs.devin.ai/zh/api-reference/v3/service-users/members-service-users.md)或[个人访问令牌](https://docs.devin.ai/zh/api-reference/personal-access-tokens.md)。正在运行的 Devin 会话所使用的令牌会被拒绝，因此会话无法修改约束其自身的 Profile。

## 行为

* 省略的字段保持不变。
* 显式传入 `null` 会清除该 Profile 在 `net_policy`、`mcp_config`、`slack_channel_access`、`slack_dm_scope`、`teams_channel_access`、`teams_dm_scope` 和 `teams_group_chat_scope` 上的设置。其他字段不接受 `null`。
* `net_policy: null` 表示该 Profile 未指定任何网络策略，而非拒绝所有访问。如需拒绝所有访问，请使用 `{"allow": []}`。
* `mcp_config.servers` 通过 slug 列出 MCP 服务器 (可以是 MCP Marketplace 中的 slug，例如 `github`，也可以是某个安装实例的 slug) 。


## OpenAPI

````yaml zh/v3-openapi.yaml PATCH /v3beta1/organizations/{org_id}/security-profiles/{profile_id}
openapi: 3.1.0
info:
  description: 采用 Service User 身份验证和 RBAC 的 Devin v3 API
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3beta1/organizations/{org_id}/security-profiles/{profile_id}:
    patch:
      tags:
        - security-profiles
      summary: 更新组织安全 Profile
      description: |-
        更新组织自有的安全 Profile。省略的字段
        保持不变；显式传入 null 会清除 net_policy / mcp_config。
      operationId: >-
        handle_update_security_profile_v3beta1_organizations__org_id__security_profiles__profile_id__patch
      parameters:
        - in: path
          name: profile_id
          required: true
          schema:
            title: Profile Id
            type: string
        - description: 组织 ID（前缀：org-）
          in: path
          name: org_id
          required: true
          schema:
            example: org-abc123def456
            title: Org Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SecurityProfileUpdateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecurityProfileResponse'
          description: 成功响应
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 未授权
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 禁止访问
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 未找到
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 冲突
        '410':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 已移除
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 无法处理的内容
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 请求过多
components:
  schemas:
    SecurityProfileUpdateRequest:
      additionalProperties: false
      description: |-
        PATCH 语义：省略的字段保持不变；显式传入 null
        会清除可为空的字段（net_policy、mcp_config、slack_channel_access、
        slack_dm_scope、teams_channel_access、teams_dm_scope、
        teams_group_chat_scope），其他字段则不接受 null。
      properties:
        devin_mcp_read_only:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Devin Mcp Read Only
        enforcement_level:
          anyOf:
            - enum:
                - recommended
                - mandatory
              type: string
            - type: 'null'
          title: Enforcement Level
        git_access_level:
          anyOf:
            - enum:
                - read_only
                - read_write
              type: string
            - type: 'null'
          title: Git Access Level
        mcp_config:
          anyOf:
            - $ref: '#/components/schemas/SecurityProfileMcpConfig'
            - type: 'null'
        name:
          anyOf:
            - maxLength: 128
              minLength: 1
              type: string
            - type: 'null'
          title: Name
        net_policy:
          anyOf:
            - $ref: '#/components/schemas/SecurityProfileNetPolicy'
            - type: 'null'
        remove_github_cli_token:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Remove Github Cli Token
        slack_channel_access:
          anyOf:
            - $ref: '#/components/schemas/SecurityProfileSlackChannelAccess'
            - type: 'null'
        slack_dm_scope:
          anyOf:
            - enum:
                - disabled
                - org_members
                - workspace
              type: string
            - type: 'null'
          title: Slack Dm Scope
        teams_channel_access:
          anyOf:
            - $ref: '#/components/schemas/SecurityProfileTeamsChannelAccess'
            - type: 'null'
        teams_dm_scope:
          anyOf:
            - enum:
                - disabled
                - installed_users
              type: string
            - type: 'null'
          title: Teams Dm Scope
        teams_group_chat_scope:
          anyOf:
            - enum:
                - disabled
                - origin_chat
              type: string
            - type: 'null'
          title: Teams Group Chat Scope
      title: SecurityProfileUpdateRequest
      type: object
    SecurityProfileResponse:
      additionalProperties: false
      description: 组织拥有的安全 Profile。
      properties:
        created_at:
          title: Created At
          type: integer
        devin_mcp_read_only:
          description: 为 true 时，会话只能调用只读 Devin MCP 工具（不允许创建会话、管理自动化或执行其他写入操作）。
          title: Devin Mcp Read Only
          type: boolean
        enforcement_level:
          description: >-
            recommended Profile 可被下级绑定覆盖；mandatory Profile
            则设定限制基线，下级策略只能进一步收紧限制。
          enum:
            - recommended
            - mandatory
          title: Enforcement Level
          type: string
        git_access_level:
          enum:
            - read_only
            - read_write
          title: Git Access Level
          type: string
        mcp_config:
          anyOf:
            - $ref: '#/components/schemas/SecurityProfileMcpConfig'
            - type: 'null'
          description: null = 此 Profile 不对 MCP 作规定。
        name:
          title: Name
          type: string
        net_policy:
          anyOf:
            - $ref: '#/components/schemas/SecurityProfileNetPolicy'
            - type: 'null'
          description: null = 此 Profile 不对网络作规定（并不表示全部拒绝）。
        org_id:
          title: Org Id
          type: string
        profile_id:
          description: 安全 Profile 的 ID。
          title: Profile Id
          type: string
        remove_github_cli_token:
          description: 为 true 时，从会话所在的机器中移除 GitHub CLI 令牌，阻止直接访问 GitHub API。
          title: Remove Github Cli Token
          type: boolean
        slack_channel_access:
          anyOf:
            - $ref: '#/components/schemas/SecurityProfileSlackChannelAccess'
            - type: 'null'
          description: >-
            限定受此 Profile 管理的会话可在哪些 Slack 频道中读取和发布消息。null = 此 Profile 不作规定，使用组织的
            Slack 设置。
        slack_dm_scope:
          anyOf:
            - enum:
                - disabled
                - org_members
                - workspace
              type: string
            - type: 'null'
          description: >-
            限定在此 Profile 下谁可以在 Slack 中向 Devin 发送私信。null = 此 Profile 不作规定，使用组织的
            Slack 设置。对于企业账户，'workspace' 的范围会缩小为 'org_members'。
          title: Slack Dm Scope
        teams_channel_access:
          anyOf:
            - $ref: '#/components/schemas/SecurityProfileTeamsChannelAccess'
            - type: 'null'
          description: >-
            限定受此 Profile 管理的会话可在哪些 Microsoft Teams 频道中读取和发布消息。null = 此 Profile
            不作规定，使用组织的 Teams 默认访问设置。
        teams_dm_scope:
          anyOf:
            - enum:
                - disabled
                - installed_users
              type: string
            - type: 'null'
          description: >-
            限定在此 Profile 下 Devin 可以在 Microsoft Teams 中向谁发送私信。null = 此 Profile
            不作规定，使用组织的 Teams 默认访问设置。
          title: Teams Dm Scope
        teams_group_chat_scope:
          anyOf:
            - enum:
                - disabled
                - origin_chat
              type: string
            - type: 'null'
          description: >-
            限定在此 Profile 下 Devin 可以读取哪些 Teams 群聊；`origin_chat` = 仅限发起会话的群聊；null
            = 不作规定，与私信一样，由组织的 Teams 默认访问设置派生。
          title: Teams Group Chat Scope
        updated_at:
          title: Updated At
          type: integer
      required:
        - profile_id
        - name
        - git_access_level
        - enforcement_level
        - devin_mcp_read_only
        - remove_github_cli_token
        - created_at
        - updated_at
        - org_id
      title: SecurityProfileResponse
      type: object
    ProblemDetail:
      description: >-
        v3 API 的 RFC 9457 application/problem+json 错误响应体。


        detail 沿用自旧版 {"detail": ...} 响应体，以保持向后兼容；其他成员字段为新增字段。errors
        包含字段级验证失败信息（仅 422）。
      properties:
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: 针对此次具体情况的、便于人理解的说明。
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          description: 因操作被阻止而拒绝请求时返回的机器可读代码（例如 "user_frozen"、"migrated_session"）。
          title: Error Code
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          description: 字段级验证错误（仅适用于 422 响应）。
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          description: 此次出现对应的 URI 引用（请求路径）。
          title: Instance
        status:
          description: HTTP 状态码。
          title: Status
          type: integer
        title:
          description: 对问题类型的简短、便于理解的概述。
          title: Title
          type: string
        type:
          default: about:blank
          description: 用于标识问题类型的 URI 引用。
          title: Type
          type: string
      required:
        - title
        - status
      title: ProblemDetail
      type: object
    SecurityProfileMcpConfig:
      additionalProperties: false
      properties:
        servers:
          description: >-
            受此 Profile 管理的会话可使用的 MCP 服务器，以 slug 为键：可以是 MCP Marketplace 的
            slug（mcp-servers 资源的 slug 字段，例如 'github'、'notion'），也可以是安装实例的
            slug。当自定义安装实例与 MCP Marketplace 服务器的 slug 相同时，优先使用自定义安装实例。
          items:
            type: string
          title: Servers
          type: array
      required:
        - servers
      title: SecurityProfileMcpConfig
      type: object
    SecurityProfileNetPolicy:
      additionalProperties: false
      properties:
        allow:
          description: 允许访问的目标地址；未列出的地址均被阻止。主机名条目支持通配符（例如 *.github.com）。空列表也是有效策略，表示拒绝所有访问。
          items:
            anyOf:
              - $ref: '#/components/schemas/SecurityProfileHostnameDestination'
              - $ref: '#/components/schemas/SecurityProfileIpv4Destination'
              - $ref: '#/components/schemas/SecurityProfileIpv6Destination'
          title: Allow
          type: array
      required:
        - allow
      title: SecurityProfileNetPolicy
      type: object
    SecurityProfileSlackChannelAccess:
      additionalProperties: false
      properties:
        channels:
          description: mode 为 'specific' 时允许的频道；在其他模式下忽略此字段（并返回空列表）。
          items:
            $ref: '#/components/schemas/SecurityProfileSlackChannel'
          title: Channels
          type: array
        mode:
          description: >-
            none = 会话不得在任何频道中读取或发布消息；specific = 仅限列出的频道；all_public = Slack
            应用已加入的任何公开频道。
          enum:
            - none
            - specific
            - all_public
          title: Mode
          type: string
      required:
        - mode
      title: SecurityProfileSlackChannelAccess
      type: object
    SecurityProfileTeamsChannelAccess:
      additionalProperties: false
      properties:
        channels:
          description: 模式为 'specific' 时允许访问的频道；在其他模式下会被忽略（并返回空值）。
          items:
            $ref: '#/components/schemas/SecurityProfileTeamsChannel'
          title: Channels
          type: array
        mode:
          description: >-
            none = 会话不得在任何频道中读取或发布消息；specific = 仅限列出的频道；installed_teams = 已安装
            Devin 应用的团队中的任何频道。
          enum:
            - none
            - specific
            - installed_teams
          title: Mode
          type: string
      required:
        - mode
      title: SecurityProfileTeamsChannelAccess
      type: object
    SecurityProfileHostnameDestination:
      additionalProperties: false
      properties:
        hostname:
          title: Hostname
          type: string
      required:
        - hostname
      title: SecurityProfileHostnameDestination
      type: object
    SecurityProfileIpv4Destination:
      additionalProperties: false
      properties:
        ipv4:
          title: Ipv4
          type: string
      required:
        - ipv4
      title: SecurityProfileIpv4Destination
      type: object
    SecurityProfileIpv6Destination:
      additionalProperties: false
      properties:
        ipv6:
          title: Ipv6
          type: string
      required:
        - ipv6
      title: SecurityProfileIpv6Destination
      type: object
    SecurityProfileSlackChannel:
      additionalProperties: false
      properties:
        channel_id:
          description: Slack 频道 ID。
          minLength: 1
          title: Channel Id
          type: string
        team_id:
          description: Slack workspace（团队）ID。
          minLength: 1
          title: Team Id
          type: string
      required:
        - team_id
        - channel_id
      title: SecurityProfileSlackChannel
      type: object
    SecurityProfileTeamsChannel:
      additionalProperties: false
      properties:
        channel_id:
          description: Teams 频道 ID（'19:...@thread.tacv2'）。
          minLength: 1
          title: Channel Id
          type: string
        team_id:
          description: Microsoft Teams 团队的 Entra 组 ID。
          minLength: 1
          title: Team Id
          type: string
      required:
        - team_id
        - channel_id
      title: SecurityProfileTeamsChannel
      type: object
  securitySchemes:
    bearerAuth:
      description: 服务用户凭据（前缀：cog_）
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.