Reference/Optional policies & approvals

Request approval

Request approval through the retained LedgerService adapter.

op_sys_legacy_request_approval
Optional local integrationOptional integrationRead as Markdown ↗
On this page

Use this capability

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

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.

SDK convenience: client.ledger().request_approval(…). The capability adapter wraps the method value in result. Nested fields arguments are expanded into keyword arguments by the adapter.

Parameters

Arguments are a JSON object. The published schema does not permit unknown top-level fields. Native record payloads and structured arguments are JSON values, not JSON-encoded strings.

actionstringRequired
actorstringRequired

Cooperative local actor. This does not change the authenticated hosted principal.

artifact_kindnull | stringOptional

Schema default: null. Omit the field; send null only if its schema permits null.

artifact_pathnull | stringOptional

Schema default: null. Omit the field; send null only if its schema permits null.

comment_kindnull | stringOptional

Schema default: null. Omit the field; send null only if its schema permits null.

contextnull | objectOptional

Schema default: null. Omit the field; send null only if its schema permits null.

entity_typenull | stringOptional

Schema default: null. Omit the field; send null only if its schema permits null.

event_typenull | stringOptional

Schema default: null. Omit the field; send null only if its schema permits null.

operation_jsonnull | objectOptional

Schema default: null. Omit the field; send null only if its schema permits null.

payloadnull | objectOptional

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

Schema default: null. Omit the field; send null only if its schema permits null.

reasonstringRequired
relation_typenull | stringOptional

Schema default: null. Omit the field; send null only if its schema permits null.

session_idnull | stringOptional

Schema default: null. Omit the field; send null only if its schema permits null.

target_idstringRequired
target_typestringRequired
ttl_secondsinteger | nullOptional

Schema default: null. Omit the field; send null only if its schema permits null.

worker_idnull | stringOptional

Schema default: null. Omit the field; send null only if its schema permits null.

workflow_namespacenull | stringOptional

Schema default: null. Omit the field; send null only if its schema permits null.

workflow_versionnull | stringOptional

Schema default: null. Omit the field; send null only if its schema permits null.

Complete input JSON Schema
Complete input schema · JSON
{  "additionalProperties": false,  "properties": {    "action": {      "type": "string"    },    "actor": {      "type": "string"    },    "artifact_kind": {      "default": null,      "type": [        "null",        "string"      ]    },    "artifact_path": {      "default": null,      "type": [        "null",        "string"      ]    },    "comment_kind": {      "default": null,      "type": [        "null",        "string"      ]    },    "context": {      "additionalProperties": {},      "default": null,      "type": [        "null",        "object"      ]    },    "entity_type": {      "default": null,      "type": [        "null",        "string"      ]    },    "event_type": {      "default": null,      "type": [        "null",        "string"      ]    },    "operation_json": {      "additionalProperties": {},      "default": null,      "type": [        "null",        "object"      ]    },    "payload": {      "additionalProperties": {},      "default": null,      "type": [        "null",        "object"      ]    },    "reason": {      "type": "string"    },    "relation_type": {      "default": null,      "type": [        "null",        "string"      ]    },    "session_id": {      "default": null,      "type": [        "null",        "string"      ]    },    "target_id": {      "type": "string"    },    "target_type": {      "type": "string"    },    "ttl_seconds": {      "default": null,      "type": [        "integer",        "null"      ]    },    "worker_id": {      "default": null,      "type": [        "null",        "string"      ]    },    "workflow_namespace": {      "default": null,      "type": [        "null",        "string"      ]    },    "workflow_version": {      "default": null,      "type": [        "null",        "string"      ]    }  },  "required": [    "actor",    "action",    "target_type",    "target_id",    "reason"  ],  "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 {result: value}. The result retains the SDK method’s value, including null where allowed. It is not the resource-keyed CLI command envelope.

SDK return annotation: dict[str, typing.Any].

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.