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

# Replace system controls

> Requires scopes: admin:org



## OpenAPI

````yaml /api-reference/openapi.json put /api/system/controls
openapi: 3.1.0
info:
  title: EvalGate API
  version: 3.7.6
  description: EvalGate API. See docs/api-contract.md for stability commitments.
servers:
  - url: https://evalgate.com
    description: Production
  - url: http://localhost:3000
    description: Local
security: []
paths:
  /api/system/controls:
    put:
      tags:
        - system
      summary: Replace system controls
      description: 'Requires scopes: admin:org'
      operationId: put_system_controls
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PutApiSystemControlsRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PutApiSystemControlsResponse200ApplicationJson
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth:
            - admin:org
components:
  schemas:
    PutApiSystemControlsRequest:
      type: object
      properties:
        pii:
          type: object
          properties:
            scrubMode:
              oneOf:
                - type: string
                  enum:
                    - drop
                - type: string
                  enum:
                    - hash
                - type: string
                  enum:
                    - redact
                - type: string
                  enum:
                    - tokenize
            allowPIIEmbedding:
              oneOf:
                - type: boolean
                  enum:
                    - false
                - type: boolean
                  enum:
                    - true
            allowRawStorage:
              oneOf:
                - type: boolean
                  enum:
                    - false
                - type: boolean
                  enum:
                    - true
          additionalProperties: false
        externalProviders:
          type: object
          properties:
            allowedProviders:
              type: array
              items:
                type: string
            allowExternalLLM:
              oneOf:
                - type: boolean
                  enum:
                    - false
                - type: boolean
                  enum:
                    - true
          additionalProperties: false
        retention:
          type: object
          properties:
            logs:
              oneOf:
                - type: string
                  enum:
                    - custom
                - type: string
                  enum:
                    - 30d
                - type: string
                  enum:
                    - 90d
            evalData:
              oneOf:
                - type: string
                  enum:
                    - custom
                - type: string
                  enum:
                    - 30d
                - type: string
                  enum:
                    - 90d
            customEvalDataDays:
              oneOf:
                - type: 'null'
                - type: number
            customLogDays:
              oneOf:
                - type: 'null'
                - type: number
          additionalProperties: false
        costAlerts:
          type: object
          properties:
            enabled:
              oneOf:
                - type: boolean
                  enum:
                    - false
                - type: boolean
                  enum:
                    - true
            dailyBudgetUsd:
              oneOf:
                - type: 'null'
                - type: number
            weeklyBudgetUsd:
              oneOf:
                - type: 'null'
                - type: number
            monthlyBudgetUsd:
              oneOf:
                - type: 'null'
                - type: number
          additionalProperties: false
      additionalProperties: false
    PutApiSystemControlsResponse200ApplicationJson:
      type: object
      properties:
        organizationId:
          $ref: '#/components/schemas/OrganizationId'
        policyVersion:
          type: string
        policy:
          type: object
          properties:
            version:
              type: string
            drift:
              type: object
              properties:
                invariants:
                  type: object
                  properties:
                    parityAcrossSurfaces:
                      type: boolean
                      enum:
                        - true
                    deterministicOutputs:
                      type: boolean
                      enum:
                        - true
                    noHardcodedThresholds:
                      type: boolean
                      enum:
                        - true
                    singleSourceOfTruth:
                      type: boolean
                      enum:
                        - true
                    configFullyApplied:
                      type: boolean
                      enum:
                        - true
                  additionalProperties: false
                  required:
                    - parityAcrossSurfaces
                    - deterministicOutputs
                    - noHardcodedThresholds
                    - singleSourceOfTruth
                    - configFullyApplied
                metrics:
                  type: object
                  properties:
                    minHistory:
                      type: number
                    zThresholdWarning:
                      type: number
                    zThresholdCritical:
                      type: number
                    klDivergenceThreshold:
                      type: number
                    outputVarianceThreshold:
                      type: number
                  additionalProperties: false
                  required:
                    - minHistory
                    - zThresholdWarning
                    - zThresholdCritical
                    - klDivergenceThreshold
                    - outputVarianceThreshold
                behavioral:
                  type: object
                  properties:
                    cotUsageDrop:
                      type: number
                    cotUsageSpike:
                      type: number
                    confidenceDrop:
                      type: number
                    confidenceSpike:
                      type: number
                    toolSuccessDrop:
                      type: number
                    retrievalDrop:
                      type: number
                    errorSpike:
                      type: number
                    toolUsageChangeDrop:
                      type: number
                  additionalProperties: false
                  required:
                    - cotUsageDrop
                    - cotUsageSpike
                    - confidenceDrop
                    - confidenceSpike
                    - toolSuccessDrop
                    - retrievalDrop
                    - errorSpike
                    - toolUsageChangeDrop
              additionalProperties: false
              required:
                - invariants
                - metrics
                - behavioral
            pii:
              type: object
              properties:
                enabled:
                  type: boolean
                scrubMode:
                  oneOf:
                    - type: string
                      enum:
                        - drop
                    - type: string
                      enum:
                        - hash
                    - type: string
                      enum:
                        - redact
                    - type: string
                      enum:
                        - tokenize
                allowRawStorage:
                  type: boolean
                allowPIIEmbedding:
                  type: boolean
                allowExternalTransfer:
                  type: boolean
                detection:
                  type: object
                  properties:
                    enableRegex:
                      type: boolean
                    enableHeuristics:
                      type: boolean
                    enableModelAssistance:
                      type: boolean
                    minConfidence:
                      type: number
                  additionalProperties: false
                  required:
                    - enableRegex
                    - enableHeuristics
                    - enableModelAssistance
                    - minConfidence
                maxFalsePositiveRate:
                  type: number
              additionalProperties: false
              required:
                - enabled
                - scrubMode
                - allowRawStorage
                - allowPIIEmbedding
                - allowExternalTransfer
                - detection
                - maxFalsePositiveRate
            externalProviders:
              type: object
              properties:
                allowExternalLLM:
                  type: boolean
                allowedProviders:
                  type: array
                  items:
                    type: string
                logCalls:
                  type: boolean
              additionalProperties: false
              required:
                - allowExternalLLM
                - allowedProviders
                - logCalls
            judges:
              type: object
              properties:
                defaultPresetId:
                  type: string
                allowMultiJudge:
                  type: boolean
                allowedModels:
                  type: array
                  items:
                    type: string
                maxRunCostUsd:
                  type: number
                maxLatencyMs:
                  type: number
                disagreementPolicy:
                  oneOf:
                    - type: string
                      enum:
                        - warn
                    - type: string
                      enum:
                        - escalate
                    - type: string
                      enum:
                        - inform
                    - type: string
                      enum:
                        - block_unstable_production
              additionalProperties: false
              required:
                - defaultPresetId
                - allowMultiJudge
                - allowedModels
                - maxRunCostUsd
                - maxLatencyMs
                - disagreementPolicy
            retention:
              type: object
              properties:
                evalData:
                  oneOf:
                    - type: string
                      enum:
                        - custom
                    - type: string
                      enum:
                        - 30d
                    - type: string
                      enum:
                        - 90d
                logs:
                  oneOf:
                    - type: string
                      enum:
                        - custom
                    - type: string
                      enum:
                        - 30d
                    - type: string
                      enum:
                        - 90d
                modelCalls:
                  type: string
                  enum:
                    - evidence
                datasetVersions:
                  type: string
                  enum:
                    - governed
                experimentResults:
                  type: string
                  enum:
                    - governed
                copilotMessages:
                  oneOf:
                    - type: string
                      enum:
                        - custom
                    - type: string
                      enum:
                        - 30d
                    - type: string
                      enum:
                        - 90d
                remoteRunnerLogs:
                  oneOf:
                    - type: string
                      enum:
                        - custom
                    - type: string
                      enum:
                        - 30d
                    - type: string
                      enum:
                        - 90d
                customEvalDataDays:
                  oneOf:
                    - type: 'null'
                    - type: number
                customLogDays:
                  oneOf:
                    - type: 'null'
                    - type: number
                customCopilotMessageDays:
                  oneOf:
                    - type: 'null'
                    - type: number
                customRemoteRunnerLogDays:
                  oneOf:
                    - type: 'null'
                    - type: number
              additionalProperties: false
              required:
                - evalData
                - logs
                - modelCalls
                - datasetVersions
                - experimentResults
                - copilotMessages
                - remoteRunnerLogs
            evalgate:
              type: object
              properties:
                clustering:
                  type: object
                  properties:
                    singletonSimilarityScore:
                      type: number
                    maxAutoClusters:
                      type: number
                    centroidKeywordCount:
                      type: number
                    sampleLimitPerCluster:
                      type: number
                  additionalProperties: false
                  required:
                    - singletonSimilarityScore
                    - maxAutoClusters
                    - centroidKeywordCount
                    - sampleLimitPerCluster
                discovery:
                  type: object
                  properties:
                    diversityThreshold:
                      type: number
                    maxRedundantPairs:
                      type: number
                  additionalProperties: false
                  required:
                    - diversityThreshold
                    - maxRedundantPairs
                autonomous:
                  type: object
                  properties:
                    datasetAugmentation:
                      type: object
                      properties:
                        maxAugmentationsPerRound:
                          type: number
                        minImprovementThreshold:
                          type: number
                        diversityThreshold:
                          type: number
                        maxTotalAugmentations:
                          type: number
                      additionalProperties: false
                      required:
                        - maxAugmentationsPerRound
                        - minImprovementThreshold
                        - diversityThreshold
                        - maxTotalAugmentations
                  additionalProperties: false
                  required:
                    - datasetAugmentation
              additionalProperties: false
              required:
                - clustering
                - discovery
                - autonomous
            missions:
              type: object
              properties:
                preprocessingBudgetUsd:
                  oneOf:
                    - type: 'null'
                    - type: number
              additionalProperties: false
              required:
                - preprocessingBudgetUsd
            costAlerts:
              type: object
              properties:
                enabled:
                  type: boolean
                dailyBudgetUsd:
                  oneOf:
                    - type: 'null'
                    - type: number
                weeklyBudgetUsd:
                  oneOf:
                    - type: 'null'
                    - type: number
                monthlyBudgetUsd:
                  oneOf:
                    - type: 'null'
                    - type: number
              additionalProperties: false
              required:
                - enabled
                - dailyBudgetUsd
                - weeklyBudgetUsd
                - monthlyBudgetUsd
            observability:
              type: object
              properties:
                traceCriticalPaths:
                  type: boolean
                logDriftSignals:
                  type: boolean
                logPiiEvents:
                  type: boolean
                requireCorrelationIds:
                  type: boolean
              additionalProperties: false
              required:
                - traceCriticalPaths
                - logDriftSignals
                - logPiiEvents
                - requireCorrelationIds
            accessControl:
              type: object
              properties:
                requireOrgIsolation:
                  type: boolean
                auditAllMutations:
                  type: boolean
              additionalProperties: false
              required:
                - requireOrgIsolation
                - auditAllMutations
            scoring:
              type: object
              properties:
                weights:
                  type: object
                  properties:
                    passRate:
                      type: number
                    safety:
                      type: number
                    judgeSchema:
                      type: number
                    latencyCost:
                      type: number
                  additionalProperties: false
                judgeSchemaSplit:
                  type: object
                  properties:
                    judge:
                      type: number
                    schema:
                      type: number
                  additionalProperties: false
                latencyCostSplit:
                  type: object
                  properties:
                    latency:
                      type: number
                    cost:
                      type: number
                  additionalProperties: false
                latencyBands:
                  type: object
                  properties:
                    goodMs:
                      type: number
                    badMs:
                      type: number
                  additionalProperties: false
                flagThresholds:
                  type: object
                  properties:
                    safetyRisk:
                      type: number
                    lowPassRate:
                      type: number
                    latencyRisk:
                      type: number
                    costRisk:
                      type: number
                  additionalProperties: false
                evidenceLevel:
                  type: object
                  properties:
                    strongMinN:
                      type: number
                    mediumMinN:
                      type: number
                  additionalProperties: false
              additionalProperties: false
          additionalProperties: false
          required:
            - version
            - drift
            - pii
            - externalProviders
            - judges
            - retention
            - evalgate
            - missions
            - costAlerts
            - observability
            - accessControl
        guardrailState:
          type: object
          properties:
            orgIsolationRequired:
              type: boolean
            auditAllMutations:
              type: boolean
            correlationIdsRequired:
              type: boolean
            traceCriticalPaths:
              type: boolean
          additionalProperties: false
          required:
            - orgIsolationRequired
            - auditAllMutations
            - correlationIdsRequired
            - traceCriticalPaths
        drift:
          type: object
          properties:
            openAlertCount:
              type: number
            recentAlerts:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: number
                  evaluationId:
                    oneOf:
                      - type: 'null'
                      - type: number
                  alertType:
                    type: string
                  severity:
                    type: string
                  explanation:
                    type: string
                  model:
                    oneOf:
                      - type: 'null'
                      - type: string
                  createdAt:
                    type: string
                  acknowledgedAt:
                    oneOf:
                      - type: 'null'
                      - type: string
                additionalProperties: false
                required:
                  - id
                  - evaluationId
                  - alertType
                  - severity
                  - explanation
                  - model
                  - createdAt
                  - acknowledgedAt
          additionalProperties: false
          required:
            - openAlertCount
            - recentAlerts
        providers:
          type: object
          properties:
            allowExternalLLM:
              type: boolean
            allowedProviders:
              type: array
              items:
                type: string
            recentCalls:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: number
                  action:
                    type: string
                  resourceType:
                    oneOf:
                      - type: 'null'
                      - type: string
                  resourceId:
                    oneOf:
                      - type: 'null'
                      - type: string
                  createdAt:
                    type: string
                  metadata:
                    oneOf:
                      - type: 'null'
                      - type: object
                        additionalProperties:
                          $ref: '#/components/schemas/JsonValue'
                additionalProperties: false
                required:
                  - id
                  - action
                  - resourceType
                  - resourceId
                  - createdAt
            recentBlockedCalls:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: number
                  action:
                    type: string
                  resourceType:
                    oneOf:
                      - type: 'null'
                      - type: string
                  resourceId:
                    oneOf:
                      - type: 'null'
                      - type: string
                  createdAt:
                    type: string
                  metadata:
                    oneOf:
                      - type: 'null'
                      - type: object
                        additionalProperties:
                          $ref: '#/components/schemas/JsonValue'
                additionalProperties: false
                required:
                  - id
                  - action
                  - resourceType
                  - resourceId
                  - createdAt
          additionalProperties: false
          required:
            - allowExternalLLM
            - allowedProviders
            - recentCalls
            - recentBlockedCalls
        judges:
          type: object
          properties:
            defaultPresetId:
              type: string
            allowMultiJudge:
              type: boolean
            allowedModels:
              type: array
              items:
                type: string
            maxRunCostUsd:
              type: number
            maxLatencyMs:
              type: number
            disagreementPolicy:
              oneOf:
                - type: string
                  enum:
                    - warn
                - type: string
                  enum:
                    - escalate
                - type: string
                  enum:
                    - inform
                - type: string
                  enum:
                    - block_unstable_production
          additionalProperties: false
          required:
            - defaultPresetId
            - allowMultiJudge
            - allowedModels
            - maxRunCostUsd
            - maxLatencyMs
            - disagreementPolicy
        pii:
          type: object
          properties:
            scrubMode:
              oneOf:
                - type: string
                  enum:
                    - drop
                - type: string
                  enum:
                    - hash
                - type: string
                  enum:
                    - redact
                - type: string
                  enum:
                    - tokenize
            allowPIIEmbedding:
              type: boolean
            allowRawStorage:
              type: boolean
            recentEvents:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: number
                  action:
                    type: string
                  resourceType:
                    oneOf:
                      - type: 'null'
                      - type: string
                  resourceId:
                    oneOf:
                      - type: 'null'
                      - type: string
                  createdAt:
                    type: string
                  metadata:
                    oneOf:
                      - type: 'null'
                      - type: object
                        additionalProperties:
                          $ref: '#/components/schemas/JsonValue'
                additionalProperties: false
                required:
                  - id
                  - action
                  - resourceType
                  - resourceId
                  - createdAt
          additionalProperties: false
          required:
            - scrubMode
            - allowPIIEmbedding
            - allowRawStorage
            - recentEvents
        retention:
          type: object
          properties:
            policy:
              type: object
              properties:
                evalData:
                  oneOf:
                    - type: string
                      enum:
                        - custom
                    - type: string
                      enum:
                        - 30d
                    - type: string
                      enum:
                        - 90d
                logs:
                  oneOf:
                    - type: string
                      enum:
                        - custom
                    - type: string
                      enum:
                        - 30d
                    - type: string
                      enum:
                        - 90d
                modelCalls:
                  type: string
                  enum:
                    - evidence
                datasetVersions:
                  type: string
                  enum:
                    - governed
                experimentResults:
                  type: string
                  enum:
                    - governed
                copilotMessages:
                  oneOf:
                    - type: string
                      enum:
                        - custom
                    - type: string
                      enum:
                        - 30d
                    - type: string
                      enum:
                        - 90d
                remoteRunnerLogs:
                  oneOf:
                    - type: string
                      enum:
                        - custom
                    - type: string
                      enum:
                        - 30d
                    - type: string
                      enum:
                        - 90d
                customEvalDataDays:
                  oneOf:
                    - type: 'null'
                    - type: number
                customLogDays:
                  oneOf:
                    - type: 'null'
                    - type: number
                customCopilotMessageDays:
                  oneOf:
                    - type: 'null'
                    - type: number
                customRemoteRunnerLogDays:
                  oneOf:
                    - type: 'null'
                    - type: number
              additionalProperties: false
              required:
                - evalData
                - logs
                - modelCalls
                - datasetVersions
                - experimentResults
                - copilotMessages
                - remoteRunnerLogs
            latestSweepAt:
              oneOf:
                - type: 'null'
                - type: string
            latestSweep:
              oneOf:
                - type: 'null'
                - type: object
                  properties:
                    id:
                      type: number
                    action:
                      type: string
                    resourceType:
                      oneOf:
                        - type: 'null'
                        - type: string
                    resourceId:
                      oneOf:
                        - type: 'null'
                        - type: string
                    createdAt:
                      type: string
                    metadata:
                      oneOf:
                        - type: 'null'
                        - type: object
                          additionalProperties:
                            $ref: '#/components/schemas/JsonValue'
                  additionalProperties: false
                  required:
                    - id
                    - action
                    - resourceType
                    - resourceId
                    - createdAt
          additionalProperties: false
          required:
            - policy
            - latestSweepAt
            - latestSweep
      additionalProperties: false
      required:
        - organizationId
        - policyVersion
        - policy
        - guardrailState
        - drift
        - providers
        - judges
        - pii
        - retention
    OrganizationId:
      type: string
      format: uuid
    JsonValue:
      oneOf:
        - type: 'null'
        - type: boolean
        - type: number
        - type: string
        - type: array
          items:
            $ref: '#/components/schemas/JsonValue'
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - UNAUTHORIZED
                - FORBIDDEN
                - NOT_FOUND
                - VALIDATION_ERROR
                - RATE_LIMITED
                - CONFLICT
                - INTERNAL_ERROR
                - SERVICE_UNAVAILABLE
                - QUOTA_EXCEEDED
                - NO_ORG_MEMBERSHIP
                - CROSS_ORG_REFERENCE
                - INCOMPLETE
                - MALFORMED
            message:
              type: string
            details: {}
            requestId:
              type: string
              format: uuid
          required:
            - code
            - message
      required:
        - error
  responses:
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Conflict:
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    RateLimited:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key or Session Token

````