Client programs
A client program is one of the client's own programs, in any language, that runs beside the instance: a Python
model, a search engine, an application the client already has. Each one says what it needs in a declaration,
program.json. An admin approves it on the Programs screen, and it gets an API token of its own that can do
exactly what it declared. With a host, every start gives it a new token through the host; nobody
copies one by hand.
Client programs run on the instance's host, shade-programs, a separate program beside the instance that runs each
client program in a confined container of its own. Whoever runs the instance connects SHADE to it
(Deployment). Without a host, client programs can be approved here but not run or called,
and the screen says so.
What users can do
Admins:
- Add a client program by pasting its declaration (Declaration: the
program.jsonits developer gives you). It waits for approval: nothing runs and no token is made. Setting names (the host's address and token) and file names sit under Technical details, closed until opened. - Review what it asks for: its image, its limits, the ports it serves, the hosts it calls, the actions its token may perform and the personal data it keeps.
- Approve it, after signing in again with their password and a two-factor code or a passkey, and typing its name. On an instance with a host no token is shown: the host gets a new one at every start. Without a host, the token is shown once, to copy and give to the client program wherever it runs.
- Revoke an approved client program. Its token stops working at once, and it is taken off the host. Nothing of it stays on the host: a client program keeps no files there, only in SHADE, which a person's lookup and erasure already cover.
- Add a new declaration for a pending or revoked client program; it waits for approval again.
- Start and stop an approved client program on the host, and see how it is doing there.
- Read a client program's log on the host (its last 200 lines) and its use (CPU, memory, processes, network).
Modules that declare it, and SHADE itself, call a running client program through the host (see Calls to a client program below), and the Personal data screen finds and deletes what a client program keeps about a person.
Who may do it
| Action | Permission | Roles |
|---|---|---|
| See the client programs, their logs and their use | programs.read | admin |
| Add, approve, revoke, start and stop client programs | programs.manage | admin |
Both stay with admins: no custom role, module, client program, AI assistant or background work can have them.
In the admin

Programs (Dutch: Programma's) is in the settings area's Connections group, for admins.
- A table of the client programs: the name and description, the image's digest, the actions it uses, and its status (Waiting for approval, Approved, with who approved it and when, or Revoked).
- On the host: for an approved client program, how it is doing there: Getting its image, Scanning its image, Running, Restarting, Failed (with why) or Stopped; whether it runs in its own container or under gVisor; how often it restarted in a row; or Not on the host. While it gets or scans its image the column is read again every few seconds.
- Without a host, a notice says client programs can be approved but not run, and how to set one up. When the host does not answer, a notice says so, with why.
- Add a program opens a form with a text box for the declaration. Each problem with it is listed: not valid JSON, a field that is wrong, a port listed twice, or an action a client program can never be given.
- Review on a waiting client program opens the approval dialog: a warning, what the declaration asks for, then the password, the code (or the passkey) and the name. Approve stays off until all are given. An admin with neither two-factor nor a passkey is told to set one up on their account page first.
- Once approved with a host, the dialog closes and says to start it: the host gives it its token. Without a host, the dialog shows the token with Copy. It is not shown again.
- Start on an approved client program that is not running gives it a new token and asks the host to start it: the host gets its image, checks it is the approved one, scans it and runs it. Stop stops it; its logs stay on the host.
- Logs on a client program the host has opens its last log lines (what it wrote, and the host's own lines: starts, failures, the decisions on its outgoing calls, calls to it) and its use over the last day: the latest sample, and the highest CPU and memory. Refresh reads them again.
- Revoke on an approved client program asks first. One the host could not take off then shows still on the host, with Revoke again to take it off.
- The API tokens screen lists each client program's token as kind Program, acting as the client program. It is revoked with its client program, under Programs.
The declaration
{
"name": "model",
"description": "A Python model that tags images",
"image": "ghcr.io/acme/model@sha256:<64 hex digits>",
"limits": { "cpus": 1, "memoryMb": 512, "diskMb": 1024, "pids": 256 },
"ports": [8080],
"capabilities": {
"network": { "hosts": ["api.example.com"] },
"uses": ["content.read", "media.read"],
"personalData": { "purpose": "Tags on the users' photos", "kept": "user" }
}
}
name: lowercase letters, digits and dashes, 2 to 40 characters.image: pinned by its digest, so what was approved is exactly what runs.limits: CPUs (0.1 to 8), memory (32 MB to 16 GB), disk (16 MB to 100 GB) and processes (8 to 4096, 256 if left out).ports: at most 5, from 1024 to 65535; none if left out. A client program can't be reached unless it declares a port, and then only through the host. One that keeps personal data serves at least one.capabilities.network.hosts: the public hosts it calls; never an address or a local name.capabilities.uses: the actions its token may perform. Never one that stays with admins (the team, roles, tokens, the logs, settings, personal records, modules, client programs, the forms' submissions), and only actions this instance knows.capabilities.personalData: what personal data it keeps and about whom:userfor data kept by the ids of user accounts,personfor data kept by email address.
On the host
- A running client program gets the instance's address and its token from the host, and uses the token on the content and data APIs. Beyond the instance, it can reach only the hosts it declared.
- Every Start makes a new token and hands it to the host with the start; the token from the start before stops working once the host has the new one. A start the host refuses leaves the token the client program has. The host keeps the token so the client program keeps it across restarts (its own and the host's), and never shows it.
- Approving a client program hands its declaration to the host, as trusted: an admin approved exactly that image. It does not start it: Start does. A host that could not be reached at that moment doesn't undo the approval; the dialog says so, and Start hands it over again.
- Starting and stopping are audited (
programs.start,programs.stop). - How the host runs a client program (its image scanned, its limits, a network of its own, the hosts it may call) is in shade-programs' README.
Calls to a client program
SHADE never calls a client program by its address: it asks the host, which forwards the call to the declared port on the client program's own network, and nowhere else.
- Only an approved, running client program. Modules only call the client programs they declare; their consent lists them.
- A path on the client program, a short list of headers, at most 1 MB sent and 5 MB answered, 10 seconds by default and at most 60. A redirect is returned, never followed.
- Each call is in the client program's log on the host: its method, its path without the query, the status and the time.
Personal data a client program keeps
A client program that declares personalData takes part in the Personal data screen and in a user's own
download, like SHADE's other kinds (What the client's programs keep): looking someone up asks every approved client
program that keeps personal data, by their email address or by the ids of their accounts, and deleting asks each to
delete it. A client program that cannot answer (no host, not running, failing) stops the lookup or the deletion with
the reason, so nothing is left out unseen. Deleting asks the client programs first, before SHADE deletes anything of
its own: when one fails, nothing in SHADE is deleted yet, and deleting again finishes the job (a client program
deletes nothing the second time). When a user account is deleted, what client programs keep for it is deleted too,
as soon as the host can be reached.
A client program that keeps nothing personal keeps nothing that must survive a restart: its disk is gone with its container.
Rules and limits
- A client program's token works on the content API and the data API, never for AI assistants (MCP). It acts as the
client program and can do exactly the actions its declaration uses. What it does is in the audit log as
program:<name>. - The token belongs to the admin who approved it. If that admin is deactivated or removed, the token stops working, like their other tokens. The list then says the token stopped working, and Start is refused: revoke the client program and approve it again.
- An approved client program keeps its declaration. To change it, revoke it, add the new declaration and approve it.
- Approving, revoking and starting are audited (
programs.approve,programs.revoke,programs.startwith the new token's first characters) and approving and revoking raise the security alert A program approved or revoked to every admin (Errors and security alerts). Adding a declaration is audited too (programs.register), and so is a refused approval (programs.approve-failed). - Signing in again allows five tries per admin per quarter of an hour.
For developers
The code and its tests: shade/features/programs/README.md in the shade repository.
Limitations
- shade-programs has no release yet: first a rehearsal beside a test instance, then its first release (Roadmap).