apply_control_changeset
Apply a batch of control operations atomically in one transaction to reorganize threat model controls, deduplicate, remap, or delete with built-in orphan guard.
Instructions
Apply a batch of control operations atomically as ONE transaction.
Use this to reorganize a model's controls in a single step — for example to deduplicate controls (remap several onto the right objectives and delete the redundant ones at once), instead of many separate calls. All operations commit together or not at all.
Mapping-only: remap/delete/set_groups change objective mappings and retire controls but never re-author a control's description, so a kept or reused control keeps its status, evidence, and assertions. The orphan guard is evaluated on the FINAL state of the batch, so a delete paired with a covering remap or add in the same changeset is allowed; a changeset that would leave any previously-covered control objective uncovered is rejected as a whole and nothing is written.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ops | Yes | JSON array of operation objects. Each object has an "op" of "remap", "delete", "add", or "set_groups": - remap: {"op": "remap", "control_id": "CTRL-03", "co_ids": ["CO1", "CO2"]} - delete: {"op": "delete", "control_id": "CTRL-09", "reason": "duplicate of CTRL-03"} - add: {"op": "add", "description": "...", "co_ids": ["CO5"], "mitigation_group": 1} - set_groups: {"op": "set_groups", "co_id": "CO1", "groups": {"1": ["CTRL-03"], "2": ["CTRL-04"]}} | |
| model_id | Yes | ID of the threat model. | |
| change_reason | Yes | Why this reorganization is appropriate (min 10 chars). Recorded on every affected control's version history. | |
| server_version | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||