$npx -y skills add prompt-security/clawsec --skill hermes-attestation-guardianHermes-only runtime security attestation and drift detection skill for operator-managed Hermes infrastructure.
| 1 | # Hermes Attestation Guardian |
| 2 | |
| 3 | IMPORTANT SCOPE: |
| 4 | - This skill targets Hermes infrastructure only (CLI/Gateway/profile-managed deployments). |
| 5 | - This skill is not an OpenClaw runtime hook package. |
| 6 | |
| 7 | ## Vercel Skills Installation |
| 8 | |
| 9 | Install with the Vercel Skills CLI for this harness: |
| 10 | |
| 11 | ```bash |
| 12 | npx skills add prompt-security/clawsec --skill hermes-attestation-guardian -a hermes-agent -y |
| 13 | ``` |
| 14 | |
| 15 | ## Release Artifact Verification |
| 16 | |
| 17 | For standalone installs, verify the signed release manifest before trusting `SKILL.md`, `skill.json`, or the archive. The `skill.json` file is the package metadata/SBOM source, and the release pipeline signs `checksums.json` with the ClawSec release key. |
| 18 | |
| 19 | ```bash |
| 20 | set -euo pipefail |
| 21 | |
| 22 | SKILL_NAME="hermes-attestation-guardian" |
| 23 | VERSION="0.1.7" |
| 24 | REPO="prompt-security/clawsec" |
| 25 | TAG="${SKILL_NAME}-v${VERSION}" |
| 26 | BASE="https://github.com/${REPO}/releases/download/${TAG}" |
| 27 | ZIP_NAME="${SKILL_NAME}-v${VERSION}.zip" |
| 28 | TMP_DIR="$(mktemp -d)" |
| 29 | trap 'rm -rf "$TMP_DIR"' EXIT |
| 30 | |
| 31 | RELEASE_PUBKEY_SHA256="711424e4535f84093fefb024cd1ca4ec87439e53907b305b79a631d5befba9c8" |
| 32 | |
| 33 | curl -fsSL "$BASE/checksums.json" -o "$TMP_DIR/checksums.json" |
| 34 | curl -fsSL "$BASE/checksums.sig" -o "$TMP_DIR/checksums.sig" |
| 35 | curl -fsSL "$BASE/signing-public.pem" -o "$TMP_DIR/signing-public.pem" |
| 36 | curl -fsSL "$BASE/$ZIP_NAME" -o "$TMP_DIR/$ZIP_NAME" |
| 37 | curl -fsSL "$BASE/SKILL.md" -o "$TMP_DIR/SKILL.md" |
| 38 | curl -fsSL "$BASE/skill.json" -o "$TMP_DIR/skill.json" |
| 39 | |
| 40 | ACTUAL_PUBKEY_SHA256="$(openssl pkey -pubin -in "$TMP_DIR/signing-public.pem" -outform DER | shasum -a 256 | awk '{print $1}')" |
| 41 | if [ "$ACTUAL_PUBKEY_SHA256" != "$RELEASE_PUBKEY_SHA256" ]; then |
| 42 | echo "ERROR: signing-public.pem fingerprint mismatch" >&2 |
| 43 | exit 1 |
| 44 | fi |
| 45 | |
| 46 | openssl base64 -d -A -in "$TMP_DIR/checksums.sig" -out "$TMP_DIR/checksums.sig.bin" |
| 47 | openssl pkeyutl -verify -rawin -pubin \ |
| 48 | -inkey "$TMP_DIR/signing-public.pem" \ |
| 49 | -sigfile "$TMP_DIR/checksums.sig.bin" \ |
| 50 | -in "$TMP_DIR/checksums.json" >/dev/null |
| 51 | |
| 52 | hash_file() { |
| 53 | if command -v shasum >/dev/null 2>&1; then |
| 54 | shasum -a 256 "$1" | awk '{print $1}' |
| 55 | else |
| 56 | sha256sum "$1" | awk '{print $1}' |
| 57 | fi |
| 58 | } |
| 59 | |
| 60 | verify_manifest_file() { |
| 61 | asset="$1" |
| 62 | path="$2" |
| 63 | expected="$(jq -r --arg asset "$asset" '.files[$asset].sha256 // empty' "$TMP_DIR/checksums.json")" |
| 64 | if [ -z "$expected" ]; then |
| 65 | echo "ERROR: checksums.json missing $asset" >&2 |
| 66 | exit 1 |
| 67 | fi |
| 68 | actual="$(hash_file "$path")" |
| 69 | if [ "$actual" != "$expected" ]; then |
| 70 | echo "ERROR: checksum mismatch for $asset" >&2 |
| 71 | exit 1 |
| 72 | fi |
| 73 | } |
| 74 | |
| 75 | expected_archive="$(jq -r '.archive.sha256 // empty' "$TMP_DIR/checksums.json")" |
| 76 | if [ -z "$expected_archive" ]; then |
| 77 | echo "ERROR: checksums.json missing archive.sha256" >&2 |
| 78 | exit 1 |
| 79 | fi |
| 80 | actual_archive="$(hash_file "$TMP_DIR/$ZIP_NAME")" |
| 81 | if [ "$actual_archive" != "$expected_archive" ]; then |
| 82 | echo "ERROR: archive checksum mismatch" >&2 |
| 83 | exit 1 |
| 84 | fi |
| 85 | |
| 86 | verify_manifest_file "SKILL.md" "$TMP_DIR/SKILL.md" |
| 87 | verify_manifest_file "skill.json" "$TMP_DIR/skill.json" |
| 88 | |
| 89 | echo "Signed release manifest, archive, SKILL.md, and skill.json verified." |
| 90 | ``` |
| 91 | |
| 92 | Only install or extract the archive after this verification succeeds. |
| 93 | |
| 94 | ## Goal |
| 95 | |
| 96 | Generate deterministic Hermes posture attestations, verify them with fail-closed integrity checks, and compare baseline drift using stable severity mapping. |
| 97 | |
| 98 | ## Hermes guard trust policy note |
| 99 | |
| 100 | When installing from community sources, configure Hermes guard to use signature-aware trust (trusted signer fingerprint allowlist) rather than source-name-only trust. Unknown signer fingerprints should stay on community policy, and invalid signatures must remain blocked. |
| 101 | |
| 102 | ## Commands |
| 103 | |
| 104 | ```bash |
| 105 | # Generate attestation (default output: ~/.hermes/security/attestations/current.json) |
| 106 | node scripts/generate_attestation.mjs |
| 107 | |
| 108 | # Generate with explicit policy + deterministic timestamp |
| 109 | node scripts/generate_attestation.mjs \ |
| 110 | --policy ~/.hermes/security/attestation-policy.json \ |
| 111 | --generated-at 2026-04-15T18:00:00.000Z \ |
| 112 | --write-sha256 |
| 113 | |
| 114 | # Verify schema + canonical digest |
| 115 | node scripts/verify_attestation.mjs --input ~/.hermes/security/attestations/current.json |
| 116 | |
| 117 | # Verify with baseline diff (baseline must be authenticated) |
| 118 | node scripts/verify_attestation.mjs \ |
| 119 | --input ~/.hermes/security/attestations/current.json \ |
| 120 | --baseline ~/.hermes/security/attestations/baseline.json \ |
| 121 | --baseline-expected-sha256 <trusted-baseline-sha256> \ |
| 122 | --fail-on-severity high |
| 123 | |
| 124 | # Optional detached signature verification |
| 125 | node scripts/verify_attestation.mjs \ |
| 126 | --input ~/.hermes/security/attestations/current.json \ |
| 127 | --signature ~/.hermes/security/attestations/current.json.sig \ |
| 128 | --public-key ~/.hermes/security/keys/attestation-public.pem |
| 129 | |
| 130 | # Refresh advisory feed verification state (fail-closed by default) |
| 131 | node scripts/refresh_advisory_ |