A JSON Schema for defining AI agent work as a verifiable commitment instead of a task.
When work goes to an agent or any other executor, it needs a durable spec: what "done" means, who can act, and what must not happen. That spec has to survive handoffs. If it lives only in thread context, every new worker rebuilds intent from fragments and the organization re-explains the same constraints again.
npm install commitment-schemaimport { readFileSync } from "node:fs";
import { validateCommitment } from "commitment-schema";
const raw = readFileSync("examples/refactor-handler.json", "utf8");
const payload: unknown = JSON.parse(raw);
const { valid, errors } = validateCommitment(payload);
if (!valid) {
console.error("Invalid commitment:");
for (const message of errors) {
console.error(message);
}
process.exit(1);
}
console.log("Commitment is valid.");- outcome: what must become true in the world when this is settled.
- verifier: how an observer decides the outcome was reached, without re-litigating intent (success metric).
- boundary: what must not happen while pursuing the outcome.
- authority: who may execute, delegate, or sign acceptance.
- budget: resources consumed along the way (money, time, tokens, headcount, riskAppetite; at least one required).
- deadline: when the commitment expires or must escalate (ISO 8601 date-time).
- failureBehavior: what happens when verification fails or budget is exhausted (
escalate,retry_narrower_scope,spend_contingency_budget,halt_and_surface_conflict). - amendmentOwner: who may revise the commitment.
Background: The Fully Agentic Company: The One Part No Agent Will Ever Run
MIT