{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://weverlabs.com/schemas/agent-trust-profile.schema.json",
  "title": "Agent Trust Profile",
  "description": "Public-safe profile used to register an external agent, system, or agentic business before quote, credit, and paid Work Order access.",
  "type": "object",
  "required": [
    "profile_type",
    "agent_name",
    "operator_contact",
    "system_url",
    "purpose",
    "requested_capabilities",
    "data_policy",
    "review_status",
    "created_at"
  ],
  "additionalProperties": true,
  "properties": {
    "profile_id": {
      "type": "string"
    },
    "profile_type": {
      "type": "string",
      "const": "agent_trust_profile"
    },
    "agent_name": {
      "type": "string"
    },
    "operator_contact": {
      "type": "object",
      "required": [
        "name",
        "email"
      ],
      "additionalProperties": true,
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "organization": {
          "type": "string"
        }
      }
    },
    "system_url": {
      "type": "string",
      "format": "uri"
    },
    "documentation_url": {
      "type": "string",
      "format": "uri"
    },
    "agent_card_url": {
      "type": "string",
      "format": "uri"
    },
    "purpose": {
      "type": "string"
    },
    "requested_capabilities": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "requested_tools": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "packetops",
          "distributionops",
          "tokenops",
          "wever_labs_os"
        ]
      }
    },
    "callback": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "callback_url": {
          "type": "string",
          "format": "uri"
        },
        "events_requested": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "data_policy": {
      "type": "object",
      "required": [
        "allowed_data_modes",
        "public_safe_statement"
      ],
      "additionalProperties": true,
      "properties": {
        "allowed_data_modes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "public_safe_demo",
              "metadata_only",
              "client_provided_context",
              "production_connected_after_review"
            ]
          }
        },
        "public_safe_statement": {
          "type": "string"
        },
        "prohibited_inputs_acknowledged": {
          "type": "boolean"
        }
      }
    },
    "payment_posture": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "quote_required": {
          "type": "boolean"
        },
        "preferred_settlement_track": {
          "type": "string"
        },
        "credit_ledger_required": {
          "type": "boolean"
        }
      }
    },
    "trust_level": {
      "type": "string",
      "enum": [
        "unreviewed",
        "registered",
        "reviewed",
        "trusted",
        "suspended"
      ]
    },
    "risk_tier": {
      "type": "string",
      "enum": [
        "low",
        "medium",
        "high",
        "unknown"
      ]
    },
    "review_status": {
      "type": "string",
      "enum": [
        "submitted",
        "in_review",
        "approved",
        "needs_more_information",
        "declined",
        "suspended"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
