Contracts
A contract is the core unit of AIPC. It is a machine-readable set of rules that travels alongside data and tells any AI agent exactly how that data must be presented.
What is a contract?
Today, when a developer integrates a data API, they read the documentation, understand the compliance requirements, and build a UI that enforces them. A contract encodes those same requirements in a format that AI agents can interpret programmatically — no human in the loop required.
The envelope structure
Every AIPC-compliant API response is wrapped in an envelope with three top-level fields:
{
"aipc_version": "0.1.0",
"provider": { ... },
"contract": { ... },
"payload": { ... }
}
| Field | Purpose |
|---|---|
aipc_version | The protocol version this response conforms to. |
provider | Metadata about the data provider: id, name, authority, contract version, terms URL. |
contract | The presentation rules: disclosures, display rules, attribution, freshness, tone, conditionals, and fail behavior. |
payload | The actual data. Any JSON object. The contract references fields inside the payload by dot-notation paths. |
Contract sections
The contract object contains these sections:
- Disclosures — text that must appear alongside data (e.g., legal disclaimers)
- Display Rules — formatting instructions for individual fields (e.g., show as percentage with 2 decimal places)
- Attribution — source credit the AI must include
- Freshness — when the data expires and what to do when it does
- Tone — restrictions on how the AI frames the data
- Conditionals — rules that activate based on field values or user context
- Fail Behavior — what happens when the AI cannot satisfy a required rule
Design principles
Contracts follow three guiding principles:
- Data-carries-rules. The compliance requirements travel with the data, not in external documentation. This means any consumer — human or AI — receives the rules automatically.
- Fail-safe by default. If an AI agent cannot satisfy a required disclosure, the default behavior is to suppress the data entirely. Silence is safer than misinformation.
- Provider authority. The data provider writes the contract. The AI agent must comply. The consumer cannot override required rules.