CloudJod
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.

Updated · 9 min read

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

deploy-botkey Deploy Change settings Delete apps onaskoff onaskoff onaskoff waits for an owner never given: off
  1. An automation's key has a switch for each thing it may do.
  2. On: it does it.
  3. Ask: the change is held until an owner accepts it, under Approvals.
  4. Off: refused, as is everything the key was never given.
An automation's key does only what its switches allow: each is on, ask or off, and ask puts an owner in the way.
SettingWhat happens
OnIt does it.
AskThe 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.
OffRefused. 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:

AreaSwitches
AppsSee 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
CodeRead code, Change code
DatabasesSee databases, Create and attach databases, Open database data, Delete databases
Servers and clustersSee servers and clusters, Change clusters and placement, Join and remove servers, Buy machines, Open shells
DNSSee DNS, Change DNS
DevelopNotes, tasks and messages, Change skills
Usage, bills and recordsSee 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:

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

PresetFor
WatchSees apps, logs, servers and usage, and changes nothing. For a monitor, or an automation's first week.
DeployA pipeline: commits code, deploys it, and rolls back a release that fails. A restart asks an owner.
OperateKeeps apps running: deploys, restarts, scales, changes settings and runs commands. Deleting asks an owner.
Build and runAn 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 emptyEvery 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:

WhenWhat they get
A switch set to Ask holds a changeThe 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 doWhat 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 fromThe 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 itAn 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
AnswerMeaning
202 with an approvalAsked: the change waits for an owner. Read the approval for its state; do not send the change again.
403 switch_offA switch it needs is off. The answer's switches names them.
403 cannot_waitThe switch asks an owner, and this request cannot wait for one.
403 automation_pausedThe automation is paused.
403 outside_projectsIt works only in some projects, and this is not in them, or it changes the whole organization.
403 not_for_automationsFor people only.
401The 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.