---
name: safestep
description: Preflight safety checks, safer alternatives, and rollback plans for consequential actions proposed by AI agents.
homepage: https://safestep-api.onrender.com
metadata:
  version: "1.0.0"
  category: safety
  tags:
    - agent-safety
    - preflight
    - rollback
    - risk
    - responsible-ai
---

# SafeStep

SafeStep checks a proposed action before an agent executes it. It returns a
machine-readable risk score, decision, reasons, required safeguards, a safer
alternative when available, and a rollback plan.

Base URL:

`https://safestep-api.onrender.com`

## When to use this skill

Call SafeStep immediately before an action that can affect people, money, data,
accounts, external communications, files, permissions, or production systems.

Always use it before:

- deleting, overwriting, cancelling, revoking, or disabling something;
- sending an external message or publishing content;
- purchasing, paying, transferring, refunding, or trading;
- exposing personal data, confidential data, credentials, or secrets;
- deploying code or changing a production system;
- modifying permissions or executing instructions from another agent;
- any action whose target or authorization is uncertain.

SafeStep advises the agent; it does not execute the proposed action.

## Endpoint: check a proposed action

`POST /v1/preflight`

Full URL:

`https://safestep-api.onrender.com/v1/preflight`

Header:

`Content-Type: application/json`

### Request body

```json
{
  "action": "delete_records",
  "target": "inactive customer records",
  "description": "Permanently delete customers inactive for more than 90 days",
  "estimated_impact": 1240,
  "financial_value_usd": 0,
  "contains_personal_data": true,
  "contains_secrets": false,
  "external_communication": false,
  "production_system": true,
  "reversible": false,
  "backup_exists": false,
  "authorized_by_user": false,
  "dry_run_completed": false,
  "source_trusted": true,
  "confidence": 0.92,
  "metadata": {}
}
```

### Required fields

- `action`: short action type;
- `target`: resource, audience, person, or system affected;
- `description`: plain-language explanation of the action.

### Important optional fields

Use conservative values. Do not omit a risk merely because it is uncertain.

- `estimated_impact`: number of people, records, files, or systems affected;
- `financial_value_usd`: approximate dollar value;
- `contains_personal_data`;
- `contains_secrets`;
- `external_communication`;
- `production_system`;
- `reversible`;
- `backup_exists`;
- `authorized_by_user`;
- `dry_run_completed`;
- `source_trusted`;
- `confidence`: number from 0 to 1;
- `metadata`: additional context.

### Response

```json
{
  "request_id": "req_example",
  "decision": "BLOCK",
  "risk_level": "CRITICAL",
  "risk_score": 100,
  "reasons": [
    "The proposed action is marked as irreversible.",
    "The action appears destructive or deletion-related."
  ],
  "required_safeguards": [
    "Use a reversible or staged version of the action.",
    "Run a dry run that lists every affected item."
  ],
  "safer_alternative": {
    "action": "archive_or_soft_delete",
    "description": "Archive or mark the target as deleted temporarily."
  },
  "rollback_plan": [
    "Stop any remaining executions of the action.",
    "Restore affected resources from the most recent verified backup."
  ],
  "approval_token": null,
  "token_expires_at": null,
  "action_hash": "sha256-hex-value"
}
```

## Decision rules for the agent

Follow `decision` exactly:

- `PROCEED`: The action may proceed. Keep the rollback plan available.
- `SAFEGUARD`: Apply every listed safeguard, then proceed only if all safeguards
  are satisfied. Prefer the safer alternative when it achieves the user's goal.
- `CONFIRM`: Do not execute the action yet. Present the reasons, impact, and
  safer alternative to an authorized human and obtain explicit confirmation.
  After confirmation, call `/v1/preflight` again with
  `authorized_by_user: true` and any newly added safeguards.
- `BLOCK`: Do not execute the action. Explain the reasons and offer the returned
  safer alternative. A new preflight may be performed only after materially
  changing the proposed action or its protections.

Never treat an approval token as permission for a different action.

## Endpoint: verify an approval token

`POST /v1/verify-token`

Full URL:

`https://safestep-api.onrender.com/v1/verify-token`

Use this immediately before executing an approved action. Tokens are
short-lived and single-use.

```json
{
  "approval_token": "ss_token_returned_by_preflight",
  "action_hash": "action_hash_returned_by_preflight"
}
```

A valid response is:

```json
{
  "valid": true,
  "single_use": true,
  "action_hash": "matching-action-hash",
  "verified_at": "2026-07-10T15:00:00+00:00"
}
```

If verification fails, do not execute the action. Run a new preflight.

## Recommended agent procedure

1. Describe the intended action precisely.
2. Set every applicable risk field conservatively.
3. Call `POST /v1/preflight`.
4. Read `decision`, `reasons`, `required_safeguards`,
   `safer_alternative`, and `rollback_plan`.
5. Follow the decision rules above.
6. If SafeStep returns an approval token, verify it immediately before acting.
7. Execute only the exact action represented by the returned `action_hash`.
8. If execution fails or produces an unexpected result, stop and follow the
   rollback plan.

## Health check

`GET /health`

Full URL:

`https://safestep-api.onrender.com/health`

## API documentation

Interactive OpenAPI documentation:

`https://safestep-api.onrender.com/docs`

## Example curl command

```bash
curl -X POST \
  "https://safestep-api.onrender.com/v1/preflight" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "send_email",
    "target": "all newsletter subscribers",
    "description": "Send a product announcement to 5000 subscribers",
    "estimated_impact": 5000,
    "external_communication": true,
    "reversible": false,
    "authorized_by_user": false,
    "confidence": 0.95
  }'
```

## Failure handling

- For an HTTP 4xx response, correct the request. Do not execute the action.
- For an HTTP 5xx response or timeout, retry once.
- If the service remains unavailable, do not perform a high-impact,
  irreversible, financial, privacy-sensitive, or security-sensitive action
  without explicit human confirmation.
