Browse the guides
Automation
Agents and scripts that run CloudJod with nobody at the keyboard, through keys with a switch for everything they may do: on, off, or ask an owner first.
An automation is a script or an agent that runs CloudJod with nobody at the keyboard: a pipeline that deploys every merge, a nightly job, an agent that keeps your apps healthy. It acts through keys of its own, and only where its switches allow: one switch for each kind of thing CloudJod does, each set to On, Off or Ask. Owners and admins set them up under Develop → Automations.
CloudJod decides every request an automation makes, not the agent making it. Whatever an agent is told or talked into, a request needing a switch that is off is refused, and the refusal is counted and shown to you.
Switches
- An automation's key has a switch for each thing it may do.
- On: it does it.
- Ask: the change is held until an owner accepts it, under Approvals.
- Off: refused, as is everything the key was never given.
| Setting | What happens |
|---|---|
| On | It does it. |
| Ask | The change is held, and an owner accepts or rejects it under Approvals, the way a change by a member who is not yet trusted waits. Accepted, it is carried out as the automation, and refused if the switch was turned off in the meantime. |
| Off | Refused. A switch an automation was never given is off. |
Only a change can ask: a switch that only reads is on or off. So is one whose requests cannot wait for a person, such as opening a shell, and a git push is refused rather than held (commit through CloudJod instead, which can wait).
The switches, by what they cover:
| Area | Switches |
|---|---|
| Apps | See apps, Read logs, Read settings, Create apps, Deploy and roll back, Restart and stop, Scale, Change settings, Run commands, Domains, Firewall and access, App API keys, Delete apps and projects |
| Code | Read code, Change code |
| Databases | See databases, Create and attach databases, Open database data, Delete databases |
| Servers and clusters | See servers and clusters, Change clusters and placement, Join and remove servers, Buy machines, Open shells |
| DNS | See DNS, Change DNS |
| Develop | Notes, tasks and messages, Change skills |
| Usage, bills and records | See usage, See bills, Change alerts, Read the audit and security logs |
Switches that delete something, cost money, let somebody in or change who is told about the organization are marked so beside them. Change alerts is one of the last: an automation that can move or remove where alerts go can keep the owners from hearing about it. A request that can change two things needs both switches: changing an app's settings can also change how many copies run and how big each is, so it needs Change settings and Scale.
Where it works
An automation works in every project, or only in the projects you choose. An automation for staging, limited to the Staging project, cannot touch production whatever its switches say. Limited to some projects, it:
- acts only on their apps and databases;
- makes new apps and databases only in them, so it names the project when it makes one (one made without a project would land in the default project);
- moves apps and databases only between them, and attaches a database only to one of their apps;
- changes nothing that belongs to the whole organization, such as DNS, clusters, servers or alerts.
Anything else is refused with the code outside_projects. Reading
the organization's lists stays open, so an agent can still find its apps among
all of them, and so do the notes and tasks agents share. Choose the projects on
the automation's page, under Where it works.
What no automation does
The team and its access, API keys, automations themselves, billing, and the
organization itself are for people. An automation is refused them whatever its
switches say, with the code not_for_automations. Its key also works
only inside its organization: it can read who it is, and nothing of its maker's
own, such as their password or sessions.
Keys
An automation's key acts within the access of the member who made it, as an API token does, and never as an owner. It stops when it is revoked, when it expires, when its automation is deleted, or when the member who made it leaves the organization. Make one key for each place it is used, so one can be revoked without the others. A key is shown once, when it is made.
A key can also name the addresses it is used from: single addresses, or
networks such as your CI runners' range, 203.0.113.0/24, up to 20.
The address that counts is the one CloudJod sees, which is your runner's public
address after any NAT. Presented from anywhere else, the key is refused with a
401, the same answer as a key that does not exist, so a key copied
out of a pipeline does nothing for whoever copied it. The owners are told, and
the automation's page suggests revoking it. The addresses are fixed when the
key is made; to change them, make a new key and revoke the old one.
Starting points
| Preset | For |
|---|---|
| Watch | Sees apps, logs, servers and usage, and changes nothing. For a monitor, or an automation's first week. |
| Deploy | A pipeline: commits code, deploys it, and rolls back a release that fails. A restart asks an owner. |
| Operate | Keeps apps running: deploys, restarts, scales, changes settings and runs commands. Deleting asks an owner. |
| Build and run | An agent that builds whole systems: apps, code, databases, domains, DNS and placement. Deleting, buying machines, anything that lets somebody in and changing where alerts go ask an owner. |
| Start empty | Every switch off. |
No preset turns on what deletes, costs money, lets somebody in or changes who is told: at most, it asks.
Choosing the switches
Start with less than you think it needs. Each automation's page shows, switch by switch, what it did, what it asked for and what it was refused over the last 30 days, and suggests changes from it: turn on, or set to ask, what it keeps being refused; turn off what it was given and has not used. Nothing changes until you choose to. Pause stops an automation at once, keys and all, until you resume it.
Being told
CloudJod tells the owners' alert channels, under Settings, Notifications:
| When | What they get |
|---|---|
| A switch set to Ask holds a change | The change, the automation that asked, and a link to that one change. An owner opens the link, reads what it would do, and accepts or rejects it there. |
| It tries what no automation may do | What it tried, with a link to the automation's page. At most once an hour for each automation, so a loop of refusals is one alert, not hundreds. |
| Its key is used from an address it may not be used from | The key's prefix and the address, with a link to the automation's page. At most once an hour for each automation. |
| An automation is made or changed, or a key is made for it | An access change, as when a member's role changes. |
Giving an agent a key
An agent connects over MCP with the key:
claude mcp add --transport http cloudjod https://api.cloudjod.com/v1/orgs/<organization>/mcp \ --header "Authorization: Bearer <the automation's key>"
Its tools then meet the automation's switches, request by request. The CloudJod
skill Run CloudJod unattended tells an agent how to work within
them: read its switches first with the my_access tool, plan only
what is on or asks, wait for an owner's answer rather than asking twice, check
every change, and roll back what breaks. Add it under Develop, Skills.
From a script
Where the key stands, with every switch and its setting:
curl -H "Authorization: Bearer $CLOUDJOD_KEY" https://api.cloudjod.com/v1/orgs/<organization>/automation/me
| Answer | Meaning |
|---|---|
202 with an approval | Asked: the change waits for an owner. Read the approval for its state; do not send the change again. |
403 switch_off | A switch it needs is off. The answer's switches names them. |
403 cannot_wait | The switch asks an owner, and this request cannot wait for one. |
403 automation_paused | The automation is paused. |
403 outside_projects | It works only in some projects, and this is not in them, or it changes the whole organization. |
403 not_for_automations | For people only. |
401 | The key was revoked or has expired, its automation was deleted, its maker left, or it was used from an address it may not be used from. |
The record
Every change an automation makes is in the audit log, as its maker through the automation's key, and so are changes to its switches: who moved which, from what to what. What it did, asked for and was refused is counted switch by switch and day, and kept 91 days.