rollback-nginx

rollback-nginx is a command for Claude Code from trumb/claude-nginx-hardening. It costs 16 tokens per session (518 once invoked), scanned B, original, MIT.

A rollback command for previewing or restoring earlier copies of an Nginx security configuration.

In plain words
What is it for?
Use it to list backups, preview restoring the latest or a selected backup, or apply a local or remote restore with the supported options.
Why use it?
It provides a way to inspect available backups and recover a previous configuration after a hardening change.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the claude-nginx-hardening plugin — 1 skill, 8 commands, 3 agents shipped together

Good fit Use it to list backups, preview restoring the latest or a selected backup, or apply a local or remote restore with the supported options.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/trumb/claude-nginx-hardening/rollback-nginx
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/trumb/claude-nginx-hardening

Made for: Claude Code.

Or install claude-nginx-hardening, the plugin that ships this one along with the rest of its 1 skill, 8 commands, 3 agents.

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 rollback-nginx

README.md
[![agentmods](https://agentmods.dev/badge/commands/trumb/claude-nginx-hardening/rollback-nginx/github.svg)](https://agentmods.dev/commands/trumb/claude-nginx-hardening/rollback-nginx)
Your own site
<a href="https://agentmods.dev/commands/trumb/claude-nginx-hardening/rollback-nginx"><img src="https://agentmods.dev/badge/commands/trumb/claude-nginx-hardening/rollback-nginx/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 rollback-nginx

Your own site · 80×15
<a href="https://agentmods.dev/commands/trumb/claude-nginx-hardening/rollback-nginx"><img src="https://agentmods.dev/badge/commands/trumb/claude-nginx-hardening/rollback-nginx.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 518 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00016 $0.00518
Opus 5 $0.00008 $0.00259
Sonnet 5 $0.00003 $0.00104
Haiku 4.5 $0.00002 $0.00052

Measured 9d ago against content hash 3e212225247f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

rollback-nginx scanned grade B with 1 finding 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 9d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

6. **Validate** — `sudo nginx -t`
commands/rollback-nginx.md · 52 lines

What it actually says

Context

  • Current config: !ls /etc/nginx/snippets/security-hardening.conf 2>/dev/null && echo "PRESENT" || echo "MISSING"
  • Available backups: !ls /etc/nginx/snippets/security-hardening.conf.bak.* 2>/dev/null | wc -l backups found
  • Latest backup: !ls -t /etc/nginx/snippets/security-hardening.conf.bak.* 2>/dev/null | head -1 || echo "none"

Operating Mode

DEFAULT: R0 + R1 (preview only) With --apply: W1 (local restore) With --remote: W1 + X1 (local + remote restore)

Read @skills/nginx-hardening/EXECUTION-POLICY.md for full policy.

Subcommands

/harden-nginx rollback (bare)

Interactive mode — list recent backups and let user choose.

/harden-nginx rollback latest

Preview what would change if restoring the most recent backup. With --apply: actually restore it.

/harden-nginx rollback <backup-id>

Preview what would change if restoring a specific backup. With --apply: actually restore it.

/harden-nginx rollback --list

Show all available backups with timestamps, sizes, and run IDs.

Workflow

  1. List backupspython3 scripts/rollback-manager.py list --file <target>
  2. Previewpython3 scripts/rollback-manager.py preview --file <target> --backup-id <id> Show unified diff to user
  3. Confirm — User must explicitly approve restore
  4. Safety backup — Create backup of CURRENT state before restoring (so restore is reversible)
  5. Restorepython3 scripts/rollback-manager.py restore --file <target> --backup-id <id>
  6. Validatesudo nginx -t
  7. Reloadsudo systemctl reload nginx
  8. Git — Optionally create revert commit (NO force push, NO hard reset — Invariant 11)
  9. Log — Append rollback record to CHANGELOG.md

On failure at step 6 or 7:

  • Restore from the safety backup created in step 4
  • Run nginx -t again to verify recovery
  • Report failure, recommend manual investigation
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. 9d ago First seen · 52 lines · 16 tokens per session scan B 3e212225247f

Subscribe to this mod's changes

rollback-nginx is a command published in the GitHub repository trumb/claude-nginx-hardening (2 stars, last pushed 5mo ago), licensed MIT. It adds 16 tokens to every session and 518 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.