Host security hardening and risk-tolerance configuration for HanzoBot deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, HanzoBot cron scheduling for periodic checks, or version status checks on a machine running HanzoBot (laptop, workstation, Pi, VPS).
Assess and harden the host running HanzoBot, then align it to a user-defined risk tolerance without breaking access. Use HanzoBot security tooling as a first-class signal, but treat OS hardening as a separate, explicit set of steps.
Before starting, check the current model. If it is below state-of-the-art (e.g., Opus 4.5, GPT 5.2+), recommend switching. Do not block execution.
Try to infer 1–5 from the environment before asking. Prefer simple, non-technical questions if you need confirmation.
Determine (in order):
Note: these are not blocking items, but are highly recommended, especially if HanzoBot can access sensitive data.
First ask once for permission to run read-only checks. If granted, run them by default and only ask questions for items you cannot infer or verify. Do not ask for information already visible in runtime or command output. Keep the permission ask as a single sentence, and list follow-up info needed as an unordered list (not numbered) unless you are presenting selectable choices.
If you must ask, use non-technical prompts:
Examples:
Only ask for the risk profile after system context is known.
If the user grants read-only permission, run the OS-appropriate checks by default. If not, offer them (numbered). Examples:
uname -a, sw_vers, cat /etc/os-release.ss -ltnup (or ss -ltnp if -u unsupported).lsof -nP -iTCP -sTCP:LISTEN.ufw status, firewall-cmd --state, nft list ruleset (pick what is installed)./usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate and pfctl -s info.tmutil status (if Time Machine is used).As part of the default read-only checks, run hanzo-bot security audit --deep. Only offer alternatives if the user requests them:
hanzo-bot security audit (faster, non-probing)hanzo-bot security audit --json (structured output)Offer to apply HanzoBot safe defaults (numbered):
hanzo-bot security audit --fixBe explicit that --fix only tightens HanzoBot defaults and file permissions. It does not change host firewall, SSH, or OS update policies.
If browser control is enabled, recommend that 2FA be enabled on all important accounts, with hardware keys preferred and SMS not sufficient.
As part of the default read-only checks, run hanzo-bot update status.
Report the current channel and whether an update is available.
Ask the user to pick or confirm a risk posture and any required open services/ports (numbered choices below). Do not pigeonhole into fixed profiles; if the user prefers, capture requirements instead of choosing a profile. Offer suggested profiles as optional defaults (numbered). Note that most users pick Home/Workstation Balanced:
Provide a plan that includes:
Always show the plan before any changes.
Offer one of these choices (numbered so users can reply with a single digit):
For each step:
Re-check:
Deliver a final posture report and note any deferred items.
Require explicit approval for:
If unsure, ask.
After HanzoBot install or first hardening pass, run at least one baseline audit and version check:
hanzo-bot security audithanzo-bot security audit --deephanzo-bot update statusOngoing monitoring is recommended. Use the HanzoBot cron tool/CLI to schedule periodic audits (Gateway scheduler). Do not create scheduled tasks without explicit approval. Store outputs in a user-approved location and avoid secrets in logs. When scheduling headless cron runs, include a note in the output that instructs the user to call healthcheck so issues can be fixed.
After any audit or hardening pass, explicitly offer scheduling and require a direct response. Use a short prompt like (numbered):
hanzo-bot cron add?”If the user says yes, ask for:
hanzo-bot update statusUse a stable cron job name so updates are deterministic. Prefer exact names:
healthcheck:security-audithealthcheck:update-statusBefore creating, hanzo-bot cron list and match on exact name. If found, hanzo-bot cron edit <id> .... If not found, hanzo-bot cron add --name <name> ....
Also offer a periodic version check so the user can decide when to update (numbered):
hanzo-bot update status (preferred for source checkouts and channels)npm view hanzo-bot version (published npm version)Use only supported commands and flags:
hanzo-bot security audit [--deep] [--fix] [--json]hanzo-bot status / hanzo-bot status --deephanzo-bot health --jsonhanzo-bot update statushanzo-bot cron add|list|runs|runDo not invent CLI flags or imply HanzoBot enforces host firewall/SSH policies.
Record:
Redact secrets. Never log tokens or full credential contents.
Only write to memory files when the user explicitly opts in and the session is a private/local workspace (per docs/reference/templates/AGENTS.md). Otherwise provide a redacted, paste-ready summary the user can decide to save elsewhere.
Follow the durable-memory prompt format used by HanzoBot compaction:
memory/YYYY-MM-DD.md.After each audit/hardening run, if opted-in, append a short, dated summary to memory/YYYY-MM-DD.md (what was checked, key findings, actions taken, any scheduled cron jobs, key decisions, and all commands executed). Append-only: never overwrite existing entries. Redact sensitive host details (usernames, hostnames, IPs, serials, service names, tokens). If there are durable preferences or decisions (risk posture, allowed ports, update policy), also update MEMORY.md (long-term memory is optional and only used in private sessions).
If the session cannot write to the workspace, ask for permission or provide exact entries the user can paste into the memory files.