---
title: "Improve scenario instructions with AI"
method: POST
path: "/test_framework/v3/scenarios/improve_instructions/"
tags: ["test_framework"]
---

# Improve scenario instructions with AI

`POST /test_framework/v3/scenarios/improve_instructions/`

## Request

- Base URL: `https://api.cekura.ai`
- URL: `https://api.cekura.ai/test_framework/v3/scenarios/improve_instructions/`
- Auth: one of:
  - API key in header `X-CEKURA-API-KEY`
  - HTTP bearer
  - HTTP bearer

Rewrite `current_instructions`, or write new ones, following `extra_instructions`, and return the result. Nothing is saved; apply it with the evaluator update endpoint. Usually takes under a minute.

## Request body

- ScenarioInstructionsRequest
  - `agent` integer, required
  - `extra_instructions` string, required
  - `current_instructions` string

## Response `200`

- object
  - `status` 'completed' | 'failed': `failed` when the job could not produce its result; see `error` / `errors`.
  - `agent_id` integer
  - `instructions` string, nullable
  - `expected_outcome_prompt` string, nullable
  - `error` string, nullable: Why the job failed, when it did.

## Other responses

- `400`
- `403`: No access to the agent, project, metric or result the job runs on.
- `504`: The job did not finish within 15 minutes. It may still complete in the background.

## Changes

- **2026-11-03** `a6fb6a739212`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cekura/apis/cekura-api/changes/test_framework/v3/scenarios/improve_instructions/post.md)

---

[API](https://skmtc.dev/cekura/apis/cekura-api.md) - [All operations](https://skmtc.dev/cekura/apis/cekura-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cekura/apis/cekura-api/revisions/a6fb6a739212?raw)
