# Werker: the whole site
> Werker turns your instructions into agents and workflows that run in sandboxes. Open source, self-hosted first.
Werker is early: it works end to end on one machine, and its own instance is live on one server. Each page says what is built, how far it has been tested and what is planned.
# How Werker works
> What happens between describing some work and getting a result in Werker, what the pieces are called, and which parts are built.
Source: https://werker.cloud/how-it-works (updated 2026-12-01)
You describe work in the web app, Werker generates an agent or a
workflow of several agents from the description, saves it, and runs it
in a sandbox. The core path (describe, generate, run, result) works
end to end on one machine at spike quality. Werker's own instance is
live and has run agents in a sandbox.
## From description to result
1. **Describe.** You type the work into the web app's new-work page. A
workspace (one organisation's isolated space in a Werker install)
owns everything that follows.
2. **Generate.** A model call decides whether the work is one agent
(one job, with standing instructions for its role) or a workflow
(ordered steps, each done by one agent, one agent possibly serving
several steps). Both are saved. A saved agent whose role fits is
reused instead of saved again.
3. **Ask or stop.** If the work needs something only you can give,
generation pauses and asks, then continues with your answers. If it
needs something not set up (no sandbox, a service not connected),
nothing is saved and the page lists what to set up. A request that
cannot be done fails with a reason and saves nothing.
4. **Run.** A run is one execution of a saved agent or workflow. Each
step runs in a sandbox (an isolated container created for the run)
and reports back. You watch it live in the browser.
5. **Result.** The run's result is the last step's markdown summary,
plus any files the steps kept.
Generation can also read a repeating request ("every morning") and
save it as a schedule. Before anything is saved it shows a brief to
approve, which you can skip.
## What a step can report
A step ends with one of three statuses.
| Status | Meaning |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| done | A markdown summary and the files to show. Everything in `/work` is saved to the run's project. The next step receives the summary and file paths. |
| failed | Why the task cannot be done. The run fails. |
| needs input | A question only you can answer. The run pauses, its sandbox is kept, and your answer restarts that step with the question and answer. |
A done step can also list what it checked, assumed and worked around.
This is the agent's own report and nothing verifies it. It was built
on 2026-11-24 and has not been run with a real model.
## Runs survive crashes
Runs are durable: if the worker process stops, the run continues from
its last completed step and does not redo finished steps. Run state is
a file on the worker machine's disk, so a run cannot move to a
different worker machine. Durable recovery can repeat an external
action, such as opening a pull request, after a restart, and no
deduplication exists yet.
## Running again, editing and schedules
- **Run again** executes the saved definition as it is now, without
going back through generation.
- **Edit** an agent's name, role and default task, and add, reorder
and edit a workflow's steps. An edit changes later runs, not one in
progress.
- **Stop** ends a queued, running or waiting run. **Archive** hides a
finished run from lists and deletes nothing.
- **Schedules** run a saved agent or workflow every hour, day or week
at a set time in a time zone. A schedule missed while no worker ran
fires once, then continues.
## Equipment
Equipment is the first version of how an agent learns: a step that
finishes can report the procedure it worked out (commands, code and
checks that worked, as markdown). Werker saves it with that agent, and
the agent's later runs are given it to follow when it fits and correct
when it does not. Editing the agent's role or task sets it aside. The
agent still reasons on every run. One procedure per agent assumes an
agent does one kind of job.
## Versions, history and restore
Each saved change to an agent, workflow, factory or role preset is
kept as a numbered version, with who made it and when. A History sheet
shows what each version changed and restores an earlier one as a new
version, so nothing is removed. Restore follows the permissions and
rules of an edit. This was tested with unit, component and
disposable-database tests and has not been looked at in a browser.
Runs do not record which version they ran.
## Factories
A factory is a lasting place for a team of agents to work. Terms:
- **Factory team:** a lead and specialists, each a saved agent. The
team can be written from a brief by one model call, and saved as a
starter for new factories.
- **Room:** a thread where you and members talk. A message can address
one member, several, or all, and members can ask each other. Other
members read along and stay quiet unless the message is theirs. A
turn limit per message (24 by default) stops members keeping a room
running and spending indefinitely.
- **Decision inbox:** a workspace-wide, live list of runs paused for
an answer, including questions members ask you.
Maturity: rooms and the inbox are a spike, checked by model-only evals
(a lead asking a specialist, a specialist asking you through the
inbox, a lead asking two specialists). Live sandbox-backed factory
runs are not verified. The factory screens are being redesigned: today
they expose per-member settings before the work starts. Writing a team
from a brief has run on a scripted model only, not a real one. Expect
this area to change.
## How well generation works
`pnpm eval:generation`, Werker's own check, ran 8 cases on 2026-11-09
against one model and all 8 passed, once each. Results vary between
runs, so this is not a pass rate. The plan cases (4), the setup case
and the web cases passed once each on 2026-11-23. Several runs per
case, harder cases and running the check in CI are not done.
## What is not built yet
- Triggers on incoming work, such as a new issue. Only schedules
exist.
- The improvement loop that proposes changes to a definition from past
runs. Scoring and versions exist; nothing proposes changes.
- Replaying equipment as a program with no model in the loop. This is
where a cost saving would come from.
- Verification checks between steps.
- Live previews of dev servers that agents start inside sandboxes.
- Credits and billing.
- Moving runs between worker machines.
See [status](/status) for the full list, and
[connections](/docs/connections) for tools and credentials.
---
# Sandboxes and security
> Where Werker agent code runs, what it can reach, where your keys are kept, how workspaces are separated, and what has not been done.
Source: https://werker.cloud/security (updated 2026-12-01)
Agent code runs in a sandbox created for that run and deleted after
it, never in the worker process. Provider keys are sealed so the web
app cannot read them, and each workspace's rows are separated by
Postgres row-level security. Werker's own instance is live over HTTPS.
Parts of the sandbox options have not been run, as listed below.
## One sandbox per run
A run is one execution of an agent, workflow or factory request. Each
run gets its own sandbox, created on its first command and deleted
when the run finishes. Code that agents write is treated as untrusted.
The worker, a separate process, keeps what must be trusted: the queue
claim, durable run state, model calls with the workspace's keys, and
writing run events. It sends code and tool calls into the sandbox.
Sandboxes are never shared between workspaces. Only the worker
controls Docker, never the agent containers.
## Sandbox providers
You choose the provider in Admin → Sandboxes. Only an instance
administrator can.
| | Docker with gVisor | Daytona | Docker Cloud Sandboxes |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| Runs on | Your own host | Daytona's service | Docker's service |
| Isolation | gVisor user-space kernel | Provider's | Provider's |
| Key references | Yes, through the gateway | No | No |
| Git | Yes, through the gateway | With a GitHub App connection; checked by script on 2026-11-28 | With a GitHub App connection; checked by script on 2026-11-28 |
| Allowed-sites network | Yes, tested | Built, not run | Built, not run; needs the Docker account to deny by default first |
| CPU and memory limits | Yes | Rounded up to whole CPUs and GiB; not run | Five fixed sizes; not run through a worker |
| Process limit | Yes | Not applied | Not applied |
| What has been run | Tested on a cloud VM: start and stop, memory and CPU caps, no host files visible, network blocked or allowed, a run killed mid-cleanup then resumed | One generation evaluation (8 cases needing a shell, 6 passed), network none | The adapter driven by a script, network none; not run through a worker |
Not run on Daytona: the allowed-sites network, CPU and memory limits,
and stopping and restarting the sandbox of a run waiting for input.
Docker describes Cloud Sandboxes as experimental. It ends a sandbox
session 24 hours after it starts, and a command still running then is
untested.
## Network access
Sandbox network access is one of three settings, per instance:
- `none`: no network. This is the default. On Docker it is
`--network none`.
- `gateway`: only the sites you allow. On Docker, sandboxes join an
internal network whose only reachable peer is a forward-proxy
gateway that allows listed hosts, and `.example.com` allows
subdomains. On Daytona it maps to Daytona's domain allow-list. On
Docker Cloud it needs the account's policy set to deny by default,
because with a new account a sandbox allowing only one site still
reached other sites.
- `open`: refused for a Docker host, because an open container could
reach that host's network. Hosted providers allow every site by
default, so Admin picks `open` when one is chosen. This has not been
run against either provider.
On Daytona tiers 1 and 2, the organisation's own restrictions apply
and a sandbox's setting cannot override them. Gateway requests are not
yet recorded in the audit log.
## Limits and concurrency
Admin → Sandboxes sets CPUs, memory and processes per sandbox (off
unless set) and the most sandboxes at once on the host (none by
default). A worker runs one run at a time by default, and an operator
can cap running runs per workspace.
## Sandbox images
A sandbox starts from one image, which decides what is installed.
Admin → Sandboxes lists the images; one is the default
(`node:22-alpine`). A worker probes each image in a no-network sandbox
to record what it contains. Planning picks the image for the work from
that list, and the agent is told what the image has. If planning picks
none, the default is used. Image selection has been run on Docker
Cloud Sandboxes and Daytona, not on Docker with gVisor. You cannot yet
choose an image by hand, use private images or build one.
## Where your keys are
- Provider keys are sealed in the web app with a public key. The web
app can store a key but cannot read it back. Only the worker, which
holds the install's master key, opens it.
- A key never enters a sandbox. On Docker with gVisor, a sandbox gets
a reference and a run token. The gateway outside the sandbox swaps
the reference for the key on the outgoing call, only for that run's
workspace. The grant is held in the gateway's memory and removed
with the sandbox.
- A sandbox provider's own key (Daytona, Docker) is sealed the same
way, and one provider's key is never sent to another.
- Daytona and Docker Cloud sandboxes cannot reach the gateway, so they
get no provider keys and no Git, and work that needs them waits.
## Workspaces, roles and sign-in
A workspace is private: a company with several users, or one person.
It owns its connections, agents, workflows, runs and audit log. A
self-hosted install usually has one workspace. A user belongs to one.
- Roles are owner, admin, member and viewer, held per membership. An
admin can switch permissions on or off per role. A denied request
returns 404, so it does not reveal that the thing exists.
- Row-level security: workspace-owned Postgres tables carry a
workspace ID and a policy, and the app connects as a role that does
not own the tables. A query that forgets its workspace filter still
cannot read another workspace's rows.
- Sign-in uses Better Auth with email and password. Public sign-up is
off.
- The first user is the instance administrator, who sees settings the
whole instance shares, such as sandboxes.
## Audit log and visitor analytics
The audit log is append-only: the app's database role can add and read
events but not change or delete them. It records changes to members,
roles and connections, sign-ins, runs, sandbox lifecycle, shell
commands (first 500 characters), and service calls, never keys or
request bodies. It is per workspace and shown in Admin → Audit. It
does not yet record factory conversations or the role used on each
event.
Visitor analytics stores page views without an IP address, raw user
agent or cookie. A daily visitor hash uses a salt that is replaced
every UTC day, so a visitor cannot be linked across days. Only
instance administrators see it.
## What has not been done
- The install script's `--domain` option has not issued a real
certificate. Werker's own instance is live over HTTPS on Coolify.
- No external audit or penetration test has been done. Nothing in the
project records one.
- Everything listed above as not run: Daytona's allowed-sites network,
limits and stop and restart; Docker Cloud Sandboxes through a
worker, its allowed-sites network, and a command crossing 24 hours;
`open` on either hosted provider; image selection on Docker with
gVisor.
- Row-level security, the worker and sandboxes were tested by hand,
not by automated tests.
- Per-workspace allowlists, and workspaces bringing their own sandbox
host, are not built. Live previews of agent dev servers are planned.
---
# Pricing and ways to run Werker
> Self-hosting is free under the MIT licence and is the only offering that exists. Two hosted offerings are planned and have no prices yet.
Source: https://werker.cloud/pricing (updated 2026-11-30)
Werker is free to self-host: it is planned as open source under the
MIT licence, and a private single-server install works today. Two
hosted offerings are planned. Neither is open to anyone yet and
neither has a price.
## The three offerings
| Offering | Who runs the server | Whose AI provider keys | Paid how | State |
| --------------------------- | ------------------- | ---------------------- | --------------- | ------------------------------------------- |
| Self-hosted | You | Yours | Free | A private single-server install works today |
| Hosted, your keys | Werker's operator | Yours | A flat fee | Planned |
| Hosted, everything included | Werker's operator | The operator's | Prepaid credits | Planned |
## Self-hosted
You install Werker on your own Linux server, add your own AI provider
keys, run sandboxes on your own Docker host or your own account with a
sandbox provider, and add your own users. There is no licence fee and
no usage fee to Werker.
What you pay for yourself:
- The server.
- Your AI provider, at the provider's prices. Werker shows tokens and
an estimated cost for each run, so you can see what the work costs.
- A hosted sandbox provider, if you choose one instead of your own
Docker host.
The MIT licence allows you to change Werker and to run it under your
own name.
[Self-hosting](/docs/self-hosting) lists what the install needs and
what is not ready.
## Hosted, your keys (planned)
The operator would run the server, the install, the domain, upgrades
and backups. You would get a private workspace, and add your own
provider keys and your own users. The plan is a flat fee with no
credits, because your provider bills you directly for the AI you use.
Your own branding and your own domain on a hosted instance have been
considered. That is not decided.
## Hosted, everything included (planned)
For people who do not want provider accounts. You would sign up, pay,
and use the operator's keys and sandboxes. The plan is prepaid
credits: a run draws on your balance, and runs stop when the balance
reaches zero. Credits are needed here because the operator carries the
cost of the models, the sandboxes and the services a run calls.
## The order things are being built in
1. Self-hosting.
2. One hosted instance used by the operator, to learn from real work
what runs cost.
3. Hosted, your keys, for a few customers added by hand.
4. Hosted, everything included, once credits work.
## What is not built yet
- Any hosted offering. Nothing hosted is open to customers.
- Prices. None have been set.
- Sign-up. Today a workspace is created by the operator from the
command line.
- Credits, payment and billing.
- AI provider keys shared by every workspace on an instance, which the
everything-included offering needs.
[Status](/status) has the full list of what is built.
---
# Status: what is built and what is not
> How far along Werker is on 2026-11-30: what exists, how far each part has been tested, what is missing and what is next.
Source: https://werker.cloud/status (updated 2026-12-01)
Werker is at spike quality. Generating a workflow from a description,
running it durably in a sandbox, sign-in and workspaces work end to
end on one machine, and a private single-server install exists. This
site and Werker's own instance of the app went live on one server on
2026-11-30. The design is still changing, and no hosted service is
open to customers. The deployment facts are from 2026-11-30; the rest
of this page was last checked on 2026-11-26.
A run is one execution of an agent or workflow. A sandbox is an
isolated environment where agents run code. A workspace is one
organisation's separate space. A factory is a team of agents that
takes a request through to a result.
## Works today
"Run end to end" means run by hand through the whole path on one
machine, not in production.
| Area | What exists | How far it has been tested |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Generation | Describe work on `/new`; Werker generates an agent or multi-step workflow, saves it and runs it. | Eight cases run on 2026-11-09, all passed, once each. |
| Durable runs | Multi-step runs that resume after a crash without redoing finished steps. | Run end to end. |
| Queue and workspace isolation | Postgres queue with leases, and row-level security per workspace. | Tested by hand. The standard test run has no database, worker or sandbox tests. |
| Run view | Live run page and live lists of runs. | Run end to end. |
| Step results | A step reports done (markdown summary and files), failed, or needs input, which pauses the run until you answer. Rendered as safe markdown. | Run end to end. |
| Saved agents, workflows, schedules | Generation saves what it makes and reuses a fitting agent. Saved workflows can be rerun, edited and scheduled hourly, daily or weekly. | Run end to end. |
| Equipment | A step can report the procedure it worked out and that agent's later runs are given it. First version only. | Built; replay without a model is not built. |
| Sign-in, workspaces, roles | Better Auth sign-in, workspaces and roles. The first user is the instance administrator. | Run end to end. |
| Encrypted keys | Keys sealed per workspace. The web app cannot open them; only the worker, with the install's master key, can. | Run end to end. |
| Connections | Admin → Connections: connect, check, update and disconnect model providers, GitHub, HTTP APIs and remote MCP servers, with direct keys or tokens. No OAuth or app catalogue. A run whose connection does not offer its model is refused at queue time. | Saving and testing a connection has run on one machine. Checks against real accounts are still needed. |
| Capabilities | A capability is a named tool bound per workspace: `classify@1` and `shell@1`. | Tested by hand. |
| Docker sandboxes | One gVisor sandbox per run over Docker and SSH; network only through an allowlisting gateway. | Run end to end. |
| Daytona sandboxes | An administrator can use Daytona instead of a Docker host, with a sealed API key. No key references. Git through a GitHub App connection. | Run on Daytona once (2026-11-23, without network). Allowed-sites network and limits not run. |
| Docker Cloud Sandboxes | A third choice, with a sealed Docker ID and token. No key references. Git through a GitHub App connection. | Adapter run against Docker by script (2026-11-24, without network). Not yet run through a worker. |
| Sandbox settings and images | Admin → Sandboxes sets host, limits, concurrency and network, lists start images and what each has installed; planning picks the image. | Image selection run on Docker Cloud Sandboxes and Daytona, not on Docker with gVisor. |
| Self-host install | `deploy/install.sh` starts a private single-server install with generated secrets, a setup screen and an optional HTTPS domain. See [self-hosting](/docs/self-hosting). | Install, setup and testing a connection ran on one machine. A complete AI run on a fresh install, HTTPS, restore and upgrades have not. |
| Deployment on Coolify | This site and Werker's own instance, as two applications on one server, over HTTPS. | Schema applied, first administrator created and connections added (2026-11-30). A sandboxed run worked, and runs, connections and a project survived a redeploy (2026-11-30). |
| Usage, audit, traces | Tokens and estimated cost per run; an append-only audit log in Admin → Audit; a Trace tab per run. See [observability](/docs/costs-and-traces). | Audit seen recording real runs on Daytona (2026-11-23). Traces seen with fixture rows only, not a real run. |
| Metrics per piece of work | Volume, success, typical cost and time, and how often a person stepped in, by workflow, agent, factory, version, model or task. | Seen in a browser against local runs. |
| Versions and history | Every saved change to an agent, workflow, factory or role preset is a numbered version; a History sheet restores one as a new version. | Unit, component and database tests only; not seen in a browser. |
| Step accounts and interventions | A step can list what it checked, assumed and worked around; interventions are counted. | The step prompt has not been run on a real model. |
| Scores | A `classify@1` judge answers questions you set about sampled finished runs. | No real judge call made; not seen in a browser. |
| Other web app parts | Dashboard, settings, files page, visitor analytics without IP addresses or cookies, a `/how-it-works` map. | Built; no separate test record. |
## Known gaps
In order of importance.
1. **Generation quality is measured only once.** Eight cases passed,
one run each, on 2026-11-09. Reliable generation is the central
claim, and one pass per case gives no pass rate. Repeated runs per
case and harder cases are the next measurement.
2. **Runs cannot move between worker machines.** Durable run state is
in Postgres, but projects are folders on the worker's disk, so a
worker on another machine does not have them. Run one worker
machine for now.
3. **The audit trail is incomplete.** Not yet recorded: factory
conversations, idempotency keys for external actions, the Pi
version used for each run, and retention for run traces.
4. **The backend has few automated tests.** Row-level security, the
worker, capabilities, sandboxes, schedules and the usage and
overview queries were checked by hand, and the standard test run
includes no database, worker or sandbox tests. A change can break
them unnoticed.
5. **The web app and worker stop when the database restarts.** A
dropped database connection ends both processes instead of
reconnecting. This matters in any deployment, including Werker's
own.
## Not started
- Replaying an equipment procedure as a program with no model in the
loop.
- Triggers on incoming work.
- Verification of results.
- The improvement loop that proposes changes to a definition from low
scores and workarounds. Scoring and versions exist to review and
undo a change, but nothing proposes changes yet.
- Instance model connections shared with workspaces, for a cloud
offering.
- Workspaces bringing their own sandbox host.
- Live previews of dev servers that agents run inside sandboxes.
- Credits and billing. See [pricing](/pricing).
- A hosted service for customers.
- Automatic upgrades and password recovery in the self-host install,
and a scheduled backup. Schema changes are numbered migrations,
applied on start; upgrading an install has not been rehearsed.
## Factories
A factory has saved teams of agents, rooms where members address and
ask each other, a workspace-wide inbox for paused runs, and starters
(a saved team and room settings to start a new factory from).
The factory interface is still being redesigned. Today it asks you to
configure each member before the work starts, where the intended
design starts from a template. The team is written in one model call,
not through a conversation with you. Checks so far used a model only,
not live sandboxes. Starters are covered by unit, component and
database tests only, with no confirmed browser check. Expect the
factory screens and behaviour to change.
## What is being worked on next
In this order:
1. Letting runs move between worker machines, before running more than
one worker machine.
2. A fuller audit trail and automated backend tests.
3. The not-started list above, once workflows finish reliably.
---
# Is Werker for you?
> Who Werker suits today, who should wait, and the reason for each, based on what is built and what is missing.
Source: https://werker.cloud/fit (updated 2026-11-30)
Werker suits you today if you want to try describing work and having
agents do it in sandboxes, on a server you control, and you can live
with early software. It does not suit you yet if you need a hosted
service or something to depend on in production.
## It may suit you today if
- **You want to describe the outcome, not wire a workflow by hand.**
You say what you want done; Werker builds an agent, or a workflow of
several agents, and runs it. There is no canvas of blocks to connect
first.
- **The work needs code to run, not only API calls.** Each run gets a
sandbox where agents run commands and produce files, and the files a
run keeps come back to you.
- **You want it on your own server with your own keys.** One Linux
server with Docker is enough. Your AI provider keys stay in your
install, sealed so that the web app cannot read them back.
- **You want to see what a run did and what it cost.** Tokens and an
estimated cost per run, a trace of each model turn and tool call,
and an audit log are built.
- **You are comfortable on a command line** and will reach a private
install through an SSH tunnel.
- **You can accept breaking changes.** The design is still changing.
## Wait if
| You need | Why Werker is not ready |
| ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| A hosted service you sign up for | Nothing hosted is open, and sign-up, billing and credits are not built |
| Public HTTPS from the install script | The script's HTTPS option has not issued a real certificate; Werker's own instance is live over HTTPS on Coolify |
| Backups, restore and upgrades you can rely on | These need further work; there is no tested upgrade path |
| Account recovery by email | Not built |
| More than one worker machine | A run's durable state is a file on the worker's disk, so a run cannot move to another machine |
| Runs started by incoming events, such as a webhook or a new issue | Triggers are not built; runs start from the web app, a schedule or a script |
| Sign-in with OAuth to outside services | Connections use keys or tokens you paste in |
| A long record of reliability | Generated workflows have been measured on a small set of cases, each run once |
| Software that has had a security review | Nothing in the project records one |
## What kind of work fits
Work that fits is work you can describe in a few sentences, that ends
in a file or a written result, and that a person could check. The
cases the project measures itself on are of this kind: looking up a
package and writing a report file, analysing a CSV file and drawing a
chart, writing a small program with its tests and running them, and
labelling a set of items.
Work that does not fit yet: anything that must react to outside events
as they happen, and anything where an agent's mistake costs more than
someone's time to review the result.
## If you are evaluating on someone's behalf
These pages hold the facts to check:
- [Status](/status): each built thing, with how far it has been
tested.
- [Self-hosting](/docs/self-hosting): requirements and what the
install does.
- [Sandboxes and security](/security): isolation, network access, keys
and workspaces.
- [Architecture](/docs/how-its-built): the processes, the database and
the known limits.
- [Pricing](/pricing): what is free and what is planned.
Every page is also available as markdown at its address plus `.md`,
and the whole site as one file at `/llms-full.txt`.
---
# Questions and answers
> Short answers about what Werker is, what it runs on, what it costs, how safe it is and how far along it is.
Source: https://werker.cloud/faq (updated 2026-11-30)
Short answers, each with a link to the page that has the detail.
Werker is early software: where something is planned or untested, the
answer says so.
## What is Werker?
Werker is a platform where you describe some work in plain words and
it is turned into AI agents and a workflow that run. The agents work
in sandboxes, where they can run code and produce files. See
[how Werker works](/how-it-works).
## How is it different from a workflow builder?
You describe the outcome and Werker builds the agents and the steps.
You do not connect blocks by hand first. What it builds is saved, so
you can edit it, run it again or put it on a schedule.
## Can I use it today?
Yes, on your own server. A private single-server install works.
Werker's own instance is live, but nothing hosted is open to customers
yet. See [status](/status).
## Is Werker open source?
It is planned as open source under the MIT licence. The source is not
public yet.
## What does it cost?
Self-hosting is free. You pay for your server and for your AI provider
at the provider's prices. Two hosted offerings are planned and have no
prices yet. See [pricing](/pricing).
## What do I need to self-host it?
A Linux server with Docker Engine and Docker Compose, gVisor for
running agent code, and an AI provider key that you add in the web app
after setup. Node and pnpm are not needed on the server. See
[self-hosting](/docs/self-hosting).
## Does it run on a single VPS or a bare-metal server?
Yes. The install is one server running Postgres, the web app and a
worker with Docker Compose. It has been tested on one server, running
Ubuntu 24.04 on ARM64 with 8 GB of memory.
## Which databases and services does it need?
Postgres only. Postgres is also the queue, so there is no separate
queue or cache to run. See [architecture](/docs/how-its-built).
## Which AI models can it use?
The ones your connected provider offers. You add your own provider key
in Admin → Connections. See
[connections and tools](/docs/connections).
## Where does agent code run?
In a sandbox created for that run and deleted afterwards. A sandbox
can run on your own Docker host with gVisor, on Daytona, or on Docker
Cloud Sandboxes. See [sandboxes and security](/security).
## Can an agent reach the internet?
Only if you allow it. A sandbox has no network, or reaches the sites
you allow through a gateway. How far this has been tested differs by
sandbox provider. See [sandboxes and security](/security).
## Where are my API keys kept?
In your install's database, encrypted. The web app seals a key with a
public key and cannot open it again. Only the worker can. See
[sandboxes and security](/security).
## Can several teams or customers share one install?
Yes. Each gets a private workspace with its own users, roles, keys and
runs. Postgres row-level security keeps one workspace's rows from
another. See [sandboxes and security](/security).
## What happens if the server crashes during a run?
The run resumes without redoing the steps that had finished. One
limit: a run's durable state is a file on the worker's disk, so a run
cannot move to a different worker machine. See
[architecture](/docs/how-its-built).
## Can a run ask me a question?
Yes. A step that needs something only you can give pauses the run.
When you answer, the run continues from that step.
## Can I see what a run cost?
Yes. Each run shows tokens and an estimated cost per model, and a
trace of each model turn and tool call. See
[costs, traces and audit](/docs/costs-and-traces).
## Can runs start by themselves?
On a schedule, yes: every hour, day or week. Starting a run from an
incoming event, such as a webhook, is not built.
## Is it ready for production?
No. It works end to end on one machine and is live on Werker's own
server. Backups, upgrades and account recovery need further work, and
most of the backend has no automated tests. See
[is Werker for you?](/fit).
## Has it had a security audit?
No. Nothing in the project records an external audit or a penetration
test.
## What does the name mean?
Werker is Dutch for worker.
---
# Getting started
> Install Werker on a Linux server, connect a model provider, choose where agent code runs and describe your first piece of work.
Source: https://werker.cloud/docs/getting-started (updated 2026-12-01)
You describe some work. Werker makes the agents that do it, runs them
in a sandbox and gives you the result. This page goes from a Linux
server to a first result.
Werker is early. You can only use it by running it yourself, and each
page says what has not been tested. The
[status page](https://werker.cloud/status) lists everything built and not
built.
## 1. Install it
You need Docker Engine, Docker Compose v2 and an account with an AI
provider.
```sh
git clone https://github.com/werker-ai/werker.git
cd werker
deploy/install.sh
```
The script prints how to reach the app and a setup code. If you use
Coolify, follow [its steps](self-hosting.md#on-coolify) instead.
[Self-hosting](self-hosting.md) covers what the script does and a
public domain.
## 2. Create your account
Open the app, enter the setup code and choose an email and password.
You become the first administrator. Setup closes after that, and
public sign-up stays off.
## 3. Connect a model provider
Open **Admin → Connections**, choose **Add connection**, pick a
provider and paste its API key. Only OpenAI and Fireworks have been
used with a real key. The models you can now use are in **Admin →
Models**. [Connections](connections.md) has the rest.
## 4. Check where code will run
Agents write and run code in a sandbox. The Docker install uses gVisor
on the same server, with no network. Work that reads the web needs a
network setting that allows the sites, in **Admin → Sandboxes**. See
[sandboxes](sandboxes.md).
## 5. Describe some work
Open **New** and say what you want done. Something small that needs no
network:
```text
Write a Node.js script that makes a CSV of 200 made-up orders over six months, then summarise sales by month as a table and a chart. Keep the CSV.
```
Werker may ask questions, then shows a brief: what it will make, what
done means and what it assumed. Press **Approve and start**, or **Just
do it now** to skip both.
Watch the run live. The result is a summary with the files it kept.
## Next
- [Examples](examples.md) has prompts for repeating work, workflows
and teams.
- [Agents and workflows](agents-and-workflows.md) covers running
something again, editing it and putting it on a schedule.
## If it does not work
- **The page lists things to set up:** the work needs something not
connected, such as a sandbox or a service. Set it up, then continue.
- **A run is refused when it is queued:** the connection does not
offer the model you picked.
- **A connection test reports "No worker answered":** the worker is
not running. Look at its logs
([operations](self-hosting.md#operations)).
To work on Werker's own code, start with
[development](engineering/development.md).
---
# Examples
> Prompts to paste into Werker and change, for single agents, workflows of several steps and factories.
Source: https://werker.cloud/docs/examples (updated 2026-12-03)
# Examples
Open **Search…** (), choose **New**, and describe
the work in your own words. Try one of these examples as written or
change it to fit. Werker works out the agents, steps and schedule from
the text. It may ask a round of questions and shows a brief to approve
before it starts
([how](agents-and-workflows.md#questions-and-the-brief)). Change the
names, times and links to your own.
`/work` is the project: files saved there are kept for the next run
([projects](projects.md)). An agent that keeps files needs a sandbox
(Admin → Sandboxes). One that reads the web needs a sandbox network
that allows the sites, or a connected service that fetches or searches
pages ([connections](connections.md)).
## If Werker asks questions
Answer in the boxes, then press **Continue**. One that comes up is
**Which project or repository do you mean?** Give the full link:
```text
https://github.com/earendil-works/pi
```
**Just do it now** sends the answers as they are picked and starts,
with no brief to approve.
## Agents
One agent doing one job. A prompt that says when it repeats ("every
day at 8:00") also makes a schedule.
### Triage the issue inbox
```text
Triage the three newest open issues in werker-ai/werker. Which would you pick up first, and why? Link each issue and suggest its next action. Leave GitHub unchanged.
```
Open the linked issues to check the ranking. Substitute your
repository for `werker-ai/werker`.
### Check the till
Needs: a sandbox to save the note.
```text
The till started with £40. We took £23.50 and £16.25 in cash and gave a £4.75 cash refund. I counted £74 at close. Does that add up? Save me a note for the morning.
```
Check the morning note: £40 + £23.50 + £16.25 − £4.75 comes to £75.
With £74 in the drawer, the till is £1 short.
### Release watcher
Needs: sandbox, web.
```text
Every morning, tell me what’s new in Svelte, Vite and Pi. Link me to the releases worth reading and don’t repeat ones you’ve already told me about.
```
To check the next digest without waiting until morning, open the
finished run and choose **Run again**. Compare the two digests: a
release from the first one shouldn’t appear as new in the second.
### Site checker
Needs: sandbox, web.
```text
Every day at 7:00, check every page in https://example.com/sitemap.xml. Report broken links, pages with a missing title or description, and pages that took more than 2 seconds to load. Add one row per page to /work/history.csv.
```
### Model price watcher
Needs: sandbox, web.
```text
Every Monday at 9:00, collect the input and output prices of the models on the OpenAI, Anthropic and Google pricing pages. Save them as /work/prices.csv, compare them with last week's prices and show what changed as a table and a chart.
```
### Docs checker
Needs: sandbox with Git, web.
```text
Every Friday at 16:00, clone https://github.com/OWNER/REPO and check its README and docs folder. List every file path, command and link they mention that no longer exists, with the file and line.
```
## Workflows
Ordered steps, each done by one agent.
### Review the Renovate queue
```text
List the two newest open Renovate PRs in werker-ai/werker. Review each separately: did the build and tests pass for this version? Tell me which to merge and which to hold, with links. Don’t merge anything.
```
In the workflow builder, keep the first step to listing PRs and their
head and base commits. On the review step, switch on **Run once per
item the step before lists**. Each PR then gets its own job. Open the
jobs to see the verdicts: a passing Renovate age check is not a
passing build. This example reads existing CI; it does not start a
build or merge a PR. If a job finishes with **CI pending**, open its
GitHub Actions link for the final result. The finished job does not
resume when CI completes.
### Topic brief
Needs: sandbox, web, a search service.
```text
Every Monday at 8:00, in separate steps: search for last week's news about TOPIC, remove anything already covered in earlier briefs in /work/briefs, then write a one-page brief with a link for every claim and save it in /work/briefs.
```
### Weekly changelog
Needs: sandbox with Git, web.
```text
Every Friday at 15:00, in separate steps: collect the commits to main of https://github.com/OWNER/REPO from the last 7 days, group them into features, fixes and other, then write a changelog a user would understand and save it as markdown in /work.
```
### Issue triage
Needs: a GitHub connection, or web for a public repository.
```text
Every weekday at 9:00, in separate steps: list the open issues of OWNER/REPO that have no label, then for each suggest a label, a priority and any likely duplicate, with the reason. Report them as one table. Do not change anything on GitHub.
```
To give each issue its own job, open the saved workflow and switch on
"Run once per item the step before lists"
([workflow steps](agents-and-workflows.md#workflow-steps)).
## Factories
A saved team with a lead. Message the lead in a room and it hands work
to the members ([factories](factories.md)). A factory works when it is
messaged; it does not run on a schedule.
### Release desk
```text
Make me a release team for werker-ai/werker. I want to bring a proposed change to the lead and get a QA testing recommendation and a draft release note. Don’t publish anything.
```
Give the lead a real PR in the team room:
```text
For https://github.com/werker-ai/werker/pull/96, what would QA test before release, and does this need a user-facing note? Give me the recommendation here.
```
Bring the next PR to the same team. Ask which checks were actually run
and which are recommendations.
### Small web app team
Needs: sandbox.
```text
Make a factory that builds small web apps. A lead who plans the work, a builder, a tester who runs the app before it is called done, and a reviewer who checks accessibility and simplicity.
```
### Blog desk
Needs: sandbox, web, a search service.
```text
Make a factory that writes blog posts. A lead who agrees the outline, a researcher who finds sources, a writer, and a fact checker who links a source to every claim before a post is finished.
```
### Data desk
Needs: sandbox with Python and pandas ([images](sandboxes.md#images)).
```text
Make a factory that answers questions about CSV files. A lead, an analyst who works with pandas, one who makes the charts, and a sceptic who recalculates every number before it is reported.
```
---
# Agents and workflows
> How described work becomes a saved agent or workflow, and how to answer it, run it again, edit it, schedule it and read its result.
Source: https://werker.cloud/docs/agents-and-workflows (updated 2026-12-01)
An **agent** does one job. A **workflow** is ordered steps, each done
by one agent. You do not choose between them: describe the work in
**New** and Werker does. For ongoing work you direct with many
requests it makes a [factory](factories.md) instead.
## Describing work
Say what you want, where the input is and what you want back. If it
repeats, say when ("every weekday at 9:00") and it gets a schedule.
In the text box:
- `@` mentions a connection, a saved agent or workflow, or a
[project](projects.md) to work in.
- `/agent`, `/workflow` and `/factory` decide what is made.
- `/schedule` picks when it repeats.
- `/now` starts without questions or a brief.
## Questions and the brief
Werker may ask up to two rounds of questions, with a recommended
answer already picked. It then shows a brief: what it will make, what
done means and what it assumed. Nothing is saved until you press
**Approve and start**. **Just do it now** takes the answers as they
are picked and starts.
If the work needs something that is not set up, such as a sandbox or a
service, nothing is saved and the page lists what to set up. A request
that cannot be done fails with the reason.
## While it runs
Each run gets its own [sandbox](sandboxes.md). You follow it live, and
it carries on if you close the page. A run interrupted by a crash
continues from its last finished step.
A step ends in one of three ways:
| Ends as | Meaning |
| ----------- | ------------------------------------------------------------------------------ |
| done | A summary, and files kept in the run's project. The next step gets both. |
| needs input | A question only you can answer. The run waits; your answer restarts that step. |
| failed | Why the task cannot be done. The run fails. |
Questions from every run are in **Decisions**. **Stop run** ends a run
that is queued, running or waiting.
## Reading a result
The result is the last step's summary with its files. Under it, **The
agent's account** lists what the agent says it checked, assumed and
worked around. A run with workarounds is marked in the list of runs.
Nothing checks the account: an agent that hides a workaround is not
caught.
## Running it again
What Werker makes is saved, in **Agents** or **Workflows**.
- **Run again** uses the saved version, with your edits. It does not
plan the work afresh.
- **Edit** changes later runs, not one in progress.
- **History** shows what each saved change did and restores an earlier
one as a new version.
- **Archive** hides a finished run from lists; its link still opens
it, and **Restore** puts it back. Its schedules carry on. Runs
cannot be deleted.
On a saved agent, workflow or factory, **Archive** hides the saved
item, not its runs. The planner no longer offers an archived agent.
Open **Archived** on its list to restore it. Archiving turns off an
agent or workflow’s schedule; restoring does not turn it back on.
**Delete** permanently removes the saved item but keeps its runs,
recorded costs and project. Remove an agent from saved workflows that
use it before deleting it.
## Schedules
A saved agent or workflow can run every hour, day or week at a set
time in a time zone. 09:00 stays 09:00 when the clocks change. One
missed while no worker was running fires once, then carries on. A
scheduled run that cannot be queued says why on the Schedule card.
Schedules are the only trigger. Starting work when something arrives,
such as a new issue, is not built
([#7](https://github.com/werker-ai/werker/issues/7)).
## Workflow steps
In the workflow builder you can add, reorder and edit steps, and:
- **Run once per item the step before lists:** the last step becomes
one job for each item, such as each open pull request, several at
once. At most 50 items. An item already run once gets no second job.
- **Then decide what comes next:** a yes or no question about a step's
result goes on, skips the next step or stops the run. It needs a
classifier ([connections](connections.md#the-classifier)). An
unclear answer goes on.
## What agents learn
A finished step can report the procedure that worked: commands, code
and checks. Werker keeps it with that agent as its equipment and gives
it to later runs. Editing the agent's role or task sets it aside, and
you can discard it on the agent's page. The agent still reasons on
every run; replaying a procedure with no model is not built
([#8](https://github.com/werker-ai/werker/issues/8)).
## Limits
- An agent or workflow step stops after 24 model rounds that call
tools without finishing. Several tool calls in one round count once.
Completed earlier steps keep their results.
- After a crash, an external action such as opening a pull request can
be repeated ([#16](https://github.com/werker-ai/werker/issues/16)).
- How well generation works has been measured only a few times
([status](https://werker.cloud/status)).
---
# Factories
> A saved team with a lead that you send work to, how to make one, talk to it in rooms, change its members and reuse the team.
Source: https://werker.cloud/docs/factories (updated 2026-12-01)
A factory is a team that keeps working on one thing, such as a
website: a lead, and specialists the lead hands work to. Use one when
you will direct the work with many requests. For work you can state
once, use an [agent or workflow](agents-and-workflows.md).
Factories are at spike quality.
## Making one
Describe the team's work in **New**, or use **New factory** on the
Factories page. Werker asks questions and shows a brief, as for any
work, then fits a team to it. You can start from a saved team instead.
A factory works when it is messaged. It does not run on a schedule.
## Rooms
A conversation with a factory is a room.
- **Who you address:** the lead, unless you pick someone else.
`@name`, `@lead` and `@all` address members.
- **Asking each other:** members can ask other members, or open a new
room for some of them. Their replies come back to whoever asked.
- **Reading along:** other members in the room see the message and
stay quiet unless it is theirs. Each read is a model call, and a
factory can switch it off.
- **`/status`** asks the lead for a report.
- **`/stop`**, for people who may stop runs, stops the room's work and
whatever it set off in rooms its members opened.
Messages between members fold into one line; open it to read them.
Each member's reply is a run you can open. The panel beside the room
shows what each member is doing, what is waiting for you, the project
and what the conversation has cost.
A member whose turn fails or is stopped counts as finished, and
whoever asked it is told. Stopping one turn therefore gives the asker
another: stop that too, or use `/stop`.
## Questions for you
A member that needs an answer stops and asks. The question is in the
room, on the factory's page and in **Decisions**. Answer it in any of
them.
## Changing the team
On the factory's **Team** page:
- **Ask for a change** in words. Werker shows it as a difference per
member; apply it or discard it.
- **Edit a member:** instructions, responsibilities, model and tools.
- **Teams:** up to four, each with its own lead and at most four
members, under the factory lead. Drag members between them, or use
the menu.
- **Remove a member:** its messages stay. A lead cannot be removed
until another member leads.
A change you asked for applies to the next turns, and cannot be
applied while the team has work queued, running or waiting.
**History** restores an earlier team.
### With more than one team
A factory lead asks team leads, a team lead asks its own members and
the other leads, and a member asks its own team. You can address
anyone.
Each room belongs to a team, or is the leads' room. `@` and a team's
name reaches that team's lead, `@all` reaches the team (or the leads,
in their room), and `@factory` reaches the factory lead. A message in
a team's room never wakes another team.
### Room settings
- **Conversation prompt:** what every member is told about talking in
the room, before its own instructions.
- **Turns per message:** how many turns one of your messages may set
off, counting every ask, follow-up and read. It is 24 to start with.
- **Everyone reads every message:** reading along, on to start with.
## Saved teams
**Save as starter** keeps a team to make more factories from. The
Teams page shows each saved team, how its factories have done and
which have changed since. **Copy into starter** brings a factory's
changes back.
Every workspace starts with one default team, "New members", which new
factories and new members start from. You can edit it but not delete
it.
## Files
A factory's members share one [project](projects.md). The factory's
page shows what the newest version changed, and **Run it** starts it.
## Limits
- Fitting a team to a brief, and changing one by asking, have been
tested with scripted models and in component tests, not on a real
model.
- Deleting a factory removes its rooms and messages. Runs, costs and
its project stay.
---
# Projects
> The folder of files an agent, workflow or factory keeps between runs, how versions work, and running what was built.
Source: https://werker.cloud/docs/projects (updated 2026-12-02)
A project is the folder of files an agent, workflow or factory keeps
between runs. A run finds its project's files in `/work`, and `/work`
is saved as a new version each time a step finishes.
## Which project a run uses
- A saved agent, workflow or factory has one project of its own, made
the first time it saves something. Its scheduled runs use the same
one.
- Mentioning a project with `@` in **New** makes the run work in that
one. Later runs of what it made do too.
- Any other run with a sandbox has a project of its own.
## What is kept
Everything in `/work`, except folders such as `node_modules`, `.venv`
and `__pycache__`, and whatever the project's `.gitignore` names. A
packed project can be 200 MB.
When two runs save at once, changes to different lines are joined. If
both changed the same lines, the project is left as it was and the
second run's activity says so. Its files are kept, but nothing in the
app shows them.
## Browsing
**Projects** in the sidebar lists them. Open one to see its folders,
read a file, pick an older version or download a zip.
## Deleting
**Delete project** in a row's menu deletes the project and its files
after you confirm. Runs that used it stay. It is refused while a run
is working in the project or a preview of it is running. The next run
of the workflow, agent or factory that worked in it starts a new,
empty project. It needs the permission to delete runs.
## Running what was built
**Run it** starts the version you are looking at in a sandbox of its
own and gives you a link. It stops by itself after 30 minutes, or when
you press **Stop**.
It needs Daytona or Docker Cloud Sandboxes. Docker with gVisor cannot
give a sandbox an address, so there the button is off. On Daytona this
has not been run.
Agents are told to say how the project starts in
`werker.preview.json`, at its root:
```json
{ "install": "npm install", "start": "node server.js", "port": 4000 }
```
Without it, Werker tries `package.json` scripts, then Python apps,
then plain web pages, and says what it assumed.
The running site is code an agent wrote:
- it is served from the provider's address, not Werker's, and gets
none of your keys;
- the address is not private: anyone who has it can open the site
until it stops.
## Backups
Projects are files on the server, not in the database, so a database
backup does not include them. Back up the projects folder too
([self-hosting](self-hosting.md#data-and-backups)).
---
# Costs and traces
> What Werker records about a run, what it cost and who changed what, and how far each record has been tested.
Source: https://werker.cloud/docs/costs-and-traces (updated 2026-12-01)
Werker records usage and estimated cost per run, a trace of each model
turn and tool call, an append-only audit log, and metrics per piece of
work. Several of these have been seen only against test data or the
local database. All of it is spike quality.
## Summary of what exists
| Record | Question it answers | How far it has been exercised |
| ------------------------- | --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| Usage | What did this run spend on models? | Built. |
| Run trace | What did this run do, turn by turn? | Built. Seen in a browser with made-up rows only, not with a trace from a real run. |
| Cost of a unit of work | What did a step, agent, workflow or factory cost? | Built. Same as the trace: seen with made-up rows. |
| Metrics per piece of work | Is the work succeeding, getting dearer, needing a person? | Built. Seen in a browser against the local database's runs. |
| Audit log | Who or what did something, to what, and when? | Built. Seen recording real runs on Daytona. Signing in and editing through a browser were not tested end to end. |
| Interventions | How often did a person step in? | Built. Tested against a disposable database. The part that shows it on run pages was not seen in a browser. |
| Scores | Did a run do what it should have? | Built. No real judge call has been made. |
| Visitor analytics | Who visits, and from where? | Built. Not yet seen on a hosted instance. |
## Usage per run
When a run finishes, stops or waits for input, the worker stores
input, output and cached tokens per model, and an estimated cost at
the model provider catalogue's prices. The cost is 0 when the
catalogue has no price. A run's page shows this once it has stopped,
and Admin → Usage shows a workspace's last 30 days: per day, per
model, and the runs that spent most. The spend of an attempt that
crashed before its first second was stored is not recorded.
## Run traces
A trace holds one span per model turn and per tool call, with
duration, failure, exit code, token counts and cost. The worker writes
spans while a run is going and again when it ends. The run page's
Trace tab shows cost, tokens, turns and tool calls, where each turn's
time went, a failures-only filter and a drawer for each span.
Observability (`/observability`) adds overview, runs, tools and costs,
over 24 hours, 7, 30 or 90 days.
Secrets such as API keys, tokens and passwords are redacted before
storage, long values are cut, and the model's thinking is never
stored. A missing duration is estimated from the surrounding turn.
## The cost of a unit of work
Cost is shown for a run, a step, an agent, a workflow and a
[factory](factories.md). It has three parts:
- **Model calls:** from the usage records.
- **Sandbox time:** seconds a sandbox ran, times the CPU and memory it
had, times prices an instance admin sets in Admin → Sandboxes.
- **Service calls:** calls to connected services, times a price per
call that an admin sets.
A part with no price is shown as seconds or calls with "no price set",
left out of the total, and the total is marked incomplete. Where only
some of it was priced the money is marked `*`.
**Observability → Costs** has a row for each workflow, factory and
agent. It starts with workflows and factories; clear the filter for
agents. A row opens to where its money went and its latest 20 pieces
of work. An agent's spend is also in the workflow or factory it worked
in, so rows do not add up to the total.
A run's page works its cost out from today's prices. Everything else
uses the prices from when the run ended, so a later change does not
alter past work. Prices per workspace are not built.
## Metrics per piece of work
A piece of work is one run of a workflow or agent, or one request to a
factory with every member turn it set off. The same five figures are
on **Observability → Overview** for the workspace, over the range you
pick, and on each workflow's, agent's and factory's own page, over the
last 30 days. They count work that began in that time.
| Figure | What it is |
| -------------------- | --------------------------------------------------------------------------------------------- |
| Finished | How many have ended: done, failed or stopped. |
| Succeeded | The share of those that are done. Beside it, the judge's pass rate. |
| Typical cost | The median cost of an ended piece of work. "High" is the 90th percentile. |
| Typical time working | The median time in model turns and tool calls, added up. Waiting for a person is not counted. |
| Stepped in | How often [a person stepped in](#interventions), per ended piece of work. |
- Each shows the change from the equal period before, but only when
both ended at least 5 pieces of work.
**Compare by** splits them, for up to 20 rows:
- **Version:** the saved version when the work began, so you can read
before and after an edit. Editing an agent is a version of the
agent, not of the workflow it is in.
- **Model:** the model the run was given.
- **Task:** the same text asked again. Different words are a different
row.
One line gives what 100 and 1,000 more pieces of work would cost at
the average cost so far. A factory also lists its rooms, with what a
typical request in each cost.
Not built: replaying work under another model
([#26](https://github.com/werker-ai/werker/issues/26)), and trend
lines over more than two periods
([#28](https://github.com/werker-ai/werker/issues/28)).
## Versions
Each saved change to an agent, workflow, factory or role preset is
kept as a numbered version with who made it, and can be restored as a
new version. It is tested against a disposable database and in
component tests, and was not seen in a browser.
## The audit log
The audit log is append-only: the app's database role can add and read
events but not change or delete them. It is separate per workspace,
plus instance-level events. It records:
- sign-ins, sign-outs and failed sign-ins;
- changes to connections, members, roles, models, prices, settings,
agents, workflows, factories and schedules;
- runs queued, stopped, answered, archived and restored, including
those from schedules and scripts;
- sandbox created, started, stopped and deleted;
- shell commands an agent ran, and service and MCP calls, with status
and duration.
It never stores keys, passwords or request bodies. It shows in Admin →
Audit and on each run's page, for people with the audit permission.
## Interventions
An intervention is a person answering a question, stopping a run, or
running again after a failure. Only actions by a signed-in person
count; schedules, scripts and edits made afterwards do not. The count
shows on the run page and feeds the metric above.
## Scores
A judge answers questions you set about a sample of finished runs,
pass or fail with one of eight fixed reasons. Three built-in questions
(did it do what was asked, did it report its problems, is the result
grounded) are on at 25 percent, and you can edit them or add more.
Pass rates and failing runs are in Observability → Scores. Judging
cost is kept on the verdict, not in the run's cost.
Not tested: no real judge call has been made.
## Visitor analytics
Werker counts page views without IP addresses, raw user agents or
cookies. A visitor is a daily hash that cannot be linked across days,
so counts are visitor-days. Bots and requests with Do Not Track are
skipped. Instance admins see totals in Admin → Analytics.
## What is not recorded or built yet
- **Trace retention:** not built; traces are kept.
- **Idempotency keys for external actions,** so a step re-run after a
restart does not repeat them
([#16](https://github.com/werker-ai/werker/issues/16)).
- **Factory conversations,** and the role used on each audit event,
are not recorded.
- **Before and after content** of an edit is in versions, not the
audit log.
- **Proposed improvements** from low scores and traces are not built;
nothing changes a definition by itself.
- **Alerts** on falling pass rates, and search of traces beyond recent
failures.
- **Billing and credits** are not built. See
[pricing](https://werker.cloud/pricing) and [status](https://werker.cloud/status).
---
# The werker CLI
> Start and follow Werker work from a terminal, or let your own agent do it with an API key.
Source: https://werker.cloud/docs/cli (updated 2026-12-01)
`werker` starts, follows and stops work in a Werker, from a terminal
or from an agent such as Claude Code. Your agent shapes the request
with you, then hands it over.
It is not on npm yet. From Werker's source:
`pnpm --filter @werkerai/cli build`, then
`node apps/cli/dist/index.js`.
## Signing in
Make a key in **Settings → API keys**
([API keys](users-and-access.md#api-keys)), then pipe it in, so it
stays out of your shell's history:
```sh
werker login --url https://werker.example.com < key.txt
werker whoami
```
Or set `WERKER_URL` and `WERKER_API_KEY`. A saved key is only sent to
the address it was saved for, over HTTPS or to your own machine.
## Using it
| Command | What it does |
| ------------------------------------- | ----------------------------------------------- |
| `werker guide` | Tells an agent how to use it |
| `werker context` | Lists models, connections and saved work |
| `werker run --file request.md` | Starts work, prints the run's ID and returns |
| `werker run --agent ` | Runs a saved agent (or `--workflow`) |
| `werker runs list`, `get`, `follow` | Reads runs |
| `werker runs cancel`, `rerun` | Stops a run, or runs its saved work again |
| `werker answer "…"` | Answers a run that asked, if the key may |
| `werker files list`, `get` | Downloads what a run made (`project` for a zip) |
| `werker factory list`, `show`, `read` | Reads factories and their rooms |
| `werker factory send`, `stop` | Sends a message to a room, or stops its work |
| `werker call --list` | Lists every operation; `call ` runs one |
It never asks for anything: text comes from words, `--file` or stdin,
and `--json` prints JSON. Work starts without the questions **New**
asks. With more than one model, name one with `--model`.
## Exit codes
| Code | Meaning |
| ---- | ------------------------------------ |
| 0 | Done |
| 1 | It failed, or the run did |
| 2 | The command was used wrongly |
| 3 | The run is waiting for an answer |
| 4 | The key is missing, or may not do it |
| 5 | Still going when the time ran out |
## What has been tested
On one machine, against a development Werker: signing in, reading,
refusals, starting a described agent, following it, and downloading
its file and project. Answering a run, factories and running saved
work have only been tested with made-up servers or not at all.
## Not built
- Sending files to a run.
- Following a factory's room; read it again instead.
An assistant that speaks MCP can connect without the CLI
([MCP](mcp.md)).
---
# MCP
> Connect an assistant such as Claude Code or Codex to Werker, to start and follow work by asking.
Source: https://werker.cloud/docs/mcp (updated 2026-12-01)
An assistant that speaks MCP can start and follow work in your Werker,
at `/mcp` on its address. There is nothing to install.
## Connecting
Make a key in **Settings → API keys**
([API keys](users-and-access.md#api-keys)) and keep it in an
environment variable, such as `WERKER_API_KEY`.
Claude Code, in a project's `.mcp.json`:
```json
{
"mcpServers": {
"werker": {
"type": "http",
"url": "https://werker.example.com/mcp",
"headers": { "Authorization": "Bearer ${WERKER_API_KEY}" }
}
}
}
```
Codex, in `~/.codex/config.toml`:
```toml
[mcp_servers.werker]
url = "https://werker.example.com/mcp"
bearer_token_env_var = "WERKER_API_KEY"
```
## What it can do
The assistant writes a short script instead of calling one tool at a
time.
| Tool | What it does |
| ------- | -------------------------------------------------- |
| `docs` | Shows the functions a script can call |
| `read` | Runs a script that only reads |
| `write` | Runs a script that can start, change and stop work |
- `write` can spend money.
- A key that only reads is not offered `write`. Answering a run needs
a key that may answer for you.
- What a script did before it failed stays done.
- A script has 30 seconds, so the assistant starts work and looks
again later.
## What has been tested
On one machine: Claude Code listing runs and starting a saved agent,
and Codex counting runs. Cursor has not been tried. A client that only
signs in with OAuth, such as ChatGPT's connectors, cannot connect yet.
---
# Self-hosting
> What you need to run Werker on your own Linux server, how to install, back up and operate it, and what is not ready.
Source: https://werker.cloud/docs/self-hosting (updated 2026-12-01)
A private, single-server installation with Docker Compose, or a
deployment [on Coolify](#on-coolify). Neither is hardened.
## Requirements
- A Linux server with Docker Engine and Docker Compose v2.
- A copy of [the repository](https://github.com/werker-ai/werker).
- gVisor (`runsc`) registered as a Docker runtime for code execution.
On Debian or Ubuntu the install script adds it (using `sudo`); on
other distributions install it first. The install script requires it
even if sandboxes will run on
[Daytona or Docker Cloud Sandboxes](sandboxes.md#choosing-a-provider)
instead (chosen later in Admin → Sandboxes).
- An AI provider account and API key, added in the web app after
setup.
Node and pnpm run inside the image; they are not required on the host.
The first build needs internet access. No provider keys or local
`.env` files are copied into the image.
## Install
From the repository directory on the server:
```sh
deploy/install.sh
```
The script checks Docker, installs gVisor if Docker has no `runsc`
runtime, runs `docker compose -f deploy/compose.yaml up -d --build`,
waits for the web app and prints how to reach it and the setup code.
It is safe to run again, and running the compose command yourself does
the same without the checks.
The build generates and retains internal secrets, starts Postgres,
applies the schema, replaces development database passwords, and
starts the web app and worker. It does not seed a development user.
The web listener is bound to **127.0.0.1:5231**, not a public
interface. There are no DNS, reverse proxy or existing website
changes. Postgres has no published port.
From your own computer, keep this tunnel running:
```sh
ssh -N -L 127.0.0.1:5231:127.0.0.1:5231 your-server
```
Open **http://localhost:5231**. Use that exact hostname and port: this
recipe configures them as the authentication origin and builds the web
image for that origin.
### A public domain instead
```sh
deploy/install.sh --domain werker.example.com
```
This builds the web image for `https://werker.example.com` and starts
a Caddy container that gets and renews the certificate. It needs a DNS
record for the domain pointing at the server, and ports 80 and 443
free: a server already running a reverse proxy (Coolify, Traefik,
nginx) should route the domain to `127.0.0.1:5231` there instead. The
domain is remembered in `deploy/.env`, which holds no secrets. This
path has only been checked as far as the compose configuration; no
certificate has been issued with it yet.
## First use
1. Get your setup code on the server (the install script prints it):
```sh
docker compose -f deploy/compose.yaml exec web node deploy/start.ts setup-code
```
2. Enter it on the setup screen and choose your email and password.
This creates the first instance administrator and a workspace.
Setup closes once an account exists; public signup remains off.
Adding more people is in [users and access](users-and-access.md).
3. Open **Admin → Connections**, choose **Connect** on a model
provider and paste its API key ([connections](connections.md)). The
web app can store the key but not read it back.
4. Check **Admin → Models** for provider availability, then use
**New** to describe some work.
The worker uses this server's Docker socket for gVisor sandboxes.
Sandbox networking starts disabled; resource and network settings are
under **Admin → Sandboxes**. Only the trusted worker receives the
Docker socket, never the generated-code containers.
Supported providers, credential handling and the classifier binding
are in [connections](connections.md).
## What runs
| Service | What it does |
| ----------- | ------------------------------------------------------------------------------- |
| `configure` | Runs once, generates the install's secrets and gives each service only its own. |
| `postgres` | Postgres 17. No published port. |
| `migrate` | Runs once, applies the database schema. |
| `web` | The web app. Listens on 127.0.0.1:5231. |
| `worker` | Runs the work and controls Docker for sandboxes. |
| `proxy` | Optional Caddy reverse proxy, started only with `--domain`. |
## Which service holds which secret
`configure` generates every secret once and hands each service only
its own, on separate volumes:
- **web:** its database passwords, the session-signing secret, the
setup code and a public key. It holds nothing that decrypts stored
credentials.
- **worker:** its database password and the master key. Only the
worker opens stored credentials, so **Test connection** and model
checks run there; a test reports "No worker answered" when the
worker is down
([how credentials are sealed](connections.md#how-keys-are-kept)).
- **postgres:** its own password.
- **configure** and **migrate**, which run and exit: all of them.
## Operations
```sh
docker compose -f deploy/compose.yaml ps
docker compose -f deploy/compose.yaml logs --tail=100 web worker
docker compose -f deploy/compose.yaml restart web worker
docker compose -f deploy/compose.yaml stop
docker compose -f deploy/compose.yaml up -d
```
Docker restarts the long-running services after a reboot. The
`configure` and `migrate` containers are one-time jobs; an exited
status with code 0 is normal.
## Data and backups
Persistent Docker volumes:
- `werker-selfhost_postgres`: accounts, connections, workflows and
runs.
- `werker-selfhost_secrets`: generated database passwords,
authentication secret, master key and setup code. Treat this volume
as credentials.
- `werker-selfhost_projects`: the files agents keep
([projects](projects.md)).
Preserve **all four**. Losing the secrets volume loses access to
encrypted provider keys and the database. Do not use `down -v` unless
you intend to destroy the installation. The `secrets-web`,
`secrets-worker` and `secrets-postgres` volumes are copies rewritten
from `secrets` on every start; `caddy` holds certificates Caddy can
get again.
To back up, stop the services and archive the four volumes together:
```sh
docker compose -f deploy/compose.yaml stop
for volume in postgres runs secrets projects; do
docker run --rm -v werker-selfhost_$volume:/from:ro -v "$PWD":/to \
alpine tar czf /to/werker-$volume.tar.gz -C /from .
done
docker compose -f deploy/compose.yaml up -d
```
The archives contain every credential. Restoring is the reverse into
empty volumes of the same names; it has not been rehearsed, and there
is no scheduled backup. Schema changes are numbered migrations,
applied on start; upgrading an install has not been rehearsed. Do not
reset a populated installation to work around that.
## On Coolify
How Werker's own instance was set up, on Coolify 4.7.10, on 2026-11-30
and again on another server on 2026-12-01. Coolify builds the
repository with Railpack. These steps replace the install script.
### Before you start
- **Docker 29.10.1 on the server**, as tested.
- **A domain** for the app, such as `app.example.com`, with a DNS
record pointing at the server.
- **A GitHub source in Coolify** (Sources), a GitHub App with access
to the repository or your fork of it. A push to the branch then
redeploys. For a repository in an organisation, install the App on
the organisation.
- **A key for Daytona or Docker Cloud Sandboxes.** The app's container
has no Docker socket, so gVisor sandboxes do not run there
([sandboxes](sandboxes.md)).
### 1. Add the database
Add a PostgreSQL 17 database to a project, and **press Start**. The
app cannot start without it. From its General page, copy the
**internal** Postgres URL, not the public one.
### 2. Add the app
Add the repository from your GitHub source and change the build pack
from Docker Compose.
| Setting | Value |
| ----------------- | ----------------------------------- |
| Branch | `main` |
| Build pack | **Railpack** |
| Base directory | `/` |
| Build command | `pnpm --filter @werkerai/app build` |
| Start command | `pnpm start` |
| Port | 3000 |
| Domain | `https://app.example.com` |
| Persistent volume | `/app/data` |
The volume holds run files and projects.
### 3. Make the secrets
In your own terminal. It prints them and saves nothing:
```sh
for n in 1 2 3; do echo "HEX $n: $(openssl rand -hex 24)"; done
for n in 1 2; do echo "BASE64 $n: $(openssl rand -base64 32)"; done
```
### 4. Add the environment variables
```sh
# Available at build time and at runtime
ORIGIN=https://app.example.com
# Build time: projects need Git in the running container
RAILPACK_DEPLOY_APT_PACKAGES=git
# Runtime only
WERKER_OWNER_DATABASE_URL=
WERKER_DATABASE_URL=postgresql://werker_app:@
WERKER_AUTH_DATABASE_URL=postgresql://werker_auth:@?options=-c%20search_path%3Dauth
WERKER_SETUP_CODE=
WERKER_AUTH_SECRET=
WERKER_SECRET_KEY=
WERKER_SANDBOX_NAMESPACE=prod
```
Untick build time for the ones under "Runtime only".
- **`WERKER_OWNER_DATABASE_URL`** is the database's own administrator.
Paste the internal URL whole and unchanged. Its password is
Coolify's, and matches none of the others.
- **``** is everything after the `@` in that URL, with the port
and database name and without any `?` part. If Coolify shows
`postgres://postgres:abc@xyz123:5432/postgres`, it is
`xyz123:5432/postgres`.
- **`` and ``** are new passwords, used only here.
`pnpm start` makes the tables and the two database users, and gives
the users these passwords.
- **`WERKER_SECRET_KEY`** encrypts stored provider keys. Keep a copy
outside Coolify: without it they cannot be read.
### 5. Deploy and make your account
1. Press Deploy, or push to the branch.
2. Open `https://app.example.com/setup`. There is nothing to run on
the server: the setup code is the `WERKER_SETUP_CODE` you put in
Coolify.
3. Choose your email and password. Do this soon after deploying, as
setup stays open until an account exists.
### 6. Set it up in the app
1. **Admin → Sandboxes:** choose Daytona or Docker Cloud Sandboxes and
press **Save**, then add its key. The default is a Docker socket
this container does not have, and its check fails with
`spawn docker ENOENT`.
2. **Admin → Connections:** add a model provider
([connections](connections.md)).
3. **Admin → Email**, if you want it: [email](connections.md#email).
4. **New:** run something small. That tests the worker and the
sandbox.
On 2026-11-30 a sandboxed run worked this way, and runs, connections
and a project survived a redeploy. No run has been checked on the
server set up on 2026-12-01.
### 7. Keep it running
- **Health check** (the app's Healthcheck page): HTTP GET, port 3000,
path `/api/health`, start period 30 seconds, then **Enable** and
confirm.
- **Memory limit** (Resource Limits): Werker's own is 4 GB.
- **Backups** (the database's Backups page): add a schedule such as
`0 3 * * *`, and under Retention set how many to keep; 0 keeps them
all. Run **Back up now** once and see that it succeeds.
- A backup on the same server is lost with it, so add S3 storage. It
does not hold `/app/data`, and provider keys in it cannot be read
without `WERKER_SECRET_KEY`.
The limit and health check apply from the next deploy.
### Moving to another server
Set up the new one beside the old, then point the domain at it. To
stop the old application deploying on a push, set it to **Manual
deployments only** (Advanced).
- To reuse an emptied database instead, drop the `public` and `auth`
schemas, then `CREATE SCHEMA public` and
`GRANT USAGE ON SCHEMA public TO PUBLIC`. Without the grant the app
cannot see its tables. This was rehearsed on a throwaway database.
### How it differs from the Docker install
- Web and worker run in one container, and both get every variable,
including the master key and the database owner's URL.
- `pnpm start` does not pass the stop signal on, so a redeploy cuts
off running work.
## What is not ready
- **A complete AI run on a fresh install** has not been run with the
install script. Install, first-administrator setup, and saving and
testing a connection have. On Coolify a sandboxed run worked on
2026-11-30.
- **Public HTTPS from the install script:** `--domain` has not issued
a real certificate.
- **Upgrades and restore** have not been rehearsed, and the Docker
install has no scheduled backup or automatic upgrade.
- **Account recovery:** there is no email or password recovery.
- **Postgres restarting** stops the web app and worker, instead of
them reconnecting.
- **One worker machine only:** a run cannot move between machines.
- **Server size:** no minimum has been established. The tested VPS is
Ubuntu 24.04 on ARM64 with 8 GB RAM.
`/api/health` is not proof that an AI run works. A first run still
needs a valid provider key, model access and, for code in Docker, a
working gVisor runtime.
The Docker installation gives its sandboxes, cleanup labels and
optional gateway their own names, so they do not collide with another
Werker worker on the same Docker host.
---
# Connections
> Connect model providers, GitHub, HTTP APIs, MCP servers and email, what each gives a run, how keys are kept and what is verified.
Source: https://werker.cloud/docs/connections (updated 2026-12-01)
Werker uses your own keys. A connection is a key or token for a model
provider, GitHub, an HTTP API or a remote MCP server, and belongs to
one workspace. Most have been checked with synthetic tests rather than
live accounts.
## Adding one
1. Open **Admin → Connections** and choose **Add connection**, or open
the command palette (Ctrl K, or ⌘K on a Mac) and choose **Connect a
service…**.
2. Pick a service. A listed one fills in its own address, so it asks
only for a name and a key.
3. Werker checks it and saves it. You can test it again, reconnect or
disconnect it from the list.
Enter keys in that form, never in a conversation. Leaving the key
blank when editing keeps the stored one.
Checking TypeSafe makes a small request that can cost money.
## Model providers
OpenAI, Anthropic, Google Gemini, OpenRouter, Mistral, Groq, xAI,
Fireworks and TypeSafe. Only OpenAI and Fireworks have been used with
a real key. Those two also report which models a key can use; for the
others every catalogue model is assumed available.
- A run uses the workspace's oldest connection that offers its model.
- A run whose model its connection does not offer is refused when it
is queued.
- Limit a workspace to chosen models in **Admin → Models**.
- A custom endpoint changes where a provider is reached. It does not
add a new provider.
### The classifier
The first connection that offers a classifier model also becomes the
workspace's classifier, which answers yes or no, choice and score
questions for
[workflow decisions](agents-and-workflows.md#workflow-steps) and
[scores](costs-and-traces.md#scores). Change it in **Admin → Models**,
under **Decision model**.
## GitHub
- **GitHub App:** **Admin → Connections → GitHub App** makes a private
App on your GitHub account, then GitHub asks which repositories it
may use. It can read metadata, checks and statuses, and write
contents and pull requests.
- **Token:** paste a GitHub token. You can limit it to named
repositories; the token's own permissions are still the most it can
do.
Use the App for Git in hosted [sandboxes](sandboxes.md): a personal
token is never given to one. Tokens were tested against a local
fixture, not a live account. Git with the App was checked with scripts
against Daytona and Docker on 2026-11-28.
The App is always made under your personal account, so it cannot be
installed on an organisation's repositories
([#58](https://github.com/werker-ai/werker/issues/58)). Deleting one
on GitHub leaves Werker's connection behind, so delete that in **Admin
→ Connections** too.
## Other services
| Kind | What it gives a run | Checked |
| -------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| HTTP API | Requests to one saved address | Presets such as Slack, Discord, GitLab, Cloudflare and Vercel, only for rejecting a wrong key |
| Remote MCP server | Its tools | Context7, DeepWiki, Svelte and Cloudflare Docs need no key and listed their tools on 2026-11-17. Linear, Stripe and GitHub's server were checked only for rejecting a wrong key |
| Web search and pages | Tavily, Brave, Kagi, Firecrawl, Exa and Linkup | One search and one page read passed on 2026-11-23 |
Any other address can be added as an HTTP API or an MCP server.
Requests stay on the saved address, so an agent cannot send a key
somewhere else.
## Email
One SMTP server for the whole instance, in **Admin → Email**. Nothing
but a test email is sent with it yet.
1. **Verify a domain** with your provider, such as
[Resend](https://resend.com/docs/dashboard/domains/introduction).
2. **Make a key** for sending from that domain.
3. **Fill in Admin → Email.** Resend, Brevo and Mailgun fill in their
own server. With Resend the username is filled in too, and the key
is the password. The sender is an address at the verified domain,
such as `noreply@mail.example.com`.
4. **Save**, then **Send test** to yourself.
On 2026-11-30 a test email sent through Resend arrived.
## Who can use a connection
Every run in the workspace, within what it is given. Connections for
one factory only are not built
([#15](https://github.com/werker-ai/werker/issues/15)).
## How keys are kept
- The web app seals a key and cannot read it back. Only the worker,
which holds the install's master key, opens it.
- A key is never shown again, and cannot be moved to another
workspace.
- Sandboxes do not receive keys. On Docker with gVisor a gateway
outside the sandbox adds the key to the outgoing call. On the hosted
providers a sandbox gets no provider keys, and work that needs them
waits.
- Code in a sandbox can still use the access it was given.
On Coolify the web app and worker share one container, so both hold
the master key ([self-hosting](self-hosting.md#on-coolify)).
More is in [security](https://werker.cloud/security) and the
[engineering docs](engineering/integrations.md).
## Not built
- Signing in to services with OAuth, and a hosted app catalogue
([#14](https://github.com/werker-ai/werker/issues/14)).
- Messages from Werker when a run finishes or needs you
([#39](https://github.com/werker-ai/werker/issues/39)). An agent can
send one itself through a connected service.
---
# Sandboxes
> Choose where agent code runs, what network it can reach, which image it starts from and how much of the server it may use.
Source: https://werker.cloud/docs/sandboxes (updated 2026-12-02)
Code that agents write runs in a sandbox made for that run and deleted
after it. An instance administrator sets this up in **Admin →
Sandboxes**. What a sandbox protects against, and what it does not, is
in [security](https://werker.cloud/security).
## Choosing a provider
| | Your Docker host (gVisor) | Daytona | Docker Cloud Sandboxes |
| ----------------- | ------------------------------ | -------------------------------- | ------------------------------------ |
| Runs on | Your own server | Daytona's service | Docker's service |
| You need | gVisor, which the install adds | A Daytona API key | A Docker ID and access token |
| Git | Through Werker's gateway | With a GitHub App connection | With a GitHub App connection |
| Run it (previews) | No | Yes | Yes |
| CPU and memory | As set | Rounded up to whole CPUs and GiB | The smallest of five sizes that fits |
The install adds gVisor on Debian and Ubuntu; on other distributions
install it first. To use a hosted provider, choose it under "Sandboxes
run on", press **Save**, then add its key. The key is sealed when
saved and never shown again.
- **Daytona:** Git needs a key with `manage:secrets`. Werker turns
Daytona's auto-stop off, so if every worker stays down sandboxes
keep running until you delete them in Daytona.
- **Docker Cloud Sandboxes:** make the token with "Allow Cloud
Sandboxes access". Werker stops a sandbox 24 hours after it starts.
## Network
Daytona and Docker Cloud Sandboxes default to **Open**. Your Docker
host defaults to **No network**.
## Images
A sandbox starts from an image, which decides what is installed. List
the ones you want under Images and pick a default (`node:22-alpine` to
begin with). Werker starts each once to see which languages and tools
it has, and then picks one that suits the work. Press **Probe again**
after rebuilding a tag.
## Limits
On your Docker host and Daytona, set CPUs, memory and processes for
each sandbox; empty means no limit. Daytona ignores the process limit.
Docker Cloud Sandboxes has a **Size** menu instead. **Sandboxes at
once** caps how many run together. On your Docker host, Admin shows
how many fit once memory per sandbox is set.
**Stop sandboxes of runs waiting for input** is on by default: a
waiting run's sandbox is stopped and kept, because its files are the
work so far. Workers remove sandboxes left over from finished runs
every 10 minutes.
## What has not been tested
- The allowed-sites network, and CPU and memory limits, on Daytona.
- Git on the hosted providers was checked with scripts against both on
2026-11-28, not in a Werker run on Daytona.
How each provider is driven is in the
[engineering docs](engineering/sandboxes.md).
---
# Users and access
> Workspaces, members and roles in Werker, how to add people and change what a role may do, and what is missing.
Source: https://werker.cloud/docs/users-and-access (updated 2026-12-02)
A **workspace** is private to one person or one team. It owns its
connections, agents, workflows, factories, runs and audit log, and no
workspace can see another. Setup makes the first one. A login belongs
to one; someone with a personal workspace and a company one has a
login, with its own email, for each.
An **instance administrator** looks after the whole install, such as
[sandboxes](sandboxes.md). The first account is one. It does not give
access to other workspaces.
## Naming a workspace
The name at the top of the sidebar, under "werker", is changed in
**Admin**: click the name beside **Workspace name**, type, and press
Enter. An owner or admin can, unless the role's permissions were
changed.
## Adding people
With email configured in **Admin → Email**, **Invite by email** in
**Admin → Members** sends a link to join the workspace. New users
choose a password; existing users sign in with their own. Links expire
after seven days. Resending or canceling invalidates the old link.
**Mail server accepted** does not mean the recipient has joined.
Without an email provider, **Add member** adds the person directly.
With email configured, the same option is **Add with password**. Give
the new user their password yourself. Someone who already belongs to a
workspace cannot be added to another.
You can only give a role at or below your own, and you cannot change
or remove yourself, so a workspace always keeps an owner.
## Roles
| Role | Starts with |
| ------ | ----------------------------------------------------------------------------------- |
| owner | Everything. Its permissions cannot be changed. |
| admin | Everything but changing billing or deleting the workspace. |
| member | Makes, changes and runs agents and workflows, and sees connections. No admin pages. |
| viewer | Sees agents, workflows and runs. |
**Admin → Roles** switches a permission on or off for admin, member or
viewer. You cannot change your own role's permissions, or switch one
you do not hold.
## A new workspace
There is no screen for making one. `pnpm add-user`, run from Werker's
source with access to its database, makes a workspace with its first
user. Running it inside the Docker install is not documented.
## API keys
A key lets the [CLI](cli.md), or an assistant over [MCP](mcp.md), work
as you. Make one in **Settings → API keys**: name it, choose what it
may do and how long it lasts, and copy it. It is shown only then.
- **Read** sees what you can see. **Read and write** also starts,
stops and changes work, which can spend money.
- **Let it answer for you** is off unless you choose it. With it, an
agent holding the key could approve its own work.
- A key never does more than your role may, and follows your role if
it changes. It cannot manage members, roles, connections, settings
or keys.
- Revoking a key stops it at once. Removing a member removes theirs.
Someone who may change members sees every member's keys in **Admin →
Members**, never the keys themselves, and can revoke those of people
they may change.
There is no limit on how often a key is used or what it spends
([#99](https://github.com/werker-ai/werker/issues/99)).
## What is recorded
Sign-ins, failed sign-ins of a known email, and changes to members,
roles, connections and API keys, and what a key does, are in **Admin →
Audit** ([costs and traces](costs-and-traces.md#the-audit-log)).
## How long data is kept
An instance admin sets, in **Admin → Data retention**, how many days
the instance keeps **Run detail** (the activity and trace of a run,
counted from when it ended), the **Audit log** and **Ended items**
(project previews, and discarded changes to starters and factories).
The defaults are 90, 365 and 30 days. Empty keeps for ever, and each
field shows its default. A worker deletes what is older once a day.
Spend, totals, step results, factory conversations and versions are
always kept. The deletion has been run against test data, not against
a long-lived installation.
## Not built
- Password changes
([#33](https://github.com/werker-ai/werker/issues/33)) and
forgotten-password recovery
([#140](https://github.com/werker-ai/werker/issues/140)).
- Provider keys shared from the instance to its workspaces
([#10](https://github.com/werker-ai/werker/issues/10)).
How workspaces are kept apart is in [security](https://werker.cloud/security)
and the [engineering docs](engineering/workspaces-and-access.md).
---
# How it's built
> What Werker is made of, how runs stay durable on Postgres, and the architectural limits that matter before you run or trust it.
Source: https://werker.cloud/docs/how-its-built (updated 2026-12-01)
Werker is two processes and one Postgres database. A web app serves
the interface and a worker executes runs; Postgres holds the data, the
work queue and the live-update signals, so there is no separate queue
or cache service to run. The main limit is that a run's durable state
is a file on the worker's own disk, so a run cannot move between
worker machines. The whole system is spike quality: it works end to
end on one machine, and Werker's own instance is live on one server.
## The two processes
A run is one execution of an agent or workflow. A workspace is one
organisation's separate set of data, users and settings.
| Process | What it is | What it does |
| ------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Web app | SvelteKit 3 and Svelte 5 on Node | Serves the interface and sign-in. Starts runs by adding rows to Postgres. Streams live updates to the browser. It cannot open stored provider keys. |
| Worker | A Node process | Claims queued runs from Postgres, runs each in the Pi agent harness under Pi Durable, starts and stops sandboxes, writes run events, usage, traces and totals. Holds the install's master key, so it is the only process that can open stored keys. |
A sandbox is an isolated environment where an agent can run code and
produce files. A worker can run several runs at once. An instance
admin sets the limit per worker and per workspace in the database, and
workers re-read it without a restart.
## Postgres as database and queue
- **Workspaces:** every workspace table uses row-level security, and
the app connects as a restricted role.
- **Queue:** a run is a row. Workers claim rows with
`FOR UPDATE SKIP LOCKED`, so several workers can claim at once
without taking the same run.
- **Wake-up:** a trigger sends `NOTIFY` when a run is queued, and
workers `LISTEN`. A slow poll is the fallback, because notifications
are not replayed if a listener was disconnected.
- **Leases:** a claimed run holds a 30 second lease, renewed every 10
seconds. A run whose worker died can be claimed again when its lease
expires.
## How runs stay durable
Pi Durable runs each run as a durable task and resumes it after a
crash without redoing finished work. Workflows run as one durable
task, with each step in its own child conversation. Resuming after a
crash has been tested by hand on one machine only. Durable state for a
run is kept in Postgres while the run is running or waiting for input,
and deleted when it ends. Run events, step results, usage, traces and
totals are written to Postgres too.
## Live updates in the browser
- **Lists of runs** (the runs, dashboard and decisions pages, the
sidebar and the header) follow the database through one
server-sent-events stream per browser tab. The server re-reads on a
`NOTIFY`, sends only a changed result, and re-checks the session at
most once a minute before it sends.
- **A run in progress** streams its events to its page over
server-sent events.
- **Limit:** over HTTP/1.1 a browser allows six connections per site,
so many open tabs can wait. Serving the app over HTTP/2, for example
through a reverse proxy, lifts this.
## The code
The code is split into packages, each with a list of the packages it
may depend on. CI fails on an import outside that list. The packages
are in [architecture](engineering/architecture.md) and what is
enforced is in [boundary checks](engineering/guardrails.md).
It stands on Better Auth for sign-in, Pi and Pi Durable for running
agents, and gVisor over Docker, Docker Cloud Sandboxes or Daytona for
sandboxes.
## Licence
MIT. The source is at
[github.com/werker-ai/werker](https://github.com/werker-ai/werker).
## Known architectural limits
- **Runs cannot move between worker machines.** A run's durable state
is in Postgres, but projects are folders on the worker's disk
([projects](projects.md)), so a worker on another machine does not
have them. Run one worker machine until this changes.
- **The web app and worker stop when the database restarts.** A
dropped connection ends both processes instead of reconnecting. This
is not fixed yet.
- **Backend testing is partial.** CI runs database tests on a
throwaway Postgres. The worker and sandboxes were tested by hand.
See also [self-hosting](self-hosting.md),
[security](https://werker.cloud/security) and [status](https://werker.cloud/status). The
detail is in the [engineering docs](engineering/architecture.md).
---
# Development
> Setting up the repository to work on Werker's code, and its commands.
Source: https://werker.cloud/docs/engineering/development (updated 2026-12-01)
Setting up the repository to work on Werker's code, and its commands.
To use Werker, read [getting started](../getting-started.md).
## Setting up
Requires Node 24.15+ and pnpm 12. The repository pins the pnpm version
in `package.json`.
```sh
pnpm install
pnpm dev
```
`pnpm dev` starts Postgres in Docker. Add provider keys to a root
`.env` (see `.env.example`) or through Admin → Connections.
## Commands
```sh
pnpm dev # Postgres, migrations, dev seed, web (http://localhost:5230) and worker
pnpm dev:site # the public site (http://localhost:5232); needs no database
pnpm dev:seed # dev user auto-dev@werker.local in workspace-a, connections for keys in .env, and the sandbox at WERKER_SANDBOX_HOST
pnpm db:reset # wipe the local database, then rebuild it (migrations and dev seed)
pnpm check # formatting, linting, package boundaries, Svelte, and TypeScript (changes nothing)
pnpm format # format the repository and apply lint fixes
pnpm test:unit # boundary checks, package, browser, and Node tests
pnpm test:postgres # database tests, on a throwaway Postgres container (needs Docker)
pnpm db:schema # regenerate packages/db/schema.sql from the migrations
pnpm eval:images # with a worker running: does planning pick a sandbox image that has what the work uses
pnpm build # production build of the web app and the public site
pnpm start # production: set up the database, then run the built web app and the worker
```
Install Chromium before running browser tests for the first time:
```sh
pnpm --filter @werkerai/app exec playwright install chromium
```
CI installs the browser and runs `pnpm check`, `pnpm test`,
`pnpm test:postgres`, `pnpm db:schema --check`, `pnpm build`,
`pnpm docs:index` and `pnpm docs:lint`.
## Reading the docs
`pnpx @wiki0/cli ui .` from the root of the repository opens the
engineering docs and the site's docs in a browser.
---
# Werker architecture
> How the repository is divided into apps and packages, what each one owns, and the tools that check it.
Source: https://werker.cloud/docs/engineering/architecture (updated 2026-12-01)
How the repository is divided into apps and packages, what each one
owns, and the tools that check it.
The processes and the limits that follow from them are in
[how it's built](../how-its-built.md).
## Package structure
```
apps/app/ SvelteKit UI and Node server; calls core, and
uses rules for pure logic the browser shares
apps/site/ Public site, docs, blog and waiting list; UI and rules only
apps/reels/ The web app's pages as scripted demos for the site
apps/worker/ Starts the run engine; enqueue script
apps/cli/ The command werker, for npm; types only
packages/ui/ Theme, logo and UI primitives; no dependencies
packages/domain/ Shared types; no dependencies
packages/rules/ Deterministic decisions over domain values
packages/db/ Postgres access, migrations, row-level security
packages/connections/ Provider adapters, secrets, capability bindings
packages/auth/ Sign-in, sessions, workspaces and roles (Better Auth)
packages/core/ Use cases the apps call
packages/runtime/ Run engine: queue claims, Pi harness, workflows
packages/scripts/ Runs an assistant's script in its own process
tools/checks/ Executable package and import boundaries
docs/ Generated glossary of the docs in apps/site
```
Packages use the `@werkerai` npm scope. The project domain is
`werker.cloud`: the public site is at the apex and the app at
`app.werker.cloud`, both deployed on Coolify
([public site](site-plan.md),
[Coolify](../self-hosting.md#on-coolify)).
Source entrypoints are under each package's `src/index.ts`.
## Dependency direction
| Package | May depend on |
| ----------- | ------------------------------------ |
| domain | nothing |
| rules | domain |
| db | domain |
| connections | domain, rules |
| auth | domain, db |
| core | domain, rules, db, connections, auth |
| runtime | domain, rules, db, connections |
| scripts | domain |
| ui | nothing |
| web | core, domain, rules, scripts, ui |
| site | ui, rules |
| reels | web, domain, ui |
| worker | runtime, core, domain |
| cli | domain |
Each package may depend only on the packages its policy lists in
`tools/checks/policy.ts`. Which package owns which third-party
dependency, and the other enforced rules, are in
[executable boundary checks](guardrails.md).
## Packages
One line each; the README has the detail.
- **[domain](https://github.com/werker-ai/werker/blob/main/packages/domain/README.md):** shared
types and the registry of platform parts.
- **[rules](https://github.com/werker-ai/werker/blob/main/packages/rules/README.md):**
deterministic decisions over domain values.
- **[db](https://github.com/werker-ai/werker/blob/main/packages/db/README.md):** Postgres access,
migrations, row-level security and live-update listening.
- **[connections](https://github.com/werker-ai/werker/blob/main/packages/connections/README.md):**
provider adapters, sealed secrets and capability bindings
([capabilities](capabilities.md)).
- **[auth](https://github.com/werker-ai/werker/blob/main/packages/auth/README.md):** sign-in,
sessions, workspaces and roles
([workspaces and access](workspaces-and-access.md)).
- **[core](https://github.com/werker-ai/werker/blob/main/packages/core/README.md):** the use cases
the apps call.
- **[runtime](https://github.com/werker-ai/werker/blob/main/packages/runtime/README.md):** the run
engine: queue claims, Pi Durable, sandboxes, workflows.
- **[scripts](https://github.com/werker-ai/werker/blob/main/packages/scripts/README.md):** runs a
script an assistant wrote over MCP
([scripts](api-and-cli.md#scripts)).
- **[ui](https://github.com/werker-ai/werker/blob/main/packages/ui/README.md):** theme, logo and
UI primitives.
## Apps
- **`apps/app`:** the signed-in SvelteKit app and Node server. Product
copy is in `apps/app/src/lib/messaging/`. `GET /api/health` reports
process liveness only. How pages update live:
[database and events](database-and-events.md#live-updates-pubsub).
- **`apps/site`:** the public landing page, pages, docs and blog,
prerendered, with a Node server for the waiting list
([public site](site-plan.md)). The app's `/` redirects to the
dashboard or to sign-in.
- **`apps/reels`:** plays `apps/app`'s pages with made-up data, for
the public site to run in an iframe
([reels](https://github.com/werker-ai/werker/blob/main/apps/reels/README.md)). `pnpm reels:build` writes
it into the site's static files.
- **`apps/worker`:** `src/main.ts` starts the run engine;
`src/enqueue.ts` queues a run or workflow.
- **`apps/cli`:** the command `werker`, for npm as `@werkerai/cli`. It
talks to a Werker over HTTP and bundles the types it shares
([API, CLI and MCP](api-and-cli.md)).
## Tooling and checks
- Node 24.15+ and pnpm 12.
- SvelteKit 3 and Svelte 5 with the Node adapter.
- Strict TypeScript and shared `tsconfig.base.json`.
- Tailwind CSS 4.
- Vite+ for development, builds, linting, formatting, and Vitest.
- Playwright Chromium for browser component tests.
- wiki0 for documentation indexing and linting.
Dependency versions are centralised in the pnpm catalogue.
`pnpm check` runs [boundary checks](guardrails.md), package type
checks, and root tooling type checks.
## Tests
- `pnpm test:boundaries`: Node tests for the checker and source
parser.
- `pnpm test:packages`: Vitest tests for the package APIs.
- Web `client` project: `*.svelte.test.ts` in real Chromium.
- Web `server` project: other `*.test.ts` in Node.
`pnpm test:unit` runs all four groups. Tests require no credentials.
## Configuration and deployment
Local development uses Postgres from `compose.yaml` (`pnpm db:up`,
port 54329). In development (`pnpm dev`) the worker reads
`WERKER_SECRET_KEY` from the root `.env` through `nopeek`;
`pnpm start` reads an `.env` if there is one.
The schema is the migrations in `packages/db/sql/`, applied in name
order by `pnpm db:migrate` and recorded in `schema_migrations`.
`001_schema.sql` is the baseline. Every change is a new numbered file,
and the existing ones are frozen. `packages/db/schema.sql` is the
schema those files produce, generated by `pnpm db:schema` (CI fails
when it is out of date) and never edited by hand. The rules for
foreign keys and their indexes are at the top of `001_schema.sql`.
`pnpm db:migrate` applies a file once, so an edited file does not
reach an existing database. `pnpm db:reset` drops the local database
and rebuilds it: migrations and the dev seed. The seed adds the dev
user, a connection for each provider key in `.env`, and the sandbox
host from `WERKER_SANDBOX_HOST` in `.env` (for example
`ssh://user@box`); without it, eval cases that need a shell are
skipped. The reset loses runs, workflows, agents and `workspace-b`
(which `pnpm db:rls-check` needs; `pnpm add-user` adds it back, with
an email no other workspace has).
SvelteKit configuration lives in `apps/app/vite.config.ts`. The
optional root `.env` is read during development and builds, and loaded
by the production start command. `ORIGIN` sets the canonical origin
during the build; runtime `HOST` and `PORT` control the Node listener.
Local environment files, build output, databases, and browser reports
are ignored by Git. [.env.example](https://github.com/werker-ai/werker/blob/main/.env.example)
contains non-secret examples.
---
# Executable boundary checks
> What the boundary checker enforces: imports, sizes, names and layout.
Source: https://werker.cloud/docs/engineering/guardrails (updated 2026-12-02)
`pnpm check:boundaries` runs the checker in `tools/checks/run.ts`.
`pnpm check` runs it too.
## Enforced boundaries
The policy is `tools/checks/policy.ts`.
- Every package must have a policy; a new package without one fails.
- A package may depend on and import only the Werker packages its
policy lists (the table is in [Architecture](architecture.md)).
- Third-party packages with an owner may only be declared or imported
by that owner: `pg` by `@werkerai/db`, `better-auth` by
`@werkerai/auth`, `@earendil-works/pi-ai` and `@daytona/sdk` by
`@werkerai/connections`, `nodemailer` by `@werkerai/connections`,
`citty` by `@werkerai/cli`, `@earendil-works/pi-codemode` by
`@werkerai/runtime` and `@werkerai/scripts`, other
`@earendil-works/*` packages by `@werkerai/runtime`, and `tmcp` and
`@tmcp/*` by `@werkerai/app`.
- `.sql` files may only live under `packages/db/`.
- Production domain and rules modules cannot import Node built-ins.
Test files are exempt.
- Package imports must be declared by the importing package.
- Imports must match the target package's public exports.
- Relative imports cannot reach outside their package.
- Application packages cannot be imported as package APIs, except
where a policy's `apps` names one (`apps/reels` imports `apps/app`'s
exports).
- Unknown `@werkerai/*` package imports are rejected.
- Names: application-owned variables, functions, parameters and type
or class members use snake_case (no `UPPER_CASE` constants); types,
interfaces and classes use PascalCase. Object-literal keys and
third-party names are left alone, and library exports are not given
snake_case aliases. External contract keys an owned type must mirror
are allowlisted in `external_property_names`
(`tools/checks/naming.ts`). Code copied from upstream projects,
listed in `vendored_paths` (`tools/checks/policy.ts`), keeps its
upstream names: the shadcn-svelte primitives in
`packages/ui/src/components/ui/`, `packages/ui/src/hooks/`,
`packages/ui/src/highlighter.ts` and `tools/oxlint/anti-slop/`.
- `$effect` is not used in `apps/app/src/`, `apps/site/src/`,
`apps/reels/src/` or `packages/ui/src/`: derive state with
`$derived`, update it in event handlers, and set up DOM or library
work with `{@attach}` or `onMount` (`tools/checks/runes.ts`).
- In the same UI source directories, the navigation check flags
`invalidateAll` in scripts and template expressions. SvelteKit uses
`refreshAll` for both the function and the navigation option.
- Nested ternaries: outside `vendored_paths`, a ternary cannot sit
directly in another ternary's condition or branch, in scripts or
Svelte template expressions. Use if/return, `$derived.by`, `{#if}`
blocks or a lookup object (`tools/checks/ternaries.ts`).
- Tools are defined with `define_tool`
(`packages/runtime/src/tools/define.ts`), which limits a tool's name
to those in the registry; nothing else in `packages/runtime/src/`
may name pi-durable's `defineTool` (`tools/checks/registry.ts`).
## Size limits
`tools/checks/size.ts` measures every source file outside
`vendored_paths`, except test files (`*.test.ts`, `*.spec.ts`). The
limits are `size_limits` in `tools/checks/policy.ts`:
| What | Limit |
| ---------------------------------------------- | --------- |
| A function, method or callback | 100 lines |
| A top-level `try`, `if`, loop or block | 100 lines |
| A `.ts` or `.js` file | 500 lines |
| A Svelte component, script and markup together | 400 lines |
- A function inside a long function is measured as well, and named
`outer.inner`.
- Lines include blank lines and comments.
- `size_exempt` (`tools/checks/policy.ts`) lists files with no
file-length limit, each with a reason: currently
`packages/domain/src/registry.ts`. Their functions are still
measured.
- `.sql` files are not measured.
Code that was over a limit when the check was added is recorded in
`tools/checks/size-baseline.json`, keyed by file path, or `path#name`
for a function. The check fails when:
- something not in the baseline is over its limit;
- something in the baseline is longer than its recorded size;
- something in the baseline is shorter than its recorded size, or is
no longer over its limit. `pnpm check:sizes:lower` then lowers or
removes the entry. That command never adds an entry or raises one.
So a recorded size only goes down. Two functions with the same name in
one file share one entry, the longer of the two.
## Folders
`tools/checks/layout.ts`: when five or more files in one folder share
a first word (`sandbox-types.ts`, `sandbox-files.ts`, ...), the check
fails and names the folder to make: the files move into `sandbox/` and
drop the prefix (`sandbox/types.ts`). The number is
`prefix_group_limit` in `tools/checks/policy.ts`.
- A file and its tests count as one.
- Files named after the folder they are already in
(`components/run/run-view.svelte`) are left alone.
- SvelteKit route files (`+page.svelte`) and `vendored_paths` are not
counted.
Two oxlint rules in the root `vite.config.ts` sit beside the size
check: `max-depth` (blocks nested at most 4 deep) and `max-params` (at
most 6 parameters). `max-depth` is off for three files whose long
functions are in the baseline; the list is in `vite.config.ts`.
## Implementation
The checker discovers source and package manifests from the
filesystem, including new untracked files. It ignores dependencies and
generated build output.
TypeScript's compiler API inspects imports, re-exports, import types,
literal dynamic imports, and literal `require` calls. The Svelte
compiler locates component script blocks before TypeScript parses
them. Comments and strings resembling imports are not treated as
imports.
Import checks are static: computed module names are not checked.
## Tests and commands
```sh
pnpm check:boundaries
pnpm check:sizes:lower
pnpm test:boundaries
pnpm check
pnpm test:unit
```
Checker tests build temporary fixture repositories.
## The registry
`packages/domain/src/registry.ts` lists every part the platform has:
the kinds of record that can be created, what starts work, what an
agent can be given, and the tools, capabilities and connection
adapters behind them. [Registry](registry.md) is that list as a page.
Package tests fail when the code has a part the registry lacks:
- a table or a column in `packages/db/sql/`
(`packages/db/src/registry.test.ts`);
- a tool (`define_tool`, above), and the tools a service connection
gives a run (`packages/runtime/src/registry.test.ts`);
- a model or sandbox adapter
(`packages/connections/src/registry.test.ts`);
- a bindable capability (a type in
`packages/core/src/connections/connections.ts`);
- `apps/site/src/content/docs/engineering/registry.md` differing from
the registry (`packages/domain/src/registry-page.test.ts`;
`pnpm docs:registry` writes it).
They cannot see a new global from a library upgrade, an environment
variable, or a change in behaviour that adds no table, column, tool,
adapter or capability.
---
# Agents, workflows and factories
> How agents, workflows, equipment, schedules, factories and saved teams are built, and their known limits.
Source: https://werker.cloud/docs/engineering/agents-workflows-factories (updated 2026-12-01)
How agents, workflows, equipment, schedules and factories are built.
Using them is in [agents and workflows](../agents-and-workflows.md)
and [factories](../factories.md). Factories add saved teams,
[rooms](factory-rooms.md) where members talk to each other, and a
decisions inbox.
## Agent
One agent doing one job: a name, standing instructions for its role,
and a default task when run on its own (`agents` table, `Agent` in
`packages/domain/src/agents.ts`). Its tools come from the
[tool registry](capabilities.md); code it runs goes in a
[sandbox](sandboxes.md). Standalone agents use workspace-bound tools;
factory members can additionally restrict their allowed tools.
### Equipment
Equipment is how an agent learns: the procedure it worked out on a
run, given to its later runs so they do not work the job out again.
- A step that finishes as done can report a `procedure` with
`finish_step`: the commands, code and checks that worked, as
markdown. For a step run by a saved agent, the worker saves it as
that agent's equipment (`agent_equipment`, one active version per
agent; older versions are kept as stale with why).
- The agent's next runs get the active procedure in their
instructions, to follow when it fits and to correct when it does
not. A corrected procedure replaces it.
- Editing the agent's role or task sets its equipment aside. The agent
page shows the equipment and can discard it.
Today the agent still reasons on every run, with the procedure in
hand. Replaying a saved program with no model in the loop, which is
where the cost saving is, is not built
([#8](https://github.com/werker-ai/werker/issues/8)). One procedure
per agent assumes an agent does one kind of job; a general agent
reused for different jobs carries the procedure of whichever job
reported last.
## Workflow
Ordered steps; each step is a task done by one agent, and one agent
can serve several steps (`workflows` and `workflow_steps` tables).
Steps run in order and share their outputs. Steps are durable: an
interrupted workflow continues from its last completed step.
- **Creation:** `/new` takes a description and opens `/new/`,
which follows creation until the work is saved, then opens the run
(`apps/app/src/lib/components/creation/creation-view.svelte`). It
shows what the generator thinks, says and looks at as `creation` run
events (`packages/runtime/src/creation-feed.ts`). A run queued from
`/new` is shaped first (`runs.shape`): the generator may ask one
round of questions with `request_details`, each with a recommended
answer (`runs.pause.questions`), and then stops with a brief
(`propose_brief`, `runs.pause.shaping.brief`). Nothing is saved
until the person approves the brief (`approve_brief`) or presses
"just do it now" (`start_creation`); each answer starts creation
again with what was asked and answered
([shaping](ui.md#shaping-on-new)). A run queued without shaping
plans at once and asks only for what the work cannot be done
without. A request that cannot be created fails with the generator's
reason and nothing saved. `/runs/` redirects to `/new/`
until the work is saved.
- **Not ready:** when the work needs something that is not set up (no
sandbox, a service not connected), `define_workflow` saves nothing.
The run waits as `needs_input` with those needs in
`runs.pause.setup`, and `/new/` lists them with a way to set
each up (connect a service there, or a link to Admin). Continuing
starts creation again, so the plan uses what is connected by then.
- **Generation:** The generator chooses an agent for one coherent job,
or a workflow when explicit stages, handoffs or verification help.
Many tool calls do not by themselves need a workflow. Its
`define_workflow` tool saves the chosen kind, name, agents and tasks
(`packages/runtime/src/workflow/define/workflow.ts`). The worker
saves an agent linked through `runs.agent_id`, or agents and a
workflow linked through `runs.workflow_id`, then executes the work
without a review gate.
- **Brief:** `define_workflow` keeps what done means and what was
assumed (`WorkBrief` in `packages/domain/src/agents.ts`): from the
approved brief, else as the generator gives them. They are saved in
the plan (`runs.plan`, and `plan` on the workflow or agent the run
created) and in the run's steps (`runs.workflow.brief`), and every
step's instructions carry them with "do not ask for anything it
already settles" (`brief_note` in
`packages/runtime/src/workflow/step/brief.ts`). A later run of the
saved workflow or agent gets them from its plan. A factory keeps
them in `factories.brief` (`{ done, assumed }`), and the run that
writes its team is given them after the description as "Done means"
and "Assumed" lists (`packages/runtime/src/run/team.ts`); the team's
generator is told to write the lead to them
(`packages/runtime/src/workflow/team-brief.ts`).
- **Plan:** `define_workflow` also takes what the description asks of
the platform (`PlanReport` in `packages/domain/src/agents.ts`):
- `schedule`: work that repeats ("every morning") is saved as the
schedule of the new agent or workflow, in the viewer's time zone
(`runs.time_zone`, sent by `/new`), and is left out of the
instructions. The work still runs once now.
- `needs`: the [registry](registry.md) abilities the work depends
on. `plan_readiness` (`packages/rules/src/creation/plan.ts`) marks
each ready or not, with what is missing.
- `unsupported`: parts of the request that are planned registry
entries, or `other`. The rest of the work is still defined.
- The plan is saved on the run and on the workflow or agent it
created (`plan` columns), and the run page shows it. A schedule is
saved switched off while a need is not ready. Nothing stops the
run.
- Work that repeats and reuses a saved agent is saved as a one-step
workflow: a schedule runs a saved agent's own task, which a reused
agent keeps.
- The generator thinks at a high reasoning level where its model
can; steps run at the model's default.
- **Reusing agents:** the generator is shown the workspace's saved
agents (name and the start of each role) and told to reuse one whose
role fits. A factory's members are not offered. An agent it names
that already exists is used as saved, not saved again, so repeated
similar work runs under one agent and builds on its equipment.
- **Running:** each step runs in a child conversation whose
instructions are its agent's. A run keeps a snapshot of the steps
and agents in `runs.workflow`, so editing an agent changes later
runs, not one in progress.
- **Running again:** `queue_run` with `workflow_id` or `agent_id`
executes the saved definition with its current edits. Run pages and
the runs list expose this as Run again, preserving the run's model;
they do not send the original description back through generation.
- **Editing:** an agent's name, role and default task can be changed
at `/agents/`; steps are added, reordered and edited in the
builder at `/workflows//builder`. An agent a step uses cannot be
deleted.
- **History:** each saved change to an agent, workflow, factory or
saved team is kept as a version, with who made it. The History
button on its page shows what each version changed and restores an
earlier one ([versions](definition-versions.md)).
## Step results
`define_workflow` takes a method and a completion condition for each
step. Both become its editable task, separate from the agent’s
standing role. When the plan declares file deliverables, the task
starts with a `Required files:` paragraph, one absolute `/work` path
per line. The step checks these paths against the saved project on
completion, including when its report omits them. This checks
existence, not freshness or contents.
Each step ends by calling `finish_step`
(`packages/runtime/src/workflow/step/tools.ts`) with one of three
statuses:
- **done:** a markdown summary, plus paths of files under `/work` to
show with the result. The worker saves `/work` as the next version
of the run's [project](projects.md) and records each named file as a
file of that version (`step_files`,
`packages/runtime/src/project/files.ts`); nothing is copied twice.
The next step gets the summary and the file paths. The run's result
is the last step's summary.
- **needs_input:** a question only the person who asked can answer.
The run stops as `needs_input` with where it stopped in
`runs.pause`; its sandbox is kept. The answer (`answer_run`) queues
it again, and that step starts over with the question and answer.
Each resume is a new durable task (`runs.resumes` counts them).
- **failed:** why the task cannot be done; the run fails.
A step that answers in prose without calling `finish_step` is taken as
done, with its answer as the summary. Every report is kept in
`run_steps`.
### The agent's account
A done step can give three optional `finish_step` lists of one-line
statements (`StepAccount` in `packages/domain/src/runs.ts`): `checked`
(what it verified and how), `assumed` (what it took as true) and
`worked_around` (what failed and what it did instead). They are kept
with `done` as `run_steps.account`, trimmed by `step_account`
(`packages/rules/src/account.ts`: at most 8 lines of 400 characters
per list), and are not given to the next step. The run page shows them
as "The agent's account", and a run with workarounds has an "N worked
around" badge. Nothing checks the account against the trace.
Generated and saved agent runs use the same durable step execution as
workflows: they can keep files and ask for input. A run of raw
instructions runs in one conversation, without steps.
**Stop run** sets `cancelled`. Workers abort the durable task and
remove its sandbox; a waiting run's cancellation wakes the cleanup
sweep. Late completion or pause writes cannot change a stopped run
back to another status.
**Archive** sets `runs.archived_at` on a finished run, and Restore
clears it. Nothing is deleted, so its results, files, spans and usage
stay in the cost and observability totals. Both actions need
`delete:run` (owners and admins) and are recorded as `run.archived`
and `run.restored`. Runs cannot be deleted.
## Harness
Agents run on upstream Pi's libraries:
[Pi Durable](https://github.com/earendil-works/pi/tree/main/packages/durable)
(durable conversations, tasks, child tasks, a task graph and stored
sleeps), `pi-ai`, `pi-codemode` and `pi-mcp`. Each run's storage is
owned by the worker that claimed it from the
[queue](database-and-events.md).
Pi is a library here, not what users see. Werker's web UI shows runs:
Pi Durable's `watch()` streams each committed change to a conversation
(transcript, streamed partial answers, tool calls and their output,
usage), which the server forwards to the browser.
## Schedules
The `schedules` table.
- The next time is worked out in the database, in the schedule's time
zone (`schedule_next`), so 09:00 stays 09:00 across clock changes.
- Every worker checks for due schedules every 30 seconds
(`start_scheduler` in `packages/core/src/schedules.ts`).
`claim_due_schedule()` claims one and moves it to its next time in
the same statement, so two workers never queue the same occurrence.
- A scheduled run is queued like Run: the saved definition as it is at
that time. A run that cannot be queued (its model is no longer
offered, the workflow has no steps) is recorded on the schedule and
shown on the card.
## Once per item
A workflow's last step can run once per item that the step before it
lists: one job per open pull request, for example, several at once.
- **In the builder:** a step's "Run once per item the step before
lists" switch, with how many jobs may run at once (1 to 10, 3 by
default). Saved as `workflow_steps.for_each`, and in the workflow's
versions. It must be the last step and not the first
(`workflow_step_problems` in
`packages/rules/src/workflow-steps.ts`).
- **Listing:** the step before it is told it lists items (`prompt_for`
in `packages/runtime/src/workflow/step/brief.ts`) and finishes done
with `items`: each a key, a label and the input its job needs. At
most 50, keys unique (`batch_item_problems` in
`packages/rules/src/batch.ts`). For a pull request the key is
`owner/repo#number@head-sha`, so a PR pushed to again gets a new
job.
- **Queueing:** `finish_step` queues the jobs before it reports
(`queue_batch` in `packages/db/src/runs/batches.ts`): a
`run_batches` row for the step, and per item a run of the same saved
workflow, model and project, holding only the for_each step with its
item added as untrusted data (`job_instructions`). `item_runs` keeps
each key once per workflow, ever: an item listed again, by a
replayed step or by tomorrow's scheduled run, gets no job. The
step's summary says how many were queued and how many were run
before. A run of a workflow that is not saved cannot queue jobs.
- **The listing run then ends:** it does not run the for_each step
itself, and nothing waits for the jobs (`step_after` in
`packages/rules/src/decisions/step-decide.ts`).
- **At once:** `claim_next_run` takes a batch's job only while fewer
of that batch than its cap are running, on top of the workspace and
host limits.
- **Each job** is an ordinary run: its own sandbox, started from the
workflow's image (`run_sandbox_image`), and a fresh clone through
the GitHub App connection with `github_git`
([sandboxes](sandboxes.md)). A job that cannot go on finishes
`needs_input` and is listed in Decisions under its label and the
workflow's name; answering it resumes that job.
- **The board:** the listing run's page shows its jobs under the
result (`apps/app/src/lib/components/run/run-batch.svelte`): each
item's status, its result or what it waits for, and a link to its
run. Refresh reads them again.
## Decide what comes next
Uses a [decision model](decision-models.md). A step can end with a
yes/no question about its result, and the answer decides whether the
run goes on, skips the next step or stops as done.
- **In the builder:** a step's "Then decide what comes next" switch,
with the question, what yes and what no mean, and an action for each
(`step-decide-field.svelte`). Saved as `workflow_steps.decide`
(`StepDecide` in `packages/domain/src/step-decide.ts`), and in the
workflow's versions.
- **Where it can go** (`workflow_step_problems` in
`packages/rules/src/workflow-steps.ts`): not on the last step, and
not on a for_each step. On the step before a for_each step it can
only go on or stop.
- **Asking:** once the step is done, the workspace's classify@1 is
asked the question with only the step's name and result
(`step_decide_request` in
`packages/rules/src/decisions/step-decide.ts`; the call is in
`packages/runtime/src/run/decisions/decide.ts`, 10 s at most). Its
tokens and cost are added to the run's usage.
- **Deciding** (`step_decision`): 0.7 and above takes the action for
yes, 0.3 and below the action for no. Any other answer, no
classifier, or a failed or timed-out call goes on, as the workflow
would without the question. `step_after` gives the next step:
skipping past the end, or onto a for_each step, ends the run.
- **Shown:** the run's activity says which way it went and why
("decided: no (0.12): stopped the run", "unsettled (0.55): went
on"), the step list shows it under the step, and a skipped step is
marked skipped.
## Workflow options
A workflow runs on a schedule (above) or when someone starts it. A
trigger on incoming work, verification between steps and an
improvement loop that proposes changes to its steps or skills are not
built ([#7](https://github.com/werker-ai/werker/issues/7)).
## Factory
A saved team with rooms, linked runs and the decisions waiting on a
person ([factory rooms](factory-rooms.md)). A lead coordinates the
specialists it addresses. Factories use the same run engine as agents
and workflows. `/factories` has a New factory dialog holding the
`/new` composer with `/factory` picked
(`apps/app/src/lib/components/factory/new-factory.svelte`).
### The default team
Each workspace has one saved team marked as its default
(`factory_starters.is_default`, at most one per workspace by the
`factory_starters_default` index). It says what a new factory and a
new member start as:
- A factory created without a starter gets the default's members,
teams and room settings (`created_team` in
`packages/runtime/src/run/factory/factory.ts`). The factory records
no `starter_id`: it is not linked to the default.
- New team copies the default's members (`create_starter`,
`packages/core/src/starters/team.ts`).
- On a team board, an added lead starts as the default's lead and an
added specialist as its first specialist (`board_presets` in
`apps/app/src/lib/factory/board/convert.ts`).
The default is created with the workspace: a trigger on
`auth.organization` calls `create_default_starter()`
(`packages/db/sql/001_schema.sql`), so sign-up, admin, eval and test
fixtures and the RLS check all get one the same way. It is named "New
members" and holds a built-in "Factory lead" with no tools and an
"Unassigned specialist" with `shell` and `classify`, both with no
model, so the run's model or the workspace's first is used. There is
no fallback at read time: `get_default_starter`
(`packages/db/src/starters/saved.ts`) throws when a workspace has
none.
It is edited, changed by asking and versioned as any saved team, and
shows a Default badge on `/factories/teams`. It cannot be deleted
(`delete_factory_starter`). Choosing another team as the default is
not built ([#48](https://github.com/werker-ai/werker/issues/48)).
### A team from `/new`
The person describes the work on `/new` and Werker decides between an
agent, a workflow and a team.
- **Who decides:** the generator. Its brief
(`packages/runtime/src/workflow/generate/brief.ts`) says a team is
for a standing team or an ongoing collaboration directed with many
requests; work stated once is an agent or workflow, and repeating
work is a schedule.
- **How:** a team is [shaped](ui.md#shaping-on-new) like anything
else: questions, then a brief. Once the person approves or starts,
the generator calls `define_factory` with a name, what the team
works on, and what done means and what was assumed. What it works on
is saved as the factory's description and the two lists as
`factories.brief`
(`packages/runtime/src/workflow/define/factory.ts`). The worker
saves the factory with the default team's members on the model
picked on `/new`, and queues the
[change that fits the team to the brief](#a-factorys-team-changed-by-asking)
(`queue_team_fit` in
`packages/runtime/src/run/factory/team-fit.ts`). If a
[planning model](ui.md#planning-model) is set, it writes the team.
- **Once only:** the factory's ID is worked out from the run's ID
(`run_factory_id` in
`packages/db/src/factories/created-factory.ts`), so a replayed run
makes one factory, and no column links the two.
- **Where the person lands:** the creation page opens the factory's
page, which follows the fit on its activity stream (`change`).
`/new/` and `/runs/` of that run redirect there
afterwards.
### Starters
A starter is a workspace's saved team: name, a one-paragraph purpose,
its teams (`factory_starters.teams`: name and purpose, at least one),
each member (role, team by name, name, instructions, responsibilities,
model, tools) and the room settings. One row in `factory_starters`,
members as JSON. With two or more [teams](factory-rooms.md#teams) a
factory created from it gets the same teams, leads and members
(`starter_team` in `packages/core/src/starters/saved.ts`).
- **Pages:** `/factories/teams` lists the starters with their outcomes
(`read_starter_work` in `packages/db/src/starters/outcomes.ts`). A
starter's page (`/factories/teams/`) is the shared team page
(`apps/app/src/lib/components/team-page/`), as a factory's Team page
is.
- **New team:** a copy of the default team's members
(`create_starter`, `packages/core/src/starters/team.ts`).
- **Editing:** each change saves the whole starter with
`edit_starter_team`, checked against the starter rules: one lead, at
least one specialist, at most `factory_max_specialists`, different
names, offered models and the workspace's tools. The team board
(`apps/app/src/lib/factory/board/ops.ts`) adds, renames and removes
teams and moves members between them. Diffs match teams by name,
then lead, then place (`team_diff` in
`packages/rules/src/starters/team-diff.ts`).
- **Change by asking:** a request queues a run on the workspace's
planning model, else the lead's, that calls `propose_starter_change`
with the team as it should be
(`packages/runtime/src/workflow/starter/`). The proposal is shown as
a diff; Apply writes it as the next version, Discard drops it.
Models and tools come only from what the workspace offered when
asked (`packages/rules/src/starters/proposal.ts`). A proposal made
before the starter changed cannot be applied. Rows:
`starter_changes`.
- **Drift and copy back:** a factory with `starter_id` whose members
or room settings differ from the starter is listed with its diff
(`starter_drift`, `packages/rules/src/starters/diff.ts`) and "Copy
into starter".
- **Versions:** every write records a `factory_starter` version with a
reason and the run that made it
([versions](definition-versions.md)).
- **From a factory:** Save as starter takes the factory's name and the
first paragraph of its description (`starter_purpose`).
- **Using one:** a picked starter (the New factory dialog,
`/new?starter=` or `@`) gives the factory the starter's members,
room settings and `starter_id`, and no team is fitted to the brief
(`packages/runtime/src/run/factory/factory.ts`).
`resolve_starter_members` (`packages/rules/src/starters/content.ts`)
replaces a model the workspace no longer offers and drops a tool it
does not have.
- **Permissions:** reading needs `view:agent`, changing
`update:agent`.
### A factory's team changed by asking
A factory's team is changed the way a [starter](#starters) is: a model
proposes the team as it should be after a request, shown as a diff,
and the person applies or discards it. A new factory's team is fitted
to its brief the same way, applied at once. The web UI is the
factory's Team page (`/factories//team`, see
[factory rooms](factory-rooms.md#teams)).
How it works:
- **Rows:** a change to a factory is a `starter_changes` row with
`target = 'factory'` and `factory_id`; `base_updated_at` is
`factories.updated_at` when it was asked. Triggers move
`factories.updated_at` on any write to the factory, its members,
their agents' name or instructions, or its teams
(`packages/db/sql/001_schema.sql`).
- **Ask:** `ask_change` (`packages/core/src/starters/changes.ts`), the
same for a starter and a factory, queues a run on the planning
model, else the lead's, with the models and tools the workspace
offers now (`queue_change`, `packages/db/src/starters/changes.ts`).
One change is worked on at a time; a new request discards a waiting
proposal.
- **Run:** the same `starter` phase and `propose_starter_change` tool
as a starter's (`packages/runtime/src/workflow/starter/`). The model
is given the factory's team read as starter content with each
member's sandbox image (`factory_content`,
`packages/rules/src/starters/factory.ts`) and the factory's
description and brief. A member with the shell may be given a listed
image (`factory_image_problems`, `settle_factory_proposal`).
- **Apply:** `plan_factory_change` matches the proposal to the
factory's rows (teams by name, then lead, then place; members by
name, then place within their role; members left out are removed).
`apply_factory_change` (`packages/db/src/teams/change.ts`) writes it
in one transaction: teams added, renamed, reordered and removed (a
removed team's rooms become the leads'), members rewritten, moved,
added with their own agents and removed, and the room settings. It
records one version of the factory and of each member's agent, with
the request as the reason and the run. Refused when the factory
changed after it was asked, or while the team has turns queued,
running or waiting. It applies to the next turns.
- **Fitting a new factory:** a factory `/new` makes without a starter
queues a change with `factory_fit_request` and `auto_apply`
(`queue_team_fit`, `packages/runtime/src/run/factory/team-fit.ts`).
The brief tells the model to rewrite every member for the brief and
to add, remove or regroup members and teams as the work needs. When
it is proposed, the worker applies it (`apply_fitted_team`). While
it works, no turn is queued in the factory (trigger
`refuse_turn_during_team_fit`, and `refuse_during_team_fit` in core
for the message the person reads) and no member is edited
(`guard_factory_team_fit`). If it fails, the change's own status is
`failed` with why in `error`; if it was proposed but could not be
applied, it stays `proposed` with why in `error`, for a person to
apply or discard. `fit_factory_team` queues the fit for a caller
that creates a factory itself.
- **Removing a member:** `remove_factory_member`
(`packages/core/src/teams/remove.ts`,
`packages/db/src/teams/remove.ts`) sets
`factory_members.removed_at`; the row stays, so messages and turns
keep its name (`Factory.former_members`). A removed member is left
out of the team, routing, mentions, asks, reading along, room
instructions and new turns. Refused for a lead (another member is
made lead first), when its team would not stand without it
(`removal_refusal`, `packages/rules/src/teams/removal.ts`), and
while the team has turns queued, running or waiting.
- **Deleting a factory:** `delete_factory`
(`packages/db/src/factories/delete.ts`) deletes it with its teams,
members, rooms, messages, turns, asks and changes, then the members'
own agents (an agent a workflow step uses is kept). Runs,
`run_usage`, `run_totals`, versions and audit events stay; its
project stays with `factory_id` null. Refused while any of its turns
or a change to its team is queued, running or waiting.
## Known limits
- A successful run can hide a broken setup: an agent works around
stale instructions or failing tools and still reports success. A
step can say so itself ([the agent's account](#the-agents-account)),
which depends on the agent saying it.
- Durable recovery can repeat external actions, such as opening a pull
request or sending a notification, after a restart
([#16](https://github.com/werker-ai/werker/issues/16)).
---
# Factory rooms
> How factory rooms, turns, asking, reading along and teams work in the code.
Source: https://werker.cloud/docs/engineering/factory-rooms (updated 2026-12-01)
Using one is in [factories](../factories.md#rooms). A factory thread
is a room: several members take part, a message can address several of
them, and members can ask each other.
## How a room works
- **Participants.** A member joins a room when a message addresses it
(`factory_thread_participants`).
- **Addressing.** Every message lists the members it addresses
(`factory_messages.recipients`). Each addressed member is given a
turn and replies.
- **Reading along.** The other members already in the room are given
the message too, as a listening turn (`factory_turns.listening`).
They are told to stay quiet unless it is squarely theirs and nobody
addressed covers it. A quiet member reports `(quiet)`, which is
never posted; a short report that names it, such as "Exactly
(quiet)", counts too (`is_quiet` in
`packages/db/src/rooms/quiet.ts`). Each read is a model call; a
factory can switch reading along off (`factories.listen`). It
applies to the user's messages and to what members ask, not to
replies.
- **Read-along check.** When the workspace has `classify@1` bound, a
listening turn first asks it whether the message is about the
member's responsibilities, given the message, its author, who it
addresses and the member (`listen_gate` in
`packages/runtime/src/run/decisions/listen-gate.ts`, the question
and rule in `packages/rules/src/decisions/listen-gate.ts`). Below
0.3 the turn ends `(quiet)` at once, with no sandbox and no model
turn, and its activity says "skipped reading along"; otherwise, and
whenever no classifier is bound or the call fails or takes over 10
seconds, the turn runs. The call's cost is on the listening run.
- **Turns.** A turn is one run answering one message
(`factory_turns`). Its final report is posted to the room as the
member's message. The private transcript is not.
- **Asking.** During a turn a member can call `ask_members` with other
members' IDs and one message. The message is posted when the turn
finishes, and each member asked takes a turn. When all of them have
finished, the asker gets a follow-up turn with their replies. A
member asked this way can ask others in turn. Members already
waiting for its reply in that chain are not asked again or queued to
listen, including when the question crosses rooms.
- **New rooms.** `open_room` does the same in a new room with only the
members named, and the follow-up comes back to the room it was
called from.
- **The user.** The room page's composer addresses one member,
several, or everyone, from the recipient control or by typing
`@name` (the member's name with hyphens for spaces), `@lead` or
`@all` (`apps/app/src/lib/mentions/mentions.ts`). Typing `@` opens a
menu of the members, `@lead` and `@all`; a picked one is typed in
and addresses the member, and recognised mentions show as badges in
the text ([menu and badges](ui.md#mentions-and-commands-on-new)).
`/status` sends the lead a fixed request for a report
(`apps/app/src/lib/mentions/room-menu.ts`). Starting a conversation
from a factory page works the same way; the lead is the default.
- **Room links.** A message links to the room its turn opened, and
that room links back. A factory's list of rooms updates live.
The tools are in `packages/runtime/src/workflow/step/tools.ts`;
dispatch, the join and the follow-up are in
`packages/db/src/rooms/factory-rooms.ts`.
## What the room shows
- **The person's messages, in full:** a message is the person's when
they wrote it, or when a member wrote it to them. A member's message
is to the person when it addresses nobody (a reply to a member who
asked addresses that member, `settle_factory_turn` in
`packages/db/src/rooms/factory-rooms.ts`) and the first turn of its
member's chain answered the person's message. A follow-up turn
continues an earlier turn of the same member
(`factory_turns.continues_run_id`), so a member's final report back
to the person after asking others is shown in full too.
- **Between members, folded:** everything else (asks, replies to an
ask, and a member reading along who speaks up about an ask). Runs of
such messages that come one after another fold into one line, "Team
worked for X · N messages between members", where X runs from the
message shown before the fold to the last folded one. A final report
between two folds splits them.
- **Where:** `room_feed` and `is_for_person` in
`apps/app/src/lib/factory/fold.ts` (unit tests in `fold.test.ts`).
The factory page's conversation list picks each room's latest
message to or from the person with the same rule in SQL
(`room_states` in `packages/db/src/factories/status.ts`).
- **Work in progress:** turns queued or running are live rows at the
end of the feed; a turn waiting for the person's answer is a card
with the answer form there. A turn that ended with nothing posted
(failed, stopped, finished without replying) still shows under the
message it answers.
- **Live:** the room's stream re-reads on a message in the room and on
any run of the workspace changing status (`follow_factory_thread` in
`packages/core/src/factories/threads.ts`), and also sends the
factory's status for the side panel (`follow_factory_status` in
`packages/core/src/factories/status.ts`).
## Teams
A factory has one factory lead (`factory_members.role = 'lead'`, in no
team) and 1 to 4 teams (`factory_teams`: name, one line of purpose,
position).
- **One team:** the factory lead leads it and it has no lead of its
own. It has one strip, every member is in every room, and `@lead`
and `@all` reach the lead and everyone.
- **Two or more:** each team has exactly one team lead
(`role = 'team_lead'`) and at most 4 members besides it.
- **Limits** are rules in `packages/rules/src/teams/limits.ts`
(`team_plan_problems`, constants `factory_max_teams`,
`factory_max_team_members` in `packages/domain/src/factories.ts`):
at most 4 teams, one lead each, at most 4 members, names of at most
40 characters that differ from each other, from members' names and
from `lead`, `all`, `everyone` and `factory`. The board, the server,
starter and factory proposals all check them and show the sentence
where it bites.
Who may ask whom is `ask_refusal` in
`packages/rules/src/teams/shape.ts`, enforced in `ask_targets`
(`packages/runtime/src/run/factory/room.ts`); a refused `ask_members`
or `open_room` fails with its sentence. The rule is in
[factories](../factories.md#with-more-than-one-team). With one team
anyone may ask anyone.
Rooms:
- Each room belongs to a team (`factory_threads.team_id`) or, with
null, is the leads' room, shown as "Whole factory (leads)". A room
`open_room` opens belongs to the team of everyone in it, else it is
a leads' room (`room_team`; `factory_asks.room_team_id`).
- **Reading along** applies only to the room's readers who are in it:
its team's members in a team room, the leads in the leads' room
(`room_readers`). A lead of another team asked into a room answers
but does not read along, so a message in a team room never wakes
another team (`send_factory_message` in
`packages/core/src/factories/threads.ts`, `listener_ids` in the
runtime).
- **Mentions** (`room_mentions`, `mentioned_ids`; the web app's
`mentioned_members` with a scope). The server resolves mentions in
the text too.
- **Turns per message** are counted across teams.
- **Fold:** a message between leads of different teams folds like one
between members; only messages to or from the person stay unfolded
(`apps/app/src/lib/factory/fold.ts`).
The Team page (`/factories//team`) is the shared team page
(`apps/app/src/lib/components/team-page/team-page.svelte`). Its board
is saved with `edit_factory_teams` (`packages/db/src/teams/edit.ts`)
in one transaction and one factory version; a removed team's rooms
become leads' rooms. Changes apply to new turns.
## Changing the team by asking
See
[a factory's team changed by asking](agents-workflows-factories.md#a-factorys-team-changed-by-asking).
## Settings
Each factory sets these under Room settings on its Team page
(`apps/app/src/lib/components/starter/room.svelte`, the same form a
saved team uses). What each does is in
[room settings](../factories.md#room-settings). The built-in prompt is
`factory_conversation_prompt` and the built-in turn limit
`factory_default_turn_limit`, in `packages/domain/src/factories.ts`.
An ask that would pass the limit is refused and the member is told to
reply with what it has.
A [starter](agents-workflows-factories.md#starters) saves these three
settings with the team, and a factory created from it starts with
them.
## Fixed rules
- **One ask per turn.** A turn can call `ask_members` or `open_room`
once, naming as many members as it needs.
- **No change to a member while its team is working.** Editing a
member, its agent or its equipment is refused while any turn in its
factory is queued, running or waiting for an answer.
- **No turn while a new team is being fitted.** While the change that
fits a new factory's team to its brief works, a message to the
factory is refused and no member can be edited. A change by asking
that a person asked for does not hold messages back; applying it
waits until no turn is queued, running or waiting.
## Failure and stopping
- A turn that fails, is stopped or reports nothing counts as finished;
the asker's follow-up is told which.
- An ask recorded by an attempt that lost its lease is not sent by the
attempt that replaces it.
- **Stopping a room.** `/stop` in a room's composer (shown to a member
who may stop runs) stops every turn of the room that is queued,
running or waiting, and every such turn those set off in rooms they
opened, with no follow-up turn: the exchange ends there. Asks they
were waiting on are marked `factory_asks.stopped_at`. A member of
another room who asked for a stopped turn still gets its follow-up.
The composer says how many turns it stopped, here and elsewhere
(`stop_room` in `packages/db/src/rooms/stop.ts`). The room panel has
a `/stop` button for a role that may stop runs.
---
# Creation schema
> The registry of what Werker can do, and the plan the generator fills in when it defines work.
Source: https://werker.cloud/docs/engineering/creation-schema (updated 2026-12-02)
The registry lists every part Werker has; the plan is what the
generator fills in when it defines work.
- The list of parts, with the status and reason of each:
[Registry](registry.md), generated from
`packages/domain/src/registry.ts`.
- The tests that keep the registry complete:
[the registry section of the executable checks](guardrails.md#the-registry).
- How the generator fills in and saves a plan (`schedule`, `needs`,
`unsupported`, the brief), and the Plan card on the run page:
[Agents, workflows and factories](agents-workflows-factories.md).
- Shaping before anything is saved: [shaping](ui.md#shaping-on-new).
## How it works
- **One registry.** What describes the platform to a model or a person
is derived from it. What a run can do is answered by one rule,
`abilities_available` in `packages/rules/src/tools.ts`.
- **Data in `packages/domain`, logic in `packages/rules`.** The
registry is plain `as const` data. `plan_problems`,
`abilities_available` and `plan_readiness` are in `packages/rules`.
- **No shared input shape.** Each consumer builds its own from the
registry's id lists. The web workflow form names agents by id, the
generator by name.
- **Every entry has a status.** `offered` is built and usable by the
generator, `built` is built and not offered, with a reason, and
`planned` is not built. The generator names a `planned` entry as the
reason a request cannot be met, so `unsupported` is checked against
the registry.
- **Triggers are their own list.** `schedule` is one kind of trigger.
The plan has `schedule`, saved on the run and on the item it
created.
- **New plan fields are optional**, so a generation already in flight
can still replay.
- **Abilities are not permissions.** `shell`, `files` and `web` are
one tool, so a factory member's `allowed_tools` is a list of tool
names.
- **Readiness uses the same conditions as the run:** a sandbox host
set, a network (`open` or `gateway`), a saved connection. The
browser receives states, not the instance settings behind them.
- **`needs` is a forecast.** The generator cannot see what an MCP
server or an HTTP API offers.
- **A schedule and its needs belong to the workflow.** A plan with a
schedule that reuses a saved agent is saved as a one-step workflow.
- **Factory member agents are not offered for reuse.**
- **The registry check is in package tests and two import rules**, as
`tools/checks` may not import `@werkerai/domain`
(`tools/checks/policy.ts`).
- **No standing input.** An answer is kept only in that run's `pause`,
so a scheduled run asks again. `standing_input` is `planned` in the
registry.
## Worked example
"Every morning, check five competitor pricing pages, compare with my
rates and email me what changed."
- `schedule`: every day at 09:00 in the viewer's time zone.
- `needs`: `web` for the hosts, if the pages are named.
- `needs`: `http_service` with a `service` hint for email; readiness
says no such connection exists.
- `needs`: `files`, to keep yesterday's prices in `/work` for the next
run.
- `unsupported`: `standing_input` (the five pages and the rates, if
not given).
## Limits
- The registry checks show that a feature is listed, not that the
generator is offered it; [Registry](registry.md) shows "built, not
offered".
- Not caught: a new global from a library upgrade, an environment
flag, or a change in behaviour that adds no table, column, tool,
adapter or capability.
---
# Registry
> Every part the platform has, by whether the generator can use it. Generated.
Source: https://werker.cloud/docs/engineering/registry (updated 2026-12-01)
Every part the platform has, by whether the generator can use it.
Generated from `packages/domain/src/registry.ts` by
`pnpm docs:registry`; do not edit. See
[Creation schema](creation-schema.md).
## Offered to the generator
Built, and the generator can use it when it turns a description into a
plan.
- thing `agent`: One agent doing one job: a name, a role and a task.
- thing `workflow`: Ordered steps, each a task done by one agent.
- thing `schedule`: Runs a saved agent or workflow every hour, day or
week at a time in a time zone.
- trigger `now`: The work runs once, when it is described.
- trigger `schedule`: Every hour, day or week at a time in a time
zone.
- ability `code`: Reason, and run JavaScript with no files or network.
- ability `ask_user`: Stop and ask the person who asked for the work.
- ability `classify`: Label or score data against questions.
- ability `shell`: Run commands in the run’s own Linux sandbox.
- ability `files`: Write files in /work, the work’s project, kept with
the run and for its next run.
- ability `web`: Read web pages: the hosts the sandbox network allows,
or any page through a connected service that fetches pages.
- ability `provider_api`: Call a connected model provider from the
sandbox, the key held by the gateway.
- ability `http_service`: Call a connected HTTP API or GitHub.
- ability `mcp_service`: Call the tools of a connected MCP server.
- ability `github_git`: Clone, fetch and push a GitHub repository.
- ability `web_search`: Search the web through a connected search
service.
## Built, not offered to the generator
A person or the platform can use these; the generator cannot. Each
says why.
- thing `equipment`: The procedure an agent worked out, given to its
later runs. Why: An agent works it out on a run; it is not planned
ahead.
- thing `run`: One execution, with its step results and kept files.
Why: A run is the work being done, not a part of a plan.
- thing `factory`: A saved team: a lead and members that work in
rooms. Why: Made from /new by define_factory beside a plan, not as a
step of one.
- thing `factory_member`: An agent in a factory, with a role, a model
and allowed tools. Why: Written with its factory: from a starter, or
by the run that fits the team to its brief.
- thing `factory_team`: A team inside a factory: a name, one line of
purpose, a lead and its members. Why: Written with its factory, or
changed by asking; plans do not make one.
- thing `project`: The folder of files a workflow, agent or factory
keeps between runs, with a version for each save. Why: Every run
with a sandbox works in its project; the generator has nothing to
choose (apps/site/src/content/docs/engineering/projects.md).
- thing `factory_starter`: A saved team (members and room settings)
new factories start from. Why: A person saves a team as a starter;
plans do not make one.
- thing `room`: A conversation in a factory, with its participants.
Why: Opened in a factory by a person or a member, not by a plan.
- thing `factory_message`: A message in a room, and a member’s ask of
other members. Why: Written in a room by a person or a member, not
by a plan.
- thing `connection`: Where an external service is reached, and its
key. Why: It holds credentials; a person connects a service.
- thing `capability_binding`: Which connection and model serve a
capability. Why: An operator setting.
- thing `model_allow_list`: The models a workspace may use; none
listed means all. Why: An admin setting.
- thing `workspace`: A workspace and the people in it. Why: Access,
not work.
- thing `role_override`: A workspace’s change to what a role may do.
Why: Access, not work.
- thing `instance_settings`: Worker concurrency, the email connection
and the sandbox: host, network, limits, the images a sandbox can
start from with what a probe found installed in each, and how many
days to keep run detail, audit events and ended items. Why: An
operator setting.
- thing `workspace_limit`: How many runs a workspace may have running
at once. Why: An operator setting.
- thing `instance_prices`: What sandbox time and service calls cost,
for the cost of a run. Why: An operator setting.
- thing `score`: A question a judge answers about a sample of finished
runs, pass or fail. Why: A workspace setting made on Observability →
Scores.
- ability `team`: Ask other members of a factory, or open a room. Why:
Only a factory turn has other members to ask.
## Planned
Not built. The generator can name one as the reason a request cannot
be met.
- trigger `event`: Incoming work, such as a new issue. Why: Not built.
- ability `standing_input`: A value the person gives once, kept for
later runs. Why: An answer is kept only for the run that asked.
- ability `file_input`: A file the person supplies. Why: There is no
upload.
- ability `delivery`: Send the result somewhere, or notify someone.
Why: Notifications are not built.
## Tools
- `codemode`: provides code
- `finish_step`: provides ask_user, files
- `define_workflow`: only in a generation
- `request_details`: provides ask_user; only in a generation
- `propose_brief`: only in a generation
- `look_up`: only in a generation
- `define_factory`: only in a generation
- `propose_starter_change`: only in a team change
- `ask_members`: provides team; only in a factory turn
- `open_room`: provides team; only in a factory turn
- `classify`: provides classify; a factory member can be allowed it
- `classify_rows`: provides classify
- `shell`: provides shell, files, web, provider_api; a factory member
can be allowed it
- `connections_list`: provides http_service, mcp_service; the
generator can call it to look at what is connected
- `connection_request`: provides http_service, web, web_search
- `mcp_list_tools`: provides mcp_service; the generator can call it to
look at what is connected
- `mcp_call_tool`: provides mcp_service
- `github_git`: provides github_git
## Capabilities
- `classify@1`: the `classify` tool
- `shell@1`: the `shell` tool
## Connection adapters
- `openai` (model)
- `anthropic` (model)
- `google` (model)
- `openrouter` (model)
- `mistral` (model)
- `groq` (model)
- `xai` (model)
- `fireworks` (model)
- `typesafe` (model)
- `github` (service): gives a run connections_list,
connection_request, github_git
- `http` (service): gives a run connections_list, connection_request
- `mcp` (service): gives a run connections_list, mcp_list_tools,
mcp_call_tool
- `docker-gvisor` (sandbox)
- `daytona` (sandbox)
- `docker-cloud` (sandbox)
## Services
A connection made from one of these keeps its name, so a plan knows
what the connection can do.
- `tavily` (http, api.tavily.com): web_search, web
- `brave` (http, api.search.brave.com): web_search
- `kagi` (http, kagi.com): web_search
- `firecrawl` (http, api.firecrawl.dev): web, web_search
- `exa` (http, api.exa.ai): web_search, web
- `linkup` (http, api.linkup.so): web_search
## Tables that are records, not things
- `api_keys`: A person’s keys for the CLI and MCP, kept as a hash.
Nothing makes or reads one yet.
- `starter_changes`: Each change to a starter or a factory’s team,
asked for in words: the run that proposed it, the proposal and
whether it was applied or discarded. A new factory’s team is fitted
to its brief by one applied automatically.
- `audit_events`: What people, the system and agents did, written as
it happens.
- `emails`: Emails to send and how each went: queued by the web app,
sent by a worker.
- `analytics.page_views`: Visitor analytics: one row per page view,
written by the web app; no IP address or cookie.
- `analytics.page_view_salt`: Today's random salt for visitor hashes,
replaced each UTC day.
- `audit_event_entities`: The things each audit event touched.
- `definition_versions`: A snapshot of an agent, workflow, factory or
starter each time it changes, written with the change, and the run
that made it when there was one.
- `run_events`: What a run did, written by the worker.
- `observability.run_usage`: Tokens and cost of a run, written by the
worker.
- `observability.run_spans`: Each model turn and tool call of a run,
written by the worker.
- `observability.run_scores`: A judge's verdict on a run for one
score, written by the worker.
- `observability.run_totals`: What each run came to, written by the
worker when it pauses or ends: the metrics per piece of work and the
costs read these.
- `observability.run_agent_totals`: Model spend per agent within a
run, written with the run’s totals.
- `connection_models`: Models a connection was found to offer, by a
check.
- `auth.session`: Sign-in state.
- `auth.account`: Sign-in state.
- `auth.verification`: Sign-in state.
- `auth.invitation`: Workspace invitations, their expiry and latest
queued email.
- `durable.runs`: The next id and commit sequence of a run’s durable
state.
- `durable.record_ids`: Which record type owns each id of a run’s
durable state.
- `durable.conversations`: A run’s Pi conversations.
- `durable.entries`: The entries of a run’s Pi conversations.
- `durable.tasks`: A run’s Pi tasks.
- `durable.submissions`: What was submitted to a run’s Pi
conversations.
- `durable.documents`: A run’s Pi documents.
- `durable.document_revisions`: The content of a run’s Pi documents,
as a base and deltas.
---
# Versions of agents, workflows and factories
> How saved changes to agents, workflows, factories and saved teams are kept and restored.
Source: https://werker.cloud/docs/engineering/definition-versions (updated 2026-12-02)
Each time a saved agent, workflow, factory or saved team (starter)
changes, Werker keeps a full copy of it as a numbered version, with
who changed it, when and why. A version can be read, compared and
restored.
The [audit log](observability.md#audit-log) records that an edit
happened. A version holds what the definition was. An improvement loop
that proposes changes is planned
([workflow options](agents-workflows-factories.md#workflow-options),
[#7](https://github.com/werker-ai/werker/issues/7)).
## What a version holds
One row of `definition_versions` (`packages/db/sql/001_schema.sql`):
the workspace, the kind and ID of the definition, a version number
that counts up from 1 for that definition, the snapshot as JSON,
`source` (`user`, `system` or `agent`, as in the audit log), the
user's ID and email as it was then (`actor_user_id`, `actor_label`),
an optional reason, `run_id` (the run that made or motivated the
change) and the time. The app role can add and read rows, never change
or delete them; row-level security keeps a workspace to its own. There
is no foreign key to the definition, so versions outlive it.
The snapshot types are in `packages/domain/src/versions.ts`:
| Kind | Snapshot |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `agent` | Name, instructions, task, and for a factory member its factory, role, team, responsibilities, model and allowed tools. |
| `workflow` | Name, description and the ordered steps: name, agent ID, instructions, and `for_each` and `decide` when set. |
| `factory` | Name, description, room settings (conversation prompt, turn limit, `listen`), teams and each member: agent ID, name, instructions, role, team, responsibilities, model and tools. |
| `factory_starter` | Name, description, room settings, teams and each member: role, team, name, instructions, responsibilities, model and tools. |
Not in a snapshot: an agent's equipment, schedules, the plan a
definition was generated from, and the starter a factory came from.
## When a version is recorded
In the write functions of `packages/db`, in the same transaction as
the write (`record_version` in `packages/db/src/versions/record.ts`),
so the web app, the generator and any later caller are covered:
- Creation is version 1. A write that leaves the definition as its
latest version has it records nothing.
- A change to a factory member records a version of the member's agent
and of the factory, as each snapshot holds the member. Creating a
factory records version 1 of the factory and of each member's agent.
- A definition with no version gets its state before the change as
version 1 (`record_baseline`), then the change as version 2.
- Each write function takes an optional author (`ChangeAuthor`). The
web app passes the signed-in user
(`apps/app/src/lib/server/author.ts`). The generator's saves are
recorded as source `agent`, label `generator`, with the run in the
reason. A caller that passes none is recorded as Werker (`system`).
## History and restore
- **Where:** a History button opens a sheet
(`apps/app/src/lib/components/history/`).
- **What it shows:** versions newest first, each with who, when, the
reason if any, and what it changed from the version before. The
comparison is `diff_versions` in
`packages/rules/src/versions/diff.ts`, made on the server by
`list_history` (`packages/core/src/versions.ts`). The newest 100
versions are shown.
- **Workflow steps** are matched by name, then by place, so a step
added at the start does not mark every later step as changed. A step
both renamed and moved shows as one removed and one added.
- **Restore** asks for confirmation, then sets the definition back to
that version and records the result as a new version with the reason
"Restored version N" (`restore_version` in
`packages/core/src/versions.ts`). Nothing in the history is removed.
It needs the permission an edit needs (`update:agent` or
`update:workflow`; factories and starters follow agents, as their
other actions do) and is written to the audit log with
`restored_version` (`apps/app/src/lib/remote/history.remote.ts`).
- **The rules of an edit apply.** A restore is refused when a member's
model is no longer offered, when a factory member would change while
its team has turns queued, running or waiting, and when a workflow
step's agent no longer exists. Restoring an agent's role or task
sets its equipment aside, as an edit does.
- **A factory restore** sets back its name, description, room
settings, teams, and each member's role, team, texts and settings,
through the board's writer (`save_team`). Members added since are
removed; a member removed since comes back as a new member with a
new agent, as an agent that left a factory cannot rejoin it.
## Limits
- A version is not linked to its audit event. The web app writes the
audit event after the change, in its own transaction; the two are
matched by definition and time.
- A definition written by SQL outside these functions has no history
until its next change.
- Nothing prunes versions, and a deleted definition's versions stay.
- Runs do not record which version of a definition they ran. A run
keeps its own snapshot of the steps in `runs.workflow`.
- The web app edit forms take no reason; only restores and the
generator set one.
---
# Decision models
> Where Werker uses classifiers such as Jev, and how their answers are used.
Source: https://werker.cloud/docs/engineering/decision-models (updated 2026-12-02)
A decision model (a classifier such as Jev) answers a narrow question
in one pass, with no generated text. A workspace's classifier is the
capability `classify@1` ([capabilities](capabilities.md)).
## The rule
When the workspace has `classify@1` bound, the platform asks it; when
it has not, the path without it runs. A classifier that fails, times
out or answers nothing usable falls back to that path. It never fails
or stops a run. Every call is metered on the run it serves.
## How answers are read
Code decides from the answers. A probability above 0.7 reads as yes
and below 0.3 as no; the band between is unsettled (`settled_band` in
`packages/rules/src/decisions/settled.ts`). A score's verdict passes
or fails at 0.5 ([scores](scores.md)).
## Where it is used
- **Scores.** The judge of a workspace's questions about its runs
([scores](scores.md)).
- **Reading along in rooms.** A listening turn first asks whether the
message is squarely the member's, and ends quiet below 0.3
([factory rooms](factory-rooms.md)).
- **Outcome of a turn.** A finished run is labelled answered,
delegated, quiet, blocked or failed (`runs.outcome`, `label_outcome`
in `packages/runtime/src/run/decisions/outcome.ts`, the rules in
`packages/rules/src/decisions/run-outcome.ts`). Code labels failed
runs, runs waiting on the person and quiet reports; the rest get two
yes/no questions on the request and the result: did it give what was
asked, and was it stopped by something missing, broken or not
allowed. A run that sent an ask is delegated only when it clearly
did not answer. Unsettled answers leave no label.
`pnpm --filter @werkerai/worker label-outcomes` labels earlier runs.
- **Rows.** `tools.classify_rows`
(`packages/runtime/src/tools/classify-rows.ts`,
`packages/rules/src/classify-rows.ts`) asks one yes/no question per
row: 8 calls at once, 1,000 rows per call, 2M input tokens per run,
no question asked twice about the same row in a run. The rows'
indexes and probabilities come back.
- **A decide step in workflows.** A step can end with a yes/no
question that decides what comes next
([decide what comes next](agents-workflows-factories.md#decide-what-comes-next)).
- **`/new` offers saved work.** While a person follows creation,
`classify@1` is asked of each saved workflow with steps and each
agent with a task (up to 40) whether running it would do what the
request asks for. Code offers at most three at 0.7 and above. "Run
this" runs the saved item on the creation's model and stops the
creation as handed on; "Make something new" goes on and is not asked
again (`packages/rules/src/decisions/saved-offers.ts`,
`packages/runtime/src/run/decisions/saved-offers.ts`).
- **The generator sees only agents that may fit.** Before it plans,
each saved agent it would be shown (up to 40) is asked whether it
could do the work or one stage of it. Only a clear no (0.3 and
below) is left out (`packages/rules/src/decisions/agent-fit.ts`).
- **In a run,** agents can call `tools.classify`. `step_abilities`
(`packages/runtime/src/run/setup/planning.ts`) tells them how to
ask.
Each call's tokens and cost are stored on the run under the
classifier's model (`usage_rows` in
`packages/runtime/src/tools/usage.ts`).
## Providers and bindings
`classify@1` has implementations for the `typesafe`, `openai` and
`openrouter` adapters.
- **TypeSafe and OpenAI:** the first connection is bound as the
workspace's classifier ([integrations](integrations.md)).
- **OpenRouter:** decision calls go to `/api/v1/systemone`, chat to
`/api/v1/chat/completions`. A new connection binds
`typesafe/jev-1.14` when the workspace has no classifier
(`default_classifier_model` in
`packages/connections/src/models.ts`).
- **Choosing one:** Admin → Models has a "Decision model" row listing
the classifiers the workspace's connections offer. Choosing one
rebinds `classify@1`.
The providers are `classify_implementations` in
`packages/connections/src/capabilities/classify.ts`.
---
# Generation quality check
> The checks that measure whether generated agents and workflows are good enough to run.
Source: https://werker.cloud/docs/engineering/generation-check (updated 2026-11-30)
Werker's core bet is that workflows generated from a description are
good enough to run without editing. `pnpm eval:generation` measures
that.
## How it works
- **Cases** (`apps/worker/src/eval/cases.ts`): descriptions someone
might type into `/new`.
- **Running:** each case is queued as a workflow generated from its
description, for the workspace and model given (`--workspace`,
`--model`, default `workspace-a` and `gpt-5.6-luna`; `--only`
filters by name). A worker must be running. A case names the
abilities it needs by their [registry](registry.md) id (`shell`,
`classify`, `web` for the sandbox's network); it is skipped when the
workspace's runs lack one.
- **Plan cases:** a case with `plan` (`plan-*`) is decided by the plan
the generator saved: the schedule's fields, and the
[registry](registry.md) ids it must list under needs and
unsupported. The check then stops the run and removes the schedule.
- **Setup cases:** a case with `setup` (`setup-slack`) is decided by
creation stopping before it saves anything, with each listed ability
not ready (`runs.pause.setup`). The check then stops the run. Needs
a workspace with no Slack connection.
- **Web cases:** `web-page-title` reads a page and
`web-search-homepage` searches, through a connected web service or
the sandbox's network; each is skipped when the workspace has
neither.
- **Scoring:**
- **Fixed checks:** strings the result must contain, where the
answer is known (25 primes, largest 97; left-pad 1.3.0). When a
case has them, they decide.
- **Judge:** `classify@1` (Jev), asked whether the task was
achieved, as the user would see it. It decides cases without fixed
checks. For the impossible task it asks whether the result says
the data is unavailable instead of inventing it; refusing at
generation also passes. So does stopping to ask for what is
missing: nothing is connected that could answer, so the check
stops the run and passes the case without the judge.
- **Files** (`files`): the run's steps must keep at least that many
files.
- **Asking** (`answer`): a step must stop for input instead of
guessing. The check then answers it with `answer`, the run must
finish, and the judge sees the task with the answer.
- **Judge controls:** before scoring, the judge is given fixed
results it must get right. The report shows how many it got right.
- **Output:** a PASS/FAIL table, and the full results (each run's
result, error, steps and timing) in `data/evals/` (not in Git).
Files the runs kept, such as a chart or a CSV, are saved beside the
report in `data/evals/generation-