Reference
Interventions Reference
Intervention kinds, target selectors, patch shapes, and stale-target guards.
Kinds
context_mask
message_patch
prompt_patch
prompt_clause_mask
memory_mask
state_mask
state_patch
tool_args_patch
tool_mask
tool_schema_edit
tool_schema_patch
tool_result_substitution
retrieval_substitution
model_config_patch
model_config_change
policy_override
input_patch
human_decision_substitution
latency_or_error_injection
checkpoint_resumeIntervention Record
| Field | Type |
|---|---|
projectId | string |
branchId | string |
kind | intervention kind |
target | structured selector |
operations | JSON Patch-style operations |
description | optional string |
patch | optional JSON |
expectedBaseHash | optional stale-target guard |
metadata | object |
Target Selectors
Interventions use the same structured target shape in branch records and experiment specs.
{
"target": {
"refId": "tool_abc",
"eventId": "event_abc",
"eventType": "tool.started",
"toolName": "policy_search",
"modelCallId": "model_abc",
"artifactId": "artifact_abc",
"contextItemId": "context_abc",
"contextPath": "prompt.system",
"jsonPointer": "/args/query"
}
}All supplied selector fields must match. jsonPointer scopes patch operations to a subdocument.
Branch replay is checkpoint-bounded. A target at or before the branch checkpoint is reported and not patched.
Patch Operations
Patch operations support JSON Patch-style operations plus:
| Operation | Purpose |
|---|---|
replace_text | Replace matching text in a string payload. |
mask_span | Mask a span in text-like content. |
Use expectedBaseHash to prevent stale-target patches when a context item or artifact changed after the spec was written.