safety

safety is a command for Claude Code from HermeticOrmus/LibreEmbed-Claude-Code. It costs 25 tokens per session (836 once invoked), scanned A, original, MIT.

A command for checking C firmware against MISRA rules, changing functions to follow those rules, documenting accepted violations, and preparing certification checklists. MISRA is a set of C coding guidelines widely used in safety-related devices.

In plain words
What is it for?
Use it to analyze files or directories, enforce selected rules, write deviation reports, and create checklists for a specified safety standard.
Why use it?
It helps find rule violations, record why an exception is allowed, and organize evidence for standards such as IEC 61508 and DO-178C.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the safety-critical plugin — 1 skill, 1 command, 1 agent shipped together

Good fit Use it to analyze files or directories, enforce selected rules, write deviation reports, and create checklists for a specified safety standard.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/hermeticormus/libreembed-claude-code/safety
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/HermeticOrmus/LibreEmbed-Claude-Code

Made for: Claude Code.

Or install safety-critical, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for safety

README.md
[![agentmods](https://agentmods.dev/badge/commands/hermeticormus/libreembed-claude-code/safety/github.svg)](https://agentmods.dev/commands/hermeticormus/libreembed-claude-code/safety)
Your own site
<a href="https://agentmods.dev/commands/hermeticormus/libreembed-claude-code/safety"><img src="https://agentmods.dev/badge/commands/hermeticormus/libreembed-claude-code/safety/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for safety

Your own site · 80×15
<a href="https://agentmods.dev/commands/hermeticormus/libreembed-claude-code/safety"><img src="https://agentmods.dev/badge/commands/hermeticormus/libreembed-claude-code/safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 836 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00025 $0.00836
Opus 5.5 $0.00010 $0.00334
Sonnet 5.5 $0.00005 $0.00167
Haiku 4.5 $0.00003 $0.00084

Measured 15d ago against content hash 5bb4fdbcdb1e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

safety scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 15d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/safety-critical/commands/safety.md · 110 lines

How it starts

The opening of the file, as written. The whole thing — 110 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/safety

Safety-critical firmware command: MISRA analysis, defensive patterns, watchdog, certification.

Trigger

/safety <action> [options]

Actions

analyze

Analyze C code for MISRA violations and safety issues.

/safety analyze --file src/motor_control.c --ruleset misra-2012
/safety analyze --dir src/ --level required-mandatory --output report.txt

enforce

Rewrite a function to be MISRA compliant.

/safety enforce --function process_command --rule 15.5
/safety enforce --function set_register --rule 11.3

report

Generate a deviation report for a known violation.

/safety report --rule 11.5 --file hal_wrapper.c --line 42 --reason "HAL requires void*"

certify

Generate a certification evidence checklist.

/safety certify --standard iec-61508 --sil 2
/safety certify --standard do-178c --dal B

Process

  1. Identify applicable safety standard and required integrity level.
  2. Configure static analysis tool with the MISRA ruleset.
  3. Run analysis on all source files.
  4. Categorize violations: fix immediately (mandatory) or document deviation (required/advisory).
  5. Write deviation records for each documented suppression.
  6. Verify 100% statement coverage with gcov or Polyspace.

Output Examples

cppcheck MISRA check

# Install: pip install cppcheck (or package manager)
cppcheck --enable=all --std=c11 \
    --addon=misra.json \
    --suppressions-list=misra_suppressions.txt \
    --xml --xml-version=2 \
    src/ 2> misra_report.xml

MISRA deviation log entry

Deviation Record: DEV-2024-011
Rule:        MISRA C:2012 Rule 11.5
File:        src/hal_wrapper.c, line 42
Violation:   Cast from void* to SPI_HandleTypeDef*
Justification: STM32 HAL API requires void* parameter. Type is
               verified by handle initialization in MX_SPI1_Init().
Risk:        Low. Type mismatch would cause fault at initialization,
             not silently at runtime.
Test:        TC-HAL-001: SPI loopback test verifies correct operation.
Approved:    J. Smith, 2024-03-15

Read the full file on GitHub · 110 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 15d ago First seen · 110 lines · 25 tokens per session scan A 5bb4fdbcdb1e

Subscribe to this mod's changes

safety is a command published in the GitHub repository HermeticOrmus/LibreEmbed-Claude-Code (50 stars, last pushed 6d ago), licensed MIT. It adds 25 tokens to every session and 836 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-01.