Reference/Optional policies & approvals

Approval request

Record a request for an operation requiring approval.

op_sys_command_approval_request
Optional local integrationOptional integrationRead as Markdown ↗
On this page

Use this capability

CLI invocation · Shell
op-sys --output json tools call op_sys_command_approval_request \  --arguments '{"action":"<action>","reason":"<reason>","target_id":"<target_id>","target_type":"<target_type>"}'

Request template: replace placeholder identities and supply complete contract-specific objects before use. Required arguments are shown; optional arguments are listed below. MCP requests assume an initialized connection.

Named CLI command: op-sys approval request. Use --help for command-specific flag syntax; the CLI/SDK/MCP examples share arguments; HTTP uses the documented route and body.

Parameters

Arguments are a JSON object. The published schema does not permit unknown top-level fields. Some retained CLI JSON flags are strings containing JSON; follow the declared type.

actionstringRequired
actorstringOptional

Actor recorded on writes and audit entries.

Schema default: "operator"

allow_legacy_insecurebooleanOptional

HIGH: time-bounded untrusted v1/HMAC recovery; discard keystore.json, never import keys.

Schema default: false

allow_unsignedbooleanOptional

HIGH: recover deliberately unsigned v2 data using a distinct reasoned one-shot approval.

Schema default: false

approval_contextstringOptional
artifact_kindstringOptional
artifact_pathstringOptional
bundlestringOptional

Verified state.import bundle used to build its exact operation intent.

comment_kindstringOptional
entity_typestringOptional
event_typestringOptional
max_archive_bytesintegerOptional

Lower the ZIP archive bytes limit (1–17179869184; default 17179869184).

Schema default: 17179869184

max_compression_ratiointegerOptional

Lower the ZIP compression ratio limit (1–200; default 200).

Schema default: 200

max_entriesintegerOptional

Lower the ZIP entries limit (1–8192; default 8192).

Schema default: 8192

max_entry_bytesintegerOptional

Lower the ZIP entry bytes limit (1–34359738368; default 34359738368).

Schema default: 34359738368

max_filename_bytesintegerOptional

Lower the ZIP filename bytes limit (1–1024; default 1024).

Schema default: 1024

max_path_depthintegerOptional

Lower the ZIP path depth limit (1–16; default 16).

Schema default: 16

max_total_bytesintegerOptional

Lower the ZIP total bytes limit (1–68719476736; default 68719476736).

Schema default: 68719476736

operation_jsonstringOptional

Exact operation arguments as JSON; free-form effects are hashed in the review intent.

override_reasonstringOptional

Exact non-secret recovery reason (one line, at most 1024 characters); repeat it unchanged for approval and import.

payloadstringOptional

Consumer-defined JSON value validated against the selected admitted contract.

reasonstringRequired
relation_typestringOptional
session_idstringOptional
target_idstringRequired
target_typestringRequired
ttl_secondsintegerOptional
worker_idstringOptional
workflowstringOptional
workflow_versionstringOptional
Complete input JSON Schema
Complete input schema · JSON
{  "additionalProperties": false,  "properties": {    "action": {      "type": "string"    },    "actor": {      "default": "operator",      "description": "Actor recorded on writes and audit entries.",      "type": "string"    },    "allow_legacy_insecure": {      "default": false,      "description": "HIGH: time-bounded untrusted v1/HMAC recovery; discard keystore.json, never import keys.",      "type": "boolean"    },    "allow_unsigned": {      "default": false,      "description": "HIGH: recover deliberately unsigned v2 data using a distinct reasoned one-shot approval.",      "type": "boolean"    },    "approval_context": {      "type": "string"    },    "artifact_kind": {      "type": "string"    },    "artifact_path": {      "type": "string"    },    "bundle": {      "description": "Verified state.import bundle used to build its exact operation intent.",      "type": "string"    },    "comment_kind": {      "type": "string"    },    "entity_type": {      "type": "string"    },    "event_type": {      "type": "string"    },    "max_archive_bytes": {      "default": 17179869184,      "description": "Lower the ZIP archive bytes limit (1–17179869184; default 17179869184).",      "type": "integer"    },    "max_compression_ratio": {      "default": 200,      "description": "Lower the ZIP compression ratio limit (1–200; default 200).",      "type": "integer"    },    "max_entries": {      "default": 8192,      "description": "Lower the ZIP entries limit (1–8192; default 8192).",      "type": "integer"    },    "max_entry_bytes": {      "default": 34359738368,      "description": "Lower the ZIP entry bytes limit (1–34359738368; default 34359738368).",      "type": "integer"    },    "max_filename_bytes": {      "default": 1024,      "description": "Lower the ZIP filename bytes limit (1–1024; default 1024).",      "type": "integer"    },    "max_path_depth": {      "default": 16,      "description": "Lower the ZIP path depth limit (1–16; default 16).",      "type": "integer"    },    "max_total_bytes": {      "default": 68719476736,      "description": "Lower the ZIP total bytes limit (1–68719476736; default 68719476736).",      "type": "integer"    },    "operation_json": {      "description": "Exact operation arguments as JSON; free-form effects are hashed in the review intent.",      "type": "string"    },    "override_reason": {      "description": "Exact non-secret recovery reason (one line, at most 1024 characters); repeat it unchanged for approval and import.",      "type": "string"    },    "payload": {      "type": "string"    },    "reason": {      "type": "string"    },    "relation_type": {      "type": "string"    },    "session_id": {      "type": "string"    },    "target_id": {      "type": "string"    },    "target_type": {      "type": "string"    },    "ttl_seconds": {      "type": "integer"    },    "worker_id": {      "type": "string"    },    "workflow": {      "type": "string"    },    "workflow_version": {      "type": "string"    }  },  "required": [    "action",    "reason",    "target_id",    "target_type"  ],  "type": "object"}

Behavior & authority

Local policy and approver configuration determine permission. Approval is scoped to its operation; it is not a blanket privilege escalation.

Rules shared by optional policies & approvals operations
  • Inspect the requested action and current approval before deciding or revoking it.
  • An approval record does not automatically execute an action. The consuming operation still performs its checks.
  • Keep the original approval ID and operation binding when retrying. Audit history records decisions.

Response

Returns a payload under approval. See the output manual for field semantics and optional fields.

CLI tools/call result: payload.tool.result. Response envelopes across CLI, SDK and MCP ↗

The runtime does not publish a standalone response JSON Schema for this operation. Use the response description and linked output manual; the downloadable input schema is not a response contract.

Errors & retries

This operation uses the shared runtime error contract; no exhaustive operation-specific reason list is published.

For an uncertain write, preserve the original request and retry identity. On conflict, inspect current state before deciding what to change.