{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://calvinkennedy.com/writing/ai-agent-gold-rush-control-layer/agent-operating-contract.schema.json",
  "title": "Bounded Agent Operating Contract",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "version",
    "domain",
    "goal",
    "maximumAuthority",
    "externalEffect",
    "maximumLossAud",
    "evidenceTtlMinutes",
    "verifier",
    "retryRule",
    "stopConditions"
  ],
  "properties": {
    "version": {
      "const": "1.0"
    },
    "domain": {
      "type": "string",
      "minLength": 1
    },
    "goal": {
      "type": "string",
      "minLength": 1
    },
    "maximumAuthority": {
      "enum": [
        "A0",
        "A1",
        "A2",
        "A3",
        "A4"
      ]
    },
    "externalEffect": {
      "enum": [
        "none",
        "reversible",
        "irreversible"
      ]
    },
    "maximumLossAud": {
      "type": "number",
      "minimum": 0
    },
    "evidenceTtlMinutes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1440
    },
    "verifier": {
      "enum": [
        "independent",
        "human",
        "same-system"
      ]
    },
    "retryRule": {
      "type": "string",
      "minLength": 1
    },
    "stopConditions": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    },
    "requiredEvidence": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  }
}
