Skip to main content
Episode 3 of 24Prepare40 min

Install your AI agent and give it safe permissions

Install Claude Code or Codex, sign in, open an empty project folder and write the rules and deny list that keep secrets safe.

You will have: An AI agent running inside your project folder with a written rules file, an allow-list, and a deny list that blocks secret files.

Before you start

  • Finish Episode 2 so Node.js, Git and your code editor (VS Code, Cursor or similar) are installed
  • Have a paid Claude plan (for Claude Code) or a ChatGPT plan (for Codex). Verify what your plan includes on the provider's page
  • Create an empty folder for the store, for example a folder named after your store inside your Documents or Projects folder, and put PROJECT_PLAN.md in it
  • Open your code editor and use File > Open Folder to open that empty folder

Make it yours

Change the example (fashion store) to your own. Your answers are saved in this browser and used in every episode.

Other series keywords (5)

Your prompt

Paste into: Two steps. First paste into a normal AI chat to get the install steps (Part 1). When the agent is running in your project folder, paste the same prompt into the agent so it writes the rules and deny list (Part 2).
You are helping me set up Claude Code on my macOS computer so it can safely build my fashion e-commerce store, "Thread & Needle". I am a non-programmer. Explain every technical word briefly.

Decide which part applies:
- If you are a normal chat that cannot run commands on my computer, do PART 1 only, then tell me to paste this same prompt into the agent once it is running in my project folder.
- If you are Claude Code running in my project folder, do PART 2 only.

PART 1: install and sign in (one step at a time, wait for my "done")
1. Tell me to open the official documentation for Claude Code myself and give the install command for macOS from it. Do not guess flags or commands; if you are not sure, say so and tell me which official page to check.
2. Help me verify the install by printing its version, then sign in with my own account in the browser. Never ask me to paste a key or password into any chat.
3. Show me how to open a terminal inside VS Code at my project folder, start the agent there, and ask it a harmless question to confirm it works.
4. Explain the permission modes in plain words: asking before each action, auto-accepting file edits, plan mode, and the "skip all permission checks" modes. Be honest: giving the agent full permission means freedom inside this project folder under written rules, NOT unrestricted control of my computer. Skip-permission flags or modes are only for a disposable sandbox such as a virtual machine, never for my real computer.

PART 2: write the rules and the deny list
First check the official docs for Claude Code for the exact file names and setting keys, and tell me what you verified. Show me your plan and wait for my OK before changing anything. Then:
1. Create AGENTS.md at the project root with the project rules: the stack (Next.js, TypeScript, Tailwind, PostgreSQL with Drizzle, Zod), work in small steps, ask before installing anything new, explain changes in plain language, run lint and tests before committing, never print, log or commit secrets, keep secrets only in .env.local, keep .env.example with names only, and read PROJECT_PLAN.md first. If Claude Code is Claude Code, also create CLAUDE.md that imports AGENTS.md so both files stay in sync.
2. Write the project permission settings: an allow-list of safe everyday commands (reading files, status and diff in git, running lint, test and build, committing) and a deny list that blocks reading or editing .env, .env.local and other .env variants (but not .env.example), any secrets folder, private key files, force-pushing, deleting folders recursively, and running commands as administrator. Disable any mode that skips permission checks if the settings allow it.
3. If the tool has a sandbox for commands that works on macOS, turn it on. If it does not, tell me plainly what that means.
4. Test the rules: create a harmless fake file called .env containing the single line FAKE_TEST_VALUE=not-a-secret, try to read it, show me that it was blocked, then delete the fake file.

Security rules: never read, print or commit real secrets; never use a skip-permissions mode on my real computer; ask me before anything outside this folder.

Report back in this format:
1. Done: what was installed or written, and which official pages you verified
2. Check: what I should look at (the rules file, the settings file, the blocked test)
3. My decisions: anything unclear or limits of this tool I should know about

Review the prompt, then copy it. Never paste real passwords or API keys into a chat.

How to check it worked

  • Typing the agent's version command in your editor's terminal prints a version number
  • The agent starts in your project folder and answers a simple question
  • Your project folder now holds AGENTS.md (and CLAUDE.md for Claude Code) and a settings file with allow and deny lists
  • The agent refused to read the fake .env file, and you saw the refusal message
  • You can say in your own words why skip-permission modes are only for a disposable sandbox

Sample result

Example: fashion store

Example result for Claude Code on the fashion store. Codex users get its own settings file instead.

If something goes wrong

The agent command is not found after installing.
Open a brand-new terminal window and try again. If it still fails, ask the guide to check the official troubleshooting page for your system. On Windows, the install steps differ between PowerShell and the plain command prompt, so say which one you used.
Sign-in fails or the agent says your plan does not include it.
The free chat plans may not include the agent. Check your plan on the provider's page, or sign in with a plan or API account that does. Never paste a key into a chat to fix this.
The fake .env file was NOT blocked.
Do not continue. Ask the agent to show the exact deny rule it wrote and check it against the official settings page. Rules are matched by file path, so a typo or wrong folder breaks them. Repeat the test until it is blocked.
The agent keeps asking permission for every small action.
That is the safe default. Add only specific commands to the allow-list (for example the lint and test commands), one at a time, rather than switching to a mode that skips checks.

The agent needs a paid plan or API account with Anthropic (Claude Code) or OpenAI (Codex); a free chat plan may not include it. Limits and prices change, so verify on the provider's pricing page.

More in Prepare

This is part of the series Build a secure, no-cost e-commerce website with AI agents. See all 24 episodes, the tools used and answers to common questions on the series page.

We use optional cookies for analytics and referral tracking. Learn more about our privacy policy