writ_lease
Convert an ALLOW token from writ_check into a single-use execution lease bound to the exact method, path, and body you will pass to writ_execute, ensuring the approved upstream write is gated.
Instructions
Convert an ALLOW token into a single-use gated-execution lease.
Call this AFTER writ_check returns ALLOW, passing that ALLOW's authToken. The lease is bound to the exact upstream request you intend to run: the same method, path, and body bytes you will later pass to writ_execute. A lease is single-use; once executed (or expired) it is spent.
Args: auth_token: The authToken from a writ_check ALLOW decision. system_id: The registered upstream system: "stripe", "github", or "salesforce". A vaulted credential must be active for this system or the gate answers ok:false. method: HTTP method of the upstream request (e.g. "POST"). path: Upstream path (e.g. "/v1/refunds"). Must match the system's allowed path patterns. body: Optional JSON object (at most 1 MB). Sent only when provided; if you lease a body you must execute the identical body. ttl_seconds: Optional lease TTL in seconds. The gate caps it at 90 and at the token's remaining life.
On success the gate answers 201 with leaseId, expiresAt, ttlSeconds, verb, target, purpose, and systemId. On failure it answers {"ok": false, "reason": ...} (token invalid or expired, or no active vaulted credential for the system). On ok:false do NOT execute.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"auth_token": "<auth_token>",
"system_id": "<system_id>",
"method": "<method>",
"path": "<path>"
},
"name": "writ_lease"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | ||
| path | Yes | ||
| method | Yes | ||
| system_id | Yes | ||
| auth_token | Yes | ||
| ttl_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |