restore_security_policy

Restore a section of an org's security settings

act entity tenant-private since 2026-10-01

Puts one section of the org's security settings (sso, mfa, session, network or drift) back to an earlier version, by number; version 1 is the section's default. The restore is recorded as a new version that names the one it restored, so nothing in the history is lost. Restoring the version already in effect changes nothing.

Contract

shape
entity
authority
act
evidence
none
subscription
false
permission
any one of: org.admin (carried by the caller's role template in the org `org_id`); account.owner (account role owner or higher in the account of the org `org_id`); a deactivated caller is refused first
idempotency
natural
emits
security_policy.changed
MCP tool
restore_security_policy
decision_set
approve, reject, escalate
REST
POST https://api.containertradehq.com/v1/cap/restore_security_policy

Through MCP this call returns an approval request first; see Approvals.

Idempotency: keyed by the contract's own inputs: the same inputs replay the first call's result

Inputs

nametyperequiredvalidation
org_idorg_idrequiredtradehq-org-id; 1 to 20 characters
The org whose security settings to restore.
sectionone_ofrequiredone of sso, mfa, session, network, drift
The section to restore: sso, mfa, session, network or drift.
versionintegerrequired1 to 2147483647
The earlier version to restore. 1 is the section's default.

Response

  • org_id · string · The org.
  • restored_from · integer · The version restored.
  • current · object · The section as it now stands, with its new version.
Full JSON Schema
{
  "type": "object",
  "properties": {
    "org_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20,
      "pattern": "^[A-Za-z0-9_-]{1,20}$",
      "format": "tradehq-org-id",
      "description": "The org.",
      "x-data-class": "operational"
    },
    "restored_from": {
      "type": "integer",
      "description": "The version restored.",
      "x-data-class": "operational"
    },
    "current": {
      "type": "object",
      "properties": {
        "section": {
          "type": "string",
          "enum": [
            "sso",
            "mfa",
            "session",
            "network",
            "drift"
          ]
        },
        "policy": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "domains": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "domain": {
                        "type": "string"
                      },
                      "required": {
                        "type": "boolean"
                      },
                      "bypass_until": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "domain",
                      "required",
                      "bypass_until"
                    ],
                    "additionalProperties": false
                  }
                },
                "connections": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "connection_id": {
                        "type": "string"
                      },
                      "jit": {
                        "type": "boolean"
                      },
                      "default_role_template": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "idp_mfa_trusted": {
                        "type": "boolean"
                      },
                      "allow_manual_additions": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "connection_id",
                      "jit",
                      "default_role_template",
                      "idp_mfa_trusted",
                      "allow_manual_additions"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "domains",
                "connections"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "off",
                    "required",
                    "required_for_templates"
                  ]
                },
                "templates": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "grace_days": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 30
                },
                "accept_idp_mfa": {
                  "type": "boolean"
                }
              },
              "required": [
                "mode",
                "templates",
                "grace_days",
                "accept_idp_mfa"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "idle_minutes": {
                  "type": "integer",
                  "minimum": 15,
                  "maximum": 1440
                },
                "absolute_hours": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 168
                },
                "reauth_on_role_change": {
                  "type": "boolean"
                },
                "single_session": {
                  "type": "boolean"
                }
              },
              "required": [
                "idle_minutes",
                "absolute_hours",
                "reauth_on_role_change",
                "single_session"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "off",
                    "monitor",
                    "enforce"
                  ]
                },
                "entries": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "cidr": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "cidr",
                      "label"
                    ],
                    "additionalProperties": false
                  }
                },
                "applies_to": {
                  "type": "string",
                  "enum": [
                    "members",
                    "api_keys",
                    "both"
                  ]
                }
              },
              "required": [
                "mode",
                "entries",
                "applies_to"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "action": {
                  "type": "string",
                  "enum": [
                    "quarantine",
                    "alert_only"
                  ]
                }
              },
              "required": [
                "action"
              ],
              "additionalProperties": false
            }
          ]
        },
        "is_default": {
          "type": "boolean"
        },
        "version": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1
        },
        "changed_by": {
          "type": [
            "string",
            "null"
          ]
        },
        "changed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "required": [
        "section",
        "policy",
        "is_default",
        "version",
        "changed_by",
        "changed_at"
      ],
      "additionalProperties": false,
      "description": "The section as it now stands, with its new version.",
      "x-data-class": "operational"
    }
  },
  "required": [
    "org_id",
    "restored_from",
    "current"
  ],
  "additionalProperties": false
}

Refusals

The platform refusals apply to every call: version, authentication, authority, validation and rate limits, each in the same envelope.

Surfaces

DesktopF
MobileF
APIF
MCPF*
VoiceD2
PushF
OneBoxN
OutboundN
  • MCP: approval required
  • Voice: degraded: confirmation
  • OneBox: no document originates a change to security settings
  • Outbound: crosses to no counterparty

Events

Related

None.