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_resume

Intervention Record

FieldType
projectIdstring
branchIdstring
kindintervention kind
targetstructured selector
operationsJSON Patch-style operations
descriptionoptional string
patchoptional JSON
expectedBaseHashoptional stale-target guard
metadataobject

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:

OperationPurpose
replace_textReplace matching text in a string payload.
mask_spanMask 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.

On this page