# WCGW Safety Engineer (`vwnb/wcgw-safety-engineer`) Actor

AI-assisted safety-engineering agent that turns system descriptions into structured hazard analyses. Investigates losses, unsafe conditions, safety constraints, and missing evidence using systems safety methods. Produces traceable findings, assumptions, and recommendations for human review.

- **URL**: https://apify.com/vwnb/wcgw-safety-engineer.md
- **Developed by:** [Ville Kemppainen](https://apify.com/vwnb) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $9.00 / completed report

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## WCGW Safety Engineer

Describe a system — a robot cell, a machine, a vehicle function, a medical device — and get a bounded, traceable safety-engineering analysis built on [WCGW](https://wcgw-safety-suite.vercel.app)'s safety-graph methods.

> **Everything this Actor returns is an AI-generated proposal for a qualified engineer to review.** It is not an approved safety requirement, a safety case, a certification or a statement of compliance with any standard, and it does not establish that a system is or is not safe. Only the description you submit is analysed; no documents, code, tests or other evidence are examined.

### What you get

- **System boundary**: what is in scope, out of scope, and the interfaces between them
- **Assumptions** and **open questions** (information you need to supply before the analysis can be relied on)
- **Losses and hazards**, each linked to what it leads to and what mitigates it
- **STPA control structure and unsafe control actions** (controllers, control actions, feedback, UCA type and context)
- **Proposed constraints**, each linked to the hazards or UCAs it addresses
- **Findings** with severity, the concepts they concern, the evidence they cite, and whether they are *observed* (shown by a deterministic check or your own text) or *inferred* (the agent's reasoning)
- **Deterministic checks**: completeness of the model and, if you select standards, WCGW's traceability checks associated with ISO 26262, IEC 61508, ISO 13849, ISO 14971 and IEC 61800-5-2
- **A final review** in a fresh model context, reported but not applied
- **Recommended next steps**, **limitations**, and **execution metadata** (steps, operations, token use, completion status)

Every item records where it came from: your input, the initial WCGW draft, or a specific review suggestion the agent applied.

### How it works

1. **Draft** — WCGW applies its STPA and Walk the Chain methods to your description to propose the boundary, assumptions, losses, hazards, control structure, UCAs and constraints.
2. **Check** — WCGW runs its deterministic completeness, standard and graph checks (orphans, missing verification, compliance-traceability gaps).
3. **Refine** — an agent works through a bounded number of steps. Each step is one operation: graph queries for shared dependencies, single points of failure and cycles; an independent review focused on STPA coverage or unsupported claims; applying well-founded review suggestions; recording findings and open questions.
4. **Review** — a final deterministic check and an independent assessor-style review of the result.
5. **Report** — a structured dataset item, `ANALYSIS.json` and a readable `REPORT.md`, built from the recorded state without further model calls.

The agent has explicit limits on steps, runtime and model tokens. A failed operation is reported back to the agent, not retried blindly. Partial results are saved after every step.

### Input

| Field | Required | Notes |
|---|---|---|
| System name, system description | yes | The description should say what moves, what controls it, who is nearby and what protects them (40–8,000 characters). |
| Operating environment, intended use, analysis boundary | no | Free text. |
| Components, known hazards | no | Lists. Known hazards are kept and marked as stated by you. |
| Standards to trace against | no | Enables WCGW's traceability checks for those standards. |
| Stated ASIL / SIL / PL | no | Only if you have determined them. The agent never assigns integrity levels. |
| Your Anthropic API key | no | If set, all model calls of the run use your Anthropic account. Stored encrypted by Apify; never written to outputs or logs. |
| Maximum agent steps, runtime, planner tokens | no | Defaults: 10 steps, 25 minutes, 800,000 tokens. |

### Output

- **Dataset**: one item per run (views: Overview, Findings, Hazards).
- **Key-value store**: `REPORT.md` (Markdown report) and `ANALYSIS.json` (structured analysis).

Each output carries a `status`:

| Status | Meaning | Charged |
|---|---|---|
| `completed` | Draft, checks, refinement and final review all finished | yes, once |
| `incomplete` | A required stage failed or the agent stopped abnormally; partial results are included | no |
| `failed` | No usable analysis could be produced | no |
| `aborted` | The run was stopped; partial results are included | no |

Runs that are not completed end with a failed run status, so they are never mistaken for a completed analysis.

### Pricing

Pay per event: one `analysis-completed` event, charged only after a completed analysis has saved its report. Failed, incomplete and aborted runs are not charged by this Actor. The run checks before starting that your maximum cost per run covers one analysis, and stops without doing any work if it does not.

### Privacy and isolation

Your description is sent to WCGW's analysis service and to Anthropic, which runs every model call (draft, reviews and the agent). WCGW's agent operations are stateless: they do not create projects, store your description or touch any other customer's data. Do not include personal data or credentials in the description.

### Limitations

- The analysis is only as good as the description; anything not described is either an assumption or an open question.
- Checks measure links in the proposed model, not the real system.
- WCGW's shared-substrate (common-cause physics) method is not run, because it needs OPB term lookups this service does not perform.

# Actor input Schema

## `systemName` (type: `string`):

Short name of the system, product or machine being analysed.

## `systemDescription` (type: `string`):

What the system is and does: main components, energy sources and motion, controllers and software, sensors and feedback, operators and other people nearby, existing protective measures. 40 to 8,000 characters. Do not include credentials or personal data.

## `operatingEnvironment` (type: `string`):

Where and when the system operates: site, shifts, climate, nearby traffic, people present, maintenance situations.

## `intendedUse` (type: `string`):

What the system is meant to be used for, by whom, and foreseeable misuse you already know about.

## `boundaries` (type: `string`):

What is inside the analysis and what is not, including interfaces to other systems.

## `components` (type: `array`):

Optional list of the main components (up to 30).

## `knownHazards` (type: `array`):

Optional hazards you already know about (up to 20). Each becomes a hazard marked as stated by you.

## `targetStandards` (type: `array`):

Optional. Enables WCGW's traceability checks associated with these standards. The checks count links in the proposed model; they are not a compliance assessment.

## `targetAsil` (type: `string`):

Optional. Only if you have already determined it; the agent never assigns integrity levels.

## `targetSil` (type: `string`):

Optional. Only if you have already determined it; the agent never assigns integrity levels.

## `targetPl` (type: `string`):

Optional. Only if you have already determined it; the agent never assigns integrity levels.

## `anthropicApiKey` (type: `string`):

Optional. When set, every model call of this run (draft, reviews and the agent) uses your Anthropic account instead of the Actor's. The key is stored encrypted by Apify, used only for this run, and never written to the outputs or logs.

## `maxAgentSteps` (type: `integer`):

How many refinement operations the agent may run after the initial draft (1 to 25). The draft, the checks and the final review always run.

## `maxRuntimeMinutes` (type: `integer`):

Wall-clock limit for the analysis (10 to 60). The agent stops refining early enough to run the final review. The run timeout in run options must be at least this long.

## `maxModelTokens` (type: `integer`):

Inference budget for the agent's planner, in tokens processed (100,000 to 3,000,000). It does not change the price.

## Actor input object example

```json
{
  "systemName": "Automated palletising cell",
  "systemDescription": "A six-axis industrial robot picks cartons from an infeed conveyor and stacks them on pallets in a fenced cell. A cell PLC sequences the robot and conveyors. Workers exchange full pallets through a gate guarded by a light curtain; the curtain is muted while the robot works on the opposite pallet station. The robot controller enforces speed limits configured by an integrator. An operator HMI outside the fence starts, stops and resets the cell.",
  "operatingEnvironment": "Warehouse floor, two shifts, forklift traffic outside the fence, cleaning crew at night.",
  "intendedUse": "Unattended palletising; trained workers enter only to exchange pallets or clear jams.",
  "boundaries": "Robot, gripper, cell PLC, light curtain, fence and HMI. The upstream conveyor line and the warehouse management system are outside.",
  "components": [],
  "knownHazards": [],
  "targetStandards": [],
  "maxAgentSteps": 10,
  "maxRuntimeMinutes": 25,
  "maxModelTokens": 800000
}
```

# Actor output Schema

## `report` (type: `string`):

No description

## `analysis` (type: `string`):

No description

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "systemName": "Automated palletising cell",
    "systemDescription": "A six-axis industrial robot picks cartons from an infeed conveyor and stacks them on pallets in a fenced cell. A cell PLC sequences the robot and conveyors. Workers exchange full pallets through a gate guarded by a light curtain; the curtain is muted while the robot works on the opposite pallet station. The robot controller enforces speed limits configured by an integrator. An operator HMI outside the fence starts, stops and resets the cell.",
    "operatingEnvironment": "Warehouse floor, two shifts, forklift traffic outside the fence, cleaning crew at night.",
    "intendedUse": "Unattended palletising; trained workers enter only to exchange pallets or clear jams.",
    "boundaries": "Robot, gripper, cell PLC, light curtain, fence and HMI. The upstream conveyor line and the warehouse management system are outside."
};

// Run the Actor and wait for it to finish
const run = await client.actor("vwnb/wcgw-safety-engineer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "systemName": "Automated palletising cell",
    "systemDescription": "A six-axis industrial robot picks cartons from an infeed conveyor and stacks them on pallets in a fenced cell. A cell PLC sequences the robot and conveyors. Workers exchange full pallets through a gate guarded by a light curtain; the curtain is muted while the robot works on the opposite pallet station. The robot controller enforces speed limits configured by an integrator. An operator HMI outside the fence starts, stops and resets the cell.",
    "operatingEnvironment": "Warehouse floor, two shifts, forklift traffic outside the fence, cleaning crew at night.",
    "intendedUse": "Unattended palletising; trained workers enter only to exchange pallets or clear jams.",
    "boundaries": "Robot, gripper, cell PLC, light curtain, fence and HMI. The upstream conveyor line and the warehouse management system are outside.",
}

# Run the Actor and wait for it to finish
run = client.actor("vwnb/wcgw-safety-engineer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "systemName": "Automated palletising cell",
  "systemDescription": "A six-axis industrial robot picks cartons from an infeed conveyor and stacks them on pallets in a fenced cell. A cell PLC sequences the robot and conveyors. Workers exchange full pallets through a gate guarded by a light curtain; the curtain is muted while the robot works on the opposite pallet station. The robot controller enforces speed limits configured by an integrator. An operator HMI outside the fence starts, stops and resets the cell.",
  "operatingEnvironment": "Warehouse floor, two shifts, forklift traffic outside the fence, cleaning crew at night.",
  "intendedUse": "Unattended palletising; trained workers enter only to exchange pallets or clear jams.",
  "boundaries": "Robot, gripper, cell PLC, light curtain, fence and HMI. The upstream conveyor line and the warehouse management system are outside."
}' |
apify call vwnb/wcgw-safety-engineer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vwnb/wcgw-safety-engineer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Mk3yZIxWKDMuqdgZF/builds/3LJIrVjrBRkeijYS1/openapi.json
