How to give Antigravity house rules and safe permissions

Day 4, 25 minutes · beginner

Goal of this lessonWrite an AGENTS.md file with house rules, see the agent follow them, save a correction with /learn and pick a safe permission preset.

Why it matters

The Antigravity agent does not remember your last conversation. Every new conversation starts fresh, so the wishes you explained on Monday are gone on Tuesday. If you keep typing the same instructions ("no frameworks", "write dates like this"), you will forget one sooner or later, and the agent will do it its own way again.

Antigravity solves this with rules: a plain text file in your project that the agent reads at the start of every conversation. The second thing that should not depend on your memory is what the agent may do on your computer. That is set by a permission preset, and the default is a good one, as long as you know what it means and keep it.

Today you give the fix-it café site its house rules, see the agent follow them, save a correction as a new rule and check your permission preset. At the end the agent knows Marijke's wishes in every new conversation, and it works inside clear limits.

Rules: AGENTS.md

A rules file is a markdown file (plain text with a few marks, such as # for a heading and - for a list) with instructions that always apply. Antigravity reads a file called AGENTS.md or GEMINI.md in your project folder, and in its parent folders up to the root of the repository. Rules from all these files are added together.

Good rules are short and checkable: "All styling goes in style.css" is a rule, "Make it look good" is not. Antigravity's docs make a split worth knowing: a rule is a limit that always holds, a skill is a procedure with several steps that the agent loads only when it needs it. This lesson is about rules. Skills, including how Antigravity finds them, are the subject of the course One skill, every agent. If you know CLAUDE.md from Claude Code 101, AGENTS.md is the same idea.

Two more ways to save rules:

  • /learn looks at a correction you made in the conversation and proposes a rule (or a skill). It never writes straight away: it first shows a proposal, and saves only after you approve it.
  • Global rules in your home folder apply to every project on your computer. Keep this course's rules in the project.

Permissions: the preset

A permission preset decides what the agent may do without asking you. On a personal account the App has four:

  • Request Review: every terminal command needs your approval.
  • Default: commands run without asking, but only inside a sandbox: a fenced-off space that can only write in your project folder and temporary folders, with no internet. Anything outside the sandbox needs your approval. This is the preset Antigravity picks for you.
  • Auto: like Default, but Antigravity itself decides which commands outside the sandbox are safe. Risky or irreversible ones still ask.
  • Turbo: everything runs without asking, with full access to your computer. Not for this course.

On Windows the sandbox needs Windows 11 24H2 or later with the August 2026 update. Without a working sandbox, Antigravity falls back to Request Review. That is fine: you just approve more often.

You can also add your own allow, ask and deny rules on top of the preset under Settings, General, Global Permissions. A deny rule always wins. You do not need them for this course.

The steps

  1. Create AGENTS.md in the project folder with the house rules. You can let the agent write it with the exact text from the guide, or make it yourself in a text editor.
  2. Check that Antigravity sees it under Customizations in the left sidebar.
  3. Start a new conversation and test one rule with a request that breaks it.
  4. Check your permission preset in the message box.
  5. Turn a correction into a rule with /learn, read the proposal and approve it.
  6. Review and commit the rule file, as in lesson 3.

Follow the guide for Google Antigravity below.

Example: Marijke's rules at work

Marijke asked for a Google font on the headings. The agent answered that AGENTS.md says not to load fonts from other websites, and offered a system font instead. She took it. Later the agent wrote "9 Jan" on the home page. She corrected it and ran /learn with the date format. The proposal said it would add one line to AGENTS.md. She approved it and committed the file.

Common mistakes

  • A rule nobody can check. "Be careful" does nothing. "Never remove a session date without asking me first" does.
  • Testing in the old conversation. Start a new one, so you know the agent got the rules from the file and not from the chat.
  • Choosing Turbo to stop the questions. The questions are the safety net. If one command keeps asking, approve that one command, not everything.
  • Rules in a subfolder. Antigravity does not load rules from folders below the project folder. Keep AGENTS.md at the top.

Deeper dive

Today's actions

Ticks are not saved without an account

Do it in Google Antigravity

Google Antigravity

  1. Start a new conversation in the brambleford-fixit-cafe project and paste this task. The agent creates the rules file in the project folder.
    Create a file AGENTS.md in the root of this folder with exactly this text, and change nothing else:
    
    # House rules for the Brambleford Fix-It Café site
    
    - Plain HTML and CSS only. No frameworks, no build tools and no JavaScript unless I ask for it.
    - All styling goes in style.css.
    - Write for visitors in plain English: short sentences, no jargon.
    - Every page has the same menu with links to all pages.
    - Never remove a session date without asking me first.
    - Do not load fonts, images or scripts from other websites.
    - After a change, list the files you changed and what I should check.
  2. Click Customizations in the left sidebar and open the Installed tab. Expand Skills & Rules, filter the list to Rules and check that AGENTS.md is there. If it is not, open Settings, select the project under Projects and scroll to Customizations.
  3. Start a new conversation, so the agent starts with the rules, and test one rule with this request.
    Make the headings look nicer with a font from Google Fonts.
  4. Read the answer. The agent should point to the rule about other websites and ask you, or offer a font that is already on the computer. If it just adds the font, tell it to undo that and to follow AGENTS.md.
  5. Open the permissions picker in the message box. Check that Default is selected. If Default is not offered, choose Request Review. Do not choose Turbo for this course.
  6. Correct the agent on something small, for example the way dates are written. Then type this and press Enter.
    /learn always write session dates as Saturday 9 January 2027 in this project
  7. The agent writes a proposal (learning_proposal.md) that says where it wants to save the rule. Read it. If it is right, tell it to apply the proposal.
  8. Open Review in the Overview panel, check the new or changed rule file (AGENTS.md, or a file in .agents/rules) and commit it.

Note: Rules in AGENTS.md are always on in this folder. The Default preset runs terminal commands in a sandbox: only the project folder and temporary folders, no network. On Windows the sandbox needs Windows 11 24H2 or later with the August 2026 update. Without a sandbox, Antigravity uses Request Review.

Checked on 4 December 2026 · Source: Antigravity docs: Rules (opens in a new tab)

Create a free account to save your progress. Sign in or sign up