harden

harden is a command for coding agents from Dragoon0x/canon. It costs 46 tokens per session (571 once invoked), scanned A, original, MIT.

A command for checking data-driven interfaces beyond the normal success case, including loading, empty, error, offline, and slow-network situations.

In plain words
What is it for?
Use it to review screens, add fallback messages and actions, handle network interruptions, and check behavior with very little or very much data.
Why use it?
It helps find the states and edge cases that are often missing when an interface is designed only for successful requests.

Command

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.

agentmods
npx agentmods add commands/dragoon0x/canon/harden
Clone the repo
git clone --depth 1 https://github.com/Dragoon0x/canon

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 harden

README.md
[![agentmods](https://agentmods.dev/badge/commands/dragoon0x/canon/harden.svg)](https://agentmods.dev/commands/dragoon0x/canon/harden)
Your own site
<a href="https://agentmods.dev/commands/dragoon0x/canon/harden"><img src="https://agentmods.dev/badge/commands/dragoon0x/canon/harden.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 571 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00046 $0.00571
Opus 5 $0.00023 $0.00285
Sonnet 5 $0.00009 $0.00114
Haiku 4.5 $0.00005 $0.00057

Measured 4d ago against content hash 0179194de90c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

harden 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 4d 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.

source/commands/harden.md · 69 lines

How it starts

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

/harden

Every interface has 4 states. Most ship 1. Harden fills in the other 3.

Coverage map

For every data-driven view in the app, confirm:

Loading

  • 400ms delay before any spinner
  • Skeleton if content shape is known
  • Spinner animates at 1000–1500ms per cycle
  • Label changes to present-continuous on the triggering button ("Saving…")
  • Fixed button width prevents layout shift

Empty

  • First-time empty: illustration + headline + description + primary CTA
  • User-cleared empty: brief confirmation
  • Filtered empty: "No results" + "Clear filters" escape
  • Search empty: "No results for X" + alternative suggestions

Error

  • Network error: retry button + calm tone
  • Server error: "Something went wrong" + retry + support link
  • 404: friendly explanation + home link
  • 403: sign-in prompt or request-access flow
  • Validation: inline at the field, specific cause, how to fix

Populated (the happy path)

  • Already designed. Just verify it degrades gracefully at low data volumes (1 item) and high (1000 items).

Network resilience

  • Offline banner if app requires network
  • Queue mutations during offline; sync on reconnect
  • Toast confirmation on reconnect: "Back online. Synced N changes."
  • Read-only mode for cached views when network is gone

Slow-network UX

Simulate 3G and check:

  • Is LCP < 2.5s on 75th percentile mobile?
  • Does the page render progressively or wait for everything?
  • Are fonts using font-display: swap so text appears immediately?
  • Is the LCP image preloaded with fetchpriority="high"?

Destructive actions

  • Prefer Undo toast (5s window) over confirmation dialog
  • Irreversible actions get explicit dialog with action verb: "Delete forever"
  • Destructive button styled as such: red background or outlined-red
  • Keyboard focus lands on the safe default (Cancel), not the destructive button

Copy hardening

  • Every error has recovery action text
  • Every empty state has next-step CTA
  • Every loading state identifies what's loading (when > 1s)
  • Every success state is brief and non-blocking (toast, not dialog)

Read the full file on GitHub · 69 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. 4d ago First seen · 69 lines · 46 tokens per session scan A 0179194de90c

Subscribe to this mod's changes

harden is a command published in the GitHub repository Dragoon0x/canon (5 stars, last pushed 4mo ago), licensed MIT. It adds 46 tokens to every session and 571 once invoked, about $0.0002 per session on Opus 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-08-31.