Semantic Contract
A semantic contract is a formal, machine-readable declaration of what an interface interaction means, what it requires, and what it guarantees. AXAG annotations express semantic contracts.
Contract vs Description
A description tells you about something. A contract binds you to something.
When AXAG declares axag-preconditions='["cart_validated"]', this is not informational — it is contractual. It means:
- The operation MUST NOT be invoked unless
cart_validatedis true - The manifest MUST include this precondition
- The tool definition MUST surface this constraint
- The agent runtime MUST validate this before execution
Contract Components
Every AXAG semantic contract consists of:
- Identity — Intent and entity declarations
- Interface — Parameters, types, and constraints
- Preconditions — Required state before execution
- Postconditions — Guaranteed state after execution
- Safety — Risk level, confirmation, approval requirements
- Execution semantics — Action type, idempotency, side effects
Contract Lifecycle
Contracts are authored by frontend engineers, validated by CI, transformed into manifests and tools, consumed by agents, and monitored for drift.