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

# List a sandbox's egress activity

> The unified per-sandbox network log: every outbound connection the
sandbox made, merged into one time-ordered stream, most recent first.
Each row has a `kind` — `connection` (host, bytes, allow/deny verdict)
or `request` (HTTP method, path, status, and the secret used, when a
credential was injected). Fields not relevant to a row's kind are
omitted.

Filter by time window (`since`/`before`) and `verdict`. Paginate by
passing the response's `next_cursor` as `before` while `has_more` is
true. A `verdict` filter returns only `connection` rows, since request
rows carry no verdict.




## OpenAPI

````yaml https://raw.githubusercontent.com/superserve-ai/sandbox/refs/heads/main/api/openapi.yaml get /sandboxes/{sandbox_id}/network
openapi: 3.1.0
info:
  title: Superserve API
  version: 0.1.0
  description: >
    Superserve provides sandbox infrastructure to run AI agents in the cloud.
    Powered by Firecracker MicroVMs.


    ## Sandbox lifecycle


    ```

    active <--> paused --> deleted

    ```


    A sandbox is `active` when running and `paused` after being paused. Resuming

    a paused sandbox returns it to `active`. Deleting releases all resources.


    | Endpoint | What it does |

    |----------|-------------|

    | `POST /sandboxes` | Create a new sandbox (optionally `from_template`) |

    | `PATCH /sandboxes/:id` | Partially update a running sandbox (e.g. network
    rules) |

    | `POST /sandboxes/:id/pause` | Snapshot full state, suspend the VM |

    | `POST /sandboxes/:id/resume` | Restore from snapshot, continue where it
    left off |

    | `DELETE /sandboxes/:id` | Delete sandbox and all resources |


    ## Sandbox environment


    By default sandboxes boot from the curated `superserve/base` template
    (Ubuntu 24.04,

    1 vCPU, 1 GB RAM, 4 GB disk, with Python 3.12, Node.js 22, npm, git, curl,

    and build-essential pre-installed). Callers can override with any template

    name (e.g. `superserve/python-3.11`, `superserve/node-22`) or a team-owned
    template UUID

    via the `from_template` field on `POST /sandboxes`.


    ## Files and commands


    `/files`, `/exec`, and `/exec/stream` run against a single sandbox and use

    its `X-Access-Token` (returned by create, resume, and activate), not the

    team API key. Two host forms reach them:


    - `https://sandbox.superserve.ai/...` with `X-Superserve-Sandbox-Id:
    <sandbox_id>`.

    - `https://boxd-{sandbox_id}.sandbox.superserve.ai/...` — no routing header
    needed.
  contact:
    name: Superserve Team
  license:
    name: Proprietary
servers:
  - url: https://api.superserve.ai
    description: Production
security: []
paths:
  /sandboxes/{sandbox_id}/network:
    parameters:
      - $ref: '#/components/parameters/SandboxId'
    get:
      tags:
        - Sandboxes
      summary: List a sandbox's egress activity
      description: |
        The unified per-sandbox network log: every outbound connection the
        sandbox made, merged into one time-ordered stream, most recent first.
        Each row has a `kind` — `connection` (host, bytes, allow/deny verdict)
        or `request` (HTTP method, path, status, and the secret used, when a
        credential was injected). Fields not relevant to a row's kind are
        omitted.

        Filter by time window (`since`/`before`) and `verdict`. Paginate by
        passing the response's `next_cursor` as `before` while `has_more` is
        true. A `verdict` filter returns only `connection` rows, since request
        rows carry no verdict.
      operationId: listSandboxNetwork
      parameters:
        - $ref: '#/components/parameters/AuditLimit'
        - name: before
          in: query
          description: >-
            Pagination cursor or time filter. Pass the previous response's
            opaque `next_cursor` to page through results, or an RFC3339
            timestamp to return rows strictly older than that time.
          schema:
            type: string
        - name: since
          in: query
          description: Return rows at or newer than this RFC3339 timestamp.
          schema:
            type: string
            format: date-time
        - name: verdict
          in: query
          description: Filter to connection rows with this verdict. Excludes request rows.
          schema:
            type: string
            enum:
              - allowed
              - blocked
              - failed
      responses:
        '200':
          description: A page of network events (most recent first)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NetworkEventPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - apiKey: []
components:
  parameters:
    SandboxId:
      name: sandbox_id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/PublicSandboxId'
      description: The unique identifier of the sandbox.
    AuditLimit:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 200
        default: 50
  schemas:
    NetworkEventPage:
      type: object
      required:
        - data
        - next_cursor
        - has_more
      description: A page of network events with pagination metadata.
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/NetworkEvent'
        next_cursor:
          type: string
          nullable: true
          description: >-
            Opaque pagination cursor. Pass it verbatim as `before` to fetch the
            next page; do not parse it. Null when has_more is false.
        has_more:
          type: boolean
          description: Whether more rows exist beyond this page.
    PublicSandboxId:
      type: string
      pattern: >-
        ^(sb-[a-z0-9]+-)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
      description: >
        Public sandbox ID: a bare UUID, or the region-tagged form
        `sb-<region>-<uuid>` (e.g. `sb-use-1b4e28ba-…`). Treat as an opaque
        string; the tagged form routes the request to the sandbox's home region.
        Endpoints accept both forms interchangeably.
    NetworkEvent:
      type: object
      required:
        - kind
        - id
        - ts
      description: |
        One row in the unified network log. `kind` selects which fields are
        present: connection rows carry dst_ip/verdict/bytes, request rows carry
        method/path/status/secret_id. Unused fields are omitted.
      properties:
        kind:
          type: string
          enum:
            - connection
            - request
        id:
          type: integer
          format: int64
        ts:
          type: string
          format: date-time
        host:
          type: string
          description: Destination host (SNI / HTTP Host).
        dst_ip:
          type: string
          description: Connection rows only.
        dst_port:
          type: integer
          format: int32
        verdict:
          type: string
          enum:
            - allowed
            - blocked
            - failed
          description: Connection rows only.
        match_rule:
          type: string
          description: Connection rows — which rule decided (domain, cidr, internal-ip, …).
        bytes_sent:
          type: integer
          format: int64
        bytes_recv:
          type: integer
          format: int64
        method:
          type: string
          description: Request rows only.
        path:
          type: string
        status:
          type: integer
          format: int32
          description: Request rows — HTTP status returned to the sandbox.
        upstream_status:
          type: integer
          format: int32
        latency_ms:
          type: integer
          format: int32
        secret_id:
          type: string
          format: uuid
          description: Request rows — the secret injected, if any.
        error_code:
          type: string
    Error:
      type: object
      description: |
        Error envelope. `error.code` is a stable, machine-readable identifier
        (e.g. `bad_request`, `not_found`, `conflict`, `rate_limited`,
        `too_many_builds`, `too_many_templates`, `too_many_sandboxes`,
        `image_pull_failed`, `step_failed`, `snapshot_failed`,
        `start_cmd_failed`, `ready_cmd_failed`, `build_failed`).
        `error.message` is human-readable and may change between releases;
        clients should branch on `code`, not `message`.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key

````