Zero-Code AI App BuilderZero-Code AI App Builder
Prompting & Planning

Guardrails

Keep the AI inside safe limits

AI is eager to help. Sometimes too eager. It may change things you didn't ask for, guess missing details, or make up facts. Guardrails keep it on track.

What are guardrails?

Think of the barriers at the side of a mountain road. You can still drive freely, but you can't fall off the edge. Guardrails in a prompt work the same way.

A guardrail is a rule that tells the AI what it must not do, or what to do when it's unsure. They matter most when AI is building your app, because one wrong change can break things.

  • Scope rules — what the AI may and may not touch.
  • Honesty rules — what to do when it doesn't know.
  • Safety rules — protecting secrets, data, and users.

Scope limits

When you ask an AI builder to fix one button, it might also "improve" your colors, rename files, and change your layout. Scope limits stop this.

Prompt
Change the "Add habit" button color to green.
Only change that button. Don't change any other files, styles, or text.

Other useful scope rules:

  • "Only edit the file HabitList.tsx."
  • "Don't add new libraries or packages."
  • "Don't delete anything. If something should be removed, tell me first."
  • "Keep the current design. Only fix the bug."

Ask before assuming

If your prompt is missing details, the AI fills the gaps with guesses. Often those guesses are wrong. Tell it to ask instead.

Prompt
I want to add a login page to my app.
Before you build anything, ask me any questions you need answered.
Don't assume details I haven't given you.

The AI might ask: "Email and password, or Google login? Should there be a 'forgot password' link?" Answering these up front saves you many rounds of fixes.

Saying "I don't know"

AI can hallucinate, which means it states something false with full confidence. You can lower this risk by giving it permission to be unsure.

Prompt
Using only the article I pasted below, list the 3 main findings.
If the article doesn't say something, write "Not in the article".
If you're not sure, say "I don't know" instead of guessing.

[paste article here]
"Only use the information I gave you" is one of the strongest guardrails. It keeps the AI from mixing in made-up facts.

Safety guardrails

When building apps, some rules protect you and your users. Add them to prompts and to your project notes.

Prompt
Rules for this project:
- Never put API keys or secret keys in frontend code. Use environment variables.
- Never commit .env or .env.local files.
- Don't delete user data without asking me first.
- Explain any change that affects login, payments, or the database before making it.
Guardrails help, but they are not a guarantee. AI can still make mistakes. Always check its work, especially for anything involving passwords, payments, or personal data.
FeaturePrevents
"Don't change other files"Surprise changes that break things
"Ask before assuming"Wrong guesses about what you want
"Say I don't know"Made-up facts
"Only use the text I gave you"Mixing in outside information
"Explain before changing"Changes you don't understand
Common guardrails and the problem each one prevents.

Common mistakes

No scope limit on a small fix

Prompt
// Wrong
Fix the spacing on my app.

// Right
Add more space between the habit cards on the home screen.
Don't change anything else.

Too many rules. Twenty rules in one prompt are hard to follow. Pick the three or four that matter most for this task. Put permanent rules in a notes file instead (you'll learn this in the next section).

Trusting without checking. Even with guardrails, read what changed and test it.

Practice

Try these exercises to lock in what you just learned.

Quiz
Not started
You ask an AI builder to change one button's color, and it also changes your fonts and layout. Which guardrail would have helped?
Quiz
Not started
You want a summary of an article with no made-up facts. Which rule helps most?
Quiz
Not started
Your prompt to add a login page leaves out many details. What guardrail should you add?

What's next?

Even with guardrails, things will sometimes break. Next, you'll learn how to report a bug to AI so it can find and fix the problem.