{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ohp1x.github.io/privyx/schema.json",
  "$defs": {
    "AgentConfig": {
      "additionalProperties": true,
      "description": "How to launch a tool and point it at the local proxy; never a shell command.\n\nEvery key but these is an option of the profile's agent ``type``, which\nits ``Options`` check.",
      "properties": {
        "type": {
          "default": "",
          "title": "Type",
          "anyOf": [
            {
              "enum": [
                "claude",
                "codex",
                "env",
                "ollama",
                "pi"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "command": {
          "minLength": 1,
          "title": "Command",
          "type": "string"
        },
        "provider": {
          "default": "generic",
          "minLength": 1,
          "title": "Provider",
          "type": "string"
        },
        "upstream": {
          "default": "",
          "title": "Upstream",
          "type": "string"
        },
        "env_vars": {
          "items": {
            "type": "string"
          },
          "title": "Env Vars",
          "type": "array"
        },
        "base_path": {
          "default": "",
          "title": "Base Path",
          "type": "string"
        },
        "extends": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Extends"
        },
        "args": {
          "items": {
            "type": "string"
          },
          "title": "Args",
          "type": "array"
        },
        "env": {
          "additionalProperties": {
            "type": "string"
          },
          "title": "Env",
          "type": "object"
        },
        "env_from": {
          "additionalProperties": {
            "type": "string"
          },
          "title": "Env From",
          "type": "object"
        },
        "budget": {
          "$ref": "#/$defs/BudgetConfig"
        },
        "presets": {
          "items": {
            "type": "string"
          },
          "title": "Presets",
          "type": "array"
        },
        "privyx": {
          "title": "Privyx",
          "$ref": "#/$defs/ProfileSettings"
        }
      },
      "title": "AgentConfig",
      "type": "object",
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "env"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "type": true,
              "command": true,
              "provider": true,
              "upstream": true,
              "env_vars": true,
              "base_path": true,
              "extends": true,
              "args": true,
              "env": true,
              "env_from": true,
              "budget": true,
              "presets": true,
              "privyx": true,
              "endpoint_env": {
                "default": [],
                "items": {
                  "type": "string"
                },
                "title": "Endpoint Env",
                "type": "array"
              }
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "claude",
                  "codex",
                  "pi",
                  "ollama"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "type": true,
              "command": true,
              "provider": true,
              "upstream": true,
              "env_vars": true,
              "base_path": true,
              "extends": true,
              "args": true,
              "env": true,
              "env_from": true,
              "budget": true,
              "presets": true,
              "privyx": true
            },
            "additionalProperties": false
          }
        }
      ]
    },
    "AnchorConfig": {
      "additionalProperties": true,
      "properties": {
        "type": {
          "default": "hmac",
          "title": "Type",
          "anyOf": [
            {
              "enum": [
                "hmac",
                "pasp"
              ]
            },
            {
              "type": "string"
            }
          ]
        }
      },
      "title": "AnchorConfig",
      "type": "object",
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "hmac",
                  "pasp"
                ]
              }
            }
          },
          "then": {
            "properties": {
              "type": true,
              "secret": {
                "default": "auto",
                "title": "Secret",
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      ]
    },
    "BudgetConfig": {
      "description": "Limits on one ``privyx run`` launch; unset means no limit.",
      "properties": {
        "max_turns": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "exclusiveMinimum": 0,
                  "type": "integer"
                },
                {
                  "type": "string",
                  "pattern": "\\$\\{"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Max Turns"
        },
        "max_tokens": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "exclusiveMinimum": 0,
                  "type": "integer"
                },
                {
                  "type": "string",
                  "pattern": "\\$\\{"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Max Tokens"
        }
      },
      "title": "BudgetConfig",
      "type": "object",
      "additionalProperties": false
    },
    "DetectorCacheConfig": {
      "description": "Configuration for turn/detection caching.\n\nCaches entity detections for previously seen text spans, avoiding\nredundant regex or NLP scans across conversation turns.",
      "properties": {
        "enabled": {
          "title": "Enabled",
          "anyOf": [
            {
              "default": true,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "max_size": {
          "title": "Max Size",
          "anyOf": [
            {
              "default": 10000,
              "type": "integer"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        }
      },
      "title": "DetectorCacheConfig",
      "type": "object",
      "additionalProperties": false
    },
    "DetectorConfig": {
      "additionalProperties": true,
      "description": "One of ``detectors``: its type, by default the entry's name, and its rules.",
      "properties": {
        "type": {
          "default": "",
          "title": "Type",
          "anyOf": [
            {
              "enum": [
                "llm",
                "presidio",
                "regex"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "enabled": {
          "title": "Enabled",
          "anyOf": [
            {
              "default": true,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "underscore_separates_words": {
          "title": "Underscore Separates Words",
          "anyOf": [
            {
              "default": true,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "cache": {
          "anyOf": [
            {
              "$ref": "#/$defs/DetectorCacheConfig"
            },
            {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "pattern": "\\$\\{"
                }
              ]
            }
          ],
          "title": "Cache"
        }
      },
      "title": "DetectorConfig",
      "type": "object",
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "regex"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "$ref": "#/$defs/DetectorConfig.regex"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "presidio"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "$ref": "#/$defs/DetectorConfig.presidio"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "llm"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "$ref": "#/$defs/DetectorConfig.llm"
          }
        }
      ]
    },
    "FeatureConfig": {
      "additionalProperties": true,
      "description": "One of ``features``: its type, by default the entry's name, and its options.",
      "properties": {
        "type": {
          "default": "",
          "title": "Type",
          "anyOf": [
            {
              "enum": [
                "audit",
                "budget",
                "cache_control",
                "directive",
                "metrics",
                "tracing"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "enabled": {
          "title": "Enabled",
          "anyOf": [
            {
              "default": true,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        }
      },
      "title": "FeatureConfig",
      "type": "object",
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "audit"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "$ref": "#/$defs/FeatureConfig.audit"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "metrics",
                  "tracing",
                  "directive",
                  "cache_control"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "$ref": "#/$defs/FeatureConfig.metrics"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "budget"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "$ref": "#/$defs/FeatureConfig.budget"
          }
        }
      ]
    },
    "LogConfig": {
      "description": "Privyx's own log: its level, its console format, and a file that also takes others'.",
      "properties": {
        "level": {
          "default": "info",
          "title": "Level",
          "type": "string"
        },
        "format": {
          "default": "text",
          "title": "Format",
          "type": "string"
        },
        "file": {
          "default": "",
          "title": "File",
          "type": "string"
        }
      },
      "title": "LogConfig",
      "type": "object",
      "additionalProperties": false
    },
    "OperatorConfig": {
      "additionalProperties": true,
      "properties": {
        "type": {
          "default": "pseudonym",
          "title": "Type",
          "anyOf": [
            {
              "enum": [
                "encrypt",
                "faker",
                "fpe",
                "hash",
                "partial",
                "pseudonym",
                "redact"
              ]
            },
            {
              "type": "string"
            }
          ]
        }
      },
      "title": "OperatorConfig",
      "type": "object",
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "pseudonym"
                ]
              }
            }
          },
          "then": {
            "properties": {
              "type": true,
              "id_length": {
                "title": "Id Length",
                "anyOf": [
                  {
                    "default": 16,
                    "maximum": 64,
                    "minimum": 6,
                    "type": "integer"
                  },
                  {
                    "type": "string",
                    "pattern": "\\$\\{"
                  }
                ]
              },
              "seed": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "pattern": "\\$\\{"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "title": "Seed"
              },
              "locale": {
                "default": "",
                "title": "Locale",
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "redact"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "type": true,
              "text": {
                "default": "[REDACTED]",
                "title": "Text",
                "type": "string"
              },
              "token": {
                "type": "string",
                "description": "Write text.",
                "deprecated": true
              }
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "hash"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "type": true,
              "id_length": {
                "title": "Id Length",
                "anyOf": [
                  {
                    "default": 12,
                    "maximum": 64,
                    "minimum": 6,
                    "type": "integer"
                  },
                  {
                    "type": "string",
                    "pattern": "\\$\\{"
                  }
                ]
              },
              "length": {
                "description": "Write id_length.",
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 6,
                    "maximum": 64,
                    "deprecated": true
                  },
                  {
                    "type": "string",
                    "pattern": "\\$\\{"
                  }
                ]
              }
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "faker"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "type": true,
              "seed": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "pattern": "\\$\\{"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "title": "Seed"
              },
              "locale": {
                "default": "",
                "title": "Locale",
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "encrypt"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "type": true,
              "key": {
                "default": "",
                "title": "Key",
                "type": "string"
              },
              "id_length": {
                "title": "Id Length",
                "anyOf": [
                  {
                    "default": 16,
                    "maximum": 64,
                    "minimum": 6,
                    "type": "integer"
                  },
                  {
                    "type": "string",
                    "pattern": "\\$\\{"
                  }
                ]
              }
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "partial"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "type": true
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "fpe"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "type": true,
              "seed": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "pattern": "\\$\\{"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "title": "Seed"
              }
            },
            "additionalProperties": false
          }
        }
      ]
    },
    "PathMappingConfig": {
      "description": "How the transparent proxy joins the upstream URL and a request path.\n\n``origin`` keeps only the upstream's ``scheme://host[:port]`` and appends\nthe request path.  ``prefix`` keeps the upstream's path as well and appends\nthe request path after ``strip_prefix``, so a router at\n``https://router.example.com/api/v1`` serves ``/v1/chat/completions`` at\n``/api/v1/chat/completions``.  ``privyx run`` strips the agent's\n``base_path``.  Requests outside ``strip_prefix`` are refused.",
      "properties": {
        "mode": {
          "title": "Mode",
          "anyOf": [
            {
              "default": "origin",
              "enum": [
                "origin",
                "prefix"
              ],
              "type": "string"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "strip_prefix": {
          "default": "",
          "title": "Strip Prefix",
          "type": "string"
        }
      },
      "title": "PathMappingConfig",
      "type": "object",
      "additionalProperties": false
    },
    "PluginsConfig": {
      "description": "Plugin loading.\n\nOpt-in: nothing is loaded unless ``paths`` or ``modules`` name something.\nEach file of ``paths``, a ``.py`` file or those of a directory, and each\nmodule of ``modules``, such as an installed package, is imported and its\n``setup(app)`` called.  Installed packages are never loaded on their own:\nan entry point is only listed.  Set ``enabled: false`` to skip both.",
      "properties": {
        "enabled": {
          "title": "Enabled",
          "anyOf": [
            {
              "default": true,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "paths": {
          "items": {
            "type": "string"
          },
          "title": "Paths",
          "type": "array"
        },
        "modules": {
          "items": {
            "type": "string"
          },
          "title": "Modules",
          "type": "array"
        }
      },
      "title": "PluginsConfig",
      "type": "object",
      "additionalProperties": false
    },
    "PolicyConfig": {
      "additionalProperties": true,
      "properties": {
        "type": {
          "default": "default",
          "title": "Type",
          "anyOf": [
            {
              "enum": [
                "default",
                "strict"
              ]
            },
            {
              "type": "string"
            }
          ]
        }
      },
      "title": "PolicyConfig",
      "type": "object",
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "default"
                ]
              }
            }
          },
          "then": {
            "properties": {
              "type": true
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "strict"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "type": true,
              "allowed": {
                "items": {
                  "type": "string"
                },
                "title": "Allowed",
                "type": "array"
              }
            },
            "additionalProperties": false
          }
        }
      ]
    },
    "ProviderConfig": {
      "additionalProperties": true,
      "description": "An upstream connection: the top-level ``provider``, or one of ``providers``.\n\n``base_url`` defaults to empty rather than to a URL: an empty value lets\nthe provider registry fall back to the endpoint that provider type is\ndocumented to use (``api.openai.com`` for ``openai``, and so on).  A\nnon-empty default here would silently override every such fallback.",
      "properties": {
        "type": {
          "default": "generic",
          "title": "Type",
          "anyOf": [
            {
              "enum": [
                "anthropic",
                "generic",
                "google",
                "openai"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "base_url": {
          "default": "",
          "title": "Base Url",
          "type": "string"
        },
        "api_key": {
          "default": "",
          "title": "Api Key",
          "type": "string"
        },
        "headers": {
          "additionalProperties": {
            "type": "string"
          },
          "title": "Headers",
          "type": "object"
        },
        "forward_client_auth": {
          "title": "Forward Client Auth",
          "anyOf": [
            {
              "default": true,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "path_mapping": {
          "$ref": "#/$defs/PathMappingConfig"
        },
        "timeout": {
          "title": "Timeout",
          "anyOf": [
            {
              "default": 300.0,
              "exclusiveMinimum": 0,
              "type": "number"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "connect_timeout": {
          "title": "Connect Timeout",
          "anyOf": [
            {
              "default": 10.0,
              "exclusiveMinimum": 0,
              "type": "number"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "max_connections": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "exclusiveMinimum": 0,
                  "type": "integer"
                },
                {
                  "type": "string",
                  "pattern": "\\$\\{"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Max Connections"
        },
        "openai_api_key": {
          "type": "string",
          "description": "Write providers.openai.api_key.",
          "deprecated": true
        },
        "anthropic_api_key": {
          "type": "string",
          "description": "Write providers.anthropic.api_key.",
          "deprecated": true
        },
        "google_api_key": {
          "type": "string",
          "description": "Write providers.google.api_key.",
          "deprecated": true
        }
      },
      "title": "ProviderConfig",
      "type": "object",
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "generic",
                  "openai",
                  "anthropic",
                  "google"
                ]
              }
            }
          },
          "then": {
            "properties": {
              "type": true,
              "base_url": true,
              "api_key": true,
              "headers": true,
              "forward_client_auth": true,
              "path_mapping": true,
              "timeout": true,
              "connect_timeout": true,
              "max_connections": true,
              "openai_api_key": {
                "type": "string",
                "description": "Write providers.openai.api_key.",
                "deprecated": true
              },
              "anthropic_api_key": {
                "type": "string",
                "description": "Write providers.anthropic.api_key.",
                "deprecated": true
              },
              "google_api_key": {
                "type": "string",
                "description": "Write providers.google.api_key.",
                "deprecated": true
              }
            },
            "additionalProperties": false
          }
        }
      ]
    },
    "ProxyConfig": {
      "description": "Proxy serving mode.\n\n``mode`` selects which app :command:`privyx proxy` serves:\n\n- ``gateway`` \u2014 configured routes sent to a fixed upstream endpoint;\n  embeddings and legacy completions use sibling endpoints. Native Ollama\n  and OpenAI/Anthropic token-counting or compaction routes are not served.\n  Gemini routes require the Google provider.\n- ``transparent`` \u2014 a drop-in reverse proxy.  Point a client's\n  ``OPENAI_BASE_URL`` / ``ANTHROPIC_BASE_URL`` at Privyx and every path is\n  forwarded to the upstream; configured masking routes are pseudonymized\n  on the way out and restored on the way back. The provider's\n  ``path_mapping`` can keep an upstream path prefix.\n\n``routes`` maps a request path to the wire schema used to transform it.\nIn transparent mode, paths not listed are forwarded verbatim when\n``passthrough_unknown`` is set (the default) and refused with 403 when it is\nnot.  The gateway serves only the listed paths either way.",
      "properties": {
        "mode": {
          "title": "Mode",
          "anyOf": [
            {
              "default": "transparent",
              "enum": [
                "gateway",
                "transparent"
              ],
              "type": "string"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "routes": {
          "additionalProperties": {
            "type": "string"
          },
          "title": "Routes",
          "type": "object"
        },
        "passthrough_unknown": {
          "title": "Passthrough Unknown",
          "anyOf": [
            {
              "default": true,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "dlp_check": {
          "title": "Dlp Check",
          "anyOf": [
            {
              "default": true,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "tap": {
          "title": "Tap",
          "anyOf": [
            {
              "default": false,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "tap_dir": {
          "default": "~/.privyx/tap",
          "title": "Tap Dir",
          "type": "string"
        },
        "forward_client_auth": {
          "title": "Forward Client Auth",
          "anyOf": [
            {
              "default": true,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ],
          "deprecated": true,
          "description": "Write provider.forward_client_auth."
        },
        "path_mapping": {
          "$ref": "#/$defs/PathMappingConfig",
          "deprecated": true,
          "description": "Write provider.path_mapping."
        },
        "timeout": {
          "title": "Timeout",
          "anyOf": [
            {
              "default": 300.0,
              "exclusiveMinimum": 0,
              "type": "number"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ],
          "deprecated": true,
          "description": "Write provider.timeout."
        },
        "connect_timeout": {
          "title": "Connect Timeout",
          "anyOf": [
            {
              "default": 10.0,
              "exclusiveMinimum": 0,
              "type": "number"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ],
          "deprecated": true,
          "description": "Write provider.connect_timeout."
        },
        "max_connections": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "exclusiveMinimum": 0,
                  "type": "integer"
                },
                {
                  "type": "string",
                  "pattern": "\\$\\{"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Max Connections",
          "deprecated": true,
          "description": "Write provider.max_connections."
        },
        "directive": {
          "type": "boolean",
          "deprecated": true,
          "description": "Write features.directive."
        },
        "cache_control": {
          "type": "boolean",
          "deprecated": true,
          "description": "Write features.cache_control."
        }
      },
      "title": "ProxyConfig",
      "type": "object",
      "additionalProperties": false
    },
    "ServerConfig": {
      "description": "Where ``privyx proxy`` listens, and how many processes serve it.",
      "properties": {
        "host": {
          "default": "127.0.0.1",
          "title": "Host",
          "type": "string"
        },
        "port": {
          "title": "Port",
          "anyOf": [
            {
              "default": 8000,
              "maximum": 65535,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "workers": {
          "title": "Workers",
          "anyOf": [
            {
              "default": 1,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "tls": {
          "$ref": "#/$defs/TLSConfig"
        }
      },
      "title": "ServerConfig",
      "type": "object",
      "additionalProperties": false
    },
    "SessionConfig": {
      "description": "How a session is identified when the client sends no ``x-privyx-session``.\n\nAn explicit ``x-privyx-session`` header always wins.  Absent one, ``strategy``\ndecides the fallback:\n\n- ``ephemeral`` (default) \u2014 a fresh session per request.  Nothing is shared\n  between requests, so two callers' pseudonym maps can never collide, but a\n  multi-turn conversation is re-tokenized from scratch every turn and shows up\n  as many sessions.\n- ``client`` \u2014 a stable session derived from the client credential\n  (``Authorization`` / ``x-api-key``): one API key \u2192 one reused session.\n  Simple, but every conversation under that key shares one pseudonym map.\n- ``conversation`` \u2014 a stable session derived from the credential *and* the\n  first user message, so one conversation \u2192 one reused session while different\n  conversations (even under the same key) stay isolated.\n\nBoth derived strategies fall back to ``ephemeral`` when their signal is absent\n(e.g. a request carries no credential).",
      "properties": {
        "strategy": {
          "title": "Strategy",
          "anyOf": [
            {
              "default": "ephemeral",
              "enum": [
                "ephemeral",
                "client",
                "conversation"
              ],
              "type": "string"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        }
      },
      "title": "SessionConfig",
      "type": "object",
      "additionalProperties": false
    },
    "TLSConfig": {
      "description": "TLS/SSL server configuration for HTTPS termination.",
      "properties": {
        "certfile": {
          "default": "",
          "title": "Certfile",
          "type": "string"
        },
        "keyfile": {
          "default": "",
          "title": "Keyfile",
          "type": "string"
        },
        "keyfile_password": {
          "default": "",
          "title": "Keyfile Password",
          "type": "string"
        },
        "ca_certs": {
          "default": "",
          "title": "Ca Certs",
          "type": "string"
        }
      },
      "title": "TLSConfig",
      "type": "object",
      "additionalProperties": false
    },
    "TokenConfig": {
      "description": "How placeholder tokens are serialized in text.\n\n``format`` must contain ``{type}`` and ``{id}``; ``{namespace}`` is optional.\nAdjacent placeholders need a delimiter between them.  The default reproduces\nthe historical ``<PRIVYX_EMAIL_1>`` syntax; alternatives include\n``[[{namespace}:{type}:{id}]]`` and ``<{namespace}:{type}:{id}>``.",
      "properties": {
        "namespace": {
          "default": "PRIVYX",
          "title": "Namespace",
          "type": "string"
        },
        "format": {
          "default": "<{namespace}_{type}_{id}>",
          "title": "Format",
          "type": "string"
        },
        "compact": {
          "title": "Compact",
          "anyOf": [
            {
              "default": false,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "label_format": {
          "default": "",
          "title": "Label Format",
          "type": "string"
        },
        "id_length": {
          "description": "Write operator.id_length.",
          "anyOf": [
            {
              "type": "integer",
              "minimum": 6,
              "maximum": 64,
              "deprecated": true
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        }
      },
      "title": "TokenConfig",
      "type": "object",
      "additionalProperties": false
    },
    "VaultConfig": {
      "additionalProperties": true,
      "properties": {
        "type": {
          "default": "memory",
          "title": "Type",
          "anyOf": [
            {
              "enum": [
                "memory",
                "redis",
                "sqlite"
              ]
            },
            {
              "type": "string"
            }
          ]
        }
      },
      "title": "VaultConfig",
      "type": "object",
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "memory"
                ]
              }
            }
          },
          "then": {
            "properties": {
              "type": true,
              "ttl": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "exclusiveMinimum": 0,
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "pattern": "\\$\\{"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "title": "Ttl"
              }
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "sqlite"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "type": true,
              "ttl": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "exclusiveMinimum": 0,
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "pattern": "\\$\\{"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "title": "Ttl"
              },
              "dsn": {
                "default": "sqlite+aiosqlite:///~/.privyx/privyx.db",
                "title": "Dsn",
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "redis"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "type": true,
              "ttl": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "exclusiveMinimum": 0,
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "pattern": "\\$\\{"
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null,
                "title": "Ttl"
              },
              "redis_url": {
                "default": "redis://localhost:6379/0",
                "title": "Redis Url",
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      ]
    },
    "DetectorConfig.regex": {
      "properties": {
        "type": true,
        "enabled": true,
        "underscore_separates_words": true,
        "cache": true,
        "builtins": {
          "title": "Builtins",
          "anyOf": [
            {
              "default": true,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "patterns": {
          "additionalProperties": {
            "type": "string"
          },
          "title": "Patterns",
          "type": "object"
        },
        "terms": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": "Terms",
          "type": "object"
        },
        "merge_terms": {
          "title": "Merge Terms",
          "anyOf": [
            {
              "default": true,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "term_variants": {
          "title": "Term Variants",
          "anyOf": [
            {
              "default": true,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "context": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": "Context",
          "type": "object"
        },
        "enable": {
          "items": {
            "type": "string"
          },
          "title": "Enable",
          "type": "array"
        },
        "disable": {
          "items": {
            "type": "string"
          },
          "title": "Disable",
          "type": "array"
        },
        "entropy_threshold": {
          "title": "Entropy Threshold",
          "anyOf": [
            {
              "default": 3.0,
              "exclusiveMinimum": 0,
              "type": "number"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "decode": {
          "title": "Decode",
          "anyOf": [
            {
              "default": false,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "normalize": {
          "title": "Normalize",
          "anyOf": [
            {
              "default": false,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "DetectorConfig.presidio": {
      "properties": {
        "type": true,
        "enabled": true,
        "underscore_separates_words": true,
        "cache": true,
        "language": {
          "default": "en",
          "title": "Language",
          "type": "string"
        },
        "model": {
          "default": "",
          "title": "Model",
          "type": "string"
        },
        "entities": {
          "items": {
            "type": "string"
          },
          "title": "Entities",
          "type": "array"
        },
        "score_threshold": {
          "title": "Score Threshold",
          "anyOf": [
            {
              "default": 0.35,
              "type": "number"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "DetectorConfig.llm": {
      "properties": {
        "type": true,
        "enabled": true,
        "underscore_separates_words": true,
        "cache": true,
        "llm_provider": {
          "default": "openai",
          "title": "Llm Provider",
          "type": "string"
        },
        "llm_model": {
          "default": "",
          "title": "Llm Model",
          "type": "string"
        },
        "llm_api_key": {
          "default": "",
          "title": "Llm Api Key",
          "type": "string"
        },
        "llm_instructions": {
          "default": "",
          "title": "Llm Instructions",
          "type": "string"
        },
        "llm_timeout": {
          "title": "Llm Timeout",
          "anyOf": [
            {
              "default": 30.0,
              "exclusiveMinimum": 0,
              "type": "number"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "llm_max_chars": {
          "title": "Llm Max Chars",
          "anyOf": [
            {
              "default": 4000,
              "exclusiveMinimum": 0,
              "type": "integer"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "llm_fallback_on_error": {
          "title": "Llm Fallback On Error",
          "anyOf": [
            {
              "default": false,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "Detectors": {
      "title": "Detectors",
      "type": "object",
      "properties": {
        "regex": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "allOf": [
                {
                  "$ref": "#/$defs/DetectorConfig"
                },
                {
                  "if": {
                    "not": {
                      "required": [
                        "type"
                      ]
                    }
                  },
                  "then": {
                    "$ref": "#/$defs/DetectorConfig.regex"
                  }
                }
              ]
            }
          ]
        },
        "presidio": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "allOf": [
                {
                  "$ref": "#/$defs/DetectorConfig"
                },
                {
                  "if": {
                    "not": {
                      "required": [
                        "type"
                      ]
                    }
                  },
                  "then": {
                    "$ref": "#/$defs/DetectorConfig.presidio"
                  }
                }
              ]
            }
          ]
        },
        "llm": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "allOf": [
                {
                  "$ref": "#/$defs/DetectorConfig"
                },
                {
                  "if": {
                    "not": {
                      "required": [
                        "type"
                      ]
                    }
                  },
                  "then": {
                    "$ref": "#/$defs/DetectorConfig.llm"
                  }
                }
              ]
            }
          ]
        }
      },
      "additionalProperties": {
        "anyOf": [
          {
            "type": "boolean"
          },
          {
            "$ref": "#/$defs/DetectorConfig"
          }
        ]
      }
    },
    "ModelPrice": {
      "description": "USD per million tokens; cache rates default to 0.1x and 1.25x of input.",
      "properties": {
        "input": {
          "minimum": 0,
          "title": "Input",
          "type": "number"
        },
        "output": {
          "minimum": 0,
          "title": "Output",
          "type": "number"
        },
        "cache_read": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Cache Read"
        },
        "cache_write": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Cache Write"
        }
      },
      "required": [
        "input",
        "output"
      ],
      "title": "ModelPrice",
      "type": "object"
    },
    "FeatureConfig.audit": {
      "properties": {
        "type": true,
        "enabled": true,
        "path": {
          "default": "~/.privyx/audit.log",
          "title": "Path",
          "type": "string"
        },
        "prices": {
          "additionalProperties": {
            "$ref": "#/$defs/ModelPrice"
          },
          "title": "Prices",
          "type": "object"
        },
        "conversation_ref": {
          "title": "Conversation Ref",
          "anyOf": [
            {
              "default": false,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "key": {
          "default": "auto",
          "title": "Key",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "FeatureConfig.metrics": {
      "properties": {
        "type": true,
        "enabled": true
      },
      "additionalProperties": false
    },
    "FeatureConfig.budget": {
      "properties": {
        "type": true,
        "enabled": true,
        "max_turns": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "exclusiveMinimum": 0,
                  "type": "integer"
                },
                {
                  "type": "string",
                  "pattern": "\\$\\{"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Max Turns"
        },
        "max_tokens": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "exclusiveMinimum": 0,
                  "type": "integer"
                },
                {
                  "type": "string",
                  "pattern": "\\$\\{"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Max Tokens"
        },
        "profile": {
          "default": "",
          "title": "Profile",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "Features": {
      "title": "Features",
      "type": "object",
      "properties": {
        "audit": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "allOf": [
                {
                  "$ref": "#/$defs/FeatureConfig"
                },
                {
                  "if": {
                    "not": {
                      "required": [
                        "type"
                      ]
                    }
                  },
                  "then": {
                    "$ref": "#/$defs/FeatureConfig.audit"
                  }
                }
              ]
            }
          ]
        },
        "metrics": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "allOf": [
                {
                  "$ref": "#/$defs/FeatureConfig"
                },
                {
                  "if": {
                    "not": {
                      "required": [
                        "type"
                      ]
                    }
                  },
                  "then": {
                    "$ref": "#/$defs/FeatureConfig.metrics"
                  }
                }
              ]
            }
          ]
        },
        "tracing": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "allOf": [
                {
                  "$ref": "#/$defs/FeatureConfig"
                },
                {
                  "if": {
                    "not": {
                      "required": [
                        "type"
                      ]
                    }
                  },
                  "then": {
                    "$ref": "#/$defs/FeatureConfig.metrics"
                  }
                }
              ]
            }
          ]
        },
        "directive": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "allOf": [
                {
                  "$ref": "#/$defs/FeatureConfig"
                },
                {
                  "if": {
                    "not": {
                      "required": [
                        "type"
                      ]
                    }
                  },
                  "then": {
                    "$ref": "#/$defs/FeatureConfig.metrics"
                  }
                }
              ]
            }
          ]
        },
        "cache_control": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "allOf": [
                {
                  "$ref": "#/$defs/FeatureConfig"
                },
                {
                  "if": {
                    "not": {
                      "required": [
                        "type"
                      ]
                    }
                  },
                  "then": {
                    "$ref": "#/$defs/FeatureConfig.metrics"
                  }
                }
              ]
            }
          ]
        },
        "budget": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "allOf": [
                {
                  "$ref": "#/$defs/FeatureConfig"
                },
                {
                  "if": {
                    "not": {
                      "required": [
                        "type"
                      ]
                    }
                  },
                  "then": {
                    "$ref": "#/$defs/FeatureConfig.budget"
                  }
                }
              ]
            }
          ]
        }
      },
      "additionalProperties": {
        "anyOf": [
          {
            "type": "boolean"
          },
          {
            "$ref": "#/$defs/FeatureConfig"
          }
        ]
      }
    },
    "ProfileSettings": {
      "type": "object",
      "properties": {
        "server": {
          "$ref": "#/$defs/ServerConfig"
        },
        "log": {
          "$ref": "#/$defs/LogConfig"
        },
        "upstream_url": {
          "default": "",
          "title": "Upstream Url",
          "type": "string",
          "deprecated": true,
          "description": "Write provider.base_url."
        },
        "vault": {
          "$ref": "#/$defs/VaultConfig"
        },
        "detectors": {
          "$ref": "#/$defs/Detectors"
        },
        "policy": {
          "$ref": "#/$defs/PolicyConfig"
        },
        "operator": {
          "$ref": "#/$defs/OperatorConfig"
        },
        "anchor": {
          "$ref": "#/$defs/AnchorConfig"
        },
        "session": {
          "$ref": "#/$defs/SessionConfig"
        },
        "token": {
          "$ref": "#/$defs/TokenConfig"
        },
        "provider": {
          "title": "Provider",
          "anyOf": [
            {
              "type": "string",
              "description": "The name of one of providers."
            },
            {
              "$ref": "#/$defs/ProviderConfig"
            }
          ]
        },
        "providers": {
          "additionalProperties": {
            "$ref": "#/$defs/ProviderConfig"
          },
          "title": "Providers",
          "type": "object"
        },
        "proxy": {
          "$ref": "#/$defs/ProxyConfig"
        },
        "features": {
          "$ref": "#/$defs/Features"
        },
        "plugins": {
          "$ref": "#/$defs/PluginsConfig"
        },
        "secrets": {
          "additionalProperties": {
            "additionalProperties": true,
            "type": "object"
          },
          "title": "Secrets",
          "type": "object"
        },
        "harvest": {
          "title": "Harvest",
          "anyOf": [
            {
              "default": false,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "host": {
          "default": "127.0.0.1",
          "title": "Host",
          "type": "string",
          "deprecated": true,
          "description": "Write server.host."
        },
        "port": {
          "title": "Port",
          "anyOf": [
            {
              "default": 8000,
              "maximum": 65535,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ],
          "deprecated": true,
          "description": "Write server.port."
        },
        "tls": {
          "$ref": "#/$defs/TLSConfig",
          "deprecated": true,
          "description": "Write server.tls."
        },
        "log_level": {
          "default": "info",
          "title": "Level",
          "type": "string",
          "deprecated": true,
          "description": "Write log.level."
        },
        "logging": {
          "default": "text",
          "title": "Format",
          "type": "string",
          "deprecated": true,
          "description": "Write log.format."
        },
        "log_file": {
          "default": "",
          "title": "File",
          "type": "string",
          "deprecated": true,
          "description": "Write log.file."
        },
        "detector": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                }
              }
            },
            {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  }
                }
              }
            }
          ],
          "deprecated": true,
          "description": "Write detectors, with an entry per detector."
        },
        "audit": {
          "type": "object",
          "deprecated": true,
          "description": "Write features.audit, and proxy.tap and proxy.tap_dir.",
          "properties": {
            "enabled": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "pattern": "\\$\\{"
                }
              ]
            },
            "path": {
              "type": "string"
            },
            "tap": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "pattern": "\\$\\{"
                }
              ]
            },
            "tap_dir": {
              "type": "string"
            },
            "prices": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/ModelPrice"
              }
            }
          },
          "additionalProperties": false
        },
        "tracing": {
          "type": "object",
          "deprecated": true,
          "description": "Write features.tracing.",
          "properties": {
            "enabled": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "pattern": "\\$\\{"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "PresetSettings": {
      "type": "object",
      "properties": {
        "server": {
          "$ref": "#/$defs/ServerConfig"
        },
        "log": {
          "$ref": "#/$defs/LogConfig"
        },
        "vault": {
          "$ref": "#/$defs/VaultConfig"
        },
        "detectors": {
          "$ref": "#/$defs/Detectors"
        },
        "policy": {
          "$ref": "#/$defs/PolicyConfig"
        },
        "operator": {
          "$ref": "#/$defs/OperatorConfig"
        },
        "anchor": {
          "$ref": "#/$defs/AnchorConfig"
        },
        "session": {
          "$ref": "#/$defs/SessionConfig"
        },
        "token": {
          "$ref": "#/$defs/TokenConfig"
        },
        "proxy": {
          "$ref": "#/$defs/ProxyConfig"
        },
        "features": {
          "$ref": "#/$defs/Features"
        },
        "plugins": {
          "$ref": "#/$defs/PluginsConfig"
        },
        "secrets": {
          "additionalProperties": {
            "additionalProperties": true,
            "type": "object"
          },
          "title": "Secrets",
          "type": "object"
        },
        "harvest": {
          "title": "Harvest",
          "anyOf": [
            {
              "default": false,
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "host": {
          "default": "127.0.0.1",
          "title": "Host",
          "type": "string",
          "deprecated": true,
          "description": "Write server.host."
        },
        "port": {
          "title": "Port",
          "anyOf": [
            {
              "default": 8000,
              "maximum": 65535,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ],
          "deprecated": true,
          "description": "Write server.port."
        },
        "tls": {
          "$ref": "#/$defs/TLSConfig",
          "deprecated": true,
          "description": "Write server.tls."
        },
        "log_level": {
          "default": "info",
          "title": "Level",
          "type": "string",
          "deprecated": true,
          "description": "Write log.level."
        },
        "logging": {
          "default": "text",
          "title": "Format",
          "type": "string",
          "deprecated": true,
          "description": "Write log.format."
        },
        "log_file": {
          "default": "",
          "title": "File",
          "type": "string",
          "deprecated": true,
          "description": "Write log.file."
        },
        "detector": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                }
              }
            },
            {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  }
                }
              }
            }
          ],
          "deprecated": true,
          "description": "Write detectors, with an entry per detector."
        },
        "audit": {
          "type": "object",
          "deprecated": true,
          "description": "Write features.audit, and proxy.tap and proxy.tap_dir.",
          "properties": {
            "enabled": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "pattern": "\\$\\{"
                }
              ]
            },
            "path": {
              "type": "string"
            },
            "tap": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "pattern": "\\$\\{"
                }
              ]
            },
            "tap_dir": {
              "type": "string"
            },
            "prices": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/ModelPrice"
              }
            }
          },
          "additionalProperties": false
        },
        "tracing": {
          "type": "object",
          "deprecated": true,
          "description": "Write features.tracing.",
          "properties": {
            "enabled": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "pattern": "\\$\\{"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "description": "Top-level Privyx settings.\n\nA key it does not define is refused, so a setting renamed in 0.3.0 and\ngiven here by its old name fails rather than doing nothing: the loader\nreads the old names of a file with a warning.",
  "properties": {
    "server": {
      "$ref": "#/$defs/ServerConfig"
    },
    "log": {
      "$ref": "#/$defs/LogConfig"
    },
    "upstream_url": {
      "default": "",
      "title": "Upstream Url",
      "type": "string",
      "deprecated": true,
      "description": "Write provider.base_url."
    },
    "vault": {
      "$ref": "#/$defs/VaultConfig"
    },
    "detectors": {
      "$ref": "#/$defs/Detectors"
    },
    "policy": {
      "$ref": "#/$defs/PolicyConfig"
    },
    "operator": {
      "$ref": "#/$defs/OperatorConfig"
    },
    "anchor": {
      "$ref": "#/$defs/AnchorConfig"
    },
    "session": {
      "$ref": "#/$defs/SessionConfig"
    },
    "token": {
      "$ref": "#/$defs/TokenConfig"
    },
    "provider": {
      "title": "Provider",
      "anyOf": [
        {
          "type": "string",
          "description": "The name of one of providers."
        },
        {
          "$ref": "#/$defs/ProviderConfig"
        }
      ]
    },
    "providers": {
      "additionalProperties": {
        "$ref": "#/$defs/ProviderConfig"
      },
      "title": "Providers",
      "type": "object"
    },
    "proxy": {
      "$ref": "#/$defs/ProxyConfig"
    },
    "features": {
      "$ref": "#/$defs/Features"
    },
    "plugins": {
      "$ref": "#/$defs/PluginsConfig"
    },
    "secrets": {
      "additionalProperties": {
        "additionalProperties": true,
        "type": "object"
      },
      "title": "Secrets",
      "type": "object"
    },
    "agents": {
      "additionalProperties": {
        "$ref": "#/$defs/AgentConfig"
      },
      "title": "Agents",
      "type": "object"
    },
    "presets": {
      "additionalProperties": {
        "$ref": "#/$defs/PresetSettings"
      },
      "title": "Presets",
      "type": "object"
    },
    "harvest": {
      "title": "Harvest",
      "anyOf": [
        {
          "default": false,
          "type": "boolean"
        },
        {
          "type": "string",
          "pattern": "\\$\\{"
        }
      ]
    },
    "include": {
      "description": "Config files or globs to merge below this one, relative to it.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    "host": {
      "default": "127.0.0.1",
      "title": "Host",
      "type": "string",
      "deprecated": true,
      "description": "Write server.host."
    },
    "port": {
      "title": "Port",
      "anyOf": [
        {
          "default": 8000,
          "maximum": 65535,
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "string",
          "pattern": "\\$\\{"
        }
      ],
      "deprecated": true,
      "description": "Write server.port."
    },
    "tls": {
      "$ref": "#/$defs/TLSConfig",
      "deprecated": true,
      "description": "Write server.tls."
    },
    "log_level": {
      "default": "info",
      "title": "Level",
      "type": "string",
      "deprecated": true,
      "description": "Write log.level."
    },
    "logging": {
      "default": "text",
      "title": "Format",
      "type": "string",
      "deprecated": true,
      "description": "Write log.format."
    },
    "log_file": {
      "default": "",
      "title": "File",
      "type": "string",
      "deprecated": true,
      "description": "Write log.file."
    },
    "detector": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string"
            }
          }
        },
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              }
            }
          }
        }
      ],
      "deprecated": true,
      "description": "Write detectors, with an entry per detector."
    },
    "audit": {
      "type": "object",
      "deprecated": true,
      "description": "Write features.audit, and proxy.tap and proxy.tap_dir.",
      "properties": {
        "enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "path": {
          "type": "string"
        },
        "tap": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        },
        "tap_dir": {
          "type": "string"
        },
        "prices": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ModelPrice"
          }
        }
      },
      "additionalProperties": false
    },
    "tracing": {
      "type": "object",
      "deprecated": true,
      "description": "Write features.tracing.",
      "properties": {
        "enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "pattern": "\\$\\{"
            }
          ]
        }
      },
      "additionalProperties": false
    }
  },
  "title": "Settings",
  "type": "object"
}
