Five built-in schemas — Agent, Entity, Relationship, Context, Registry — give multi-agent systems a shared vocabulary for delegation, trust, and authority. Define your own schemas in the same idiom.
import { schemas, validateAuthority } from "jsontology"; // Validate an agent's shape and trust rules: const agent = { id: "agent-alpha", label: "Agent Alpha", role: "orchestrator", trust: { score: 0.95, level: "authoritative" }, }; schemas.Agent.validate(agent); // { valid: true, errors: [] } // Catch unauthorized spawns before they run: const registry = { id: "reg-prod", name: "Prod Registry", governance: "authoritative", entries: [{ id: "agent-alpha", type: "agent" }], }; validateAuthority({ agent: { id: "agent-pierre", label: "Pierre", role: "delegate" }, registry }); // { valid: false, errors: [{ code: "unauthorized_spawn", ... }] } // jsontology reports; your orchestrator enforces.
Click any schema to explore its properties. Blue dots are required fields. Click object-type fields to expand nested properties.
required field optional field ▸ click object fields to expand
| Function | Returns | What it does |
|---|---|---|
schemas.X.validate(data) | { valid, errors } | Validate against a built-in schema. Errors carry path, code, and message. |
validate(schema, data) | { valid, errors } | Validate any object against any schema. Same return shape as above. |
defineOntology(schema, rules?) | DefinedOntology | Define a typed, frozen schema with optional cross-field rules. Requires $id, title, description. Returns schema with bound .validate(). |
validateAuthority(req) | { valid, errors } | Validate a proposed agent spawn against a registry contract. Catches unauthorized agents and authority mismatches. |
import { defineOntology } from "jsontology"; import type { Rule } from "jsontology"; const budgetRule: Rule = (data) => (data.amount as number) > (data.limit as number) ? [{ path: "$.amount", code: "exceeds_limit", message: "amount exceeds limit" }] : []; const HandoffSchema = defineOntology({ $id: "my-app/handoff", title: "Agent Handoff", description: "Task delegation from one agent to another", type: "object", required: ["from", "to", "task"], properties: { from: { type: "string" }, to: { type: "string" }, task: { type: "string" }, ttl: { type: "number", minimum: 0 }, }, $delegation: "explicit", $governance: "authoritative", }); HandoffSchema.validate({ from: "a", to: "b", task: "summarise" }); // { valid: true, errors: [] }
Annotations are metadata — they do not affect validation. They provide interoperability context for registries and agent systems.
| Field | Values | Meaning |
|---|---|---|
$authority | string | Who asserts this schema's authority |
$delegation | "explicit" | "implicit" | "none" | Delegation model for this schema type |
$trust | "public" | "private" | "federated" | Trust boundary for schema instances |
$governance | "authoritative" | "federated" | "consensus" | "open" | How schema entries are validated |
$registry | string | ID of the governing registry |
Digital Solution Delivery designs and hardens jsontology-powered agent schemas — delegation contracts, registries, and validation pipelines — for teams putting multi-agent systems into production.