3 checks before your AI bot goes live on a server

Three checks with Claude Code prompts: only your chosen doors open, a tested backup, and an undo.

Three checks, one prompt each in Claude CodeDo them before the bot goes onto a server
  1. 1Knock on every door
    Run from your computer, like a stranger
    • /Open to allPASS
    • /adminAsks for passwordPASS
    • /dataAsks for passwordPASS
    failures: 0
  2. 2Run the backup once by hand
    Then find the file yourselfbackup file
    • The size is not zero
    • The date is today
    • It also runs every night
  3. 3Write down your undo
    One command, ready for 3 AMRUNBOOK.mdLast version that workedNew version breaks
Any empty box? Fix it first, then go live.
  1. Three checks before an AI bot goes onto a server, each with a prompt you paste into Claude Code.
  2. 1, knock on every door from outside: from your own computer, a script tries each address. In the example the home page is open, and /admin and /data ask for a password. Every line says PASS and the last line says failures: 0.
  3. 2, run the backup once by hand and find the file: the size is not zero, the date is today, and it also runs every night.
  4. 3, write down your undo: one command in RUNBOOK.md that goes from a new version that breaks back to the last version that worked.
  5. Any empty box means fix it first, then go live.
45 minLight terminal

You need

  • Claude Code
  • A bot, agent or small web app you plan to put on your own server
  • Your project folder

Putting a bot online is like opening a shop. You think the back door is locked, but strangers try every handle anyway.

These three checks take under an hour. Each has a prompt you paste into Claude Code. Do them before your bot goes onto a server, and run check 1 again after every change. None of this costs money.

Download the ZIP to get the three prompts and the one-page checklist, or copy them from this page.

01 / 07

Check 1: knock on every door from outside

Goal: a script you run from your own computer that tries your server the way a stranger would. Only the doors you chose should open.

Before you paste, fill in the four curly-brace parts: your server address, the public pages, the pages that must ask for a password, and how the password works. If you do not know your routes (page addresses), add this line to the prompt: "First, read my code and list every route you find, then show me the list and wait for my OK."

Run the finished script from your own computer, not from the server. A test from inside the server sees doors a stranger cannot.

