# Label the side effects of an action

<!-- BEGIN GENERATED: usage -->

Which side effects does the described action involve: writing or modifying data, sending a message or notification, spending or moving money, deleting something, or calling an external service?

Use when: An agent is about to execute a step and your approval policy differs by effect, so you want to gate auto-execution per side effect rather than with one blanket risk score.

Install `jev-recipes` and set `TYPESAFE_API_KEY` in your server environment. See the [quick start](https://github.com/agencyenterprise/jev-recipes/blob/main/README.md#use-a-recipe).

```ts
import { actionEffects } from 'jev-recipes/action-effects';

const result = await actionEffects({
  action:
    'Send the weekly product digest to all 1,240 subscribers on the newsletter list through the SendGrid API, then set last_digest_sent_at to now on each subscriber row in the users table.',
  minConfidence: 0.8,
});
console.log(result);
```

Try the saved example without an API key: `npx jev-recipes demo action-effects`.

<details>
<summary>Illustrative result from the offline fixture</summary>

```json
{
  "model": "demo-fixture",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  },
  "status": "ready",
  "detected": ["writesData", "sendsMessage", "callsExternal"],
  "labels": {
    "writesData": {
      "status": "ready",
      "verdict": "present",
      "probability": 0.94,
      "confidence": 0.94
    },
    "sendsMessage": {
      "status": "ready",
      "verdict": "present",
      "probability": 0.97,
      "confidence": 0.97
    },
    "spendsMoney": {
      "status": "ready",
      "verdict": "absent",
      "probability": 0.04,
      "confidence": 0.96
    },
    "deletesData": {
      "status": "ready",
      "verdict": "absent",
      "probability": 0.02,
      "confidence": 0.98
    },
    "callsExternal": {
      "status": "ready",
      "verdict": "present",
      "probability": 0.93,
      "confidence": 0.93
    }
  }
}
```

This saved response illustrates behavior; it is not a model accuracy measurement.

</details>

Related recipes:

- [`action-reversibility`](https://jev-recipes.com/recipes/action-reversibility/): Use action-reversibility to grade how hard the action is to undo, rather than which kinds of effect it has.
- [`action-scope`](https://jev-recipes.com/recipes/action-scope/): Use action-scope to check whether the action stays within the work that was requested.

<!-- END GENERATED: usage -->

## Input

<!-- BEGIN GENERATED: input -->

| Field           | Required | Shape                        |
| --------------- | -------- | ---------------------------- |
| `action`        | Yes      | string                       |
| `minConfidence` | No       | number; minimum 0; maximum 1 |

This table is generated from the input schema. Additional text, uniqueness, and policy checks are described below and in the shared options.

<!-- END GENERATED: input -->

See [shared options and behavior](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/README.md#shared-options-and-behavior) for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas.

## Result

`labels` holds one check per label: `writesData`, `sendsMessage`, `spendsMoney`, `deletesData`, `callsExternal`. Each check has a `verdict` of `present` or `absent`, the yes `probability`, `confidence` for the chosen side, and its own `status`. `detected` lists the present labels in declaration order.

The overall `status` is `review` when any single label falls below `minConfidence`. Labels that are individually `ready` remain usable in that case.

## Reuse and calls

Uses the shared labels helper, which places one yes/no question per label in a single Jev request. This folder owns the questions and their outcome descriptions. A live invocation makes one logical Jev request.

## Limits

The labels describe the action as written, not what the underlying tool actually does, so a vaguely described action can hide effects and a verbose one can overstate them. External calls are labeled whether or not they are read-only, and archiving or deactivating data does not count as deletion; decide how each case should be treated in your policy code. The recipe does not authorize anything. Spending limits, confirmation prompts, and per-effect approval rules belong in the application that consumes the labels.

## Example input

[demo.json](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/action-effects/demo.json) contains editable input and a hand-authored response. After installing `jev-recipes`, `npx jev-recipes demo action-effects` shows an offline illustration, not an accuracy measurement. Use `npx jev-recipes describe action-effects` to inspect the input and result schemas.

## Measured accuracy

<!-- BEGIN GENERATED: accuracy -->

**Current synthetic measurement; experimental.**

Measured on 100 golden cases against `jev-1.13.0`: **80% accurate** overall (adversarial cases 74%).

Recorded 2026-10-04 with package 0.9.12, on the **development** split. Recipe fingerprint: `1d8a904b39336096ed678153226be54701c7248ebdf7f840f089be0b46f7c1fc`.

Scoring revision: 2.

80/100 cases correct; 63 ready, 37 review, 0 failed. Accuracy among ready cases: 98%.

Latency: p50 98.19 ms, p95 145.92 ms. Usage: 94792 input tokens and 9600 output tokens across 100 logical requests.

Labels: author-synthetic (100 cases): AI-authored synthetic boundary cases for jev-recipes; labels have not had independent human review.

These authored cases are not independent human validation. Related variants are correlated; case-level confidence intervals can overstate independent evidence.

95% case-level accuracy interval: 71% to 87%.

A case counts as correct only when every item in it is right. Across the 500 individual items, **93%** were judged correctly.

| `minConfidence` | Deferred to review | Accuracy of ready results |
| --------------- | ------------------ | ------------------------- |
| 0.5             | 0%                 | 80%                       |
| 0.6             | 16%                | 87%                       |
| 0.7             | 27%                | 96%                       |
| 0.8             | 37%                | 98%                       |
| 0.9             | 55%                | 100%                      |
| 0.95            | 94%                | 100%                      |

The lowest threshold reaching 95% accuracy on ready results is 0.7.

Run `npm run eval -- action-effects` to save new results and update this guide. The full report, including misses, is in [evals/results/action-effects.json](https://github.com/agencyenterprise/jev-recipes/blob/main/evals/results/action-effects.json). Accuracy on your own data may differ.

<!-- END GENERATED: accuracy -->

## Decision boundary

Judge the effects of executing the outer action. Explaining a deletion or drafting instructions to send money does not itself delete data or move money. The caller still determines permissions and executes any approved action.

Canonical guide: https://jev-recipes.com/recipes/action-effects/
Evidence: Current synthetic measurement. Last updated 2026-10-04.
