- Docs
- Studio
- Schedules and automations
- Automation probes
Automation probes
A probe is a check, run without a model in a sandbox on the automation's computer, that decides whether the automation's run starts.
Where in StudioNavigation rail → Automated → an automation → Setup
Updated View as markdown
A probe is an optional check on an automation. Without one, the automation starts a run every time its schedule comes round, and the agent decides inside that run whether there is anything to do. With a probe, the computer that owns the automation runs the check first, on its own clock, and the automation's run starts only when the check says so. Most checks find nothing, and they cost no agent time when they do.
A probe runs without a model, in a sandbox, on the computer that owns the automation. It never runs in Kelrova's cloud. It is either one of five built-in templates with a few settings, or a short script that you approve.
| Plain automation | Automation with a probe | |
|---|---|---|
| What decides a run starts | The schedule | The probe's answer |
| How often it looks | Its Repeat | Every 5 minutes to every 24 hours |
| What a quiet check leaves behind | A run and its chat | Nothing but a line in the probe's history |
Run now is unchanged: it starts the automation's run straight away, without the probe.
Templates
Templates are checks that ship with the app. Prefer one whenever it fits: each describes itself in one sentence, so it is quick to read before you approve it.
| Template | What it checks | Settings | Network |
|---|---|---|---|
| Free disk space | Free space on a disk falls below a limit. | The folder whose disk to watch (the root of the disk if you leave it out) and the minimum free space. | Optional |
| Package release | A new version of an npm package is published. | The package name. | Needed |
| Git remote head | A branch or tag on a remote Git repository moves to a new commit. | The repository URL and the branch or tag (the default branch if you leave it out). | Needed |
| Web address check | A web address answers with the wrong status, too slowly, or with a certificate close to expiry. | The URL, the expected status (200 if you leave it out), and optionally the longest acceptable response time and the fewest days left on the certificate. | Needed |
| Postgres query | A read-only query's result crosses a threshold. | The query, the comparison (less than, at most, greater than, at least, equal, not equal), the threshold and the secret that holds the connection details. | Needed |
A template that needs the network cannot be saved with the network off. The Postgres template needs the network even for a database on the same computer, because a probe with the network off has no network at all; see Network.
Scripts
When no template fits, a probe can be a script of up to 8 KiB that starts with a #! line, such as #!/bin/sh or #!/usr/bin/env python3. Longer logic can live in your project: a probe can pin up to 16 files from the project folder, each up to 256 KiB and together up to 1 MiB. The probe then runs copies of the approved files, never the live ones, from the folder named by the KELROVA_PROBE_FILES environment variable. A typical script is then a single line, such as exec python3 "$KELROVA_PROBE_FILES/scripts/probes/check.py". Pinned files must be text inside the project folder: no paths outside it and no links that lead out of it.
What a script reads and answers
Each time it runs, the script receives one JSON object on standard input. It holds the probe's settings, the current time, the state the script saved last time, and when the automation was last started by the probe and how its last run went.
The script answers with one JSON object on standard output:
| Field | Meaning |
|---|---|
run | Required. true starts the automation's run; false means there is nothing to do. |
dedupeKey | Optional, up to 128 characters. A name for the condition the probe found, such as disk-low:/. The same key again within the cool-down does not start another run. |
context | Optional, up to 4 KiB. An object of plain values and lists, with no objects inside it and strings of at most 512 characters, that the run receives with its first step. |
state | Optional, up to 16 KiB. Saved and handed back to the script next time, for example the last version it saw. Leave it out to keep the saved state. |
For example, {"run": true, "dedupeKey": "disk-low:/", "context": {"freeBytes": 14200000000}}.
Anything else counts as an error, never as a reason to run: an exit code other than 0, running past the time limit, output that is not one JSON object, output over 64 KiB, or a field that breaks the rules above. A script that hits a passing network problem should exit with an error and let the probe try again later; see Limits.
The run's first step receives context marked as untrusted data, never as an instruction. Keep text you do not control, and every secret, out of context.
Approval
A probe does nothing until you approve it. Approval covers exactly what you saw: the template and its settings or the full script, the contents of every pinned file, the network setting (shown as full network access when it is on), whether the probe may read the project, the secret names, the time limit and how often it runs. The automation's computer keeps a fingerprint of all of it and runs the probe only while what it would run still matches.
- Who can approve. You can approve on the automation's computer itself, or from any other desktop computer it has approved. So a server without a screen can be managed from your Mac. See Approved devices and signatures.
- Any change needs a new approval. Editing the script, a setting, the network, the secret names or the time limit makes the probe unapproved until you approve again. So does any change to a pinned file in the project, whether from a
git pull, an agent's edit or your own. The probe then stops, you are notified once, and it waits for your approval. - What does not. Pausing, resuming and changing the cool-down or the daily limit keep the approval.
- When an approver is removed. If you revoke a computer's approval, every probe approved from it is unapproved and stops until someone approves it again.
- Another computer. An automation taken over by another computer starts with no approval there.
A chat can propose an automation with a probe. It must test the probe first, both a check that would start the run and one that would not, and the proposal shows what was tested, the template's sentence or the full script, the network setting and the secret names. Applying the proposal saves the automation; the probe still waits for your approval. See When a chat proposes a schedule.
Test and check now
From any approved desktop computer you can:
- Test the probe: it runs once in the real sandbox, with your real secrets, and shows its answer, what it would have done, and the end of its output. A test saves nothing and starts nothing. You can test a few runs in a row, each picking up the state the one before saved.
- Check now: a real check, the same as when its time comes. If the probe answers
run, the automation's run starts.
A chat that tests a probe gets stand-in values for its secrets, never the real ones.
Network
The network is off by default. With the network off, a probe has no network at all: not the internet, and not services on the same computer.
With the network on, a probe has full network access: it can reach the internet and services on the same computer, such as a local database. The rest of the sandbox stays in place. The probe still cannot read your home folder or Kelrova's data and keys, cannot write outside its own folder, and cannot reach the computer's local system sockets. When you approve a probe with the network on, the approval says it has full network access.
On Linux, when the computer has pasta (from the passt package) installed, Kelrova also blocks link-local addresses for probes with the network on. Those are the addresses where cloud servers answer requests for their credentials. Nothing extra needs to be installed for the network to work, and the computer shows whether this extra protection is active. Apart from that, probes work the same way on macOS and Linux.
There is no way to run a probe outside the sandbox. A computer that cannot provide one reports the sandbox unavailable instead.
Secrets
A probe that needs a password, token or connection string reads it from a secret: a named value stored on the automation's computer, in the macOS Keychain or, on Linux, in a file encrypted with that computer's key. A probe lists the secret names it uses, up to 8, and gets each value as an environment variable of that name.
- Names are capital letters, digits and
_, start with a letter and are at most 64 characters.PATH,LANG,TZ,HOME,TMPDIRand names that start withKELROVA_are reserved. - Secrets are write-only. You can see their names, set a new value and delete one, but a value is never shown again: not in the editor, a proposal, a test, a log or any chat. Values never sync.
- Setting a secret from another computer sends it sealed to the automation's computer only. If the two computers cannot seal it, the secret is not sent; set it on the automation's computer instead.
- The secret names are part of what you approve, so a probe gets only the secrets you approved for it.
- Deleting a secret stops the probes that use it, and their checks read that a secret is missing.
Keep secret values out of what the probe prints and out of pinned files. The probe's settings, script, pinned files and test output reach your other computers the same way other remote requests do; see What stays on your computer and what syncs.
Limits
| Limit | Value |
|---|---|
| How often a probe checks | Every 5 minutes to every 24 hours (5 minutes if you leave it out) |
| Time limit for one check | 1 to 30 seconds (20 if you leave it out) |
| Script | 8 KiB |
| Pinned files | 16, each 256 KiB, 1 MiB together |
| Answer read | 64 KiB, with context at most 4 KiB and state at most 16 KiB |
| Secrets per probe | 8 |
Cool-down for the same dedupeKey | 0 minutes to 7 days (60 minutes if you leave it out) |
| Runs started by the probe | 1 to 96 a day (24 if you leave it out) |
| Checks at once | 1 per automation, 4 per computer |
- Busy. While the automation's last run is still going, a check that answers
runwaits, and the next check tries again. So does a check stopped by the daily limit. Nothing is lost. - Errors. After 3 errors in a row you get the automation's failure notification, and the probe checks less often, doubling the wait each time up to once an hour. After 24 hours of nothing but errors it switches itself off and says why.
- Once only. A probe can be set to switch itself off after it starts its first run: wait until something happens, then do the work once.
A check that finds nothing to do adds no run and no chat. It shows only in the probe's recent checks, together with checks that were skipped as repeats, waited for a busy run or failed.
On iPhone and iPad
The iPhone and iPad app shows a probe but cannot change it. It shows the template's sentence or the script, the network setting, the secret names, whether the probe is approved and its recent checks. From the app you can pause, resume and delete the automation. Approving, testing and editing a probe, and setting secrets, take a desktop computer. See The iPhone and iPad app.