Skip to content

Manifest reference

antifailure.yaml sits at the repository root. af init writes one from what is already in the repository; nothing regenerates it afterwards, so an edit you make survives.

The rule worth knowing before reading anything else: an environment can reach nothing on the network except the hosts listed under egress, each in the mode named. Everything else is refused with a decision you can read.

KeyTypeWhat it is
versionintSchema version. 1 today.
namestringThe project. Used in environment identifiers.
serviceslistWhat runs.
databaseblockWhere the Postgres comes from.
egressblockWhat the environment may reach.
personaslistUsers the agents sign in as.
workflowslistWhat the agents do.
invariantslistStatements about the data that must stay true.
insightsblockThe Postgres native checks.
loadblockProduction shaped traffic.
runtimeblockWhere and how long environments run.
githubblockThe pull request integration.
KeyTypeNotes
namestringRequired.
kindstringweb, worker, or cron. A web service gets a URL.
pathstringDirectory, for a monorepo.
commandstringHow to start it.
portintWhat it listens on. PORT is set for you.
health_pathstringReadiness check, default /.
health_timeoutdurationDefault 180s.
migratestringRuns before the service, with a direct connection.
schedulecronFor kind: cron.
replicasintDefault 1.
depends_onlistOther services that must start first.
envlistVariables this service needs, by name.
resourcesblockcpu and memory.
buildblockSee below.
AF-RUN-042 Service web depends on cache, which the manifest does not declare.
AF-RUN-041 The services depend on each other in a cycle: web -> worker -> web

A cycle has no order that can start, so it is refused rather than resolved arbitrarily.

KeyNotes
strategyauto (default), dockerfile, or buildpack.
dockerfilePath, when it is not ./Dockerfile.
contextBuild context, default the service’s directory.
targetA stage in a multi stage Dockerfile.
imageA prebuilt image, instead of building.
argsBuild arguments.
allow_hostsHosts the build may reach. The build is sandboxed too.
env:
- name: STRIPE_SECRET_KEY
sandbox: true
- name: LOG_LEVEL
value: debug
- name: API_URL
from: web

A name, never a secret. sandbox: true marks a variable that must hold a sandbox credential and never a live one, which is checked before anything starts. from takes the value from another service’s URL, so a worker can be told where the web service is without hardcoding a port.

A service receives what it declares and nothing else. The engine’s own environment is not passed through, or a preview would inherit whatever is exported on the laptop that started it.

KeyNotes
providerdocker (default) or neon.
versionPostgres major, default 17.
url_envThe variable services receive the connection string in.
source_url_envNames the variable holding production’s read only URL.
masking_rulesPath to the rules, default masking.yaml.
seedA command run against a fresh golden candidate.
projectFor a hosted provider, its project identifier.
api_key_envNames the variable holding that provider’s API key.
max_branchesThe plan’s concurrent branch limit.
goldenschedule, max_age, retain, storage, storage_url.
subsetSee below.
subset:
enabled: true
seed_table: organizations
seed_where: "created_at > now() - interval '90 days'"
max_rows: 100000
follow_dependents: 2
virtual_relationships:
- from: events.actor_id
to: users.id

A production shaped slice rather than the whole database. virtual_relationships is for joins your schema does not declare as foreign keys, which are the ones a subset silently breaks.

KeyNotes
defaultblock (default) or allow.
allow_ipv6Off by default.
rulesSee egress.
KeyNotes
providerlocal. kubernetes is named in the schema and not built yet; asking for it is refused rather than substituted.
ttlHow long an environment lives.
idle_sleepSuspend after this long with no traffic.
domainWildcard domain for preview URLs.
AF-MAN-001 No antifailure.yaml was found in /path or any parent directory.
AF-MAN-002 The manifest at ./antifailure.yaml is not valid: services[0].port
must be between 1 and 65535
AF-MAN-003 The manifest declares schema version 2, which this build does not
understand.
AF-MAN-005 The manifest is larger than the 256 KiB limit.
AF-MAN-006 The path ../secrets in the manifest resolves outside the repository.

The schema refuses a key it does not know, so a typo is an error at the line rather than a setting that silently does nothing.

af doctor validates without running anything, which is the fast way to check an edit.

schemas/manifest.v1.json is the source of truth, and the Go types mirror it. A test validates real manifests against both, so a field in one and not the other fails the build. Point your editor at it for completion and inline errors.

Related: detection, egress, providers.