Expand description
Engine opt-in (C0 1.9, section 4; owner decision O1).
An engine’s agents work on tasks only by pulling them, and only within the opt-in its owner set on the web: which vaults and networks, how much per day, and whether at all. Cloud never starts an agent; nothing here spawns anything.
GET /v1/me/optin (instance token) → EngineOptinV1. The owner
changes it on the web; every change gets a new optin_id, and
active: false (the stop) ends every claim of that engine at once.
The engine may stop itself: PUT /v1/me/optin EngineOptinStopV1 →
EngineOptinV1. It turns task pickup on only with the person at the
computer (rc4-16): PUT /v1/me/optin EngineOptinOnV1, signed with
the app’s bound opt-in key (no per-turn-on prompt) over OPTIN_SIGNING_DOMAIN ‖
canonical JSON of the body without presence_signature, plus
instance_id. Only the bound opt-in key signs it; there is no
presence-key fallback. The instance token alone never turns it on
(403 forbidden_right reason person_unproven); without a bound opt-in
key the engine refuses it before sending (no_optin_key: pair LeanCTX
Code with the computer first). Turning it off needs no key.
Cloud is the source of truth and enforces it on every claim:
- a claim carries the
optin_idthe engine last read (section 1TaskClaimRequestV1.optin_id, required since this section; without it400 invalid_requestfieldoptin_id); - an older
optin_id→409 invalid_statereasonoptin_changed: the engine reads the opt-in again before it pulls; active: false, or no opt-in →409 invalid_statereasonoptin_inactive;- a vault or network outside the opt-in →
403 forbidden_rightreasonoptin_scope; - the day’s budget used up →
429 rate_limitedreasondaily_budget, withlimit,used(claims) andretry_after_suntil 00:00 UTC.
Usage counts per UTC day: a claim counts one task when it is granted; the
usage of task results (section 1) adds tokens and usd_micros. A claim
is refused once any set limit is reached; a running claim is never cut
short by the budget. A granted claim counts atomically: parallel claims
of one engine never exceed daily_budget.tasks together.
An engine may apply stricter local caps (fewer tasks, a lower budget, a narrower scope). It never widens what Cloud allows.
Structs§
- Daily
Budget V1 - Limits per UTC day. A limit that is absent is no limit; since Cloud task #19 (owner decision 23.10.) that holds for the task count too.
- Daily
Usage V1 - What the engine used today (UTC).
- Engine
Optin OnV1 PUT /v1/me/optin: task pickup turned on from the computer, with the person at it (rc4-16).presence_signatureis the signature of the app’s bound opt-in key only (never the presence key; the field keeps its name on the wire) (base64url, no padding) overOPTIN_SIGNING_DOMAIN‖ canonical JSON of the body without it, plus"instance_id"(the instance UUID, lowercase with hyphens). Cloud refuses aprev_optin_idthat is not the opt-in’s current one (409 invalid_statereasonoptin_changed), so a signature works at most once.- Engine
Optin Stop V1 PUT /v1/me/optin: the engine’s own stop.- Engine
Optin V1 GET /v1/me/optin.
Enums§
- Network
V1 - A network an engine may pull questions from: an org channel
(
org:<org_id>/vault:<vault_id>/<name>). Any other kind does not decode.
Constants§
- DEFAULT_
DAILY_ TASKS - ENGINE_
OPTIN_ ON_ SCHEMA PUT /v1/me/optinwithactive: true(rc4-16).- ENGINE_
OPTIN_ SCHEMA - ENGINE_
OPTIN_ STOP_ SCHEMA - MAX_
DAILY_ TASKS - MAX_
OPTIN_ NETWORKS - MAX_
OPTIN_ VAULTS - OPTIN_
SIGNING_ DOMAIN - The domain the person’s presence signature of a turn-on is made under.