Deployment Contract v1alpha1
Updated: 20 November 2026
The contract describes what should run in a project. plan_deployment checks it strictly: unknown fields are an error (VALIDATION_FAILED), each with its path and, where obvious, the intended field: image directly on the service gives services[0].image: unknown field "image"; did you mean "source.image"? with an example as a hint, as do names from Docker Compose or Kubernetes (memory, environment, command, ports, volumes, replicas, healthcheck) and typos, including swapped letters and a missing unit (memroy in resources gives did you mean "memory_mb"?). The contract's schema with all fields and allowed values is also in the input schema of plan_deployment and apply_deployment, which an agent gets with the tool list. Fields the platform cannot handle yet are rejected with CAPABILITY_UNSUPPORTED instead of being silently ignored.
Structure
{
"api_version": "v1alpha1",
"runtime_class": "starter",
"region": "eu-central",
"budget": { "hard_eur_month": 8, "soft_eur_month": 6, "on_exceed": "scale_to_zero", "plan_against": "max" },
"rollback": { "auto": true, "on": ["health_check_failed", "crash_loop"], "window_s": 300 },
"services": [ { "name": "web", "source": { "type": "image", "image": "…" } } ]
}Top level
| Field | Values | Default | Note |
|---|---|---|---|
api_version | v1alpha1 | – | Required |
runtime_class | starter | starter | production → CAPABILITY_UNSUPPORTED |
region | eu-central | eu-central | |
budget.hard_eur_month | ≥ 0 | – | Can only lower the project budget |
budget.soft_eur_month | 0 to hard | 80 % of hard | Warning above it |
budget.on_exceed | block_new, scale_to_zero, stop | scale_to_zero | Checked every minute; scale_to_zero works like stop for now |
budget.plan_against | max, typical | max | What the plan checks the budget against: max (24/7) or typical (services with scale-to-zero 176 h per month); with typical the hard budget stops the project at runtime when it is reached (budgets) |
rollback.auto | bool | true | |
rollback.on | health_check_failed, crash_loop, error_rate | the first two | error_rate has no effect yet |
rollback.window_s | 30–3600 | 300 | |
rollback.error_rate_threshold | 0–1 | – | CAPABILITY_UNSUPPORTED |
services | 1–10 entries | – | Required |
Service
| Field | Values | Default | Note |
|---|---|---|---|
name | ^[a-z][a-z0-9-]{1,30}$ | – | Required, unique |
source | see below | – | Required |
port | 1–65535 | 8080 | Passed to the app as PORT; leave out with health.type: process |
start_command | list of strings | – | Replaces entrypoint and command |
resources.memory_mb | 128, 256, 512, 1024, 2048, 4096 | 256 | Upper limit depends on the trust level |
resources.cpu | shared-0.25, shared-0.5, shared-1 | shared-0.25 | |
health.type | http, tcp, process | http | http expects 2xx or 3xx; process = worker without port and URL, healthy as long as the process runs after the start-up time |
health.path | starts with / | / | |
health.interval_s | 1–300 | 10 | |
health.timeout_s | 1–60 | 2 | |
health.grace_period_s | 1–600 | 60 (worker: 10, with a volume: 180) | Longest start-up time: the instance counts as started as soon as the check passes; if it has not passed by then, HEALTH_CHECK_FAILED |
env | name ^[A-Z][A-Z0-9_]{0,63}$, value ≤ 4096 characters | – | PORT is reserved; no secrets, use secrets for those |
availability.scale_to_zero | bool | false | true: the public service sleeps without requests and is woken by the next one; without it, it runs all the time (scale-to-zero) |
availability.idle_timeout_min | 5–1440 | 15 | Minutes without a request until it sleeps |
availability.min_instances | 0, 1 | 0 | |
availability.max_instances | 1–3 | 1 | That many instances always run, on different runners where there is room; costs N times as much. Above 3 → VALIDATION_FAILED, with a volume, job or scale_to_zero → CAPABILITY_UNSUPPORTED (Several instances) |
domains.subdomain | ^[a-z0-9-]{3,40}$ | <service>-<project> | |
domains.custom | list of hostnames, at most 5 per service | – | Custom domains, only for public services, at trust level 1 or higher; a domain only once per contract. See connect your own domain |
public | bool | true (worker: false) | false = no public URL, reachable only via connects_to |
access | account, public | account | Only for public services: account = only signed-in members of your account, public = everyone. See security |
waf | block, detect | block | Only for public services: block = the edge rejects unambiguous attacks with 403 (WAF_BLOCKED), detect = it only logs. See limits › protection filter |
connects_to | names of other services in this contract, or <service>.<project> | – | The service may reach these services as <service>.<project>.internal on their port (TCP only); everything else stays blocked. Target not in the contract, the service itself, duplicate or a worker → VALIDATION_FAILED. <service>.<project> names a service of another project of your account that shares itself via shared_with (at most 5; otherwise plan CONNECTION_NOT_SHARED). See network |
shared_with | slugs of other projects of your account | – | These projects may reach the service via connects_to: ["<service>.<this project>"]; at most 10, only services with a port. The owner confirms a new share by an agent with a passkey. See between your projects |
secrets | list of names as for env, at most 50 | – | Set values beforehand with set_secrets; passed in as environment variables. Not set → VALIDATION_FAILED. Not PORT, not also in env |
egress.mode | internet, allowlist | internet | allowlist: the service reaches only the hosts in egress.allow outside. See network |
egress.allow | at most 50 hostnames such as api.stripe.com or *.github.com | – | Only with allowlist, then required. *.github.com covers all names below it, not github.com itself. No IP addresses or networks, no wildcard for a whole ending (*.com) → VALIDATION_FAILED |
schedule | { cron, command?, timeout_s? (1–3600), timezone? } | – | Makes the service a job: no permanently running instance, no port, no URL; at every time of the cron expression command (default start_command, otherwise the image) runs once, at most one run per minute, runs never overlap. timeout_s default 600, timezone default Europe/Berlin. Not together with port, public, access, health, availability, domains (VALIDATION_FAILED) or storage (CAPABILITY_UNSUPPORTED). See jobs |
storage.volumes | at most 2 per service: name ^[a-z][a-z0-9-]{1,30}$, mount_path absolute, size_gb 1–100 | – | Persistent storage, €0.15/GB-month as long as the volume exists. Data persists across deployments, restarts and rollbacks. Not under /bin, /boot, /dev, /etc, /lib*, /proc, /run, /sbin, /sys, /usr; paths must not be nested. Growing works, shrinking does not (VOLUME_SHRINK). Leaving it out removes the volume after approval; it is kept free of charge for 7 days and comes back if it is in the contract again (VOLUME_REMOVAL). A service with a volume is replaced on deployment: the old instance stops, then the new one starts. If get_platform_info shows volumes.available: false, you get CAPABILITY_UNSUPPORTED |
Sources
Ready-made image
{ "type": "image", "image": "ghcr.io/acme/app:1.2.3" }OCI reference with tag or digest, linux/amd64. Pinned to a digest at planning.
From a private registry with pull_secret, the name of a secret of the service with the value user:token:
{ "type": "image", "image": "ghcr.io/acme/app:1.2.3", "pull_secret": "REGISTRY_AUTH" }Set the secret beforehand with set_secrets; it is not passed in as an environment variable. Not set or without : → VALIDATION_FAILED, rejected by the registry → REGISTRY_AUTH_FAILED. See ready-made image.
Follow new images of the tag automatically with auto_deploy:
{ "type": "image", "image": "ghcr.io/acme/app:main", "auto_deploy": { "track": "tag" } }track is tag (default, follow the tag in image) or a version pattern such as 1.x / 1.4.x (highest matching version MAJOR.MINOR.PATCH, the tag in image is the start version), approval is none (default, roll out at once) or owner (every new image waits for a passkey approval, 24 hours). image needs a tag, not a digest (VALIDATION_FAILED); not for upload. See auto-deploy.
Upload of a ready-made image
{ "type": "upload", "artifact_id": "art_…" }artifact_id from create_upload with an OCI layout; nothing is built. See image without a registry.
Upload with a Dockerfile
{ "type": "upload", "artifact_id": "art_…", "context_dir": ".", "dockerfile": "Dockerfile" }artifact_id from create_upload. context_dir relative to the archive root, dockerfile relative to context_dir.
Git
{ "type": "git", "repo": "acme/shop", "branch": "main", "auto_deploy": { "approval": "owner" }, "pull_requests": "check" }repo is a GitHub repo connected in the portal, branch without a value is the default branch; dockerfile, context_dir and build_size as for upload. auto_deploy ({} or with approval: "owner") rolls out every push, pull_requests (check or off) checks pull requests. See build from Git. As long as the platform's GitHub App is not set up, type: "git" gives CAPABILITY_UNSUPPORTED.
Several contracts per project
A contract contains at most 10 services; connects_to reaches services of the same contract and shared services of other projects of your account. Services missing from the contract stay unchanged and are not deleted. Their costs do count in the budget check, though. The trust level limits the total number of services.
The full JSON schema is returned by get_platform_info(topic: "contract_schema").