← Back to library

Harden a home AI agent before you start relying on it

Product leader Aman Khan's second OpenClaw post argues installation is about 20% of the work. He shares one prompt for a coding agent that installs, hardens and adds a crash watchdog, warns never to expose the machine publicly with Tailscale Funnel, sets identity files, suggests a gentle first week and reports $10 to $15 daily model costs.

  • OutcomeSet up a self-hosted messaging agent so it cannot leak keys or answer strangers, recovers from crashes, and understands your context from the first conversation.
  • SetupAn afternoon+
  • LevelIntermediate
  • CreditAman Khan
View original
Works with
OpenClawClaude Code

Published Oct 23, 2026Updated Oct 23, 2026AI dry run on sample input: passed Oct 23, 2026Source verified Oct 23, 2026

When should you use it?

  • You run a personal agent on your own hardware
  • It is reachable through a messaging app
  • You plan to connect personal notes or accounts

Not for: People who want a managed service; Machines shared with others

What do you need, and what do you get?

You need

  • A dedicated computer
  • A private network such as Tailscale
  • A coding agent to run the setup prompt

You get

  • A hardened install with crash recovery
  • Identity and behavior files for the agent
  • A cost and model plan

How does it work, step by step?

  1. Secure firstSpend the first quarter hour on hardening before any fun tasks.
  2. Stay privateUse private serving on your tailnet and never the public tunnel option.
  3. Write identity filesDescribe the agent's persona, your context and rules so it refuses tricks from others.
  4. Ease inUse the first week for simple conversations to learn the interaction style.
  5. Plan for driftExpect frequent updates and occasional messaging disconnects; know the quick fix.

The prompt

Our own prompt, inspired by Aman Khan and written to work in OpenClaw and Claude Code. Values in lime are placeholders.

Prompt0 variables
You are setting up my personal agent on this machine. Install it, then harden it: no public exposure, private network only, secrets outside readable workspace files, and a watchdog that restarts it after a crash. Create identity files describing who I am and rules for strangers, including never revealing keys or personal details. Show me each change before applying it.

Inspired by Aman Khan: How to Make Your OpenClaw Agent Useful and Secure. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.

What can go wrong?

  • The messaging link drops every few days in his experience; a silent agent is often just disconnected.
  • Top-tier models cost far more; a cheaper model handles most daily chores.

Our take

Aman Khan's second OpenClaw post does the boring work first, which most self-hosting guides skip. Installation is only about a fifth of the job; hardening, a crash watchdog and clear identity files are what make week one safe. The warning never to expose the machine publicly with a Tailscale Funnel-style tunnel is the single most important line for anyone using remote access tools. Before connecting notes or email, write down what the agent must never share, then try to trick it yourself and see whether it complies. Keep API keys in a secrets store, not in files the agent can read aloud in chat. Ease into the first week with low-stakes chores and a spend cap, since he reports daily model costs in the low tens of dollars. Plan for drift: revisit firewall rules, open ports and connected accounts monthly. Prefer Tailscale or similar private networking over any public URL. Document how to recover when the watchdog restarts the process.

Where the time goes back: Doing security and identity up front avoids the costly mistakes that come from a powerful agent left wide open.

FAQ

What did it cost him?
He puts typical spend in the low teens of dollars per day, higher on heavy workload days.
Should it join group chats?
He expects others to attempt manipulation, so the persona rules must cover secrets.

Source and credit

Inspired by Aman Khan. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.

Inspired by
How to Make Your OpenClaw Agent Useful and Secure
Creator
Aman Khan
Published on
amankhan1.substack.com (Substack)
Original date
Feb 17, 2026
License
Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
Originally for
OpenClaw
AI dry run
Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in Privacy & Security

All 22 Privacy & Security playbooks →

Related playbooks

Privacy & SecurityRoutine✓ AI dry run

Approve a daily memory diff from your personal agent

Keep a personal agent's long-term memory accurate by reviewing a short daily list of proposed additions and edits before they are saved.

Credit: PrincessEe on Hacker News

An afternoon+
Privacy & SecurityPrompt✓ AI dry run

Declutter a Fire TV Stick with a coding agent, safely

Let a terminal coding agent connect to your Fire TV Stick over ADB on your home network, back up its state, switch off Amazon's ad and tracking options, disable unwanted apps a few at a time with your approval, and leave you a tested restore script.

Credit: u/Mean-Kaleidoscope873 on r/ClaudeCode

Under an hour
Privacy & SecurityWorkflow✓ AI dry run

Dictate new skills from your phone for small house chores

From your phone, have an assistant write small skills for local chores, run a daily brief, and fix its memory when it picks wrong.

Credit: Thomas Millar (@thmsmlr)

Under an hour
Privacy & SecurityRoutine✓ AI dry run

Forward vendor spam to an agent that unsubscribes

Clear trade-show and vendor mailing lists without opening each email, and without giving an agent your personal mailbox.

Credit: Vivek V.

Under an hour
Privacy & SecurityWorkflow✓ AI dry run

Let a coding agent instrument an old PC game you own

Have a coding agent get a classic game running, run it headless, map its memory and scripts, and build helper tools so you can check its work.

Credit: TeMPOraL on Hacker News

An afternoon+