How to Vibe Code Your First App Without Leaking Your Keys

How do you vibe code your first app?
To vibe code your first app, describe a small app to an AI tool in plain words, let it write the code and test the result yourself. Work in five steps: pick a tool, describe the app, build and test it, fix by describing and save each working state, then keep keys and other people’s data safe before you share.
It suits a small app that only you use. The main risk is that code that works can still be unsafe, so keys (the passwords a program uses to call a service) stay out of the project, and nothing that stores other people’s data goes online until someone has read its code.
Vibe coding is building software by describing it to an AI and accepting the code it writes, judged by whether it works. It belongs to our agentic and autonomous coding theme, which covers AI that writes code for you.
For what vibe coding is and where it breaks, read what vibe coding is and where it breaks. This guide is the hands-on part.
You ask an AI for a web page that keeps your reading list, the articles you mean to read, with a way to tick them off. It works first time. Then you ask for one small change, an error appears and there is no earlier version to go back to. The steps prevent that moment.
What you need: a tool and an account
Two kinds of tool do the job. An AI coding agent reads your project’s files, edits them and runs commands to reach a goal you give it, in an editor or in a terminal (a text window where you type commands).
Many can also reach other tools through the Model Context Protocol; bigger jobs such as an AI code migration are not for a first app. Claude Code, Cursor, GitHub Copilot in agent mode and Devin Desktop (the former Windsurf) are agents.
An app builder does similar work in a browser tab, with nothing to install: Replit, Lovable, Bolt and v0 are app builders. If you have never used a terminal, start with an app builder.
It works until it does not: how first apps go wrong
Three failures are worth blocking in advance.
- It works until you change it. The agent edits your files directly, so a bad edit replaces the good version.
- A key lands in the wrong place. A key typed into a prompt (your message to the AI), a command or a file can end up in your project’s files, because the AI may copy it there. Put that project on a public site such as GitHub, or the key in a web page’s code, and anyone can read it.
- You cannot fix what you never read. When the AI’s fix fails, you face files you never opened.
The path: five steps
- Pick a tool and start with git, a tool that saves versions of your project.
- Describe the app in a short spec, a written description.
- Build and test it yourself. Use the app as its user would.
- Fix by describing, then save. Every saved working state has a way back.
- Keep it safe before you share. Keys and other people’s data stay private.
If you only wanted the picture, you can stop here. The steps below add commands, settings and checks.
Step 1: Pick a tool and start a project with git
Pick the kind first. An app builder saves versions for you and needs no setup. An agent runs on your computer, keeps the code in a folder you own and needs git. Choose one tool to start with; the last column shows what is free.
| Tool | Kind | Free way in |
|---|---|---|
| Claude Code | agent, terminal | no free plan; included in the paid Claude plans |
| Cursor | agent, own editor | free plan with limited use |
| Lovable, Bolt, v0 | app builders | a free plan each |
| Replit | app builder | no free plan listed on its pricing page |
Plan details as of November 2026.
The first line below downloads and runs Claude Code’s installer from claude.ai, on macOS, Linux and WSL (Linux inside Windows). The second checks it and prints a version number followed by (Claude Code).
curl -fsSL https://claude.ai/install.sh | bash
claude --version
Git is a tool that records the versions of your project that you save; a commit is one saved version with a note. Make an empty folder for the reading list, open a terminal in that folder and run git init; it turns the folder into a git project. App builders skip git.
Step 2: Describe the app in a short spec
A prompt is the message you type to the AI. A spec is a short written description of what the app must do and must not do. Write it first, then send it as your first prompt (the copy-paste prompt at the end is a ready-made one):
“One web page. I add a link with a title, see the list and tick items as read. The data stays in my browser. No logins, no server, no keys.”
The last sentence is the boundary of a first app. The AI cannot know it unless you write it down, and even then it is a request, not a lock.
Agents also read an instruction file in the project at the start of each session: CLAUDE.md in Claude Code (type /init in its chat to create one), AGENTS.md or .cursor/rules in Cursor.
Put your safety rules there; the copy-paste prompt at the end lists them. Anthropic says Claude reads the file as context, not as enforced settings.
Step 3: Build and test it yourself
Send the spec, then change one thing at a time, in one chat: ask, test, then ask again. With three changes at once, you cannot tell which broke the page.
To test, run the app. An app builder shows a live preview. With an agent, ask it to start the app and tell you the address, then open that address in your browser. Use the page as its user would: add a link, tick it, reload.
Tools can ask before they run a command; their permission mode (what they may do without asking) decides. Read each command before you approve it: you answer for it, and Claude Code’s docs note that in Manual mode an approved command can change any file you can, not only files in the project folder. Set the tool to ask:
- Claude Code: Manual mode asks before edits and commands. Versions 2.1.283 and later start in auto mode, which asks less; Anthropic says it does not guarantee safety. Run
claude --versionto see yours; Shift+Tab switches mode. - Cursor: commands need approval; Run Everything does not ask.
Do not pick Cursor’s Run Everything, or Claude Code’s bypass mode, on a project that holds anything real.
Step 4: Fix by describing what is wrong, then save
Now ask for the change: “Show the unread links first.” The page shows an error. Copy the error message into the chat after checking that it holds no key. Then say what you saw and what you expected: “When I tick a link, nothing changes” beats “fix the ticking”.
When the page works, save it. Run git status to list the changed files. If one holds a key, add its name to a file called .gitignore: git skips files listed there. Then run git add ., which picks changed files, and git commit -m "unread first", which saves them with a note. App builders save for you.
To go back after a bad change, use your tool’s own undo: Claude Code’s /rewind (or Esc twice), Cursor’s checkpoints (saved states), or a builder’s version history. Claude Code’s checkpoints can miss changes made by commands, so also ask the agent, in plain words, to restore the files to your last commit; Claude Code takes git requests that way.
This drops changes made since that commit.
Step 5: Keep it safe before you share it, and know when to stop
An API key is a secret string that lets a program use a service, such as an AI model, as you. Keep it out of three places: the prompt, the code and a “don’t ask again” approval.
The third needs an explanation. In November 2026 GitGuardian, a company that sells secret scanning, reported 31,088 secrets in Claude Code’s project settings file, settings.local.json, on public GitHub, collected since January 2025.
Its explanation: choosing “Yes, and don’t ask again” for a command that contains a key makes Claude Code save the whole command, key included, as a rule in a settings file, and some projects published that file. GitGuardian says such leaks have since fallen.
Use an environment variable instead, as GitGuardian advises: a named value kept outside the project, so commands and code carry only its name, such as $MY_API_KEY. It keeps the key out of the saved rule; it does not help if a command prints the value.
Set the value yourself, never in the chat: in your own terminal. Ask the AI how to do that on your system, without telling it the value, and have it read the key by name.
The AI sees the name. It can still see the value if it opens a file that holds it or runs a command that prints it; Claude Code can block reading a file with a deny rule such as Read(./.env), as a best effort, and Cursor with .cursorignore.
In an app builder, keys in browser-side code (code every visitor’s browser downloads) are visible to every visitor. Lovable says to treat them as compromised, store them as Secrets, its place for keys, and read them only in server-side code, which runs on a server, not in the browser.
A package is a ready-made library of code that your project downloads. When the AI adds one, search for its name on the public site that lists packages (npm for JavaScript, PyPI for Python) and check it exists: an AI can name a package that does not exist.
Deploy means putting the app on the internet, so finish these checks first. Your reading list has no login and holds nobody’s data. Once no key is in it, there is no key or personal data to expose.
Stop vibe coding, and have someone read the code, when you want to add a login or store other people’s data, or when the same error returns after two fixes. Two measurements show why a working app is not enough:
- A study revised in September 2026 gave coding agents real feature requests for existing open-source projects, chosen because people had once written them insecurely. In one setup with an older Claude model, 57% of the solutions worked, but only 11.8% were secure, so working does not mean secure.
- In June 2026 Symbiotic Security, which sells security tools, scanned 1,072 public apps, built with AI tools such as Lovable, Bolt and Windsurf, that use Supabase, a database service. 16% had a critical finding, meaning outsiders could read or change data. With no comparison group, this is no rate for all apps.
Mistakes that cost first-timers their keys and their work
| Mistake | Why it goes wrong | Fix |
|---|---|---|
| Choosing “Yes, and don’t ask again” on a command that holds a key | Claude Code saves the whole command, key included | Put only a variable name in commands; approve one command at a time |
| Publishing an app with logins or other people’s data | One mistake exposes strangers’ data | Have a person read the code first |
A habit worth keeping: ask what a change does before you accept it
Before you accept a change you do not understand, ask: “Explain what this change does in plain words, and what could go wrong.”
Copy-paste prompt: a starter spec for the reading-list app
Paste this as your first message. It carries the spec and the safety rules from the steps above.
I am building my first small web app with you. Work in small steps and explain what you do in plain words.
The app: one web page that keeps my reading list. I can add a link with a title, see the list and tick items off as read. The data stays in my browser. No logins, no server, no other people's data.
How to work:
- Show me a short plan first and wait for my OK.
- Make one change at a time and tell me how to test it.
- Before you run a command, tell me what it does.
- Ask me before you install any package, and tell me its name and what it is for.
- Never ask me to paste a key, password or token into this chat. If the app ever needs one, read it from an environment variable and tell me how to set it myself.
- Never write a key, password or token into a file, a command or a message. Keep files that hold secrets out of git.
- After each change that works, remind me to save a version.
- If I ask for logins or for storing other people's data, stop and tell me a person must read the code first.
Cheat sheet
The article on one page: open it full size, save it or share it.

AI-assisted content, human-reviewed. Images AI-generated. Editorial Standards · Our Editors