Applying recipes
Applying a recipe turns it into a live guild. Apply creates the guild, its agents with their Tasks, scripts, and paused routines, its collections, and its seed notes. Then it walks the operator through what a recipe cannot carry: logins, secret values, repositories, and setup outside the platform. When the checklist is done, the operator activates the guild and its routines start.
The Guild builder's Deploy guild uses this same flow. There is no builder-specific credential path.
When you use it
- You approved a recipe and want a guild from it.
- You captured a guild and want a second copy of its design.
- You imported a recipe from a file or the registry and want to run it.
Apply always builds a new guild, or fills an empty guild (one with no agents). It never restores a recipe onto a guild that already has agents. To change the Tasks of a live guild, use Prompt Studio.
How it works
Apply has three stages: a preview that writes nothing, the creation of the guild, and a checklist. Activation ends it. Abort undoes it.
The preview
The preview resolves everything apply needs before it writes anything:
- Names. The new guild's name and each agent's name. An agent name already taken on the box is a collision, and the agent must be renamed.
- Models. A role's model in the recipe is a recommendation. Each agent gets the model the operator picks.
- Harnesses. Each subscription role needs a harness: the recipe's, or one the operator picks.
- Machine. Every agent of the apply goes on one machine. The machine must be big enough for the largest agent and have room for all of them.
- Connectors. For each connector, the operator reuses a live login of the organisation or connects one after the guild exists. Connectors the box lacks are listed for install.
- Secrets. A secret the organisation already holds is reused by default. The operator may rename or skip it.
- Collections. A collection whose name is free is created. A live collection of that name is reused when its columns accept the recipe's. Otherwise it is a conflict the operator resolves by renaming the recipe collection.
- Limits. The organisation must have room for all the agents, browser agents, and subscription agents at once.
Models and harnesses says where each picker starts.
Creating the guild
Create guild builds the guild in an order that never leaves a broken state. Notes come before Tasks, because a Task that embeds a missing note cannot be written. Routines are created paused. If any step fails, everything the apply created so far is removed: its guild and agents, its collections, and every seed note it wrote. Each seed note is soft-deleted by id, whatever rows it carries; the created guild's deletion leaves its notes to the organisation, so the note's own deletion is what removes it. An abort removes the same. When the undo cannot delete everything, the apply fails with both its failure and what was left in place (see Activate and abort). The steps are listed under Reference.
The checklist
The checklist lists what the operator still has to do:
- Connect each connector the recipe needs, unless a reused login already covers it.
- Add each secret so it reaches every agent that needs it.
- Add each repository in the guild's Settings, with its URL and a credential, when the recipe lists repositories. When its step passes Check, each agent whose role lists the repository picks it.
- Confirm each external setup step.
Steps the platform can check are verified, not just ticked: Check looks at the live guild. Connection, secret, repository, and tool steps can be skipped. A skipped step leaves a warning: agents that need that access fail those tasks until it is added later from the guild's Tools, Secrets, or Settings.
Browser logins are not checklist work. After activation, each agent whose role needs a browser login shows a strip asking the operator to log in from its Browser tab (see Browser).
What apply never does
- It never writes a secret value. The operator adds each secret from the guild's Secrets view.
- It never makes a secret organisation-wide.
- It never writes an organisation-wide or platform-wide binding. It may reuse an organisation login, but the grant lands on the new guild or one of its agents.
In the app
Apply preview
Apply on a recipe's page opens the apply preview. From the top, it shows:
- whether the guild can be created: a Not ready to apply banner naming the first thing missing, or a line saying the recipe checks out
- Connectors to install: each connector the box lacks. An instance admin installs a registry one there (Install unverified for an unverified one). An owner or admin adds one the recipe carries as the organisation's own server (Add server).
- Connectors to set up: each connector the recipe connects that the box has but a platform admin has not set up. A platform admin gets a Set up link. Anyone else reads that a platform admin sets it up under Admin, Platform keys.
- the new guild's name (Guild name)
- a Machine picker. Machines below the recipe's minimum are disabled. The chosen machine shows its planned load bars with what the recipe's agents add, and its
machine.*findings. - the plan, as on the recipe's page, with only the sections that have entries. Each agent's card adds its Agent name, and its Model, or on a subscription agent its Harness, Cursor and Antigravity only for a role that lists a repository. The model list is the organisation's chosen models, with a hint naming the recipe's recommendation. A subscription agent's Subscription chip names the harness picked. A taken name says An agent already has this name. Rename it before creating. Each connector card adds a Login: a live login to reuse, or Connect after the guild exists.
Create guild waits until every agent on a key has a model, every subscription agent has a harness, and, with several machines, one is chosen. While no model provider is connected and an agent is on a key, a guide to Model keys stands in for the model pickers. The preview leaves out connection.missing, which is a note on how the recipe is written.
Apply checklist
After Create guild, the checklist page opens. Its header names the guild and shows Abort and Activate. A progress bar counts the steps done, starting with two milestones: Recipe validated and Guild created.
Each step shows its title, what it asks for, and its status:
- A connection step has Connect
<name>, which opens the same Connect dialog as the Tools view, and Check. A connector a platform admin has not set up shows that gap, keeps Connect disabled, and offers Set up (Admin, Platform keys) to a platform admin. A login made from the step is checked at once. The step still closes once the login is connected or the step is skipped. - A secret step has Check and a Guild secrets link.
- A repository step has Check and a Guild settings link.
- Connection steps also link to Guild tools.
- An external step has Done.
- Connection, secret, and repository steps have Skip, after a confirmation.
- The last step, Activate paused routines, has Activate routines.
Browser and tool overlay steps are not listed: logins happen on the live agent, and tool overlays close with their connection.
Activate (or Activate routines) is enabled once every other step is closed. It starts the routines and opens the guild. A done checklist offers Open the guild. Abort asks for confirmation (Abort and delete), deletes what the apply created, and returns to the library.
Strips on the guild
- While a guild's checklist is open, a strip under its tabs says Recipe setup is open: the routines stay paused until its checklist is done. Open checklist links to it.
- After activation, each agent the recipe required a browser login for shows a Browser login needed strip on its inspector, with Open Browser and Mark as done. It stays hidden while the guild's checklist is open. See Browser.
Rules and limits
| Rule | Behaviour |
|---|---|
| Recipe status | Must be ready (approved) |
| Blocking errors | Refuse the apply |
| Destination | A new guild, or an existing guild with no agents |
| One open checklist per guild | A guild has at most one open apply |
| Agent names | Must be free on the whole box |
| Model | Every agent needs one; none is picked for you when the organisation has no fitting model |
| Harness | Every subscription agent needs one: the recipe's, else the operator's pick |
| Machine | One machine for all agents; at least the largest agent's minimum; room for all of them, at most 32 agents per machine or the policy's lower cap |
| Organisation limits | Checked once for the whole batch: agents, browser agents, subscription agents, guilds |
| Routines | Created paused; start on Activate |
| Secret values | Never written by apply |
| Organisation-wide secrets and bindings | Never created by apply |
| Skipped step | Recorded as a warning |
| Activate | Refused while a step other than browser logins is open |
| Abort | Refused once the apply is ready |
Reference
Scope of what apply writes
Apply reuses existing organisation or platform connections, and the organisation's secrets. It creates new connections only at guild or agent scope. Tool overlays are upserted at the resolved connection's owner scope: right away for a reused login, after Connect for a new one. A namespaced tool the destination does not list is left out, and the apply goes on.
The destination is a guild apply creates, or an empty guild (no live agents) named by guild_id. A guild of another organisation, or a private guild the operator does not operate, is 404 (destination guild not found); a guild with agents is refused (destination guild is not empty). A recipe whose roles carry config.keep_tool_result_generations goes into an existing guild only for a guild admin (403 only a guild admin can apply a recipe that sets keep_tool_result_generations).
Choices
The preview and apply requests take the same body:
{
guild_name?, guild_id?,
names?: [{ role, name }],
models?: [{ role, model }],
harnesses?: [{ role, harness }],
machine_id?,
connections?: [{ server, action: "reuse" | "create", scope: "guild" | "agent", role?, connection_id? }],
secrets?: [{ name, action: "reuse" | "rename" | "skip", dest_name? }],
activate_keys?: [routine key]
}activate_keys lists the routines Activate unpauses; by default every routine of the recipe.
Models and harnesses
A role's config.model is a recommendation, kept exactly as written. Validation warns about one that is unknown, not connected for the organisation, and never refuses a recipe for a model reason. The apply preview shows a picker per role, preselected with the recommendation when the organisation has its provider, else the organisation's default, else nothing. The apply request carries models, the model chosen for each role, and nothing is created while a role has none (choose a model for …). A chosen model must be {provider}/{model} and offered to that role, or it is refused. The Builder writes the coach's model into the roles it drafts without one. Capturing a guild keeps each agent's live model; a subscription agent's role carries its harness and no model.
A subscription role's config.harness works the same way. The preview shows a harness picker per subscription role, preselected with the role's harness unless the box turns that harness off. The apply request carries harnesses ([{ role, harness }]), and apply refuses with choose a harness for … while a subscription role has none. A harness for a role on a key is refused with harnesses.<role>: only a subscription role takes a harness, and one the box turns off is refused. Only a subscription role keeps a harness. A role keeps the recipe's harness_model only when it applies with the harness the recipe names; with another harness, its model is the subscription's default. It keeps the recipe's harness_effort under the same condition, and only when its model runs at that effort; otherwise the model runs at its default effort. A role's secret_aliases apply as written when they validate; otherwise apply leaves them out.
A subscription role (Recipe format) takes no model: the preview lists none for it, and a model chosen for it is refused with models.<role>: a subscription role takes no model. Cursor and Antigravity run it only when it lists a repository in config.repositories: for a role that lists none, a recipe's Cursor or Antigravity is not preselected, and a chosen one is refused with harnesses.<role>: <Harness> runs a subscription agent only with a repository, since it keeps its own system prompt: pick a repository, or another harness. Its agent is created with no model, its harness, and its repositories.
Preview
POST /api/recipes/:id/preview resolves, without writing:
- the guild name:
guild_name, elseguild.name_suggestion, under the guild name rule - each role's name: the operator's, else
name_suggestion, against the charset and reserveduser. A name any agent on the box already holds is listed incollisions - each role's model and each subscription role's harness, as Models and harnesses describes. The preview's
modelslists each role's but a subscription role'srecommendedand resolvedmodel; itsharnesseslists each subscription role'srecommendedand resolvedharness - the organisation's remaining capacity for the whole batch: agents, browser agents, and subscription agents (subscription roles), each against the organisation's limit,
nullwhere nothing caps it. The preview'sremainingcarriesagents,browser_agents, andsubscription_agents - the machine every role goes on: the operator's choice (
machine_id), else the organisation's only machine, else null until the operator picks one. A recipe does not name a machine. It needs one of at least its agents' largest minimum, which the preview returns asminimum_cpuandminimum_mib. The preview'smachineslists each machine with itsid,name,box,cpu,memory_mib,planned_cpu,planned_mib, number ofagents, andfits, whether it meets that minimum.adds_cpuandadds_mibare the planned load the roles add. On the chosen machine it is a blocking finding when the machine is below a role's minimum (machine.size, one per role), when its image lacks the harness of a subscription role (machine.harness, one per role), when the roles would take the machine past 32 agents or the policy's agents per machine (machine.full), and when the machine hosts an agent of a guild the operator cannot see (machine.private). An unknownmachine_idis 404. Apply without a machine is refused - catalog presence of each
connections.server. The preview'sinstallslists each one the box lacks that can be added: from the registry (server,from: "registry",version,verified), which an instance admin installs, or from the recipe (server,from: "recipe",display_name,description,url,auth), which an owner or admin adds as the organisation's own server - which of the connectors the recipe connects the box has but a platform admin has not set up. The preview's
setupslists each one (server,integration,label). The apply goes on; those connections cannot connect until the integration is filled under Admin, Platform keys (see Configure) - existing destination organisation connections that can satisfy a server: each
connectionsentry listsreusablelogins (connected, owned by the organisation or the platform), and defaults toreuseof the first one, elsecreate. A recommendedorgscope becomesguild - each secret name against the organisation's secrets. A name the organisation holds is a collision and defaults to
reuse. The operator mayrename(withdest_name) orskip. A free one iscreate. A recommendedorgscope becomesguild - each recipe collection against the organisation's live collections (see Collections)
- provenance of builder-authored fields (
unreviewed; informational, not a gate)
The answer also carries recipe_id, recipe_name, guild_id, names, findings, errors (the blocking ones), and creates, the inventory of everything the apply would create: the guild, each agent (name, focus, model, browser, Task, enabled native tools), collections, notes, scripts, routines, connections, secrets, and repositories.
A role without a Task gets one made of its focus, the guild's objective, and its about text. A role without routines gets one per design.routines entry whose cadence is a valid cron; its instruction is the role's Task.
Collections
Each recipe collection is planned as:
createwhen the name is free in the organisationreusewhen every recipe column exists on the live collection of that name with the same type and, for a closed value list, every recipe value is accepted (extra live columns are fine)- otherwise
conflict, a blockingcollection.conflictfinding listing the differences
A scope: "guild" collection cannot be shared, so a name the organisation already holds is always a conflict for it. The operator resolves a conflict by renaming the recipe collection.
A reused collection keeps its records and the other rows of its access list.
Access
Apply gives the new guild and its agents what the recipe says on each collection and seed note, and only raises. A seed note also gets the organisation's row at the recipe's org mode, when it states one. The new guild is brought up to the recipe's guild mode, and each writers role's agent up to write. A subject that already holds as much gets no row: the guild counts the organisation's row and its own, and an agent counts its own row, else its guild's mode. An existing row is never lowered, so applying read to a reused table the guild already writes leaves it at write.
Create
POST /api/recipes/:id/apply re-runs the preview, then requires status=ready, no blocking errors, a machine, no name collision, a model for every role, and a harness for every subscription role. It answers 201 with the apply. The steps are ordered so no intermediate state is broken:
- assert the whole batch against the organisation's limits once, the machine's
maxAgentsPerMachineincluded, plus the guild limit when apply creates the guild. The roles must also fit the guild'smax_agents: the destination guild's, or the default for a new guild (see Guilds) - create the guild (or attach an empty one)
- create the agents on the chosen machine, each with empty Memory and a first Task whose
@{role}tags already name the new agents - create the seed notes, each homed in the guild the apply creates or attaches (Notes), with the access list the recipe's
org,guild, andwritersgive it, the new guild atwritewhen they give none (see Access). A key the organisation already holds is written as<guild name>-<key> - for each role in turn:
- rewrite the Task's note links (embeds and note paths) to live display paths, and write the Task again over the first one. An unresolved link fails the apply. An empty Task is not written
- insert its scripts; more scripts than the role's
max_scriptsfail the apply - insert its routines paused, with tags and note paths rewritten the same way. An empty instruction takes the role's Task. Each instruction is cut to 2,000 characters, the routine limit
- write its native-tool bindings at agent scope
- create each
createcollection with the recipe's columns. A collection that appeared under that name since preview is a conflict: preview again (409). Ascope: "guild"collection is created for the new guild, with the guild atwriteas its starting row. A createdorgcollection starts with the organisation atread. A created collection's access list is raised to the recipe'sguildandwritersas it is created, and a reused collection's then (see Access) - write the tool overlays of each reused login
- save the apply row with its checklist
Failure deletes the agents the apply created, a guild apply created (created_guild), and the collections this apply created. Reused collections stay. An empty guild the operator already made stays standing.
Once the apply is saved, and when the applying user is an org owner or admin, each reuse secret that is not organisation-wide and does not reach the guild yet is granted to it. Secret steps that then pass close.
Checklist
Each step has a derived id, a kind, a title, optional setup text, a closure (verified or confirmed), and a status (open, verified, confirmed, or skipped). Examples of ids:
conn:notionoverlays:notionsecret:TAVILY_KEYrepo:apibrowser:scoutexternal:0activate
A step for a reused login, and its overlay step, start verified.
A recipe with repositories adds one repo:<name> step per repository, and no connection step. Apply creates every agent with no repositories picked, since the new guild has none yet. When a repository's step passes, each agent whose role lists the repository in config.repositories picks it, at its place in the role's order (Recipe format). A skipped step gives it to no agent. That step's setup is the repository's purpose, where to add it (the guild's Settings, under Repositories, with that name), and what to add it with: its HTTPS URL, on any git host, and a credential, a GitHub login for a GitHub repository, an access token kept as a secret for any host, or none for a public repository, which then cannot be pushed to (Repositories). It also says to set the guild's Commit author email to a verified email of the account that owns a deploy project, when a deploy service must recognise the commits' author. Recipes do not store that email. A GitHub connection the recipe lists keeps its own step.
A secret the operator chose to skip has no step.
| Step | Closes when |
|---|---|
| Reuse or Connect server S | connection status=connected for the guild (verified), or operator skips with a warning |
Secret NAME | a secret of the destination name reaches every agent of the roles that need it, the recipe secret's roles or else every planned role (verified), or skipped |
| Tool overlays for S | the server has a guild- or agent-scope binding (verified); a verified Connect step writes the overlays and closes it; skipped with the Connect step |
Repository name | the guild has a repository of that name (verified), and each agent whose role lists it then picks it; or skipped |
| Browser for role R | deferred until after activate; the live agent asks the operator to log in |
| External item | operator attests (confirmed) |
| Activate paused routines | Activate |
A browser step's setup is the role's login instructions, or a default that says to take control of the agent's Chromium after apply and log into the site, that session cookies stay in the browser profile, and to mark the reminder done.
POST /api/applies/:id/steps/:step_id/verify re-derives destination state. It works on verified steps only (step is attestation-only otherwise). A step that does not pass answers 422 with the reason:
- a connection step says the server is not connected yet
- a secret step names the agents the secret does not reach yet
- a repository step says the guild has no repository of that name yet
- an overlay step says the tools are not bound yet
…/confirm is for browser and external steps (step must be verified by the server otherwise), and for skipping a connection, secret, overlay, or repository step with skip: true. A skip also closes the connection's overlay step and records a step.skipped warning. Any other step cannot be skipped. On a browser step, later: true records the login for after activation. An unknown step is 404.
POST /api/applies/:id/overlays ({ server, connection_id }) writes planned tool overlays after listing. Overlays bind at guild scope when every role enables the connector with the same tools and its recommended scope is not agent; otherwise each enabled role's agent gets its own binding.
Activate and abort
POST /api/applies/:id/activate defers any remaining browser logins (resolution: "later"), closes the activate step, unpauses the routines in activate_keys, and moves the row to ready. While any other step is open it is 422 (checklist still open: …).
POST /api/applies/:id/abort undoes the apply as a failed step does, then moves the row to aborted. It deletes every agent, collection, and seed note the apply made, whatever rows a note carries, and the guild when the apply created it. On an empty guild the operator brought, the guild stays and what the apply made in it goes. An abort acts as the user who aborts, so the change log credits them.
The undo runs its deletions one at a time, in order: the agents, the created guild, the collections, then the notes. It goes on past a deletion that fails and reports each one. When any is left, abort is 409 with code apply_undo_failed and the message undoing the apply left part of it in place: <each failed deletion and why>, and the apply is not marked aborted. A failed step whose undo leaves something behind answers with the same code, its message prefixed with the step's own failure, and that failure's status when it has one, else 409. Reused collections and their records stay. Org-level logins created during the checklist stay. A ready apply cannot be aborted (422).
Apply HTTP
POST /api/recipes/:id/preview
POST /api/recipes/:id/apply
GET /api/applies/:id
GET /api/guilds/:guild_id/apply
POST /api/applies/:id/overlays
POST /api/applies/:id/steps/:step_id/verify
POST /api/applies/:id/steps/:step_id/confirm
POST /api/applies/:id/activate
POST /api/applies/:id/abort| Route | Answer |
|---|---|
POST /api/recipes/:id/preview | The preview; 404 for an unknown destination guild, one hidden from the caller, or an unknown machine; 403 for a recipe that sets keep_tool_result_generations, into an existing guild, from someone not its admin; 422 for a guild that is not empty or a bad choice |
POST /api/recipes/:id/apply | 201 with the apply. 422 when the recipe is not approved, has blocking errors, has no machine, or lacks a model or harness. 409 for a name collision, a limit reached, a full guild, or a collection that appeared since preview |
GET /api/applies/:id | The apply; 404 outside the organisation, and for an apply into a private guild the caller does not operate |
GET /api/guilds/:guild_id/apply | { apply, browser_logins } |
POST /api/applies/:id/overlays | { ok: true } |
POST …/steps/:step_id/verify | The apply with the step closed; 422 with the reason |
POST …/steps/:step_id/confirm | The apply with the step closed or skipped |
POST /api/applies/:id/activate | The apply at ready; 422 while a step is open |
POST /api/applies/:id/abort | The apply at aborted; 422 once ready |
Every route under /api/applies/:id is 404 apply not found for an apply of another organisation, and for an apply into a private guild the caller does not operate, as a destination guild is in a preview. An apply whose guild is gone names none, and every member reads it.
In GET /api/guilds/:guild_id/apply, apply is the open checklist, or null once it is done or aborted. browser_logins is the agent ids a ready apply still asks to log in by hand.
Storage
recipe_applies (
id, org_id, recipe_id, created_by_user_id,
guild_id, created_guild,
status, -- preview | skeleton | checklist | ready | aborted
recipe_body_version,
preview jsonb, plan jsonb, checklist jsonb, warnings jsonb,
created_at, updated_at
)The row is written once the guild stands, at checklist. Activate moves it to ready; abort moves it to aborted. The status values preview and skeleton are allowed by the schema; the apply never writes them, because the preview is not stored. A guild has at most one apply at skeleton or checklist. plan holds the agent ids by role, the connections, secrets, collections, activate_keys, and created: the ids of the agents, collections, and notes the apply made, which a failure or an abort deletes. A plan without created falls back to the created guild's agents and the collections it planned to create. warnings starts with the preview's findings and gains each skipped step.
Screens
| Screen | Route |
|---|---|
| Apply preview | /recipes/<recipe_id>/apply |
| Apply checklist | /applies/<apply_id> |