Implementation: DESIGN (server) · Exposure: PUBLIC PREVIEW (contract). The Agency API is not live yet. This page describes the published v0.3 contract so you can review and build against it; details may change before alpha.

What it is

The Agency API is the public developer surface for the Allternit agent kernel. You send a goal. The service compiles it into explicit internal contracts (a task, agent state, a compute graph, policy, verification) and returns one durable Run that you can stream, steer, pause, cancel, audit and replay. The contract summary is: goal in, one durable verified Run out. Only goal is required. Everything else has a resolved, recorded default. What comes back is one durable object you can observe and control for the life of the work.

Availability

No endpoint on this page is live. The alpha opens only after one end-to-end run can survive restart, resume, verify, replay and receipt-backed completion. That gate is not met today: the public endpoint and the request compiler are not served, the conformance suite is not built, and no end-to-end bug-fix run has passed the gate. Inside the kernel, the signed receipt chain (effect receipts) and recorded-only replay are on main, internal only, and work-runtime runs have no public event stream yet. See what is live today. Use this reference to understand the shape of the API and to plan an integration. Do not build production systems against it yet.
Example values throughout this reference (IDs, capability and model class names, amounts, dates, default values) are illustrative. The structure and field names follow the contract.

Agents API vs Agency API

An Agent is configuration and identity. Agency is execution of work.

Simple outside, explicit inside

The request can be small because the server makes everything explicit before it runs anything.
  • Only goal is required. Workspace, authority, budget and completion are optional.
  • Defaults are resolved, recorded and returned. Whatever you omit is filled from the agent’s and profile’s versioned defaults and returned on Run.resolved before execution starts. The run stays accepted until that is recorded.
  • No hidden permissive defaults. If a safe default cannot be resolved, the call fails with 422 ERR_DEFAULTS_UNRESOLVABLE and no run executes.
  • No implicit loop. The service never runs a free-form agent loop. It compiles the request into contracts and executes those.
  • Kernel internals stay out of the default view. Which model, decision backend, graph branch, tool schema, cache or verifier ran is recorded in receipts and shown with view=debug. None of it is a required field or part of a default response.
  • No model or vendor names. Models are interchangeable components. You constrain by capability, model class, locality and trust class.
Two enforcement settings are always on for runs created here and cannot be disabled by a client: the judge fails closed, and completion is owned by the verifier. They are reported on Run.resolved.enforcement.

Progressive disclosure

The API has four tiers. Most integrations only need the first. Tier C and D fields are marked x-disclosure-tier in the OpenAPI file. Runtime hints never change semantics, eligibility, policy or evidence. Graph input is treated as opaque until the public Graph contract is frozen.

Object model

There is no Thread API. thread_id is a correlation ID only, and messages arrive as run.message events.

Base URL

This is the planned production endpoint. It does not serve these routes yet. The major version is in the path (/v1).

Authentication

Send an API key as a bearer token. Keys are scoped to one workspace or organization.
OAuth 2.0 client credentials is planned for machine-to-machine clients, with these scopes: GET /.well-known/jwks.json needs no authentication. It serves the public keys used to verify receipts.

Common headers

Request

Response

Pagination

Every list endpoint is cursor-paginated. Every list response has this envelope:

The minimal call

The smallest valid request has one field.
The service persists the run and returns 202 Accepted with the Run. Everything the server resolved for you is in resolved.
The fully explicit equivalent of the same request:
When you supply all four, resolved.defaults_source is request. Supplying a field overrides the default. It never widens authority beyond your entitlement or hard policy.

Endpoints

Product laws

These hold for every call.
  1. The API is not the kernel. HTTP, an SDK or local IPC may all drive the same kernel.
  2. The request may be simple only because the server compiles it into explicit internal contracts.
  3. The external agent identity does not reveal internal components unless you ask for debug or receipt views.
  4. Models cannot own permission, lifecycle, completion, durable truth or policy.
  5. No unattended executor may bypass policy because its own harness is in a yolo or auto-approve mode.
  6. Hard policy comes before probabilistic judgment. Probabilistic systems may raise friction but cannot weaken a hard deny.
  7. Completion is owned by the verifier and the system, not by the model that did the work.
  8. Effectful retries require idempotency receipts.
  9. Run state survives model eviction, cache loss, executor death and process restart.
  10. Every material transition is observable through typed events and receipts.
  11. No model or vendor names in the contract.
  12. Judge failure fails closed: a timeout, missing calibration or low confidence becomes an ask, never an allow.
  13. Agents request attention. They never notify people directly.
  14. Replays never cause effects.
  15. Untrusted input stays fenced and is never concatenated into control instructions.
  16. Grants are explicit, scoped and expire with the run.
  17. Receipts are append-only.

OpenAPI file

The full contract is available as an OpenAPI 3.1 file:

Download openapi-v0.3.yaml

Allternit Agency API v0.3 (preview contract)

Next