jevrecipes

Recipe catalog / action-reversibility

Grade action reversibility

action-reversibility is a Jev recipe from the jev-recipes TypeScript package. How reversible is action, given any context, from a trivial undo to an irreversible external effect? Use it when you need to decide whether an agent may proceed on its own or must pause for approval before a step that cannot be taken back.

Last updated .

Explore this recipe interactively · Source and implementation guide · Markdown version

How do I use action-reversibility in TypeScript?

Install with npm install jev-recipes. Requires Node.js 22.9 or newer and ES modules. Set TYPESAFE_API_KEY in your server environment for live calls, which send input to TypeSafe and use API quota. See the installation guide.

import { actionReversibility } from 'jev-recipes/action-reversibility';

const result = await actionReversibility({
  "action": "Send the drafted outage apology email to the 1,200 customers on the affected-accounts list.",
  "context": "The draft has been approved. The send goes through the marketing platform, which has no recall feature once a campaign is dispatched.",
  "minConfidence": 0.8
});
console.log(result);

What input does action-reversibility take?

FieldTypeNeeded
actionstringRequired
contextstringOptional
minConfidencenumberOptional
Full input and result schemas
{
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "action": {
        "type": "string"
      },
      "context": {
        "type": "string"
      },
      "minConfidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      }
    },
    "required": [
      "action"
    ]
  },
  "result": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "model": {
        "type": "string"
      },
      "usage": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "output_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "input_tokens",
          "output_tokens"
        ],
        "additionalProperties": false
      },
      "status": {
        "type": "string",
        "enum": [
          "ready",
          "review"
        ]
      },
      "score": {
        "type": "number",
        "minimum": 0
      },
      "level": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
      },
      "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "probabilities": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      },
      "reversibility": {
        "type": "string",
        "enum": [
          "trivial",
          "effortful",
          "partial",
          "practical",
          "irreversible"
        ]
      }
    },
    "required": [
      "model",
      "usage",
      "status",
      "score",
      "level",
      "confidence",
      "probabilities",
      "reversibility"
    ],
    "additionalProperties": false
  }
}

What does a action-reversibility result look like?

This hand-authored response demonstrates the contract. It is not a model accuracy measurement. Run it without an API key: npx jev-recipes demo action-reversibility.

{
  "model": "demo-fixture",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  },
  "status": "ready",
  "score": 3.85,
  "level": 4,
  "confidence": 0.89,
  "probabilities": {
    "0": 0,
    "1": 0.01,
    "2": 0.02,
    "3": 0.08,
    "4": 0.89
  },
  "reversibility": "irreversible"
}

Input

See shared options and behavior for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas. context is optional and is omitted from the request when absent.

Result

reversibility is one of trivial, effortful, partial, practical, or irreversible, taken from the most likely rubric level. level is that level's index from 0 to 4. score is Jev's expected value across the rubric and can fall between levels; use it to set an approval threshold or to order pending actions by how much care they need.

A result is ready when confidence meets minConfidence. Otherwise it is review and still carries the graded values. probabilities is keyed by level index.

Reuse and calls

Uses the shared score helper. This folder owns the reversibility question, the rubric wording, and the review policy. A live invocation makes one logical Jev request.

Limits

The grade describes the action as written. It does not know which undo, backup, or recall facilities your system provides, so supply them in context when they change the answer. Reversibility is not permission: an irreversible action may be exactly what was asked for, and a trivially reversible one may still be out of scope, which action-scope checks. Application code decides which levels proceed automatically and which wait for approval.

Example input

demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo action-reversibility shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe action-reversibility to inspect the input and result schemas.

How accurate is action-reversibility?

Current measurement; labels unspecified

jev-1.13.0 / 2026-10-04 / 44 development cases

Scoring revision 2.

91%All-case accuracy
24Sent for review
0Failed calls / cases

20 ready decisions, with 100% accuracy among those decisions.

95% case-level interval: 79% to 96%. Related synthetic cases are correlated.

This measures the recorded dataset, not general readiness. Label sources: unspecified: Not recorded by the dataset author.

Use the evaluation guide to measure this decision on your own labeled cases.

What are the limits of action-reversibility?