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

# Define what done looks like for a session

> Defines what done looks like for an existing session and returns the stored outcome. Outcomes chain rather than run concurrently: the request is rejected while the session still has a non-terminal outcome, so define the next one only after the previous is graded.



## OpenAPI

````yaml /recursion/openapi.yaml post /managed-agents/v2/sessions/{sessionId}/outcomes
openapi: 3.1.0
info:
  title: Managed Agents API
  version: 0.17.0
  description: >-
    The Recursion Managed Agents REST API. Authenticate with a Recursion API key
    as a bearer token. An organization-scoped key acts in its own organization
    and needs nothing else; a tenant-scoped key must also send
    `x-organization-id` with an organization id or `default`. Field names follow
    each operation's published schema.
servers:
  - url: https://api.recursion.labelbox.com
security:
  - bearerAuth: []
paths:
  /managed-agents/v2/sessions/{sessionId}/outcomes:
    post:
      tags:
        - Sessions
      summary: Define what done looks like for a session
      description: >-
        Defines what done looks like for an existing session and returns the
        stored outcome. Outcomes chain rather than run concurrently: the request
        is rejected while the session still has a non-terminal outcome, so
        define the next one only after the previous is graded.
      operationId: managedAgentsDefineSessionOutcomeV2
      parameters:
        - description: >-
            Session id (UUID) returned by managedAgentsStartSessionV2 or
            managedAgentsListSessionsV2.
          in: path
          name: sessionId
          required: true
          schema:
            description: >-
              Session id (UUID) returned by managedAgentsStartSessionV2 or
              managedAgentsListSessionsV2.
            format: uuid
            type: string
        - $ref: '#/components/parameters/RecursionTenantId'
        - $ref: '#/components/parameters/RecursionOrganizationId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StandaloneV2DefineOutcomeRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandaloneV2Outcome'
          description: Created
          headers:
            Location:
              description: Relative URL of the created resource.
              schema:
                type: string
              style: simple
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ManagedAgentsApiErrorInvalidJson'
                  - $ref: '#/components/schemas/ManagedAgentsApiErrorInvalidRequest'
                discriminator:
                  propertyName: code
                  mapping:
                    invalid_json: '#/components/schemas/ManagedAgentsApiErrorInvalidJson'
                    invalid_request: '#/components/schemas/ManagedAgentsApiErrorInvalidRequest'
                x-recursion-error-codes:
                  - invalid_json
                  - invalid_request
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorUnauthorized'
                x-recursion-error-codes:
                  - unauthorized
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorForbidden'
                x-recursion-error-codes:
                  - forbidden
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '404':
          description: Not Found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorNotFound'
                x-recursion-error-codes:
                  - not_found
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '409':
          description: Conflict.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorConflict'
                x-recursion-error-codes:
                  - conflict
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '413':
          description: Payload Too Large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorPayloadTooLarge'
                x-recursion-error-codes:
                  - payload_too_large
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '415':
          description: Unsupported Media Type.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorUnsupportedMediaType'
                x-recursion-error-codes:
                  - unsupported_media_type
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '429':
          headers:
            Retry-After:
              description: When to retry, as delay seconds or an HTTP date.
              schema:
                type: string
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
          description: Too Many Requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorRateLimitExceeded'
                x-recursion-error-codes:
                  - rate_limit_exceeded
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorInternalError'
                x-recursion-error-codes:
                  - internal_error
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '502':
          description: A dependent service returned an invalid response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorDependencyFailure'
                x-recursion-error-codes:
                  - bad_gateway
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '503':
          description: Service Unavailable.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorFileStorageUnconfigured
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorManagedAgentsUnavailable
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorServiceUnavailable
                discriminator:
                  propertyName: code
                  mapping:
                    file_storage_unconfigured: >-
                      #/components/schemas/ManagedAgentsApiErrorFileStorageUnconfigured
                    managed_agents_unavailable: >-
                      #/components/schemas/ManagedAgentsApiErrorManagedAgentsUnavailable
                    service_unavailable: >-
                      #/components/schemas/ManagedAgentsApiErrorServiceUnavailable
                x-recursion-error-codes:
                  - file_storage_unconfigured
                  - managed_agents_unavailable
                  - service_unavailable
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '504':
          headers:
            Retry-After:
              description: When to retry, as delay seconds or an HTTP date.
              schema:
                type: string
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
          description: A dependent service timed out.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorDependencyTimeout'
                x-recursion-error-codes:
                  - gateway_timeout
