Shorguard
Stops your AI agent from writing crypto that quantum computers will break.
Shorguard is a Hermes Agent plugin. Every time
Hermes is about to write a file, apply a patch or run a command, Shorguard checks whether it adds
quantum-vulnerable public-key cryptography (RSA, ECDSA, ECDH, EdDSA, X25519, finite-field DH, DSA).
If it does, the call is stopped before anything touches disk, and the agent is told exactly how
to rewrite it with the NIST post-quantum standards: ML-KEM (FIPS 203), ML-DSA (FIPS 204) and
SLH-DSA (FIPS 205). It also scans whole repositories and gives them a post-quantum readiness grade,
with JSON and SARIF output for CI.
you › add RSA signing to the payment receipts
hermes › write_file api/receipts.py
🛡 Shorguard stopped this write_file call: it adds quantum-vulnerable public-key cryptography.
- SG-PY-001 RSA key generation (line 4, high) → use ML-DSA-65 (FIPS 204)
hermes › write_file api/receipts.py (rewritten with mldsa.MLDSA65PrivateKey) ✓ written
Why
- The deadline is set. NIST IR 8547 (final, 27 October 2026) deprecates every quantum-vulnerable
signature and key-establishment algorithm after 2030 and disallows them after 2035, at every
key size (RSA-3072, P-256 and Ed25519 included). US federal systems must move key establishment to
post-quantum crypto by the end of 2030 (EO 14412). - Key exchange is urgent today. Traffic recorded now can be decrypted once a cryptographically
relevant quantum computer exists ("harvest now, decrypt later"). - AI agents make it worse. Coding agents still reach for
rsa.generate_private_keyand
ec.ECDH()by default, and they write code faster than anyone reviews it.
Scanners find classical crypto after it is committed. Shorguard stops the agent before it
writes it, which only a Hermes plugin can do: it sits on the pre_tool_call hook, in front of every
tool the agent uses.
Install
hermes plugins install shorguard # from the Hermes plugin catalog (once listed)
# or straight from GitHub:
hermes plugins install Akanimoh12/shorguard/shorguard --enable
No API keys, no dependencies, no account. Requires Hermes Agent ≥ 0.23.0.
What you get
| Surface | What it does |
|---|---|
Live guard (pre_tool_call) | Checks write_file, patch (both modes), terminal and execute_code before they run. Only newly added crypto counts: editing a file that already uses RSA is not blocked; adding more is. |
| Agent tools | shorguard_scan (readiness grade + findings) and shorguard_explain (why, the deadline, and working post-quantum code). |
/shorguard | In any chat (CLI, Telegram, Discord…): status, mode, threshold, scan, explain, rules. |
hermes shorguard | scan with text / JSON / SARIF output and CI exit codes, rules, explain. Also runs without Hermes: python -m shorguard scan . |
| Skill | shorguard:pq-migration, a migration playbook with tested Python recipes (ML-KEM, hybrid X25519 + ML-KEM, ML-DSA). |
Modes
| Mode | Behaviour |
|---|---|
block (default) | Refuse the call and return the fix to the agent, which then rewrites the code. |
approve | Send the call to Hermes's own approval prompt. (Under YOLO mode Hermes auto-approves, so this is advisory there.) |
warn | Let it through and attach a Shorguard note to the tool result. |
off | Guard disabled; scans and tools still work. |
/shorguard mode approve /shorguard threshold critical /shorguard status
Settings also appear in Hermes Desktop → Settings → Plugins → Shorguard, or in config.yaml:
plugins:
entries:
shorguard:
settings:
mode: block # block | approve | warn | off
block_on: high # critical | high | medium
scan_terminal: true
scan_execute_code: true
Severity
| Severity | Meaning | Default |
|---|---|---|
| critical | Key exchange / public-key encryption (RSA-OAEP, ECDH, X25519, DH). Harvest-now-decrypt-later. | stopped |
| high | Signatures and key generation (RSA, ECDSA, EdDSA, DSA, RS256/ES256/EdDSA JWTs). | stopped |
| medium | No drop-in post-quantum replacement yet (SSH keys, OpenPGP keys, PEM key files, TLS group lists without X25519MLKEM768). | noted, not stopped |
| info | Hybrid constructions (classical + ML-KEM). This is the recommended transition shape. | noted |
Legitimate exceptions
Sometimes classical crypto is required, for example to verify a third party's RSA signature. Add a
comment with a reason on the same line or the line above:
claims = jwt.decode(token, jwks_key, algorithms=["RS256"]) # shorguard: allow Google OIDC tokens are RS256
The guard then lets the write through, and the reason stays in the code for reviewers.
shorguard: allow-file <reason> exempts a whole file (e.g. interop test fixtures).
Scan a repository
hermes shorguard scan . # readable report + grade, exit 1 on high+
hermes shorguard scan . --skip-tests --fail-on critical # ignore fixtures, fail CI only on critical
hermes shorguard scan . --format sarif -o shorguard.sarif # GitHub code scanning
hermes shorguard rules # every rule
hermes shorguard explain SG-PY-004 # why + the fix
Shorguard 0.1.0 — post-quantum readiness scan of demo/legacy-payments
Files scanned: 6 Findings: 8 Grade: F
Critical 3 · High 3 · Medium 2 · Info 0
✖ CRITICAL SG-PY-009 api/vault.py:9:9 RSA-OAEP public-key encryption fix → ML-KEM-768 (FIPS 203)
✖ CRITICAL SG-GO-003 kx/session.go:10:9 ECDH / X25519 key exchange fix → ML-KEM-768 (FIPS 203)
▲ HIGH SG-JWT-001 api/auth.py:13:45 JWT signed with RSA, ECDSA or EdDSA fix → ML-DSA (FIPS 204) …
Grades: A clean · B medium only · C ≤ 5 high · D > 5 high · F any critical.
Coverage
52 rules across Python (pyca/cryptography, PyCryptodome, python-rsa, python-ecdsa, PyNaCl, paramiko),
JavaScript / TypeScript (node:crypto, WebCrypto, node-forge, node-rsa, elliptic, tweetnacl), Go,
Java / Kotlin / Scala (JCA), Rust (rsa, dalek, RustCrypto), .NET, shell / CI / Dockerfiles (openssl,
ssh-keygen, gpg), TLS config (nginx, OpenSSL) and any file (PEM private keys, JWT algorithm strings).
Run hermes shorguard rules for the full list.
Every rule matches a concrete API call, command or artefact, never a bare word like "RSA". Comments,
documentation (.md, .rst, …) and read-only terminal commands (grep, rg, find, cat,
git log …) are never flagged. Scanning the 16,000-file Hermes Agent repository takes about 6 seconds.
What Shorguard does on your machine (disclosure)
- Reads: the content of each tool call it inspects; the file a
write_fileis about to overwrite
(to flag only newly added crypto); files under a path you ask it to scan. - Writes: its own plugin state (counters and the last 50 events: time, action, tool, file name,
rule ids — never code, arguments or conversation content); its settings when you change them
with/shorguard mode/threshold; a report file only when you pass--output. - Changes agent behaviour: in
blockmode it refuses matching tool calls (pre_tool_call); in
approvemode it routes them to Hermes's approval gate; it appends notes to tool results
(transform_tool_result). - Never: network access, subprocesses, credentials, telemetry, background work, self-updates.
- With
plugins.isolation: host, Hermes does not wire plugin CLI subcommands; use/shorguard scan
or theshorguard_scantool instead.
Limitations
Shorguard is a fast pattern guard, not a data-flow analyser. It sees crypto your code calls
directly, not crypto hidden inside a dependency or a library's TLS defaults, and it cannot know
whether a key protects something that matters. Treat a clean grade as "no obvious classical crypto
in this code", not as a certification.
Development
python -m pytest -q # 100+ tests, no network
hermes plugins validate ./shorguard # the check Hermes catalog CI runs
python -m shorguard scan shorguard # Shorguard scans itself: grade A
The repository's demo/legacy-payments/ is a deliberately vulnerable sample project used in the demo.
License
MIT © 2026 Akanimoh12
README from the reviewed commit ad949b6; it updates when the author re-pins.

Akanimoh12