The licence and the runtime

The stalwart-agents wheel carries Stalwart's runtime, compiled: the reader that turns each turn into a plan, the tool check, the reply checks, the code checks, the licence and its lease, and the meters. It runs on the machine that runs your agents, so nothing a turn needs waits on the network, and your users' turns, your agents' calls and your documents stay there.

What a licence is

A licence is this machine, activated against your Stalwart account with your API key. Activation opens a lease: the runtime's permission to run for a period, renewed while the machine can reach Stalwart, and kept for a grace period when it cannot. Your plan sets how many machines may hold a lease at once, how long the lease and the grace run, and the monthly caps every machine of your account counts against together. What each plan includes is on developers.stalwart.it.

Activating a machine

$ export QLS_API_KEY=qls_live_...
$ stalwart licence activate        # once on each machine
$ stalwart licence status          # the licence, the lease, the grace and the quota left
$ stalwart licence release         # frees this machine's place, for another to take

A machine that cannot reach Stalwart is activated through one that can, where your plan includes offline activation:

$ stalwart licence request                          # on the machine to activate: writes activation-request.json
$ stalwart licence answer activation-request.json   # on a machine that reaches Stalwart: writes activation-answer.json
$ stalwart licence install activation-answer.json   # back on the first machine

What works without a key

Nothing in the package works without an API key and an activated licence, except what you need to get them:

Everything else needs both: stalwart sources build and ask, trace, verify, serve, redteam, gateway, rules compile and catalogue import, and in Python Agent.chat, the client's plans and checks, the reply check, the answers and the code check. Without them, each stops with LicenceRequired (from stalwart_agents.errors), which names stalwart licence activate and where to get a key.

What the bot downloads

A bot reads each turn with two models it keeps on its own computer, beside the runtime:

Both are pinned by their SHA-256 in this release and downloaded from https://api.stalwart.it/downloads/ in parallel parts that resume where a stopped download left off. stalwart models fetch downloads them with a progress bar, and the installers run it before the bot starts; a bot that starts without them downloads them in the background and reads with the reader alone until they are there. Each file is checked against its digest before it is loaded.

Variable What it does
STALWART_PLANNER=off the bot reads without the planner, as it did before
STALWART_CLASSIFIER=off the bot reads without the neural network (and so without the planner)
STALWART_PLANNER_HOME, STALWART_CLASSIFIER_HOME a folder holding the unpacked model, used as it is
STALWART_PLANNER_URL, STALWART_CLASSIFIER_URL another address to download the model from

The library holds the keys

The runtime holds the lease in its own memory, and checks it inside every operation it runs. The keys that sign your tenant's bundles and histories never cross into Python, and the runtime reads the clock and counts each operation itself. stalwart_agents._runtime, the loader underneath, is internal: the client, the agents and the commands call it for you, and it is not a surface to build on.

Only counts leave the machine: how many turns were read, calls checked and replies held, reported against your account's monthly caps. One total is kept for your whole account, however many machines share it.

A process holds one licence: every check, answer and plan in it is counted against that licence's lease. A client for a second service (another base_url) in the same process is refused, saying so; run it in a process of its own. Several processes of one machine -- a server's workers -- share its lease and its record safely.

Computations

A plan that needs a calculation -- a total, an average, a date difference -- runs it on your own host, in the qls-sandbox container image, when a container engine and the image are present. Every plan includes compute runs: 100 runs and 300 seconds a month on the free plan, 10,000 runs and 30,000 seconds on the paid plan, and no limit on enterprise. Client.compute, AsyncClient.compute and the LangGraph compute node run on the same path. The runtime builds the prompt from the data's shape, never its values; your own model writes the function; the runtime admits it -- no socket, no file, no import outside a short list -- and the sandbox runs it, with no network. Nothing of it leaves your host: the runs are counted, and the count goes in the usage report. python -m stalwart_agents.sandbox fetches the image this release runs. Where the image is not there, plans say compute off: in their reason, and the agent's on_unread decides what happens to the turn (worked examples).

Where the runtime cannot run

The runtime ships for Linux (x86-64 and arm64), macOS on Apple silicon and Windows (x86-64). Anywhere else, the package installs without it, and nothing on that host answers plans or tool checks: each raises SelectorUnavailableError. Run your agents on one of those platforms. Stalwart's hosted API answers neither. An enforcement point that is not an MCP client, such as Kong, asks your stalwart gateway for its checks over HTTP, so only the gateway's host needs the runtime.