Tutorial 52 — Antigravity CLI governance installer¶
Package:
@microsoft/agent-governance-antigravity-cli· Time: 15 minutes · Prerequisites: Node.js 22+, Antigravity CLI
This tutorial shows how to install the AGT Antigravity CLI governance package, confirm the extension is active, and exercise the built-in status and text-check flows.
What you'll do¶
- install the production Antigravity CLI governance package
- confirm the local extension is loaded
- run AGT status and arbitrary-text checks
- validate that risky shell actions are denied before execution
Install the package¶
If you want to preserve an existing user policy, run the install without --force-policy. If you want to reset to the packaged baseline, add:
To refresh an existing AGT-managed install after pulling a newer package build:
Restart Antigravity CLI¶
Antigravity CLI loads extension manifests, hooks, MCP servers, and custom commands on startup. After installing or updating the package, restart Antigravity CLI.
Use /hooks panel or /hooks enable-all inside Antigravity CLI if you need to confirm hook state.
Confirm the extension is active¶
In a fresh Antigravity CLI session, run:
At this point /agt:status should report:
- the active policy source
- the prompt-defense grade and coverage
- the audit path and audit-chain health
- whether the bundled policy or configured policy had any load errors
Run the built-in example flow¶
First, run the text checker:
That should return findings for prompt poisoning and secret-access cues.
Next, ask Antigravity CLI to run a clearly unsafe shell command such as a cloud metadata fetch. For example:
The AGT BeforeTool hook should deny the tool invocation before execution.
Example install from source¶
When developing from the repo, you can also use the local package directly:
Troubleshooting¶
/agt:status is not available¶
Check:
- the extension exists under
~/.antigravity/extensions/agt-global-policy - you restarted Antigravity CLI after install
/hooks panelshows the AGT hooks enabled for the current Antigravity session
agt-antigravity doctor¶
Run:
Doctor validates:
- extension installation state
- AGT install manifest presence
antigravity-extension.json, hook config, context file, and bundled MCP server presence- vendored runtime dependencies
- user policy parseability and supported schema version
- installed extension version versus the package version you are running
- the user settings file path, if one is present and parseable
If doctor reports an invalid policy, remove ~/.antigravity/agt/policy.json or set AGT_ANTIGRAVITY_POLICY_PATH to a valid replacement before restarting Antigravity CLI.
Try an example policy profile¶
The package ships ready-to-apply policy profiles:
agt-antigravity policy apply --profile strict
agt-antigravity policy apply --profile balanced
agt-antigravity policy apply --profile advisory
Then restart Antigravity CLI and inspect the result with /agt:status.
After agt-antigravity uninstall or agt-antigravity uninstall --remove-policy, restart Antigravity CLI so the removed extension, hooks, and custom commands are fully unloaded.
Node is missing¶
This package requires a working Node runtime. If node --version fails, install Node.js LTS and retry the package install.
Next steps¶
- customize
~/.antigravity/agt/policy.jsonfor your team baseline - re-run the example flow in
advisorymode - inspect the audit log at
~/.antigravity/agt/audit-log.json