Skip to content

Config approvals API (four-eyes)

When an organization enables config approval, a configuration change made by a Fachadmin (a tenant_admin or ki_manager) does not take effect immediately. It is recorded as a pending change and must be approved by a second, different administrator before it is applied — the four-eyes principle. The person who requested a change can never approve their own change. Denying or letting a request expire discards it; nothing is applied.

This lane governs changes to the organization's central prompt library — surfaced in the UI as Workspace › Library (the /library page) — to its agents — creating, editing, or restoring a saved agent, and creating an agent schedule — to its projects / knowledge areas (the /projects surface): creating, editing, or deleting a project — and to a subset of the organization's own workspace settings — surfaced in the UI as User Management › Organisation › Edit › General (formerly the account popover's "Workspace settings" popup, now retired): identity & branding (assistant_name, brand_product_name), access & governance (config_approval_required, mcp_dcr_enabled, content_logging_disabled, named_reports_enabled, answer_corrections_enabled, web_search_confirmation_enabled, report_min_group_size), and the workspace's default persona (default_user_type, settable by the tenant admin) and its default department (default_department_id, department_source_precedence; a held clear is JSON null), and the default approval waiting time for new agents (approval_ttl_default_s; a held clear is JSON null), and the automatic agent protection settings (protection_deny_burst_count, protection_deny_burst_window_s, protection_rejection_count, protection_rejection_window_s, protection_volume_factor, protection_count_expiries; only the changed ones are held and they are applied on top of the values in force at approval) — see Tenants & Gateways. It is a per-organization control, off by default — existing organizations keep today's immediate-apply behaviour until they turn it on. (Adding wallet funds is NOT governed here: a funding grant (grant_usd) is platform-admin-only — see Tenants & gateways.)

Agent, project, and tenant changes are re-validated at approval time, never replayed. A saved agent, and a project that pins a default model/provider, route every one of their conversations to that pair. Because a request may sit in the queue for up to 7 days, an approved agent or project change is re-checked against the organization's current residency and provider-allowlist rules at the moment of approval — not applied from a stale snapshot. If a model that was allowed when the change was requested has since become residency- or allowlist-blocked, the approval is refused (apply_failed, reason surfaced) and nothing is written. The requester's own authority is also re-checked at that moment: if the requester has since been removed, downgraded to a read-only role, moved to another organization (a requester or record without an organization is never treated as belonging to it; organization identifiers are compared exactly, including letter case), or lost the required role on the target (agent ownership; or, for a project, the editor/owner role — including the owner-only gate on a project's access tier or retention period), the approval is refused (requester_unauthorized). For a project change this includes a requester who was disabled or deleted while the change was held (apply_failed, requester_unauthorized, nothing written). A held delete of a gateway-locked project is re-decided against the project's current lock: it applies only when the requester may still govern the project (its owner, or department administration) — otherwise apply_failed, reason project_gateway_locked; if the requester's project role cannot be read, the approval is retryable and nothing is deleted. A held tenant change is re-validated the same way: default_user_type is re-checked against the live user-type registry (a slug retired since the request → refused apply_failed, reason invalid_default_user_type).

Base URL: https://<your-gateway-host>/admin/v1

The workspace switch mcp_dcr_enabled (unverified MCP clients, see Tenants & gateways) is one of the gated workspace settings: a genuine change is held like the other switches.

The organisation's guardrail baseline and fail-closed switch (guardrail_baseline, guardrails_fail_closed, see Tenants & gateways) are gated the same way. The approver's summary names the change by detector count and on/off state, never by keyword. At approval time the held baseline is re-checked with the same rules as the PATCH. A held value that no longer passes them, or a switch value other than 0/1, is refused (apply_failed, reason corrupt_payload) and nothing is written. When the change applies, the configuration of every gateway in the organisation is refreshed at once.

The organisation-wide EU-residency floor (eu_region_routing, see Tenants & gateways) is gated the same way when a tenant admin changes it (a platform admin's change is never held). The approver's summary reads, for example, Organisation-wide EU routing: no organisation setting -> enforced. The request records the floor stored when it was made: when the floor has changed since (for example a platform admin set it), approving answers apply_failed with reason eu_region_routing_stale and nothing is written — file the change again. A held value other than 0, 1 or null is refused (apply_failed, reason corrupt_payload). When the change applies it is audited as tenant.eu_region_routing_changed under the requester, and the configuration of every gateway in the organisation is refreshed at once.

A held agent-schedule change is checked the same way. Its e-mail destination (output_action.to) must be a plain ASCII address (see Agents), except that an address equal to the one the schedule stores at the moment of approval is accepted unchanged. A re-sent older address is judged as a new value: if the stored address was changed after the request was filed and the request re-sends the older address, it must pass today's check. If it fails, the approval is refused (apply_failed) and nothing is written; a valid older address is applied.

Required permission for every /config-approvals endpoint: GOVERNANCE_MANAGE (a manager gate-class permission; held by admin, tenant_admin and ki_manager by default). Without it the call is 403 { "error": "forbidden" }; an unauthenticated caller, or a caller with no organization (tenant), gets 401 { "error": "unauthenticated" }. Every call is re-gated and tenant-scoped server-side — the client is never the authorization boundary.

Gateway guardrails, routing rules and provider keys are governed too. With four-eyes on, a gateway administrator's (GATEWAYS_MANAGE) change to a gateway's configuration (PATCH /gateways/:id and a guardrail-config import), to its routing rules (create, update, reorder, delete) or to its provider keys (store, delete) answers 202 { "status": "pending_approval", "approval_id": "…" } and is applied only when another administrator approves. A held PATCH holds only the keys that really differ from the stored configuration (it also carries ignored_fields); a request that changes nothing is not held; when such a request would change a guardrail key or provider_base_urls back because another change was saved after it was read, it answers 409 config_changed and nothing is written (see Updating gateway config). Platform administrators are never held. At approval the gateway must still exist in the same organization and the requester must still hold GATEWAYS_MANAGE (otherwise 409 apply_failed, reason requester_unauthorized); the same validators as the direct path run again, and the audit entries name the requester as the actor. A held provider key is stored only as ciphertext (encrypted under the platform master key when it is submitted); the plaintext is never held, the ciphertext is erased as soon as the request is applied, denied or failed; a request that expires unanswered keeps it only until the organization's next approval decision or listing of the approvals (the next approve, deny or GET removes it), it is redacted in the tenant export, and pending requests are removed when the gateway is deleted. Test headers and reserved keys are never held. If the organization's record cannot be read at approval time, the approval stays pending rather than being recorded as failed; it is closed by the 7-day expiry. An organization that was deleted while the request was pending is handled by the check that precedes every apply, and the outcome depends on how it was deleted (see the table below): deleted with its users kept, the request fails with tenant_not_found; deleted together with its users, the requester is gone and the request fails with requester_unauthorized; purged, nothing can decide it any more (404) and it is kept with its proposed payload and summary erased (and a free-text failure reason replaced by erased); its status stays as it was (pending stays pending, applying stays applying). The retention sweep deletes it at 730 days.

Turning it on

Config approval is a per-organization switch, set on the tenant:

PATCH /admin/v1/tenants/<tenant-id>
{ "config_approval_required": 1 }

1 = on, 0 = off (the default). The change is audited (tenant.config_approval_changed). While it is on, every prompt-library create/update/delete/restore, agent create/update/delete/restore, agent-schedule create/update/delete, project create/update/delete, and workspace-settings change (assistant name, workspace name, default user type, unverified MCP clients, this very toggle) by a Fachadmin is held for approval; while it is off, those calls apply immediately as before. The MCP connector trusted_subprocessor setting (PATCH /mcp/<id>/trusted, operation set_trusted) is likewise always held for a non-platform-admin, and so is lowering a source policy: a connector's (PATCH /mcp/<id> with a looser tool_policy.source, operation set_source; see Source policy) and a gateway's built-in sources (PATCH /gateways/<id> with a looser config.source_policy, gateway_config / patch). Lowering the organisation's minimum for every source (tenant / update) is held while the switch is on, like the other workspace settings; raising it applies at once. The same holds for making a delivery channel internal in the organisation's delivery channel class (tenant / update); making one external applies at once. (System-provisioned example agents seeded by the workflow templates are fixed-config and are not gated.)

What happens when a change is held

With the switch on, a Fachadmin's gated mutation (any of the operations above) returns 202 Accepted instead of its usual 200/201, and nothing is written to the live configuration yet:

{ "status": "pending_approval", "approval_id": "…" }

The change is now a pending row in the approval queue. It stays valid for 7 days; after that an approve is refused (see below).

A held create answers this body without an id — nothing exists yet. A client must not treat a 202 as the created record: the web client shows a "Submitted for approval" state (with a link to Approvals › Configurations) and never opens or lists the entity; a 2xx body that is neither the held body nor a record with a non-empty string id is treated as a failure.

The requester is told the outcome

When a held request is decided, the person who filed it sees it in the notifications bell. GET /admin/auth/me and GET /admin/v1/me/notifications carry config_approval_outcomes, a live list of the caller's own requests (requested_by = the caller, in the caller's organization) decided — or expired without a decision — in the last 7 days, newest first, at most 20:

[{ "approval_id": "…", "entity_type": "chat_project", "operation": "create", "outcome": "approved",
   "name": "Claims 2027", "decided_at": 1794320000, "outcome_at": 1794320000, "target_id": "…" }]
  • outcome is approved (stored status applied), denied, failed (apply_failed: approved, but the change could not be applied), or expired (still pending when its 7-day window ran out — nobody decided; file it again if it is still wanted). A request that is still pending within its window, or applying, is not listed.
  • name is the request's summary (bounded; "" when it is absent or was erased). decided_at is unix seconds — for expired the moment it expired.
  • outcome_at (unix seconds) is when the request became an outcome. Usually that is decided_at. An approved agent change is decided at the approval but applied (or swept as failed after a stalled apply) later, and then outcome_at is that later moment. The 7-day window counts from outcome_at.
  • target_id is present only on an approved create (the new record's id); the web client links an approved project create to the new project.
  • A request the requester withdrew themselves (denied by its own requester) is not listed.
  • The list is derived from the approval queue — there is no separate notification record and nothing to dismiss; an item disappears 7 days after its decision (or expiry).
  • Acknowledging the outcomes (badge). Opening the bell acknowledges the outcomes it shows: the acknowledged items stay listed until they age out, but no longer count toward the bell's badge. Both payloads carry config_approval_outcomes_seen_up_to (unix seconds; omitted when the caller never acknowledged, while impersonating, and when the stored value is later than the server's current time): an outcome whose outcome_at is at or before it is acknowledged. A client acknowledges with the route below. It sends the newest outcome_at it showed, never the current time, so an outcome that arrived after its last refresh is not marked as seen. One limit: times are whole seconds, so an outcome that arrives in the same second as the newest one shown, after the client's last refresh, also counts as acknowledged. An absent or malformed config_approval_outcomes_seen_up_to counts as "nothing acknowledged" (every outcome counts).
  • A row whose status, entity type or operation is not one of the known values, or whose id or decision time is malformed, is left out (never shown as a guessed outcome). If the queue cannot be read the list is [] (logged).
  • The list is [] while an operator views the workspace as the user (impersonation).

POST /admin/v1/me/notifications/config-outcomes-seen

Session cookie; no permission beyond a signed-in account (unlike the /config-approvals endpoints). Records that the caller saw their config-approval outcomes up to a moment. Only the caller's own account is written (the session user; no id is read from the request). The marker only moves forward: a smaller value than the stored one answers 200 and leaves the stored value as it is. The one exception is a stored value later than the server's current time, which is replaced. An account without an organization has no outcomes: the call answers 200 and writes nothing.

Body (exactly this one key):

{ "seen_up_to": 1794320000 }
Answer When
200 { "seen_up_to": <the value sent> } accepted (stored, or the stored marker was already later)
400 { "code": "body_required" } no body
400 { "code": "body_not_object" } the body is JSON but not an object
400 { "code": "malformed_body" } the body is not valid JSON / UTF-8
400 { "code": "duplicate_key" } a key appears twice in the body
413 { "code": "body_too_complex" } the body has too many JSON values
400 { "code": "unknown_field" } any key other than seen_up_to
400 { "code": "seen_up_to_required" } seen_up_to is absent
400 { "code": "invalid_seen_up_to" } seen_up_to is null, not a number, fractional, not finite, <= 0, or later than the server's current time. A future value is refused, never clamped: it would silence outcomes not yet seen
403 { "code": "impersonation_forbidden" } while viewing the workspace as the user (impersonation)
403 { "code": "demo_read_only" } the demo identity
401 { "error": "unauthenticated" } no valid session
503 a transient database fault: nothing was stored, so retry
503 { "code": "service_starting" } schema migration in progress (Retry-After), so retry shortly

Nothing is written on any 4xx. The call is recorded in the generic admin audit trail (method, path, status, actor).

If the gate itself fails (nothing is applied in either case):

  • the organization's approval setting cannot be read, the requester's permissions cannot be read while the change would be gated (the switch is on, or the field is always held — set_trusted; with the switch off the change applies as usual), or capturing the request wrote nothing (no database connection, or a transient conflict rolled it back) → 503 { "error": "approval gate unavailable" }. Nothing was captured — send the change again.
  • any other failure while capturing (the request may already have been captured as a pending approval, or its data could not be stored) → the sanitised 500 { "error": "internal error", "request_id": "…" }. Check the approval queue before re-sending — a second submission would capture a second pending approval of the same change.

A platform admin (a Myra operator, not one of the organization's own Fachadmins) is not subject to the gate. The control governs the customer's own administrators.

GET /config-approvals

List this organization's config approvals, newest first. Tenant-scoped: only the caller's own organization's rows are ever returned.

Optional ?status= filter — one of pending, applying, applied, denied, apply_failed, expired, or all. Omitting it, an empty status=, or all returns every status. Any other value, a repeated status or a valueless ?status is rejected 400 invalid_status — it never falls back to the unfiltered list. expired is a derived display status (a still-pending row past its 7-day window); it is not a stored value, so ?status=expired returns every pending row and the client derives "expired" from expires_at. applying is a short-lived interim state for an agent change that is being applied with re-validation; a row that strands there (e.g. a worker restart mid-apply) is swept to apply_failed (reason claim_timeout) on the next decision — it is never applied twice.

entity_type is tenant_prompt, agent, agent_schedule, chat_project, tenant, mcp_connector, gateway_config, gateway_routing, or gateway_provider_key; operation is create, update, delete, restore, or set_trusted, or private_dest (a gateway_config is patch or import; a gateway_routing is rule_create, rule_update, rule_order, or rule_delete; a gateway_provider_key is key_store or key_delete) (tenant is update or private_dest, mcp_connector is set_trusted or set_source), or — for a chat_project — governance: a change of the project's owning department or gateway lock (see Departments). The list never exposes the held payload — only entity_type, operation, and a short summary. For an entity create the summary is its name (agent, prompt, or project); for a tenant (workspace settings) change it names each changed governance field with its old → new value — e.g. Workspace name: "Acme" -> "Acme GmbH"; Config approval required: off -> on (labels: Assistant name, Workspace name, Default user type, Config approval required, Unverified MCP clients (DCR); an unset name shows as (default); the summary is capped at 255 characters). A private_dest change (the tenant's private-destination allowlist) has the summary Private destinations: <cidr>, <cidr> or Private destinations: (cleared). So the approver sees what they are approving rather than a bare —.

{
  "approvals": [
    {
      "id": "…",
      "tenant_id": "…",
      "entity_type": "tenant_prompt",
      "operation": "create",
      "summary": "Complaint reply",
      "status": "pending",
      "requested_by": "…",
      "own": false,
      "requested_at": 1753000000,
      "expires_at": 1753604800
    }
  ]
}

requested_by, requested_via and decided_by are rendered for display exactly as in the organization export, by the rules in the actor rendering table: which impersonators count as Myra staff, when an id reads erased, the stf_… pseudonym, and what each field shows with and without a pseudonym key. This page describes only what is specific to the inbox.

  • Absent fields and the "" markers. A column that is NULL is absent from the row (in the example above target_id, apply_error, decided_at and applied_at of a pending create). decided_by is absent while a request is pending and where the approver's id was already removed from the record. "" is kept for the applying case: requested_by: "" means the requester was erased while the request was being applied (the record of its outcome is kept, anonymized), requested_via: "" the same for the impersonating account, and decided_by: "" the same for the approver. Neither the requester nor that impersonating administrator may approve the request. The export carries the same values.
  • own. own is the server's answer to "is this the viewer's own request?" under the same rule the approval enforces — it also counts the administrator behind the viewer's own impersonation session — and the inbox hides Approve exactly where it is true. If that session context cannot be read, the list answers 503.
  • Scope and payload. The list never contains another organization's rows, and never exposes the full held payload — only entity_type, operation, and a short summary (e.g. the prompt name). Staff and erased ids inside summary and apply_error are rewritten as described under actor rendering.

POST /config-approvals/<id>/approve

Approve a pending change. The four-eyes rule and the apply are one atomic step: the change is applied only if the approver is a different person from the requester, the request has not expired, and it is still pending. The rule compares people, not sessions: a request filed while impersonating ("View as User") records the administrator behind it, and an approval made while impersonating is judged by the administrator behind it too — so nobody can approve their own request "as" a colleague, nor approve "as themselves" a request they filed as a colleague (403 self_approval).

Outcome Response
Applied 200 { "decision": "approve", "status": "applied", "target_id": "…" }
Approver is the requester 403 { "error": "self_approval" } — a requester can never approve their own change
Already decided (approved/denied) 409 { "error": "already_decided" }
Past the 7-day window 409 { "error": "expired" }
The target no longer exists / the change can't be applied 409 { "error": "apply_failed", "reason": "not_found" }
(Tenant change) an audit entry of the applied change cannot be written The whole apply is rolled back and nothing is applied. A temporary storage fault (deadlock, lock wait, lost connection) answers 503 and the request stays pending so it can be approved again; any other fault answers 409 { "error": "apply_failed" } with a fixed reason, never the driver text
(Tenant private destinations, MCP connector set_trusted) the audit entry of the applied change cannot be written The change is rolled back together with its audit entry, so nothing is applied. A temporary storage fault answers 503 and the request stays pending so it can be approved again; any other fault answers 409 { "error": "apply_failed" } with a fixed reason, never the driver text
(Every kind) the approval's own audit entry (requested / approved / denied / apply failed) cannot be written The step is rolled back together with its audit entry: the request is not captured, or the decision is not recorded and the request stays pending. 503 when nothing was written (send it again); otherwise 500 { "error": "internal error", "request_id": "<id>" }. For an approval being applied, a failed finalize answers 500 and the request is closed claim_timeout by the 5-minute lease sweep
(Connector / gateway change) the held record has no organization, or belongs to another one 409 { "error": "apply_failed", "reason": "not_found" } — refused like a foreign record; nothing is written. A session without an organization is answered 401 { "error": "unauthenticated" } on the inbox and on approve / deny
(Every kind) the organization the request belongs to was deleted while the request was pending, its users kept 409 { "error": "apply_failed", "reason": "tenant_not_found" } — nothing is written (a held prompt-library change is not applied either) and the request is closed. While the organization is only soft-deleted its administrators cannot sign in, so nobody can decide the request; if the organization is restored the request is decidable again. The check is made just before the approval is decided; an organization deleted in the instant between that check and the commit is not caught
(Every kind) the organization was deleted together with its users while the request was pending 409 { "error": "apply_failed", "reason": "requester_unauthorized" } — the requester is gone (see the requester row below); nothing is written and the request is closed
(Every kind) the organization was purged while the request was pending 404 — the organization is gone, so there is nothing left to decide: approve, deny and the apply claim answer 404 tenant_not_found, and the request is no longer listed or exported. The row itself is kept with its proposed payload and summary erased (and a free-text failure reason replaced by erased); its status stays as it was (pending stays pending, applying stays applying). The retention sweep deletes it at 730 days
(Every kind) the organization's record cannot be read, or is unusable, when the approval is applied 503 (transient) — nothing is written; the approval stays pending. Approve again. For a prompt-library request this 503 is answered before the self-approval 403 and the expired / already_decided answers: nothing is decided, and retrying is correct
(Gateway routing rule) the held rule create/update names a target the provider does not serve (for example a myra rule with a non-Myra model id) when approved 409 { "error": "apply_failed", "reason": "model_not_servable" } — the same servability check as the direct rule write is re-run at approval against the current model catalog and the current stored rule; nothing is written. If the model catalog cannot be read at that moment the answer is 503 (transient), nothing is written and the approval stays pending — approve again
(Prompt library) the held request's stored payload is corrupt (does not decode to a JSON object — a scalar, null or an array, also an empty []) 409 { "error": "apply_failed", "reason": "corrupt_payload" } — nothing is written
(Prompt library) the write hit a transient conflict (a deadlock / lock-wait timeout that outlasted the retries) or no database connection could be obtained 503 (transient) — the change is rolled back and the approval stays pending; approve again
(Prompt library) the server was temporarily unable to write (the connection was lost mid-statement, a shutdown or failover in progress, a killed connection or a statement timeout) the sanitised 500 — the change is rolled back and the approval stays pending (never recorded as failed for a condition that clears on its own); approve again
(Prompt library) the database rejected the write deterministically (it would fail the same way on every approve — a missing required value, a value too long, a broken reference) 409 { "error": "apply_failed", "reason": "db" } — nothing is written, and the approval is recorded as failed instead of staying pending behind a 500
(Agent) the model is now residency/allowlist-blocked, or the change no longer validates 409 { "error": "apply_failed", "reason": "<residency/capability code>" } — nothing is written
(Provider key) the organization moved onto a self-serve plan after the key store was held (self-serve plans hold no own provider keys; keyless providers and the Myra pool gateway are exempt) 409 { "error": "apply_failed", "reason": "own_key_not_available_on_plan" } — nothing is written; final, not retried
(Agent) the requester lost the right to make this change 409 { "error": "apply_failed", "reason": "requester_unauthorized" }
(Agent) another approval of the same row is already applying 409 { "error": "in_progress" }
(Agent) re-validating the change hit a database fault (a knowledge-area, MCP-connector, slug or provider lookup failed) 503 (transient) — nothing is written; the approval stays pending. Approve again
The change applied (or was refused) but recording the approval's final status failed the sanitised 500 { "error": "internal error", "request_id": "…" } — never 200 applied / 409 over a row still applying; the stale-claim sweep later fails that row (claim_timeout). For an applied change the mutation is live: check the target before requesting it again.
(Agent) the stored data the change depends on cannot be decoded (a corrupt version snapshot, a corrupt gateway configuration) 409 { "error": "apply_failed", "reason": "internal" } — permanent (approving again would fail the same way); nothing is written
(Agent / agent schedule / project / tenant) the write itself hit a transient database conflict (for a tenant change also a connection lost before the change was committed — the uncommitted transaction is rolled back) — a deadlock or a lock wait the write gave up on — that rolled it back, or found no database connection at all (nothing was sent) 503 (transient) — nothing is written; the approval stays pending. Approve again. (In a longer outage the release back to pending may not be writable either: the answer is then the sanitised 500 { "error": "internal error", "request_id": "…" } and the approval shows applying — a re-approve answers 409 in_progress — until the stale-claim sweep fails it with claim_timeout, after which the change is requested again.)
(Agent / agent schedule / project / tenant) the write itself failed on any other database fault (for a tenant change: a deterministic write error that would repeat on every retry, or a COMMIT whose outcome is unknown; for an agent / agent schedule / project change also a connection lost while it ran) 409 { "error": "apply_failed", "reason": "db" }. The database's own error text is never returned or stored (it goes to the server log). After a connection that was lost while the change was being committed, the outcome is unknown and the change may have been applied — check the agent / schedule / project / organization before re-submitting. An empty update keeps its own fixed reason (no fields to update); <field>: value is not JSON-encodable: … can only appear on an approval captured before non-finite numbers were refused at the request body
(Project update) the project was deleted between the approval re-reading it and writing it 409 { "error": "apply_failed", "reason": "not_found" } — nothing is written
(Project governance) the project's department or gateway lock changed while the request waited, or its gateway changed 409 { "error": "apply_failed", "reason": "project_department_changed" \| "project_lock_changed" \| "project_pin_changed" } — nothing is written
(Project governance) the chosen department was deleted, or no longer allows the project's gateway 409 { "error": "apply_failed", "reason": "department_not_found" \| "project_gateway_outside_department" } — nothing is written
(Project governance) the requester may no longer govern the project, or (as its owner) no longer belongs to the chosen department 409 { "error": "apply_failed", "reason": "requester_unauthorized" \| "department_not_yours" } — nothing is written
(Project governance) re-validating hit a read fault (the gateway list, the tenant or the requester's project role) 503 (transient) — nothing is written; approve again shortly
The approver's session carries an impersonation context without an identifiable administrator 503 — nothing is decided (never read as "not impersonating")
The change was being applied when its requester (or the administrator who filed it while impersonating) was erased, and the apply hit a transient fault 409 { "error": "apply_failed", "reason": "requester_unauthorized" } — the request is closed, never reopened
The approver's own account is disabled or erased by the time the decision is written 409 { "error": "already_decided" } — nothing is decided under that account (reload)
(Every kind) the requester, or the administrator who filed the request while impersonating them, has since been disabled or erased 409 { "error": "apply_failed", "reason": "requester_unauthorized" } — the request is closed and never applied (the check is part of the approval's own database decision, so it cannot be raced); if an account cannot be read, or the close lost to a concurrent change, 503 (retry) and nothing is decided. (When a requester is erased, their requests younger than 730 days are kept as the governance record, not deleted: open ones are closed as apply_failed / requester_unauthorized with the proposed payload and summary erased, so approving one afterwards answers the already_decided conflict — see below.)
(Agent schedule update) another save changed the schedule's enabled, require_approval or output_action between the approval re-reading it and writing it — only for a held change that writes one of those fields and does not by itself rule out an approval hold (disabling, approval off, destination none) 503 (transient) — nothing is written; the approval stays pending. Approve again: the change is then re-checked against the schedule as it is at that moment (a refusal fails the approval)
(Agent update) the held change replaces tool_config, and another change replaced the agent's tool_config after the request was filed (a direct save, or another held change approved first) 409 { "error": "apply_failed", "reason": "tool_config_changed" } — nothing is written; the requester submits the change again on the current state (see Agents)
(Agent update) the held change replaces tool_config, and another save changed the agent between the approval re-reading it and writing it 503 (transient) — nothing is written; the approval stays pending. Approve again: the tool_config is then re-checked as above
(Agent schedule update) the schedule was deleted between the approval re-reading it and writing it — any held update 503 (transient) — nothing is written; approving again fails with 409 { "error": "apply_failed", "reason": "not_found" }
(Tenant) the held request's stored payload is corrupt (does not decode to an object, a tracked field has the wrong type, or config_approval_required is anything other than exactly 0 / 1 / "0" / "1" — e.g. a held 2 is never applied as OFF) 409 { "error": "apply_failed", "reason": "corrupt_payload" } — nothing is written (it used to be reported applied with nothing applied)
(Tenant) the organization itself cannot be read at apply time 503 (transient) — nothing is written; the approval stays pending. Approve again (only an organization that no longer exists fails the approval, 409 apply_failed reason tenant_not_found)
(Tenant, self-serve plan) the plan's configuration cannot be read at apply time 503 (transient) — nothing is written; approve again shortly
(MCP connector set_trusted) the write wrote nothing — a transient conflict, or no database connection 503 (transient) — the approval stays pending; approve again
(MCP connector set_source) the connector's policy or four-eyes flag changed since the request, the held document no longer validates against the connector's current tool classes, an approver it names is no longer an active member, or one of its cells fell below the organisation's minimum raised since the request 409 { "error": "apply_failed" } with reason source_policy_stale, invalid_tool_policy, tool_policy_unknown_approver / tool_policy_no_approver or source_policy_below_floor; nothing is written — submit a new request. A failed approver read is a 503 (approve again)
(Gateway patch carrying source_policy) the gateway's built-in sources changed since the request 409 { "error": "apply_failed" } with reason source_policy_stale; nothing is written — submit a new request
(Tenant update carrying source_policy_floor) the organisation's minimum for every source changed since the request 409 { "error": "apply_failed" } with reason source_policy_stale; nothing is written — submit a new request
(Tenant update carrying delivery_channel_class) the organisation's delivery channel class changed since the request, or the held value no longer validates 409 { "error": "apply_failed" } with reason delivery_channel_class_stale or corrupt_payload; nothing is written — submit a new request
(MCP connector set_trusted) the write failed any other way (for example the connection was lost mid-statement — the outcome is unknown) 409 { "error": "apply_failed", "reason": "db" } — never left pending, so it cannot be denied while the flag may already be live; re-read the connector and submit a new request if needed
(Tenant) committing the change failed on a transient conflict (a deadlock / certification conflict) 503 (transient) — nothing is written; approve again
(Tenant) committing the change failed any other way (for example the connection was lost during the commit) 409 { "error": "apply_failed", "reason": "db" } — the outcome is unknown, so the approval is never left pending for a second apply; reload the tenant and submit a new request if the change is missing
(Tenant) default_user_type was retired from the registry since the request was captured 409 { "error": "apply_failed", "reason": "invalid_default_user_type" }
(Tenant) a held default_role is outside the roles a tenant administrator may assign, or a held member_budget_mode / member_budget_usd is malformed 409 { "error": "apply_failed", "reason": "corrupt_payload" }
(Tenant) a held default_department_id change names a department deleted (or no longer of this organization) since capture 409 { "error": "apply_failed", "reason": "department_not_found" }
(Tenant) a held default_department_id / department_source_precedence payload is malformed (a non-string, non-null department, or an unknown precedence) 409 { "error": "apply_failed", "reason": "corrupt_payload" }
(Tenant private_dest) the held payload is corrupt (carries a ceiling, any key other than cidrs, no cidrs, or a cidrs that no longer parses) 409 { "error": "apply_failed", "reason": "corrupt_payload" } — nothing is written
(Tenant private_dest) the list is now refused (outside the current ceiling, overlapping the operator denylist, the denylist empty, ...) 409 { "error": "apply_failed", "reason": "<code>" } or "<code>: <reason>" — nothing is written
(Tenant private_dest) the stored ceiling is corrupt 409 { "error": "apply_failed", "reason": "private_destinations_corrupt" } — permanent, not retryable
(Tenant private_dest) the list cannot be encoded for storage 409 { "error": "apply_failed", "reason": "private_destinations_not_encodable" } — permanent, not retryable; nothing is written
(Tenant private_dest) the tenant no longer exists 409 { "error": "apply_failed", "reason": "tenant_not_found" }
(Tenant private_dest) the operator denylist cannot be read 503 (transient) — nothing is written; approve again
(Tenant private_dest) the write stored nothing (lock conflict, no connection) 503 (transient) — the approval stays pending; approve again
(Tenant private_dest) the write failed any other way (the outcome may be unknown) 409 { "error": "apply_failed", "reason": "db" }
Malformed approval id (non-string, empty, or over 64 characters) 400 { "error": "bad approval id" }
Not this organization's approval, or an unknown (well-formed) approval id 404 { "error": "not found" } (never leaks another tenant's existence)
(Agent / agent schedule / project / tenant) the row is still applying past its claim lease 409 { "error": "apply_failed", "reason": "claim_timeout" } — the row is swept to apply_failed, never applied twice; if another request settled the row in the same instant, the answer is 503 (retry; the retry sees the settled status)
(Agent / schedule / project / tenant / connector / gateway) the apply failed and the close matched no row (the request was settled meanwhile) 503 — the retry sees the settled status

Every 503 above has the body { "error": "temporarily unavailable; retry later" }: nothing was written and the approval stays pending — approve again — except the two settled-row 503s (the claim-timeout sweep and the failed-apply close above), where the request was settled meanwhile and the retry sees the settled status. The same 503 answers when reading the approval fails, and when a prompt-library decision (applied in one transaction with the status flip) wrote nothing. Any other database fault on that one-transaction decision is 500 { "error": "internal error", "request_id": "<id>" }: the decision may or may not have landed — reload the list before approving again. A fault while taking the four-eyes claim, while closing a request whose requester or impersonating administrator is no longer active, or while releasing an expired claim, is the same 500. See Storage faults.

How the apply runs, by domain. A prompt-library change is applied in one transaction with the status flip — either fully applied or not at all. An agent, project, or tenant change follows the same rule via a short-lived applying claim: the four-eyes claim is taken (still requested_by <> approver, and both the requester and any administrator who filed it while impersonating are active accounts), the change is re-validated against current state and applied (the shared, single code path a direct change uses — no duplicate logic, no stale replay), then the row is finalized to applied or apply_failed. A claim is only ever taken from a pending row, so an approved change is never applied twice; a claim that strands is swept to apply_failed, and the requester re-submits. A write that rolled back on a transient database conflict releases the claim back to pending (answer 503, approve again); if that release itself cannot be written the row stays applying until the sweep (409 in_progress, later apply_failed claim_timeout). Approvals that failed before this release with the database's own error text as their reason show db instead (a one-time cleanup, migration 0392). When a project is deleted, any still-pending approvals that targeted it are discarded (their held copy of the project's configuration does not outlive the workspace). A tenant approve applies only the field(s) the held request actually touched — every OTHER field on the tenant row is re-read fresh at apply time and left untouched (never overwritten from a stale captured snapshot), matching how an immediate PATCH already preserves omitted fields.

POST /config-approvals/<id>/deny

Deny (discard) a pending change — nothing is applied. Unlike approve, the requester may deny their own pending change (withdrawing it is not a four-eyes violation).

Outcome Response
Denied 200 { "decision": "deny", "status": "denied" }
Already decided 409 { "error": "already_decided" }
The denying administrator's own account was disabled or erased by the time the decision is written 409 { "error": "already_decided" } — nothing is recorded under that account
Malformed approval id (non-string, empty, or over 64 characters) 400 { "error": "bad approval id" }
Not this organization's approval, or an unknown (well-formed) approval id 404 { "error": "not found" }
Reading the approval failed, or the deny wrote nothing (a transient conflict) 503 { "error": "temporarily unavailable; retry later" } — the approval stays pending; deny again. The denied audit entry is committed with the decision, so a deny whose audit entry cannot be written is not recorded
Any other database fault 500 { "error": "internal error", "request_id": "<id>" } — the deny may or may not have landed; reload the list before denying again
The session carries an impersonation context without an identifiable administrator 503 — nothing is decided

Data protection

A pending approval stores the proposed change (the prompt text, the proposed agent configuration, a project's configuration and instructions, or — for a tenant approval — the submitted workspace-settings field(s): the assistant/workspace name, the default-role value, the four-eyes toggle or the unverified-MCP-clients switch) until it is decided. These rows are tenant-scoped; on the contract-end purge those requested more than 730 days ago are removed and the younger ones are kept as the governance record with the proposed payload and summary erased (and a free-text failure reason replaced by erased), then deleted at 730 days, and when a requester is erased (Art. 17) their rows younger than 730 days are kept for 730 days with the proposed payload and summary erased (and a free-text failure reason replaced by erased) — an open request is closed as apply_failed / requester_unauthorized — while rows older than 730 days are deleted; the requested_via and decided_by footprint of an erased administrator is anonymized in the same way (a young row the erased user decided keeps decided_by as the four-eyes record, with the payload untouched; rows older than 730 days are unlinked, decided_by becomes null); an approver's identity on other people's rows is anonymized rather than deleted, preserving the governance record. Independent of any purge or erasure, the hourly retention sweep deletes every approval request 730 days after it was requested, for any organization, except one that is still open (pending and not yet expired, or being applied); each committed batch writes a counts-only config_approval.retention_purged audit row (see Data retention). Each such row is written in the same transaction as the deletion it records (one row per committed batch, with a 1-based batch and truncated set only on the last batch; a row that cannot be written rolls the batch back and the next hourly sweep retries). The approval history (who requested, approved, or denied which change, when, plus the proposed payload) is included in the contract-end tenant export, under config_approvals — see the tenant data export. A request that is being applied at the moment its requester, the administrator who filed it while impersonating, or its approver is erased is kept, so its outcome (applied / failed) is still recorded — the erased person is anonymized (for an erased requester the held payload and summary are removed too). An erased person can no longer approve or deny anything, and no decision is recorded under their id; audit entries written on someone else's behalf during an approval (the requester's change, applied by the approver) carry no IP address. When a user is erased, a still-pending request they filed while impersonating someone is closed as apply_failed / requester_unauthorized (it can never be approved again) and, like decided ones younger than 730 days, kept as the governance record with its payload and summary erased; older requests lose their requested_via link.