Optimise agent prompt
Start the Optimise-Prompt loop for this agent: diagnose the runs the agent is FAILING on the selected evaluators, make scoped edits to the system prompt, apply each edit, and re-validate over the SAME scenarios, looping until the agent passes or a stop condition fires. An overfitting gate scrubs every edit BEFORE it's applied (it rejects edits that embed scenario IDs, transcript-cloned phrasing, hardcoded test data, or hyper-narrow single-case clauses) so the loop can't game its own validation set. On a 100% pass it sweeps the full eval set before declaring success. The loop runs in the background and writes an improvement session you poll; it returns the sessionId. It NEVER auto-applies an edit without a re-run proving the pass rate went up, and it NEVER publishes: a winning edit is left as a proposed session for an operator to accept. Set selectedEvalIds to the failing evaluators; maxIterations (default 10) caps the attempts; mode/autoMode controls whether the run is attended.
Authorization
bearerAuth A personal access token from Settings > API tokens.
In: header
Header Parameters
A key you choose, such as a UUID, that makes this POST safe to retry. Within 24 hours the same key and request answers with the first successful answer and runs nothing, the same key with a different request answers 422 idempotency_key_reused, and a key whose request is still running answers 409 idempotency_key_in_use. A failed request keeps nothing, so the same key runs it again.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://example.com/operations/optimise_agent_prompt" \ -H "Content-Type: application/json" \ -d '{ "selectedEvalIds": [ "string" ], "agent": "string" }'{}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}List custom integrations POST
List the workspace's custom HTTP integrations (operator-defined API connections, distinct from connected apps). Each: { id, name, slug, authType, baseUrl, isActive }. Stored secrets are never returned.
Override run verdict POST
Set a manual verdict on an eval run (success / failure / review_required) without overwriting the engine's computed result, it writes a separate override row, one per run. Use this when the automated pass/fail is wrong or a run needs a human to look. The run must belong to the current agent.