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

# Get a network policy

> Read what a sandbox may connect to, and whether its host enforces it. Same as boat network get.



## OpenAPI

````yaml openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/network
openapi: 3.1.0
info:
  title: Boat Public API v1
  version: 1.0.0
  description: >
    Public JSON API for creating, operating, prompting, observing, and exposing
    sandboxes from backend services, CI jobs, hosted workers, and Boat
    automation products.


    The v1 reference intentionally documents the developer integration surface
    only. Dashboard billing actions are not part of v1.
servers:
  - url: https://boat.dev/api/v1
security:
  - BoatBearerAuth: []
tags:
  - name: Boat
    description: >-
      Unified Boat account, setup, lifecycle, prompting, event history, desktop
      access, and SSH operations.
paths:
  /sandboxes/{sandboxId}/network:
    get:
      tags:
        - Boat
      summary: Get a sandbox's network policy
      description: >-
        The outbound network policy, and whether the sandbox's host enforces it.
        Needs `sandbox.read`.
      operationId: getNetworkPolicy
      parameters:
        - $ref: '#/components/parameters/SandboxId'
      responses:
        '200':
          description: The policy.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NetworkPolicyResponse'
              examples:
                enforced:
                  value:
                    ok: true
                    type: network.info
                    network:
                      mode: allow
                      allow:
                        - github.com
                        - registry.npmjs.org
                      status: enforced
                      updatedAt: '2026-11-23T12:00:00Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    SandboxId:
      name: sandboxId
      in: path
      required: true
      schema:
        type: string
        pattern: ^bx_[23456789abcdefghjkmnpqrstuvwxyz]{8}$
      description: Public Sandbox id returned by create/list/get sandbox calls.
  schemas:
    NetworkPolicyResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessBase'
        - type: object
          required:
            - network
          properties:
            type:
              type: string
              enum:
                - network.info
                - network.updated
            network:
              $ref: '#/components/schemas/SandboxNetwork'
            sandbox:
              type: object
              description: The sandbox of this policy and its state now.
              properties:
                id:
                  type: string
                state:
                  type:
                    - string
                    - 'null'
                  description: The sandbox state, as in the sandbox object.
    SuccessBase:
      type: object
      required:
        - ok
        - type
      properties:
        ok:
          type: boolean
          examples:
            - true
        type:
          type: string
          description: Stable success envelope discriminator added by v1.
    SandboxNetwork:
      type: object
      description: The sandbox's outbound network policy.
      required:
        - mode
        - allow
        - status
        - updatedAt
      properties:
        mode:
          type: string
          enum:
            - open
            - deny
            - allow
        allow:
          type: array
          items:
            type: string
          description: The canonical entries. Empty unless mode is `allow`.
        status:
          type: string
          enum:
            - enforced
            - pending
            - none
          description: >-
            `enforced`: the sandbox's host confirmed this policy. `pending`:
            saved, and not on the host yet. A running sandbox keeps its previous
            rules until then; a stopped one gets this policy before its next
            start. `none`: the mode is `open`.
        inbound:
          type: string
          enum:
            - open
            - boat-only
          description: >-
            Who can connect to the sandbox. `open`: anyone on the internet.
            `boat-only`: only boat; the host drops every other connection to the
            sandbox. `status` covers both directions.
        pendingReason:
          type: string
          enum:
            - host
            - transfer
          description: >-
            Only with status `pending`. `host`: the host has not confirmed the
            policy yet. `transfer`: the host enforces the policy, and a restore
            or a snapshot still runs. Until it ends, the storage servers of boat
            stay reachable over TLS.
        apiBound:
          type:
            - boolean
            - 'null'
          description: >-
            True when this sandbox reaches the boat API only as itself, with the
            credentials boat put in it. boat refuses every other key, sign-in or
            session from inside it with 403 `sandbox_bound`. Every sandbox that
            starts restricted is bound. False on a running sandbox that you
            restricted while it ran: its next start binds it. Null while the
            sandbox has no machine, or while boat prepares one.
        source:
          type: string
          enum:
            - environment
            - sandbox
            - default
          description: >-
            Where the policy comes from. `environment`: the policy of its
            environment version. `sandbox`: a policy set on this sandbox.
            `default`: neither sets one, so the sandbox is open.
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When the policy was last set, or null if never.
    ErrorEnvelope:
      type: object
      required:
        - ok
        - type
        - status
        - code
        - message
        - error
        - requestId
      properties:
        ok:
          type: boolean
          examples:
            - false
        type:
          type: string
          examples:
            - sandbox.error
        status:
          type: integer
          examples:
            - 409
        code:
          type: string
          examples:
            - provider_not_configured
        message:
          type: string
          examples:
            - Prompting is locked until Codex is configured on the Agents page.
        requestId:
          type: string
          examples:
            - req_01HX...
        error:
          type: object
          required:
            - code
            - message
            - status
          properties:
            code:
              type: string
            message:
              type: string
            status:
              type: integer
            details:
              type: object
              additionalProperties: true
  responses:
    Unauthorized:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            unauthorized:
              value:
                ok: false
                type: sandbox.error
                status: 401
                code: unauthorized
                message: Unauthorized
                error:
                  code: unauthorized
                  message: Unauthorized
                  status: 401
                requestId: req_01HX...
    Forbidden:
      description: >-
        Authenticated token is not allowed to perform this action.
        `sandbox_bound` on any route means that the call comes from inside a
        sandbox that started with a network policy, with a credential that is
        not its own. `inbound_closed` means that the sandbox accepts connections
        from boat only (`network.inbound` is `boat-only`), so the route cannot
        open a way in: SSH keys, port forwards, the desktop and the browser
        stream. On the host and rotate routes it means that the caller is inside
        a sandbox: the key that lives in a sandbox, or a request that a sandbox
        with a network policy sent. Publish from outside the sandbox.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            sandboxBound:
              value:
                ok: false
                type: sandbox.error
                status: 403
                code: sandbox_bound
                message: >-
                  This sandbox reaches the API only as itself: use the
                  credentials Boat put in it.
                error:
                  code: sandbox_bound
                  message: >-
                    This sandbox reaches the API only as itself: use the
                    credentials Boat put in it.
                  status: 403
                requestId: req_01HX...
            forbidden:
              value:
                ok: false
                type: sandbox.error
                status: 403
                code: forbidden
                message: Forbidden
                error:
                  code: forbidden
                  message: Forbidden
                  status: 403
                requestId: req_01HX...
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    BoatBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sandbox_api_key
      description: >-
        Boat bearer token in the form `boat_...`. Service API keys authenticate
        sandbox operations.

````

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