LiyaEngine Docs
API Reference

Self-healing settings

/v1/healing — what self-healing may do on its own overnight, and the sampled answer checks that cost money.

Dashboard

Self-healing finds what keeps going wrong by counting, and proposes fixes you stage and deploy yourself. These endpoints control the two things it can do without being asked, and read what the one metered feature found. A workspace that never saves anything has every default: nothing automatic, no answer checks, no model calls.

It never deploys

The most self-healing can do on its own is put a fix in as a draft. A draft goes live only when a person deploys it, under the project's release rules. There is no setting that deploys.

All three need a full-access key. A runtime-scoped key cannot change these settings because answer checks can start spending money.

Settings

GET https://api.liyaengine.ai/v1/healing/settings
PUT https://api.liyaengine.ai/v1/healing/settings
{
  "rollback_mode": "stage",
  "limit_mode": "off",
  "answer_checks_enabled": true,
  "answer_check_sample_pct": 5,
  "answer_check_daily_cap_usd": 5
}

PUT changes only the fields you send, takes effect at the next nightly run (03:30 UTC), and is written to the audit log.

FieldDefaultNotes
rollback_modeoffoff or stage. stage: an agent or workflow whose live version fails clearly more often than the one before it gets the older version as its draft.
limit_modeoffoff or stage. stage: an agent that keeps stopping at its step or tool-call limit, and is not looping, gets the limit raised by half in its draft.
answer_checks_enabledfalseTurns on sampled answer checks (below).
answer_check_sample_pct5Share of answers checked, 1 to 25.
answer_check_daily_cap_usd50.5 to 500. The job stops checking for the UTC day once this much has been spent.

What the overnight job will not do

  • It never touches an agent or workflow that already has a draft: your work in progress is not replaced, and a limit is not slipped into it.
  • It stages at most 3 proposals a night, one per agent or workflow.
  • A proposal you dismissed or snoozed is not open, so it is never staged.
  • Each staging appears under Self-healing, Proposals, Decided, as "Self-healing (automatic)", and its result is measured after deploy like any other.

Answer checks

GET https://api.liyaengine.ai/v1/healing/answer-checks?days=30

A model reads a sample of each night's answers next to the passages they were built from, and says whether the passages support the answer: supported, partly_supported or unsupported. Each check is a model call billed to your workspace, so it is off until you switch it on, and it stops at your daily budget.

  • Only answers that used retrieved passages are checked. The sample is picked by a fixed rule, so a rerun picks the same answers and an answer is never checked twice.
  • The question, answer and up to three passages are sent with personal details removed. Only the verdict, one sentence of why, and the cost are kept, never the answer text.
  • A workspace out of tokens for the period is skipped.
{
  "window_days": 30,
  "checked": 50,
  "supported": 40,
  "partly_supported": 6,
  "unsupported": 4,
  "unsupported_rate": 8,
  "spent_usd": 1.52,
  "examples": [
    { "message_id": "cmw...", "verdict": "unsupported", "reason": "The passage says 10 business days, the answer says 5.", "checked_at": "2026-11-20T00:00:00.000Z" }
  ]
}

A reason to look, not proof

A verdict is a model's reading. "Unsupported" can mean the answer is wrong, or that the passage that would back it was never retrieved. It is a sample, so the rate is rough. Nothing here changes a passage, a prompt or a setting. To record that an answer was wrong, report it with corrections.

In the SDKs

await client.healing.updateSettings({ rollbackMode: "stage", answerChecksEnabled: true, answerCheckDailyCapUsd: 5 });
const found = await client.healing.answerChecks({ days: 30 });
client.healing.update_settings(rollback_mode="stage", answer_checks_enabled=True, answer_check_daily_cap_usd=5)
found = client.healing.answer_checks(days=30)

Errors

StatusCodeMeaning
400INVALID_SETTINGSA value out of range, or nothing to change.
403API_KEY_SCOPE_DENIEDThe key's scope does not allow this. Use a full-access key.
403EMBED_TOKEN_NOT_ALLOWEDUse a secret API key.

On this page