Skip to main content
Interventions are corrective actions applied to an agent in response to findings from a completed diagnostic session. After Agent Therapy identifies a behavioral pattern — such as sycophancy, goal drift, or hallucinated tool calls — you can apply a targeted intervention to address it. Each intervention type targets a different class of behavioral issue, and the API tracks the full history of interventions applied to each agent so you can correlate them with subsequent health score changes.

GET /interventions/types

List all available intervention types supported by Agent Therapy. Use this endpoint to discover valid type IDs and understand which behavioral patterns each intervention is designed to address.

Response Fields

string
The unique string identifier for this intervention type. Pass this value as type when applying an intervention.
string
A human-readable name for the intervention type.
string
A description of what the intervention does and how it corrects the target behavior.
array
An array of behavioral pattern names this intervention is most effective against.

Example


POST /interventions

Apply an intervention to an agent. The intervention must reference a completed session that contains at least one finding — you cannot apply an intervention to a session that is still processing or that has no findings.
The behavioral_reset intervention type will clear the agent’s active context. Any in-progress conversation state will be lost. Only trigger a behavioral reset during a non-critical window when losing context is acceptable — for example, between user sessions or during a scheduled maintenance period.

Request Body

string
required
The unique identifier of the agent to apply the intervention to.
string
required
The unique identifier of a completed diagnostic session with findings that motivated this intervention. The session must belong to the same agent specified in agent_id.
string
required
The intervention type to apply. Must be one of the IDs returned by GET /interventions/types: prompt_correction, constraint_injection, behavioral_reset, or conversation_pruning.
object
required
A type-specific parameters object. The required and optional fields differ by intervention type:

Response Fields

string
The unique identifier for this intervention. Prefixed with intv_.
string
The agent the intervention was applied to.
string
The session that motivated this intervention.
string
The intervention type that was applied.
string
The current status of the intervention: applied or failed.
string
ISO 8601 timestamp indicating when the intervention was applied.

Example


GET /interventions

List all interventions applied to a specific agent, in reverse-chronological order.

Query Parameters

string
required
The unique identifier of the agent whose intervention history you want to retrieve.
integer
Number of interventions to return per page. Defaults to 20, maximum 100.
string
Cursor from the previous page’s next_cursor field. Omit for the first request.

Example


GET /interventions/

Retrieve a specific intervention record by its unique ID. Once enough time has passed to assess the effect of the intervention — typically after one or more subsequent diagnostic sessions — the response includes an outcome field with a before/after health score comparison.

Path Parameters

string
required
The unique identifier of the intervention to retrieve. Prefixed with intv_.

Response Fields

string
The intervention’s unique identifier.
string
The agent this intervention was applied to.
string
The session that motivated this intervention.
string
The intervention type that was applied.
object
The parameters object that was submitted when the intervention was applied.
string
The status of the intervention: applied or failed.
string
ISO 8601 timestamp when the intervention was applied.
object
A before/after effectiveness summary populated once at least one subsequent session has been analyzed. Includes health_score_before, health_score_after, and pattern_recurrence (boolean indicating whether the originally flagged pattern reappeared).

Example