{
  "$defs": {
    "AgentAccessSetting": {
      "additionalProperties": false,
      "properties": {
        "ownership": {
          "default": "shared",
          "enum": [
            "shared",
            "personal"
          ],
          "title": "Ownership",
          "type": "string"
        },
        "tools": {
          "items": {
            "maxLength": 256,
            "minLength": 1,
            "type": "string"
          },
          "title": "Tools",
          "type": "array"
        },
        "policy": {
          "default": "allow",
          "enum": [
            "allow",
            "require_approval",
            "deny"
          ],
          "title": "Policy",
          "type": "string"
        }
      },
      "title": "AgentAccessSetting",
      "type": "object"
    },
    "AgentDefinitionSource": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "enum": [
            "agent_document",
            "agents_md",
            "agent_md",
            "agent_skill",
            "skill_md",
            "skills_md",
            "skill_asset",
            "eval_md"
          ],
          "title": "Kind",
          "type": "string"
        },
        "path": {
          "title": "Path",
          "type": "string"
        },
        "content": {
          "title": "Content",
          "type": "string"
        },
        "digest": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Digest"
        },
        "encoding": {
          "default": "utf-8",
          "enum": [
            "utf-8",
            "base64"
          ],
          "title": "Encoding",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "path",
        "content"
      ],
      "title": "AgentDefinitionSource",
      "type": "object"
    },
    "AgentDocumentBudget": {
      "additionalProperties": false,
      "properties": {
        "max_calls": {
          "anyOf": [
            {
              "maximum": 1000000000,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Max Calls"
        },
        "max_tokens": {
          "anyOf": [
            {
              "maximum": 1000000000,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Max Tokens"
        }
      },
      "title": "AgentDocumentBudget",
      "type": "object"
    },
    "AgentSetup": {
      "additionalProperties": false,
      "properties": {
        "packages": {
          "$ref": "#/$defs/AgentSetupPackages"
        },
        "commands": {
          "items": {
            "maxLength": 4000,
            "type": "string"
          },
          "maxItems": 50,
          "title": "Commands",
          "type": "array"
        },
        "repos": {
          "items": {
            "$ref": "#/$defs/AgentSetupRepo"
          },
          "maxItems": 20,
          "title": "Repos",
          "type": "array"
        }
      },
      "title": "AgentSetup",
      "type": "object"
    },
    "AgentSetupPackages": {
      "additionalProperties": false,
      "properties": {
        "pip": {
          "items": {
            "type": "string"
          },
          "maxItems": 100,
          "title": "Pip",
          "type": "array"
        },
        "npm": {
          "items": {
            "type": "string"
          },
          "maxItems": 100,
          "title": "Npm",
          "type": "array"
        }
      },
      "title": "AgentSetupPackages",
      "type": "object"
    },
    "AgentSetupRepo": {
      "additionalProperties": false,
      "properties": {
        "url": {
          "maxLength": 2048,
          "title": "Url",
          "type": "string"
        },
        "path": {
          "maxLength": 512,
          "title": "Path",
          "type": "string"
        },
        "git_credential": {
          "anyOf": [
            {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Git Credential"
        }
      },
      "required": [
        "url",
        "path"
      ],
      "title": "AgentSetupRepo",
      "type": "object"
    },
    "AgentToolCapabilities": {
      "additionalProperties": false,
      "properties": {
        "bash": {
          "$ref": "#/$defs/BuiltInToolSetting"
        },
        "workspace": {
          "$ref": "#/$defs/BuiltInToolSetting"
        },
        "agents": {
          "$ref": "#/$defs/BuiltInToolSetting"
        },
        "memory": {
          "$ref": "#/$defs/MemoryToolSetting"
        },
        "web_search": {
          "$ref": "#/$defs/BuiltInToolSetting"
        },
        "web_fetch": {
          "$ref": "#/$defs/BuiltInToolSetting"
        }
      },
      "title": "AgentToolCapabilities",
      "type": "object"
    },
    "AgentWebCapabilities": {
      "additionalProperties": false,
      "properties": {
        "provider": {
          "anyOf": [
            {
              "const": "sikaru",
              "type": "string"
            },
            {
              "$ref": "#/$defs/ConnectionToolRef"
            }
          ],
          "default": "sikaru",
          "title": "Provider"
        },
        "allow_domains": {
          "items": {
            "type": "string"
          },
          "maxItems": 100,
          "title": "Allow Domains",
          "type": "array"
        },
        "block_domains": {
          "items": {
            "type": "string"
          },
          "maxItems": 100,
          "title": "Block Domains",
          "type": "array"
        }
      },
      "title": "AgentWebCapabilities",
      "type": "object"
    },
    "BuiltInToolSetting": {
      "additionalProperties": false,
      "properties": {
        "enabled": {
          "default": true,
          "title": "Enabled",
          "type": "boolean"
        },
        "policy": {
          "default": "allow",
          "enum": [
            "allow",
            "require_approval",
            "deny"
          ],
          "title": "Policy",
          "type": "string"
        }
      },
      "title": "BuiltInToolSetting",
      "type": "object"
    },
    "ConnectionToolRef": {
      "additionalProperties": false,
      "description": "A tool from a Composio or MCP connection granted to this agent.",
      "properties": {
        "connection_id": {
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$",
          "title": "Connection Id",
          "type": "string"
        },
        "tool": {
          "maxLength": 256,
          "minLength": 1,
          "title": "Tool",
          "type": "string"
        }
      },
      "required": [
        "connection_id",
        "tool"
      ],
      "title": "ConnectionToolRef",
      "type": "object"
    },
    "MemoryToolSetting": {
      "additionalProperties": false,
      "properties": {
        "enabled": {
          "default": true,
          "title": "Enabled",
          "type": "boolean"
        },
        "policy": {
          "default": "allow",
          "enum": [
            "allow",
            "require_approval",
            "deny"
          ],
          "title": "Policy",
          "type": "string"
        },
        "shared": {
          "default": true,
          "title": "Shared",
          "type": "boolean"
        },
        "user": {
          "default": true,
          "title": "User",
          "type": "boolean"
        }
      },
      "title": "MemoryToolSetting",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "Validate parsed YAML frontmatter. Server validation also checks mentions, resources, models, and project ceilings.",
  "properties": {
    "model": {
      "anyOf": [
        {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Model"
    },
    "budget": {
      "anyOf": [
        {
          "$ref": "#/$defs/AgentDocumentBudget"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "tools": {
      "$ref": "#/$defs/AgentToolCapabilities"
    },
    "web": {
      "$ref": "#/$defs/AgentWebCapabilities"
    },
    "setup": {
      "$ref": "#/$defs/AgentSetup"
    },
    "access": {
      "patternProperties": {
        "^@(app|mcp|secret|skill|agent)/[A-Za-z0-9][A-Za-z0-9_-]*$": {
          "$ref": "#/$defs/AgentAccessSetting"
        }
      },
      "title": "Access",
      "type": "object"
    },
    "sources": {
      "items": {
        "$ref": "#/$defs/AgentDefinitionSource"
      },
      "maxItems": 100,
      "title": "Sources",
      "type": "array"
    }
  },
  "title": "Sikaru agent document frontmatter",
  "type": "object",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://sikaru.ai/schemas/agent-document.json"
}
