/hstack:integration-auth0from hstack
Connects Auth0 to a host-installed Hermes assistant over SSH using native interfaces, private credentials, and verified rollback. Useful for integrating Auth0 authentication with remote Hermes deployments.
Ships in hstack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Source-verified for Hermes 0.23.2 at ae2a81ccc00e9b7c06301523e5bb09608397149c.
This procedure targets the exclusive default profile on one host account. Containers,
named profiles and concurrent configuration writers need a separately scoped procedure.
Vendor endpoints, account entitlements and tool behavior have not been tested with live credentials.
Collect $VPS_USER and $VPS_IP with SSH key access. AUTH0_DOMAIN (bare tenant hostname), AUTH0_CLIENT_ID and AUTH0_CLIENT_SECRET from an existing least-privilege M2M app authorized for read:users. This recipe does not create clients or grants.
Keep secrets in the local shell or a secret manager; do not paste them into chat.
Confirm the remote account is the host with whoami and hostname before proceeding.
The code blocks form one shell session; run them in order. Show the concrete preview before changing the server.
# Run every block of this skill in ONE shell session: later steps call these functions.
# If your harness starts a fresh shell per command, re-run this block first.
SKILL_NAME=integration-auth0
# Non-login ssh shells miss ~/.local/bin, where the Hermes installer puts `hermes`.
remote() { ssh -o BatchMode=yes "$VPS_USER@$VPS_IP" "export PATH=\"\$HOME/.local/bin:\$PATH\"; $*"; }
# gw_ready [SECONDS]: native readiness. Succeeds only when `gateway ensure --json` exits 0 and reports "state":"ready"
# (the transient pending/draining codes 5 and 6 are retried twice). It never greps `gateway status` text, because the stopped
# gateway prints "✗ Gateway is not running", which contains "running".
gw_ready() {
remote "T=${1:-60} bash -s" <<'REMOTE'
n=0
while :; do
out=$(hermes -p default gateway ensure --json --timeout "$T") && rc=0 || rc=$?
[ "$rc" = 0 ] && break
n=$((n + 1))
{ [ "$rc" = 5 ] || [ "$rc" = 6 ]; } && [ "$n" -lt 3 ] || { printf '%s\n' "$out" >&2; exit 1; }
sleep 3
done
case $out in *'"state":"ready"'*) printf '%s\n' "$out" ;; *) printf '%s\n' "$out" >&2; exit 1 ;; esac
REMOTE
}
# gw_reload: restart the default-profile gateway natively and require a ready gateway with a NEW instance_id.
# `--detach` keeps `restart` from running the gateway inside the ssh shell when no service is installed. With live
# sessions and no terminal, restart refuses; GW_INTERRUPT=1 adds -y and interrupts them deliberately (never set by default).
# Side effect: the pre-restart `ensure` read that captures the old instance_id STARTS a gateway when none is running (ensure never
# installs a service, but it does start one). A reload implies the gateway should run, so that is accepted; read-only skills never call gw_reload.
gw_reload() {
local old new out interrupt
interrupt=""
if [ "${GW_INTERRUPT:-0}" = 1 ]; then interrupt=1; fi
# Keep an endpoint identity even when ensure exits 6 (draining/restart_wait).
out=$(remote 'hermes -p default gateway ensure --json --timeout 10 2>/dev/null') || :
old=$(printf '%s\n' "$out" | sed -n 's/.*"instance_id":"\([^"]*\)".*/\1/p')
remote "hermes -p default gateway restart --detach${interrupt:+ -y}" \
|| { echo "gw_reload: gateway restart failed or was refused (live sessions? re-run with GW_INTERRUPT=1 only if interrupting them is acceptable)." >&2; return 1; }
out=$(gw_ready) || return 1
new=$(printf '%s' "$out" | sed -n 's/.*"instance_id":"\([^"]*\)".*/\1/p')
if [ -n "$old" ] && [ "$new" = "$old" ]; then echo "gw_reload: the gateway instance did not change, so it was not restarted." >&2; return 1; fi
printf '%s\n' "$out"
}
# snapshot: copy ~/.hermes/.env and config.yaml aside BEFORE the first write.
# The snapshot dir doubles as the "run in progress" marker that rollback looks for.
snapshot() {
remote "SKILL_NAME='$SKILL_NAME' bash -s" <<'REMOTE'
set -e
p="$HOME/.hermes/.hstack-backup"
d="$p/$SKILL_NAME"
# The active recovery point is published only after every artifact has been verified.
if [ -e "$d" ] || [ -L "$d" ]; then
echo "snapshot: $d exists — a previous $SKILL_NAME run did not finish. Run rollback first (restores the state before that run), then re-run." >&2
exit 1
fi
mkdir -p "$p" && chmod 700 "$p"
lock="$d.creating"
mkdir "$lock" 2>/dev/null || { echo "snapshot: another $SKILL_NAME snapshot is being created; retry after it finishes." >&2; exit 1; }
t=""
trap '[ -z "$t" ] || rm -rf "$t"; rmdir "$lock" 2>/dev/null || true' EXIT
[ ! -e "$d" ] && [ ! -L "$d" ] || { echo "snapshot: a recovery point appeared; nothing was written." >&2; exit 1; }
t=$(mktemp -d "$p/.snapshot-$SKILL_NAME.XXXXXX")
for f in .env config.yaml; do
if [ -f "$HOME/.hermes/$f" ]; then
cp -p "$HOME/.hermes/$f" "$t/$f"
cmp -s "$HOME/.hermes/$f" "$t/$f"
chmod 600 "$t/$f"
elif [ -e "$HOME/.hermes/$f" ] || [ -L "$HOME/.hermes/$f" ]; then
echo "snapshot: $f is not a readable regular file; nothing was written." >&2; exit 1
else
: > "$t/$f.absent"
chmod 600 "$t/$f.absent"
fi
done
for f in .env config.yaml; do
for entry in "$f" "$f.absent"; do
if [ -f "$t/$entry" ]; then cksum < "$t/$entry" > "$t/$entry.cksum"; chmod 600 "$t/$entry.cksum"; fi
done
done
printf 'hstack-snapshot-v1\n' > "$t/.complete"
chmod 600 "$t/.complete"
mv "$t" "$d"
[ -f "$d/.complete" ] && [ ! -d "$t" ] || { echo "snapshot: recovery-point publication failed; nothing was written." >&2; exit 1; }
t=""
REMOTE
}
# rollback: restore the exact pre-skill .env + config.yaml (so a FORCE=1 re-run that
# fails puts the previous working value back), reload the gateway with gw_reload, then retire the snapshot.
rollback() {
local rc=0
remote "SKILL_NAME='$SKILL_NAME' bash -s" <<'REMOTE' || rc=$?
set -e
trap 'echo "rollback: restoration failed; active snapshot retained for recovery." >&2' ERR
d="$HOME/.hermes/.hstack-backup/$SKILL_NAME"
[ ! -d "$d.creating" ] || { echo "rollback: snapshot creation is still in progress; retry later." >&2; exit 1; }
[ -d "$d" ] || { echo "rollback: no snapshot for $SKILL_NAME; nothing was written."; exit 10; }
# Incomplete legacy snapshots cannot prove that their final copy succeeded. Keep them for manual recovery.
[ -f "$d/.complete" ] && [ "$(cat "$d/.complete")" = hstack-snapshot-v1 ] \
|| { echo "rollback: snapshot is incomplete or legacy; active snapshot retained for manual recovery." >&2; exit 1; }
for f in .env config.yaml; do
count=0
for entry in "$f" "$f.absent"; do
if [ -f "$d/$entry" ]; then
count=$((count + 1))
[ -f "$d/$entry.cksum" ] || { echo "rollback: missing checksum for $f; active snapshot retained for recovery." >&2; exit 1; }
checksum=$(cksum < "$d/$entry")
expected_checksum=$(cat "$d/$entry.cksum")
[ "$checksum" = "$expected_checksum" ] \
|| { echo "rollback: corrupt backup for $f; active snapshot retained for recovery." >&2; exit 1; }
fi
done
[ "$count" = 1 ] || { echo "rollback: missing or ambiguous backup for $f; active snapshot retained for recovery." >&2; exit 1; }
done
for f in .env config.yaml; do
if [ -f "$d/$f" ]; then
cp -p "$d/$f" "$HOME/.hermes/$f"
cmp -s "$d/$f" "$HOME/.hermes/$f"
elif [ -f "$d/$f.absent" ]; then
rm -f "$HOME/.hermes/$f"
[ ! -e "$HOME/.hermes/$f" ] && [ ! -L "$HOME/.hermes/$f" ] || { echo "rollback: file removal failed; active snapshot retained." >&2; exit 1; }
else
echo "rollback: missing backup for $f; active snapshot retained for recovery." >&2
exit 1
fi
done
[ -f "$HOME/.hermes/.env" ] && chmod 600 "$HOME/.hermes/.env"
exit 0
REMOTE
[ "$rc" = 10 ] && return 0
[ "$rc" = 0 ] || return "$rc"
gw_reload >/dev/null \
|| { echo "rollback: files restored, but the gateway did NOT come back ready — active snapshot retained; inspect the gateway and retry rollback after resolving the fault" >&2; return 1; }
finish || return 1
echo "rollback: restored ~/.hermes/.env and config.yaml to their pre-$SKILL_NAME state."
}
# finish: mark the run successful; keep the snapshot as .prev for a manual undo.
finish() {
remote "SKILL_NAME='$SKILL_NAME' bash -s" <<'REMOTE'
set -e
trap 'echo "finish: could not retire the active snapshot; inspect the recovery point before continuing." >&2' ERR
d="$HOME/.hermes/.hstack-backup/$SKILL_NAME"
[ -d "$d" ] || exit 0
rm -rf "$d.prev"
[ ! -e "$d.prev" ] && [ ! -L "$d.prev" ] || { echo "snapshot retirement: previous destination remains; active snapshot retained." >&2; exit 1; }
mv "$d" "$d.prev"
[ ! -e "$d" ] && [ ! -L "$d" ] && [ -f "$d.prev/.complete" ] || { echo "snapshot retirement: move could not be verified; inspect the recovery point." >&2; exit 1; }
REMOTE
}
# Extra local artifacts are restored before the shared .env/config rollback.
extra_snapshot() {
remote "SKILL_NAME='$SKILL_NAME' bash -s" <<'REMOTE'
set -e
b="$HOME/.hermes/.hstack-backup/$SKILL_NAME/extra"
mkdir "$b" && chmod 700 "$b"
for rel in skills/hstack-auth0/SKILL.md skills/hstack-auth0/.hstack-managed; do
parent=$(dirname "$HOME/.hermes/$rel")
while [ "$parent" != "$HOME/.hermes" ]; do [ ! -L "$parent" ] || exit 1; parent=$(dirname "$parent"); done
p="$HOME/.hermes/$rel"; k=$(printf '%s' "$rel" | tr / _)
[ ! -L "$p" ] || { echo 'Refusing symlink artifact' >&2; exit 1; }
if [ -f "$p" ]; then cp -p "$p" "$b/$k"; cmp -s "$p" "$b/$k"; chmod 600 "$b/$k"; cksum < "$b/$k" > "$b/$k.cksum"
elif [ -e "$p" ]; then exit 1
else : > "$b/$k.absent"; fi
done
printf 'complete\n' > "$b/.complete"
REMOTE
}
extra_restore() {
remote "SKILL_NAME='$SKILL_NAME' bash -s" <<'REMOTE'
set -e
b="$HOME/.hermes/.hstack-backup/$SKILL_NAME/extra"
[ -f "$b/.complete" ] || { echo 'Incomplete extra backup retained for manual recovery' >&2; exit 1; }
# Refuse to replace a changed or foreign native workflow. A concurrent user edit
# belongs to the user; retain all recovery artifacts for manual reconciliation.
p="$HOME/.hermes/skills/hstack-auth0"
original="$b/skills_hstack-auth0_SKILL.md"
[ ! -L "$HOME/.hermes/skills" ] && [ ! -L "$p" ] || exit 1
if [ -e "$p" ]; then
[ -d "$p" ] || exit 1
entries=$(find "$p" -mindepth 1 -maxdepth 1 | wc -l | tr -d ' ')
if [ "$entries" = 0 ] && [ -f "$original.absent" ]; then :
else
[ "$entries" = 2 ] && [ -f "$p/SKILL.md" ] && [ -f "$p/.hstack-managed" ] \
&& [ ! -L "$p/SKILL.md" ] && [ ! -L "$p/.hstack-managed" ] \
&& [ "$(cksum < "$p/SKILL.md")" = "$(cat "$p/.hstack-managed")" ] \
|| { echo "extra_restore: native skill was edited or is unowned; active backup retained." >&2; exit 1; }
fi
elif [ ! -f "$original.absent" ]; then
echo "extra_restore: previous native skill was removed; active backup retained." >&2
exit 1
fi
# Validate all copies before restoring any artifact.
for rel in skills/hstack-auth0/SKILL.md skills/hstack-auth0/.hstack-managed; do
parent=$(dirname "$HOME/.hermes/$rel")
while [ "$parent" != "$HOME/.hermes" ]; do [ ! -L "$parent" ] || exit 1; parent=$(dirname "$parent"); done
k=$(printf '%s' "$rel" | tr / _)
if [ -f "$b/$k" ]; then [ "$(cksum < "$b/$k")" = "$(cat "$b/$k.cksum")" ]; else [ -f "$b/$k.absent" ]; fi
done
for rel in skills/hstack-auth0/SKILL.md skills/hstack-auth0/.hstack-managed; do
parent=$(dirname "$HOME/.hermes/$rel")
while [ "$parent" != "$HOME/.hermes" ]; do [ ! -L "$parent" ] || exit 1; parent=$(dirname "$parent"); done
p="$HOME/.hermes/$rel"; k=$(printf '%s' "$rel" | tr / _)
[ ! -L "$p" ] || exit 1
if [ -f "$b/$k" ]; then mkdir -p "$(dirname "$p")"; cp -p "$b/$k" "$p"; cmp -s "$p" "$b/$k"; chmod 600 "$p"
else rm -f "$p"; [ ! -e "$p" ]; fi
done
REMOTE
}
fail_transaction() { extra_restore && rollback; exit 1; }
The shared snapshot restores the prior .env and config.yaml bytes, rather than deleting keys.
HERMES_BANNER=$(remote '
set -e
command -v hermes >/dev/null 2>&1 \
|| { echo "FAIL: hermes not found on the VPS host PATH; container-only installations are outside this procedure"; exit 1; }
hermes -p default --version
') || { echo "ABORT: Hermes is not installed on the VPS host account (container-only installs are unsupported). Run /hermes-install first. Nothing was written."; exit 1; }
printf '%s\n' "$HERMES_BANNER" | grep -Eq '(^|[[:space:]])v?0[.]23[.]2([[:space:]]|$)' || {
echo "ABORT: this procedure is source-verified for Hermes 0.23.2 only (got: $HERMES_BANNER). Nothing was written."; exit 1;
}
remote 'whoami; hostname' || exit 1
# Existing local skill files are checked for ownership before any replacement.
secret_chars_ok() { local LC_ALL=C; case "$1" in ""|*[!A-Za-z0-9_.~+/=-]*) return 1 ;; esac; }
secret_chars_ok "${AUTH0_DOMAIN:-}" || { echo "ABORT: AUTH0_DOMAIN is empty or unsafe. Nothing was written."; exit 1; }
secret_chars_ok "${AUTH0_CLIENT_ID:-}" || { echo "ABORT: AUTH0_CLIENT_ID is empty or unsafe. Nothing was written."; exit 1; }
secret_chars_ok "${AUTH0_CLIENT_SECRET:-}" || { echo "ABORT: AUTH0_CLIENT_SECRET is empty or unsafe. Nothing was written."; exit 1; }
case "$AUTH0_DOMAIN" in -*|.*|*[!A-Za-z0-9.-]*) echo "ABORT: invalid AUTH0_DOMAIN. Nothing was written."; exit 1 ;; esac
case "$AUTH0_DOMAIN" in *.*) ;; *) echo "ABORT: tenant hostname required. Nothing was written."; exit 1 ;; esac
remote 'bash -s' <<'REMOTE' || { echo "ABORT: local skill is not safely replaceable. Nothing was written."; exit 1; }
p="$HOME/.hermes/skills/hstack-auth0"
[ ! -L "$p" ] || exit 1
if [ -e "$p" ]; then
[ -d "$p" ] && [ -f "$p/.hstack-managed" ] && [ -f "$p/SKILL.md" ] && [ ! -L "$p/SKILL.md" ] || exit 1
[ "$(cksum < "$p/SKILL.md")" = "$(cat "$p/.hstack-managed")" ] || exit 1
[ "$(find "$p" -mindepth 1 -maxdepth 1 | wc -l | tr -d ' ')" = 2 ] || exit 1
fi
REMOTE
printf '%s\n' "${AUTH0_DOMAIN:-}" "${AUTH0_CLIENT_ID:-}" "${AUTH0_CLIENT_SECRET:-}" | remote 'python3 -c '"'"'import sys, json, os, stat, urllib.request, urllib.error, urllib.parse, subprocess, base64
d=dict(zip(['"'"'"'"'"'"'"'"'AUTH0_DOMAIN'"'"'"'"'"'"'"'"', '"'"'"'"'"'"'"'"'AUTH0_CLIENT_ID'"'"'"'"'"'"'"'"', '"'"'"'"'"'"'"'"'AUTH0_CLIENT_SECRET'"'"'"'"'"'"'"'"'],sys.stdin.read().splitlines()))
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self, req, fp, code, msg, headers, newurl):
raise RuntimeError("Redirect refused; credentials were not forwarded")
def req(url, headers=None, body=None):
if not url.startswith("https://"): raise RuntimeError("HTTPS required")
r=urllib.request.Request(url,headers=headers or {},data=body)
with urllib.request.build_opener(NoRedirect).open(r,timeout=30) as f:
if f.status != 200: raise RuntimeError("Non-200 response")
data=f.read(2 * 1024 * 1024 + 1)
if len(data)>2 * 1024 * 1024: raise RuntimeError("Response too large")
return data
token=json.loads(req("https://"+d["AUTH0_DOMAIN"]+"/oauth/token",{"Content-Type":"application/json"},json.dumps({"grant_type":"client_credentials","client_id":d["AUTH0_CLIENT_ID"],"client_secret":d["AUTH0_CLIENT_SECRET"],"audience":"https://"+d["AUTH0_DOMAIN"]+"/api/v2/"}).encode()))["access_token"]
req("https://"+d["AUTH0_DOMAIN"]+"/api/v2/users?per_page=1",{"Authorization":"Bearer "+token})
print("OK: authenticated read-only vendor probe")
'"'"'' >/dev/null 2>&1 || { echo "ABORT: vendor authentication or read-only probe failed. Nothing was written."; exit 1; }
Credentials travel on SSH stdin, with redirects refused, timeout bounded, and response bodies suppressed. No .env file is sourced as shell code. No credentials are sent to a different host after an HTTP redirect.
cat <<EOF
DRY RUN — $VPS_USER@$VPS_IP, default profile only:
Integration: auth0; path: rest.
Preserve previous .env/config bytes in a private completed snapshot.
Install a discoverable read-only Hermes skill with owned-file recovery.
Any post-snapshot failure restores previous local files and checks gateway readiness.
Vendor state changes are outside local rollback; requests require their own authorization.
EOF
Proceed when this work is already authorized; if material scope or account authorization is missing, obtain it before Step 5. Never treat elapsed time as approval.
snapshot || { echo "ABORT: snapshot failed. Nothing was written."; exit 1; }
extra_snapshot || { echo "FAIL: extra snapshot incomplete; retain active backup for manual recovery. No integration settings were written."; exit 1; }
put_env() {
printf '%s\n' "$2" | remote "IFS= read -r v && hermes -p default config set $1 \"\$v\" >/dev/null 2>&1 && chmod 600 ~/.hermes/.env"
}
put_env AUTH0_DOMAIN "${AUTH0_DOMAIN:-}" || { echo "FAIL: private setting write."; fail_transaction; }
put_env AUTH0_CLIENT_ID "${AUTH0_CLIENT_ID:-}" || { echo "FAIL: private setting write."; fail_transaction; }
put_env AUTH0_CLIENT_SECRET "${AUTH0_CLIENT_SECRET:-}" || { echo "FAIL: private setting write."; fail_transaction; }
Only values on stdin reach SSH. The remote hermes config set process briefly has its value in its argv; use a trusted exclusive VPS account. chmod 600 protects the persisted .env.
remote 'bash -s' <<'REMOTE' || { echo "FAIL: native skill installation."; fail_transaction; }
set -e
p="$HOME/.hermes/skills/hstack-auth0"
[ ! -L "$HOME/.hermes/skills" ] && [ ! -L "$p" ] || exit 1
mkdir -p "$p" && chmod 700 "$p"
t=$(mktemp "$p/.SKILL.XXXXXX")
trap 'rm -f "$t"' EXIT
cat > "$t" <<'HSTACK_NATIVE_SKILL'
---
name: hstack-auth0
description: Read auth0 account data using a private host credential; use for the installed read-only auth0 connection.
---
# auth0: read-only account access
Only run this read request when the user asks for auth0 account data. Do not print credentials.
This connector is read-only; changes require a separately reviewed workflow and user authorization.
The script reads the private ~/.hermes/.env without sourcing it as executable shell code.
Use the following command through the native terminal tool on the Hermes host:
python3 -c 'import sys, json, os, stat, urllib.request, urllib.error, urllib.parse, subprocess, base64
d={}
p=os.path.expanduser("~/.hermes/.env")
if os.path.islink(p) or not os.path.isfile(p) or stat.S_IMODE(os.stat(p).st_mode)!=0o600: raise RuntimeError("Private regular .env required")
if os.path.isfile(p):
for line in open(p):
k, sep, v=line.rstrip("\n").partition("=")
if sep:
v=v.strip()
if len(v)>1 and v[0]==v[-1] and v[0] in (chr(34),chr(39)): v=v[1:-1]
d[k]=v
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self, req, fp, code, msg, headers, newurl):
raise RuntimeError("Redirect refused; credentials were not forwarded")
def req(url, headers=None, body=None):
if not url.startswith("https://"): raise RuntimeError("HTTPS required")
r=urllib.request.Request(url,headers=headers or {},data=body)
with urllib.request.build_opener(NoRedirect).open(r,timeout=30) as f:
if f.status != 200: raise RuntimeError("Non-200 response")
data=f.read(2 * 1024 * 1024 + 1)
if len(data)>2 * 1024 * 1024: raise RuntimeError("Response too large")
return data
token=json.loads(req("https://"+d["AUTH0_DOMAIN"]+"/oauth/token",{"Content-Type":"application/json"},json.dumps({"grant_type":"client_credentials","client_id":d["AUTH0_CLIENT_ID"],"client_secret":d["AUTH0_CLIENT_SECRET"],"audience":"https://"+d["AUTH0_DOMAIN"]+"/api/v2/"}).encode()))["access_token"]
result=req("https://"+d["AUTH0_DOMAIN"]+"/api/v2/users?per_page=1",{"Authorization":"Bearer "+token})
print(result.decode())
'
Return only requested account fields. Keep the fixed read-only endpoint and never expose .env values.
HSTACK_NATIVE_SKILL
chmod 600 "$t"
mv "$t" "$p/SKILL.md"
cksum < "$p/SKILL.md" > "$p/.hstack-managed"
chmod 600 "$p/.hstack-managed"
REMOTE
remote 'hermes -p default skills list --enabled-only | grep -F "hstack-auth0"' >/dev/null || { echo "FAIL: installed skill is not discoverable/enabled."; fail_transaction; }
This installs a real Hermes-discoverable native skill, with an executable read request and managed-file checksum. Existing user edits or unowned files are refused. The previous skill file and marker are recovered with the transaction.
echo "Native skills are discovered by Hermes; no separate MCP server or gateway restart is required for installation."
remote 'python3 -c '"'"'import sys, json, os, stat, urllib.request, urllib.error, urllib.parse, subprocess, base64
d={}
p=os.path.expanduser("~/.hermes/.env")
if os.path.islink(p) or not os.path.isfile(p) or stat.S_IMODE(os.stat(p).st_mode)!=0o600: raise RuntimeError("Private regular .env required")
if os.path.isfile(p):
for line in open(p):
k, sep, v=line.rstrip("\n").partition("=")
if sep:
v=v.strip()
if len(v)>1 and v[0]==v[-1] and v[0] in (chr(34),chr(39)): v=v[1:-1]
d[k]=v
class NoRedirect(urllib.request.HTTPRedirectHandler):
def redirect_request(self, req, fp, code, msg, headers, newurl):
raise RuntimeError("Redirect refused; credentials were not forwarded")
def req(url, headers=None, body=None):
if not url.startswith("https://"): raise RuntimeError("HTTPS required")
r=urllib.request.Request(url,headers=headers or {},data=body)
with urllib.request.build_opener(NoRedirect).open(r,timeout=30) as f:
if f.status != 200: raise RuntimeError("Non-200 response")
data=f.read(2 * 1024 * 1024 + 1)
if len(data)>2 * 1024 * 1024: raise RuntimeError("Response too large")
return data
token=json.loads(req("https://"+d["AUTH0_DOMAIN"]+"/oauth/token",{"Content-Type":"application/json"},json.dumps({"grant_type":"client_credentials","client_id":d["AUTH0_CLIENT_ID"],"client_secret":d["AUTH0_CLIENT_SECRET"],"audience":"https://"+d["AUTH0_DOMAIN"]+"/api/v2/"}).encode()))["access_token"]
req("https://"+d["AUTH0_DOMAIN"]+"/api/v2/users?per_page=1",{"Authorization":"Bearer "+token})
print("OK: authenticated read-only vendor probe")
'"'"'' >/dev/null 2>&1 || { echo "FAIL: persisted credentials failed the read-only probe."; fail_transaction; }
finish || { echo "FAIL: recovery point retained for inspection."; exit 1; }
echo "Read-only credential probe passed; validate one real Hermes chat turn before claiming live end-to-end compatibility."
For an active failed transaction run extra_restore && rollback. Recovery validates backup checksums before replacing files and preserves the active recovery point when restoration or readiness fails.
After a successful run, the previous bytes remain in ~/.hermes/.hstack-backup/integration-auth0.prev. For manual undo first inspect that backup, ensure no newer transaction or config writer exists, and move .prev back to the active name; then call the recovery command above. Do not delete a newer active backup.
| # | Symptom | Meaning | Action |
|---|---|---|---|
| 1 | Credential source | The read client uses an existing M2M application | Do not silently initialize a separate MCP keychain login |
| 2 | Tenant mismatch | The client secret must belong to the chosen tenant | Check AUTH0_DOMAIN before preflight |
| 3 | Audience | Management API tokens target the tenant api/v2 audience | Keep that exact audience |
| 4 | Scope | The user listing requires read:users | Do not grant write scopes for this read-only client |
| 5 | Token lifetime | Management access tokens expire | Mint a new token for each read request |
| 6 | Rollback scope | The installed skill is an owned local file | Restore its prior bytes along with private settings |
Official pinned Hermes source: v0.23.2, hermes_cli/subcommands/mcp.py, hermes_cli/mcp_catalog.py, hermes_cli/mcp_config.py, hermes_cli/subcommands/skills.py, gateway/run.py and tools/mcp_tool_config.py.
Local model tests and exact-parser checks prove procedure shape and recovery assumptions. They do not prove vendor auth, package availability, real service readiness or delivery through a chat platform. No live credentials or paid APIs were used during this migration.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub paarths-collab/hstack --plugin hstack97 skills in this plugin
/blueprint-installValidate a secret-free hstack blueprint and compose the approved Hermes skills in safe dependency order. Use when a user has exported an Agent Builder JSON plan or asks to install a SaaS Founder blueprint onto Hermes./blueprint-saas-founderCompose a safe, reviewable SaaS Founder agent blueprint from optional hstack capabilities, then hand it to the validated Hermes-only installer./hermes-backupBack up a self-hosted Hermes v0.23.2 agent over SSH with the native `hermes backup` (full zip or quick state snapshot), verify the archive, and restore it only behind an explicit gate. Use before risky changes; schedule recurring runs with /hermes-cron. Works from Claude Code, Codex, Cursor, Hermes itself, and Gemini CLI./hermes-cronCreate, verify and manage scheduled jobs on a self-hosted Hermes v0.23.2 over SSH: agent prompts, no-agent scripts, and opt-in native backup and session-prune jobs. Use when the user wants something to run on a schedule./hermes-deployDeploy a self-hosted Hermes Agent v0.23.2 with Telegram end-to-end over SSH, covering install, model, platform, skills, memory, personality, home channel, native gateway service and verification. Idempotent, dry-run-first and rollback-safe, and it works from any AI agent (Claude Code, Codex, Cursor, Gemini CLI, or Hermes itself)./hermes-fixDiagnose and repair a broken self-hosted Hermes v0.23.2 over SSH, starting from hermes doctor: gateway down or wedged, bot silent, model or tool errors, PATH, Docker UID, memory growth. Repairs are consent-gated, snapshot-backed and reload only through the native gateway lifecycle. Use when Hermes is broken. Works from any AI agent (Hermes, Claude Code, Codex, Cursor, Gemini CLI).Other plugins' skills for the same job