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

# Manage a tenant runner

> Takes the same body as the platform runner PATCH: an `action` (`cordon`, `drain`, `revoke`, `rotate`, `self_test`) or an edit of `assigned_policy`, `labels`, or both. A tenant runner never takes a decision model, and only a platform admin switches on durable tasks; both answer 400. Another tenant's runner answers 404. Requires `runner:tenant`.



## OpenAPI

````yaml https://raw.githubusercontent.com/agentsfleet/agentsfleet/main/public/openapi.json patch /v1/tenants/me/runners/{runner_id}
openapi: 3.1.0
info:
  title: agentsfleet API
  description: API for managing workspaces, fleets, triggers, and runs.
  contact:
    name: agentsfleet
    url: https://agentsfleet.net
  license:
    name: MIT
    identifier: MIT
  version: 1.0.0
servers:
  - url: https://api.agentsfleet.net
    description: Production
security: []
paths:
  /v1/tenants/me/runners/{runner_id}:
    patch:
      tags:
        - Runners
      summary: Manage a tenant runner
      description: >-
        Takes the same body as the platform runner PATCH: an `action` (`cordon`,
        `drain`, `revoke`, `rotate`, `self_test`) or an edit of
        `assigned_policy`, `labels`, or both. A tenant runner never takes a
        decision model, and only a platform admin switches on durable tasks;
        both answer 400. Another tenant's runner answers 404. Requires
        `runner:tenant`.
      operationId: update_tenant_runner
      parameters:
        - name: runner_id
          in: path
          description: >-
            Runner identifier (version 7 universally unique identifier, or
            UUID).
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunnerAdminPatchRequest'
        required: true
      responses:
        '200':
          description: >-
            The runner's state after the change, or its replacement token after
            a `rotate`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunnerPatchReply'
        '400':
          description: The request is invalid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '401':
          description: Authentication is missing, invalid, or not accepted by this endpoint
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '403':
          description: You do not have permission for this action
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '404':
          description: The resource was not found or is not accessible to you
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '409':
          description: The runner is revoked, so the request can never be honoured
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '413':
          description: The request body exceeds this endpoint's size limit
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '429':
          description: A request or capacity limit has been reached
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '500':
          description: An internal server error occurred
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '503':
          description: A required service is unavailable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
      security:
        - BearerAuth: []
