{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "The frontmatter of a floor agent file",
  "type": "object",
  "properties": {
    "model": {
      "type": "string",
      "description": "The model the agent runs on."
    },
    "image": {
      "type": "string",
      "description": "The container image the agent runs in. Required in a file that defines an agent."
    },
    "timeout_minutes": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "How long a visit may run, in minutes. Required in a file that defines an agent."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Which cluster agents may run it. A cluster agent claims a visit only when it offers every tag."
    },
    "prices": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "input_per_million": {
            "type": "number",
            "description": "US dollars for a million input tokens."
          },
          "output_per_million": {
            "type": "number",
            "description": "US dollars for a million output tokens."
          },
          "cache_read_per_million": {
            "type": "number",
            "description": "US dollars for a million tokens read from the cache. The input price when not stated."
          },
          "cache_write_per_million": {
            "type": "number",
            "description": "US dollars for a million tokens written to the cache. The input price when not stated."
          }
        },
        "required": [
          "input_per_million",
          "output_per_million"
        ],
        "additionalProperties": false
      },
      "description": "Model name to what it costs, for a model that reports tokens and no cost."
    },
    "config": {
      "type": "object",
      "properties": {
        "skills": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Names of the skills the agent is given."
        },
        "skills_source": {
          "type": "string",
          "format": "uri",
          "description": "The address the pod downloads the agent's skills from, usually the host's skills service. Without it the pod asks the floor, which has no skills to give."
        },
        "mcp_servers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "description": "The name the agent knows the server by."
              },
              "transport": {
                "type": "string",
                "enum": [
                  "stdio",
                  "http",
                  "sse"
                ],
                "description": "How the server is reached. `stdio` is a process the pod starts. `http` and `sse` are an address it calls."
              },
              "command": {
                "type": "string",
                "minLength": 1,
                "description": "`stdio` only, and required there. The command that starts the server."
              },
              "args": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "`stdio` only. The command's arguments."
              },
              "url": {
                "type": "string",
                "format": "uri",
                "description": "`http` and `sse` only, and required there. The server's address."
              },
              "headers_secret": {
                "type": "string",
                "minLength": 1,
                "description": "The key in `agent-secrets`, the Kubernetes Secret in the agents' namespace, holding one whole header line, such as `Authorization: Bearer <token>`."
              },
              "headers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "description": "The name of the header or environment variable."
                    },
                    "ref": {
                      "type": "string",
                      "minLength": 1,
                      "description": "The key in `agent-secrets`, the Kubernetes Secret in the agents' namespace, whose value it gets."
                    }
                  },
                  "required": [
                    "name",
                    "ref"
                  ],
                  "additionalProperties": false
                },
                "description": "`http` and `sse` only. Headers sent to the server, each taking its value from a key in `agent-secrets`."
              },
              "env": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "description": "The name of the header or environment variable."
                    },
                    "ref": {
                      "type": "string",
                      "minLength": 1,
                      "description": "The key in `agent-secrets`, the Kubernetes Secret in the agents' namespace, whose value it gets."
                    }
                  },
                  "required": [
                    "name",
                    "ref"
                  ],
                  "additionalProperties": false
                },
                "description": "`stdio` only. Environment variables of the server's process, each taking its value from a key in `agent-secrets`."
              }
            },
            "required": [
              "name",
              "transport"
            ],
            "additionalProperties": false
          },
          "description": "The MCP servers the agent can call."
        },
        "disallowed_tools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Tools the agent may not use."
        },
        "env": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "string"
          },
          "description": "Environment variables of the agent, as plain values."
        },
        "permission_mode": {
          "type": "string",
          "enum": [
            "auto",
            "bypass"
          ],
          "description": "`bypass` (the default) lets the agent run any tool without asking. `auto` keeps the CLI's own permission checks, so in the pod, where nobody can answer, an action that needs approval is refused."
        },
        "max_turns": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991,
          "description": "The most turns the agent takes in one visit."
        },
        "model_secret_key": {
          "type": "string",
          "minLength": 1,
          "description": "Which key in `agent-secrets`, the Kubernetes Secret in the agents' namespace, holds the model's API key. Without it, the key the install sets for the model's family is used."
        },
        "pod_resources": {
          "type": "object",
          "properties": {
            "requests": {
              "type": "object",
              "properties": {
                "cpu": {
                  "type": "string",
                  "pattern": "^\\d+(\\.\\d+)?(m|k|M|G|T|Ki|Mi|Gi|Ti)?$",
                  "description": "A Kubernetes quantity, such as `500m`."
                },
                "memory": {
                  "type": "string",
                  "pattern": "^\\d+(\\.\\d+)?(m|k|M|G|T|Ki|Mi|Gi|Ti)?$",
                  "description": "A Kubernetes quantity, such as `2Gi`."
                },
                "ephemeral-storage": {
                  "type": "string",
                  "pattern": "^\\d+(\\.\\d+)?(m|k|M|G|T|Ki|Mi|Gi|Ti)?$",
                  "description": "A Kubernetes quantity, such as `6Gi`."
                }
              },
              "additionalProperties": false,
              "description": "What the pod asks for."
            },
            "limits": {
              "type": "object",
              "properties": {
                "cpu": {
                  "type": "string",
                  "pattern": "^\\d+(\\.\\d+)?(m|k|M|G|T|Ki|Mi|Gi|Ti)?$",
                  "description": "A Kubernetes quantity, such as `500m`."
                },
                "memory": {
                  "type": "string",
                  "pattern": "^\\d+(\\.\\d+)?(m|k|M|G|T|Ki|Mi|Gi|Ti)?$",
                  "description": "A Kubernetes quantity, such as `2Gi`."
                },
                "ephemeral-storage": {
                  "type": "string",
                  "pattern": "^\\d+(\\.\\d+)?(m|k|M|G|T|Ki|Mi|Gi|Ti)?$",
                  "description": "A Kubernetes quantity, such as `6Gi`."
                }
              },
              "additionalProperties": false,
              "description": "What the pod may not exceed."
            }
          },
          "additionalProperties": false,
          "description": "The resources of the agent's container. With none, the cluster's default applies."
        }
      },
      "additionalProperties": {},
      "description": "Settings for the agent's pod. A key the floor does not know is kept and not acted on."
    }
  },
  "additionalProperties": false
}