components:
  parameters:
    RecursionTenantId:
      name: x-tenant-id
      in: header
      required: false
      description: >-
        Optional tenant consistency check. When present, it must name the tenant
        bound to the API key, including when x-organization-id is `default`.
      schema:
        minLength: 1
        type: string
    RecursionOrganizationId:
      name: x-organization-id
      in: header
      required: false
      description: >-
        Organization in which to act. Required for a tenant-scoped API key.
        Optional for an organization-scoped key, where it must name that same
        organization. The value may be an organization id or `default`.
      schema:
        minLength: 1
        type: string
  schemas:
    StandaloneV2DefineOutcomeRequest:
      additionalProperties: false
      anyOf:
        - required:
            - criteria
        - required:
            - rubric
        - required:
            - rubricFile
      description: >-
        A definition of done for a session. Send criteria, rubric, or
        rubricFile; rubricFile is exclusive, while criteria and rubric may be
        sent together only when the rubric parses to exactly those criteria.
      properties:
        criteria:
          description: >-
            Grading criteria in rubric order. Send criteria, rubric, or
            rubricFile; rubricFile cannot be combined with either other source.
            Criteria and rubric can be sent together only when the rubric parses
            to exactly those criteria, as in a read-back body. Criteria render
            to at most 256 KiB.
          items:
            $ref: '#/components/schemas/StandaloneV2CriterionConfigRequest'
          maxItems: 200
          minItems: 1
          type: array
          x-recursion-omission:
            strategy: absent
        description:
          description: Objective the agent works toward.
          minLength: 1
          type: string
        evaluatorAgentId:
          description: >-
            Explicit evaluator for this outcome. If omitted, each pass uses the
            writer session's current agent version's default evaluator, or the
            managed grader.
          minLength: 1
          type: string
          x-recursion-omission:
            strategy: absent
        maxIterations:
          default: 5
          description: >-
            Maximum evaluator passes; zero means unbounded. Null inherits the
            default of five.
          format: int64
          minimum: 0
          type:
            - 'null'
            - integer
          x-recursion-null-semantics: inherit
          x-recursion-null-source: fixed default of five evaluator passes
          maximum: 9007199254740991
        rubric:
          description: >-
            Deprecated: send criteria. Markdown rubric read into criteria at
            definition time. Cannot be combined with rubricFile; if sent with
            criteria, it must parse to exactly those criteria. Criteria render
            to at most 256 KiB.
          minLength: 1
          type: string
          x-recursion-omission:
            strategy: absent
        rubricFile:
          allOf:
            - $ref: '#/components/schemas/StandaloneV2OutcomeRubricRef'
          description: >-
            File holding the rubric, read into criteria at definition time.
            Cannot be combined with criteria or rubric. Criteria render to at
            most 256 KiB. Resolved into rubric and rubricRef on the stored
            outcome.
          writeOnly: true
          x-recursion-omission:
            strategy: absent
      required:
        - description
      type: object
    StandaloneV2Outcome:
      properties:
        agentId:
          description: Writer agent that owns the outcome (UUID).
          readOnly: true
          type: string
        createdAt:
          description: RFC 3339 timestamp when the outcome was created.
          format: date-time
          readOnly: true
          type: string
        criteria:
          description: >-
            Criteria the writer's work is evaluated against, in rubric order.
            Absent on an outcome whose historical rubric has no structured form;
            read rubric for it.
          items:
            $ref: '#/components/schemas/StandaloneV2CriterionConfig'
          type: array
        description:
          description: Objective the writer works toward, in prose.
          type: string
        endedAt:
          description: RFC 3339 timestamp when the outcome became terminal.
          format: date-time
          readOnly: true
          type: string
        evaluations:
          description: >-
            Evaluator verdicts in order, newest last. Only passes that produced
            a verdict are listed: a pass that could not grade the work is
            reported by the pass status, and by terminalResult and
            terminalExplanation when it ended the outcome. A historical pass
            whose grader session is no longer recorded stays listed here even
            though it has no evaluator.
          items:
            $ref: '#/components/schemas/StandaloneV2OutcomeEvaluation'
          readOnly: true
          type: array
        evaluatorAgentId:
          description: >-
            Explicit evaluator chosen when the outcome was defined. Absent when
            not chosen explicitly; each pass then uses the writer session's
            current agent version's defaultEvaluatorAgentId, or the managed
            grader.
          type: string
        historicalRoots:
          description: >-
            Original cloned grader roots with no pass link or verdict; iteration
            and exact preparation start are unknown.
          items:
            $ref: '#/components/schemas/OutcomeHistoricalRoot'
          readOnly: true
          type: array
        maxIterations:
          description: Maximum evaluator passes; zero explicitly means unbounded.
          format: int64
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        organizationId:
          description: Organization that owns the outcome.
          readOnly: true
          type: string
        outcomeId:
          description: Server-assigned outcome identifier (UUID).
          readOnly: true
          type: string
        passes:
          description: >-
            Cloned grading attempts, including preparation, failure, and
            interruption before a verdict exists.
          items:
            $ref: '#/components/schemas/OutcomePass'
          readOnly: true
          type: array
        rubric:
          description: >-
            Deprecated: read criteria. The markdown rubric as it was sent, or
            the criteria rendered as a keyed markdown rubric when the outcome
            was defined from a criteria list.
          type: string
        rubricRef:
          description: >-
            Source file reference when the rubric was captured from an uploaded
            file.
          readOnly: true
          type: string
        rubricSha256:
          description: SHA-256 digest of the source rubric file, when present.
          readOnly: true
          type: string
        sessionId:
          description: Writer session this outcome belongs to (UUID).
          readOnly: true
          type: string
        status:
          description: >-
            Current outcome lifecycle state, including evaluating while a root
            pass is in flight.
          enum:
            - pending
            - running
            - evaluating
            - terminal
          readOnly: true
          type: string
        terminalExplanation:
          description: >-
            Why the outcome ended, beside terminalResult: the final verdict's
            explanation, or the reason an outcome that ended without one could
            not be graded. Absent until terminal, and on an outcome that ended
            before explanations were recorded.
          readOnly: true
          type: string
        terminalResult:
          description: >-
            Final outcome verdict; absent until terminal. not_applicable means
            no criterion applied and is not success.
          enum:
            - satisfied
            - max_iterations_reached
            - not_applicable
            - not_evaluable
            - failed
          readOnly: true
          type: string
        updatedAt:
          description: RFC 3339 timestamp of the latest outcome change.
          format: date-time
          readOnly: true
          type: string
      required:
        - organizationId
        - sessionId
        - outcomeId
        - description
        - rubric
        - maxIterations
        - status
        - createdAt
        - updatedAt
      type: object
      additionalProperties: false
    ManagedAgentsApiErrorInvalidJson:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - invalid_json
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorInvalidRequest:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - invalid_request
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorUnauthorized:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - unauthorized
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorForbidden:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - forbidden
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorNotFound:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - not_found
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorConflict:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - conflict
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorPayloadTooLarge:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - payload_too_large
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorUnsupportedMediaType:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - unsupported_media_type
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorRateLimitExceeded:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - rate_limit_exceeded
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorInternalError:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - internal_error
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorDependencyFailure:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - bad_gateway
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorFileStorageUnconfigured:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - file_storage_unconfigured
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorManagedAgentsUnavailable:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - managed_agents_unavailable
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorServiceUnavailable:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - service_unavailable
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorDependencyTimeout:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - gateway_timeout
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    StandaloneV2CriterionConfigRequest:
      additionalProperties: false
      properties:
        criterionKey:
          description: Stable key of this criterion.
          maxLength: 64
          minLength: 1
          pattern: ^[a-z][a-z0-9]*(?:[-_][a-z0-9]+)*$
          type: string
        criterionText:
          description: What the evaluator checks.
          maxLength: 4096
          minLength: 1
          type: string
        label:
          description: Optional display name.
          maxLength: 80
          type: string
          x-recursion-omission:
            strategy: absent
        section:
          description: Optional heading.
          maxLength: 4096
          type: string
          x-recursion-omission:
            strategy: absent
      required:
        - criterionKey
        - criterionText
      type: object
    StandaloneV2OutcomeRubricRef:
      additionalProperties: false
      properties:
        fileId:
          description: >-
            A text or YAML file in the caller's organization whose contents
            define the rubric. It must be at most 256 KiB, unexpired, in scope,
            valid UTF-8, and contain at least one criterion.
          format: uuid
          type: string
        type:
          type: string
          const: file
          description: Always file.
      required:
        - type
        - fileId
      type: object
    StandaloneV2CriterionConfig:
      additionalProperties: false
      properties:
        criterionKey:
          description: Stable key of this criterion.
          maxLength: 64
          minLength: 1
          pattern: ^[a-z][a-z0-9]*(?:[-_][a-z0-9]+)*$
          type: string
        criterionText:
          description: What the evaluator checks.
          maxLength: 4096
          minLength: 1
          type: string
        label:
          description: Optional display name.
          maxLength: 80
          type: string
        section:
          description: Optional heading.
          maxLength: 4096
          type: string
      required:
        - criterionKey
        - criterionText
      type: object
    StandaloneV2OutcomeEvaluation:
      properties:
        agentVersionId:
          description: Writer agent version whose work this pass judged (UUID).
          type: string
        cacheReadTokens:
          description: Cache-read tokens recorded on the evaluation session.
          format: int64
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        cacheWriteTokens:
          description: Cache-write tokens recorded on the evaluation session.
          format: int64
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        costMicros:
          description: >-
            Cost captured when the pass was recorded, in micro-USD; final billed
            cost may settle later on the evaluation session.
          format: int64
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        criteria:
          description: Per-criterion verdicts in rubric order.
          items:
            $ref: '#/components/schemas/StandaloneV2OutcomeCriterion'
          type: array
        endEventId:
          description: Writer transcript event that recorded this pass's verdict.
          type: string
        endedAt:
          description: RFC 3339 timestamp when this evaluator pass finished.
          format: date-time
          type: string
        evaluationSessionId:
          description: Evaluation session that produced this verdict (UUID).
          format: uuid
          type: string
        explanation:
          description: >-
            Evaluator feedback, including gaps the writer should close on
            revision.
          type: string
        inputTokens:
          description: Prompt tokens recorded on the evaluation session.
          format: int64
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        iteration:
          description: Zero-indexed pass number; zero is the first evaluation.
          format: int64
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        outcomeId:
          description: Outcome this evaluator pass belongs to (UUID).
          type: string
        outputTokens:
          description: Completion tokens recorded on the evaluation session.
          format: int64
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        result:
          description: >-
            Verdict of this pass; needs_revision sends the writer back for
            another turn. not_applicable means no criterion applied and is not
            success.
          enum:
            - satisfied
            - needs_revision
            - max_iterations_reached
            - not_applicable
            - not_evaluable
            - failed
          type: string
        startEventId:
          description: First event of the evaluation session for this pass.
          type: string
        startedAt:
          description: RFC 3339 timestamp when this evaluator pass began.
          format: date-time
          type: string
      required:
        - outcomeId
        - iteration
        - result
      type: object
      additionalProperties: false
    OutcomeHistoricalRoot:
      description: >-
        Original cloned outcome grader root linked to the writer without a
        persisted attempt or verdict. Its pass iteration and preparation start
        are unknown.
      properties:
        createdAt:
          description: >-
            Earliest retained timestamp: evaluator root creation. Grading
            preparation may have begun earlier.
          format: date-time
          type: string
        evaluationSessionId:
          description: Original cloned evaluator root session.
          format: uuid
          type: string
        executionState:
          description: Last recorded execution state of the evaluator root.
          enum:
            - provisioning
            - queued
            - running
            - idle
            - completed
          type: string
        historyLimited:
          description: >-
            True because the original pass has no persisted attempt or verdict
            row; iteration and exact pass timing are unknown.
          type: boolean
        rootStatus:
          $ref: '#/components/schemas/SessionStatus'
          description: Evaluator root session status; no outcome verdict was recorded.
        snapshotEventId:
          description: Frozen writer snapshot, when retained on the root.
          format: uuid
          type: string
        stopReason:
          description: Service-owned reason the evaluator root stopped, when recorded.
          type: string
      required:
        - evaluationSessionId
        - rootStatus
        - createdAt
        - historyLimited
      type: object
      additionalProperties: false
    OutcomePass:
      description: >-
        One grading attempt linked to the writer's outcome, from clone
        preparation through its final status. The evaluator session retains the
        grader transcript and cost.
      properties:
        endedAt:
          description: When this pass stopped or completed.
          format: date-time
          type: string
        evaluationSessionId:
          description: Independent evaluator root reserved for this attempt.
          format: uuid
          type: string
        failureReason:
          description: Machine-readable reason when the pass could not complete.
          type: string
        iteration:
          description: 0-indexed revision round this attempt grades.
          format: int64
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        outcomeId:
          description: Outcome this grading attempt belongs to.
          format: uuid
          type: string
        snapshotEventId:
          description: Last writer event in the frozen transcript snapshot.
          format: uuid
          type: string
        startedAt:
          description: When grading preparation began.
          format: date-time
          type: string
        status:
          description: Current state of this grading attempt.
          enum:
            - preparing
            - running
            - completed
            - failed
            - interrupted
            - budget_limited
          type: string
      required:
        - outcomeId
        - evaluationSessionId
        - iteration
        - snapshotEventId
        - status
        - startedAt
      type: object
      additionalProperties: false
    ManagedAgentsApiErrorDetails:
      type: object
      properties:
        field:
          description: >-
            Request field or header responsible for the error, when one can be
            identified.
          type: string
        issues:
          description: >-
            Boundary-validation failures as path-prefixed human-readable
            messages.
          type: array
          items:
            type: string
        requestId:
          description: Request correlation identifier for support and log lookup.
          type: string
        retryable:
          description: >-
            Server advice about failure transience. `true` means transient,
            `false` means non-transient, and absence gives no advice. Automatic
            replay is allowed only when this field is not `false` and the
            operation-specific retry and idempotency contract permits replay.
          type: boolean
      additionalProperties:
        $ref: '#/components/schemas/PlatformSafeJsonValue'
      description: >-
        Optional structured error details. Reserved transport fields are typed;
        code-specific fields remain forward compatible.
    StandaloneV2OutcomeCriterion:
      properties:
        criterionId:
          description: >-
            Rubric-digest and ordinal ID, stable for the same unchanged rubric
            across every pass of it.
          type: string
        criterionKey:
          description: >-
            Key of the criterion in the outcome's criteria, which revision
            feedback cites. Absent on a historical pass whose criterion has no
            key.
          type: string
        criterionText:
          description: The criterion this verdict scores, as written.
          type: string
        evidenceEventIds:
          description: Session events (UUIDs) the evaluator cites as justification.
          items:
            type: string
          type: array
        rationale:
          description: Evaluator's reasoning for the verdict on this criterion.
          type: string
        section:
          description: >-
            Heading the criterion is grouped under, when the rubric has
            sections.
          type: string
        verdict:
          description: >-
            Evaluator judgment, conventionally pass, fail, not_applicable when
            the criterion did not apply, or not_evaluable when it could not be
            evaluated. Historical values remain open strings recorded as
            written.
          type: string
        weight:
          description: >-
            Every criterion counts the same, so this value does not affect the
            verdict.
          format: double
          type: number
      required:
        - criterionId
        - criterionText
        - weight
        - verdict
      type: object
      additionalProperties: false
    SessionStatus:
      description: Coarse session state shared by Managed Agents and imported RL rollouts.
      enum:
        - active
        - awaiting_human
        - completed
        - failed
        - cancelled
      type: string
    PlatformSafeJsonValue:
      description: >-
        A JSON value whose integer members stay within the exact ECMAScript
        safe-integer range at every nesting level.
      oneOf:
        - type: 'null'
        - type: boolean
        - type: string
        - type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        - type: number
          not:
            type: integer
        - type: array
          items:
            $ref: '#/components/schemas/PlatformSafeJsonValue'
        - additionalProperties:
            $ref: '#/components/schemas/PlatformSafeJsonValue'
          type: object
  headers:
    RecursionOrganizationId:
      description: Organization id resolved for this request.
      schema:
        minLength: 1
        type: string
    RecursionTenantId:
      description: Tenant id resolved for this request.
      schema:
        minLength: 1
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A Recursion API key, created in the console under API keys.

````