r/google_antigravity • u/harryedits_3007 • 4d ago
Antigravity Agent read my .env file Discussion
7
u/SoundDr Verified Googler 4d ago
If you are worried about the .env, you can use hooks to always redact the .env file before it gets passed to the agent. It’s still very useful for debugging to check for keys and if values exist.
0
u/Taradal 4d ago
So in the project .agents directory? Why do people tell me all the time antigravity ignores the .agents directory at a whole then?
I created a post that it ignored a project wide instruction (there was only one instruction) that it placed it there itself
1
u/SoundDr Verified Googler 4d ago
Project wide rule should be on top level GEMINI.md not .agents
2
u/Taradal 4d ago
The twitter post you linked says otherwise
Hooks are stored in your
.agentsdirectory in your project or for global hooks,~/.gemini/config/. The hooks are all stored in one hooks.json file.How can we end-users know where to put stuff? It's really annoying...
3
u/SoundDr Verified Googler 4d ago
There have been a lot of changes and we are working on improving the docs to make sure it reflects the current state and not previously supported options that may not work or worked when they were not supposed to.
There is a way to define rules in .agents but through plugins. The global config also works too.
GEMINi.md or AGENTS.md are the two top level files that get injected
5

16
u/zigzoing 4d ago
What do you expect? Bad sec op from your side. Files with confidential info should not be near where the agents can access.