components:
  schemas:
    RunnerAdminPatchRequest:
      type: object
      description: >-
        `PATCH /v1/admin/runners/{id}` body.


        Either an `action` alone, or an edit: `assigned_policy`, `labels`, or
        both,

        applied together or not at all. Anything else is a `400`.
      properties:
        action:
          oneOf:
            - $ref: '#/components/schemas/RunnerAdminAction'
              description: >-
                A state transition, token rotation, or self-test request. Sent
                alone.
            - type: 'null'
        assigned_policy:
          oneOf:
            - $ref: '#/components/schemas/AssignedPolicy'
              description: >-
                A policy re-assignment, which reaches the host on its next
                heartbeat.
            - type: 'null'
        labels:
          type:
            - array
            - 'null'
          items:
            type: string
          description: >-
            Replaces all runner labels, each at most 1,048,576 characters.
            Duplicates are removed

            in their original order. An empty list clears labels.
      additionalProperties: false
    RunnerPatchReply:
      oneOf:
        - $ref: '#/components/schemas/RunnerAdminPatchResponse'
          description: The state after an action or an edit.
        - $ref: '#/components/schemas/RunnerTokenRotatedResponse'
          description: The replacement token after a `rotate`, shown once.
      description: >-
        The `200` of a runner PATCH, admin or tenant.


        The runner's state after an action or an edit, or its replacement token

        after a `rotate`. Untagged: the two shapes already differ (`status`
        against

        `runner_token`), so the wire carries no tag and publishes as `oneOf`.

        `Debug` delegates to each shape's own, which redacts the token

        (`redact.rs`).
    ProblemBody:
      type: object
      description: The body every refusal carries, under `application/problem+json`.
      required:
        - docs_uri
        - title
        - detail
        - error_code
        - request_id
      properties:
        action_id:
          type:
            - string
            - 'null'
          description: 'On that 409 only: the action the gate held.'
        current_state:
          type:
            - string
            - 'null'
          description: 'On a 409 only: the state that forbade the transition.'
        detail:
          type: string
          description: One sentence on what was refused and why.
        docs_uri:
          type: string
          description: Where the error code is documented.
        error_code:
          type: string
          description: The registry code, stable across releases.
        etag:
          type:
            - string
            - 'null'
          description: >-
            On a 412 only: the resource's current entity tag, to refetch and
            retry.
        gate_id:
          type:
            - string
            - 'null'
          description: 'On an answered approval gate''s 409 only: the gate that was answered.'
        local_read_permitted:
          type:
            - boolean
            - 'null'
          description: >-
            On a temporary extract outage, true authorizes one local read under
            the fleet's network policy.
        outcome:
          type:
            - string
            - 'null'
          description: 'On that 409 only: the answer that stands.'
        request_id:
          type: string
          description: The request this refusal answers, for support.
        resolved_at:
          type:
            - string
            - 'null'
          format: date-time
          description: 'On that 409 only: when the standing answer was given.'
        resolved_by:
          type:
            - string
            - 'null'
          description: 'On that 409 only: who gave it.'
        title:
          type: string
          description: A short name for the refusal, safe to show a person.
        user_message:
          type:
            - string
            - 'null'
          description: A curated sentence for end users, where the code has one.
    RunnerAdminAction:
      type: string
      description: >-
        Platform-operator mutation actions.


        Rotation and self-test are operations rather than state transitions.
        They

        ride the same endpoint because they share the operator scope and the

        exactly-one-of body guard with the transition actions.
      enum:
        - cordon
        - uncordon
        - drain
        - undrain
        - revoke
        - rotate
        - self_test
    AssignedPolicy:
      type: object
      description: >-
        Sandbox isolation, outgoing network access, and concurrency settings
        assigned to this

        runner.
      required:
        - durable_tasks_enabled
        - sandbox_tier
        - network_policy
        - registry_allowlist
        - worker_count
      properties:
        decision_model_id:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            Canonical `UUIDv7` of the platform decision model; absent disables
            decisions.
        durable_tasks_enabled:
          type: boolean
          description: >-
            Permit new durable task runs; existing runs retain their issued
            mode.
        network_policy:
          $ref: '#/components/schemas/RunnerNetworkPolicy'
          description: Outgoing network access policy to apply.
        registry_allowlist:
          type: array
          items:
            type: string
          description: >-
            Default package registries added to each assignment's allowed
            network hosts. An empty

            list uses the runner's defaults.
        sandbox_tier:
          $ref: '#/components/schemas/SandboxTier'
          description: Isolation strength to apply.
        worker_count:
          type: integer
          format: int32
          description: Concurrent workers the runner may start. Clamped on both sides.
          minimum: 0
    RunnerAdminPatchResponse:
      type: object
      description: '`PATCH /v1/admin/runners/{id}` reply.'
      required:
        - id
        - status
      properties:
        assigned_policy:
          oneOf:
            - $ref: '#/components/schemas/AssignedPolicy'
              description: The assignment as stored, on the policy-update path.
            - type: 'null'
        id:
          type: string
          description: The runner that changed.
        labels:
          type:
            - array
            - 'null'
          items:
            type: string
          description: The labels as stored, each once, when the request carried labels.
        selftest_requested_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the self-test was requested. The runner receives it on its next
            heartbeat and

            reports later; this timestamp does not indicate success.
        status:
          $ref: '#/components/schemas/AdminState'
          description: Its operator state after the change.
      additionalProperties: false
    RunnerTokenRotatedResponse:
      type: object
      description: >-
        Successful runner-token rotation.


        The replacement token is returned once. The daemon stores only its
        digest,

        so no later read can recover this value.
      required:
        - id
        - runner_token
      properties:
        id:
          type: string
          description: The runner whose credential changed.
        runner_token:
          type: string
          description: The replacement bearer token. Secret — reveal once, then discard.
      additionalProperties: false
    RunnerNetworkPolicy:
      type: string
      description: Outgoing network access policy assigned to a runner.
      enum:
        - allow_all
        - deny_all_egress
        - allow_list_egress
    SandboxTier:
      type: string
      description: |-
        The isolation strength assigned to a runner, named for the engine that
        delivers it.
      enum:
        - firecracker
    AdminState:
      type: string
      description: >-
        Administrator-selected runner state. Only `Active` permits runner API
        requests.
      enum:
        - active
        - cordoned
        - draining
        - drained
        - revoked
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Send a dashboard session token, an account API key (`agt_t`), or a
        command-line credential (`afc_`) as a Bearer token. Each endpoint lists
        accepted credential types.

````

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