Check 1: the lock test
Write me an outside-in lock test for my own server. It checks from the OUTSIDE, like a stranger with only the web address. My server address: {https://your-server.example.com, or localhost:3000 on your computer for a practice run} Doors that must be PUBLIC (should answer 200): {for example: /, /privacy, /terms} Doors that must ASK FOR A PASSWORD (should answer 401 or 403 with no password, and 200 with the password): {for example: /dashboard, /admin, /api/users, /api/cron/run} How the password works: {for example: browser pop-up login (HTTP Basic), or a header called x-api-key}. The script reads the password from an environment variable called LOCK_TEST_PASSWORD (and the username from LOCK_TEST_USER if it is Basic login). The password is never written inside the file. What the script must do: 1. For every public door: send a request with no password. PASS if it answers 200, FAIL otherwise. 2. For every locked door: send a request with NO password. PASS only if the answer is 401 or 403. Any 200, any redirect (3xx), or any 5xx is a FAIL. Then send it WITH the password. PASS if it answers 200 (this proves the door works for me, not just that it is shut). 3. Path tricks. For every locked door, also try: a double slash at the start (//admin), upper-case letters (/ADMIN), a trailing slash, a trailing dot, a dot-dot path from a public page (/privacy/../admin, sent as-is without cleaning), URL-encoded characters (%2e%2e and %2f), and the same door with ?x=1 added. PASS if the answer is 401, 403, 404, or 400. FAIL if it is 200. 4. Methods. For every locked door, also try POST, PUT and DELETE with no password. Same PASS rule as step 3. 5. Print one line per check in the form "PASS label status" or "FAIL label status", and one final line "failures: N". Exit with a non-zero code if N is more than 0. Hard rules for the script: - Print only the label, PASS or FAIL, and the status number. NEVER print the password, a header value, a token, or any part of a response body. - Do not put the password on a visible command line. Use the web client's own auth option or a temporary file. - Do not send anything that changes data: the POST, PUT and DELETE tests go with no password, so a correct server refuses them. If any of them gets a 2xx answer, report FAIL and tell me to check what it changed. - Do not follow redirects. A redirect is reported as its own status. - Use only the standard library or the web client already on the machine. Do not install anything globally. After you write it, tell me the exact command to run it. Then run it against the address above and show me the output.

What good looks like: every line says PASS and the last line says failures: 0. If a locked door says FAIL with 200, a stranger can get in. Fix the server, then run the script again.

A passing test means the doors you listed are shut. It does not find doors you forgot to list, which is why the prompt can list your routes first. The script must never print your password. If you see it printed anywhere, stop and change the password.

02 / 07

Check 2: run the backup once by hand

Goal: prove the backup works today, with your own eyes. A nightly backup you never tested is a guess. Run it once by hand, then find the file.

If you already have a backup script, use Prompt A.

Check 2, Prompt A: you have a backup
I want to prove my backup works. Do this in order and stop at the first problem. 1. Find my backup script. It is probably called {backup.sh, or write "search for it"}. Show me its path and tell me in plain words what it saves and where it puts the file. Do not change it. 2. Run it once, by hand, now. 3. Find the newest backup file. Show me its full path, its size in bytes and in a readable unit, and the date and time it was made. 4. Check that it is real: the size is not zero, the date is from the last few minutes, and (if it is an archive or compressed file) it lists or opens without errors. Do NOT restore it over anything. 5. Tell me PASS or FAIL for each of those checks on its own line. Do not print the contents of the backup or any secrets inside it. 6. Last, tell me how long old backups are kept, and whether anything schedules this script to run every night. Show the schedule line if there is one. If nothing schedules it, say so clearly.
957 characters

If you have no backup yet, use Prompt B.

Check 2, Prompt B: you have no backup
My project keeps its important data in {a database, a folder of files, or write "find out"}. I have no backup. Write me a simple backup script called backup.sh that: - saves everything important into one dated file, for example backups/backup-2026-10-13-0300.tar.gz - keeps only the newest 14 files and removes older ones, but only inside the backups folder - never prints passwords or file contents - prints one line when done: the file name and its size Then run it once by hand, find the file, and show me its path, size and date. Then show me the line I would add to schedule it every night, and wait for my OK before adding anything.
638 characters

What good looks like: you can point at one file and say "That is last night's backup, it is this big, and it opens." If you cannot, the backup is not done.

03 / 07

Check 3: write down your undo

Goal: one command that puts back the last version that worked, written down where you can find it. At 3 AM you will not want to work it out.

Check 3: the rollback runbook
I need a rollback plan written into a file called RUNBOOK.md in this project. Create it if it does not exist. If it exists, add a section called "Rollback" and leave the rest alone. Do this: 1. Work out how this project is deployed to my server. Tell me what you found in plain words. If you cannot tell, ask me. 2. Find where the "last version that worked" is recorded. If nothing records it, propose the smallest fix, for example a file on the server called DEPLOYED that holds the version id after each good deploy. Show me the change and wait for my OK before making it. 3. Write the Rollback section with: - Where to find the last good version id (the exact command or file). - The exact rollback command, written so I can copy it. Use a placeholder like <last-good-version> where the id goes. Put no passwords or keys in the file. - How to check it worked afterwards (one command or one page to open, and what I should see). - What the rollback does NOT undo (for example data already written to the database). 4. Do not run the rollback on my real server. Instead, show me how to rehearse it against a copy or a test folder, and run that rehearsal with me. 5. At the end, print the Rollback section so I can read it.
1,236 characters

What good looks like: every line in the Rollback section is a command or a one-sentence instruction, the command has a placeholder and not a real secret, and you have run the rehearsal once. An undo you have never tried is a guess too.

04 / 07

After every change

Knock on the doors again. The lock test is a script, so it takes seconds. When a new version has proved itself, update the "last good version" in your runbook.

05 / 07

The one-page checklist

Keep this open next to Claude Code. Tick each box. Any empty box means fix it first, then go live.

Before your bot goes live: the checklist
CHECKLIST.md
Check 1: knock on every door from outside
- [ ] I listed every page and address my server has.
- [ ] I marked each one: public, or must ask for a password.
- [ ] Claude wrote the lock-test script (`1-LOCK-TEST-PROMPT.md`).
- [ ] I ran it from my own computer, not from the server.
- [ ] Every line says PASS. Last line: `failures: 0`.
- [ ] The script never printed my password.

Check 2: run the backup by hand
- [ ] I ran the backup script myself, once, today (`2-BACKUP-PROMPT.md`).
- [ ] I found the file and wrote down its path.
- [ ] The size is not zero and the date is today.
- [ ] Something runs it every night, and I saw the schedule line.
- [ ] I know how many days of backups are kept.

Check 3: write down your undo
- [ ] RUNBOOK.md has a Rollback section (`3-ROLLBACK-PROMPT.md`).
- [ ] It has the exact command and where the last good version id lives.
- [ ] It says how to check the rollback worked.
- [ ] I rehearsed it once on a copy.

After every change
- [ ] Run the lock test again.
- [ ] Update the "last good version" once the new one proves itself.

Go or no-go
All boxes ticked: go live. Any box empty: fix it first. None of this costs money.

06 / 07

Test it safely

Practise on a throwaway server or your own computer first (the lock test accepts a localhost address).

  • The lock test sends POST, PUT and DELETE with no password. A correct server refuses them. If one gets a 2xx answer, check what it changed.
  • Never restore a backup over live data while testing.
  • Never run the rollback on your real server while rehearsing. Use a copy.
  • As of November 2026 the checks were tested on dummy servers and dummy data. Prompt B (no backup yet) and the rollback prompt were not run by a fresh Claude, so read their output before you trust it.

Common mistakes

  1. Testing from inside the server. Run the lock test from your own computer.

  2. Trusting a backup you never opened. Find the file, check the size and date.

  3. Keeping the undo in your head. Write it in the runbook.

  4. Forgetting to re-test. Run check 1 after every change.

  5. Listing only the doors you remember. Let Claude read your code and list every route.

Do I need to write code?

No. Claude writes the script and you read the results.

Does the lock test change anything on my server?

It sends requests with no password, so a correct server refuses them. If any request gets a 2xx answer, treat that as a failure and check what it changed.

What does a passing lock test prove?

That the doors you listed are shut and the ones that should open do open. It does not find doors you forgot to list.

How often should I repeat the checks?

Run the lock test after every change to the server. Re-run the backup and rollback checks after big changes.

Finish line

What to do next

  1. Run check 1 from your own computer.

  2. Run your backup by hand and find the file.

  3. Write the Rollback section and rehearse it on a copy.

For a related safety setup, see Claude Code hooks that block pushes, deletes and secrets and Run Claude Code overnight on a big task, safely. All the guides are on the guides hub.

You reached the end of the guide