Repository navigation
✨ [feat] install: guard hooks and permissions for Antigravity (agy) - #82
Draft
danielegaleazzi92 wants to merge 4 commits into
Draft
danielegaleazzi92 wants to merge 4 commits into
danielegaleazzi92 wants to merge 4 commits into
Conversation
…g host - super-board-host.sh answers agy on ANTIGRAVITY_AGENT=1 (observed on agy 1.4.6), after the Codex ids and OPENCODE, before CLAUDECODE; SUPER_BOARD_HOST and config host take agy - setup check accepts host agy; schema, onboard and run-workflow name it (no lane backend yet: the run halts like opencode) - docs/hosts.md: agy row, detection step and env evidence; tests for the sign, the override, the config key and the empty/id-only cases Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…vity (--hosts agy) - hooks/agy-hook-adapter.py translates Antigravity PreToolUse payloads, runs the unchanged guard-*.py and answers deny/ask/allow; hooks/agy-hooks.json wires it - install.sh --hosts agy: entry merged into .agents/hooks.json (other entries kept, --protect-push with --protect-main and kept on re-install, python on Windows), host detected from config/host.sh/an existing entry, no link folder, adapter not counted as a guard - scripts/super-board-agy-permissions.py writes the lane profile (command/read_file/write_file * + deny rules for dangerous forms and secret paths) or --from-allowlist regex rules; dry run, --apply with backup - tests: test-agy-hook-adapter.sh, test-agy-permissions.sh, test-install.sh scenario 25; CLAUDE.md install contract Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- the agy install line names it, the SCRIPTS list did not carry it Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
danielegaleazzi92
force-pushed
the
feat/agy-install
branch
from
October 23, 2026 17:19
a2a1d3e to
573427d
Compare
This was referenced Oct 23, 2026
…ithout one - agy 1.4.6 rewrites its settings.json with a UTF-8 BOM and then loads permissions=<nil>: every lane tool call denied until the file is rewritten; --apply now strips it (test 7) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
danielegaleazzi92
force-pushed
the
feat/agy-install
branch
from
October 23, 2026 20:28
36b5a52 to
168025c
Compare
6 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
⏳ Draft · slice 2 of #80 (Antigravity host) · stacked on #81: merge it first, the diff shows both until then
Problem
install.sh,.agents/hooks.json,~/.gemini/antigravity-cli/settings.jsonagy).agents/skills/since ♻️ [refactor] install: shared .agents/ folder with per-host links #71) but no guard hook runs:cat .envor a worktree next to the repo go throughagy -pcannot ask and the board has written no permission rulesettings.json,Bash(...)rules); Antigravity has its own dialect and nothing speaks itSolution
hooks/agy-hook-adapter.py: translates an AntigravityPreToolUsepayload (toolCall.name,toolCall.args.CommandLine/ path keys,workspacePaths) into Claude's{tool_name, tool_input}, runs the guardssettings-snippet.jsonwould run for that tool, and answers{decision, reason}. The guards stay the single copy of every rule; no objection answersaskfor commands andallowfor workspace files, so Antigravity's own permission check still runshooks/agy-hooks.json: thesuper-board-guardsentry (run_command, the file tools) runninghooks/agy-hook-adapter.pyrelative to.agents/, which is the cwd Antigravity gives its hooksinstall.sh --hosts agy: no folder of links (Antigravity reads.agents/itself); merges the entry into.agents/hooks.jsonkeeping other entries, adds--protect-pushwith--protect-mainand keeps it on a later install, writespythoninstead ofpython3on Windows (hooks run undercmd /c, wherepython3is a Store alias), detects the host from a confighostkey,super-board-host.shor an existing entry, and names the permissions step. The adapter is not counted as a guardscripts/super-board-agy-permissions.py: reads the agy settings BOM-tolerant and rewrites them without one (agy 1.4.6 writes a BOM into its own file and then loadspermissions=<nil>: every tool denied); writes the rules a headless lane needs into the agy settings file: by defaultcommand(*),read_file(*),write_file(*)plus deny rules for the dangerous forms (force pushes,gh repo delete,gh auth,rm -rf /,--dangerously-skip-permissions) and the secret paths (.env,~/.ssh,~/.gemini,~/.gitconfig*,~/.aws,~/.config/gh);--from-allowlistconverts the board's Claude allowlist tocommand(regex:(?s)<prefix>(\s.*)?)rules instead;--add, dry run by default,--applywith a backup, invalid JSON left untouchedinstall.shheader,CLAUDE.mdinstallation contract, the scripts' docstrings.docs/hosts.mdis ✨ [feat] host: detect Google Antigravity (agy) as a host #81'sAcceptance criteria
cat .env,rm -rf /, a worktree outside.claude/worktrees/, a key literal in a write are denied through the adapter;git statusand a workspace write pass; the push guard only with--protect-push↳ verified:
tests/test-agy-hook-adapter.sh(21 checks), and live on agy 1.4.6:git worktree add ../elsewhereansweredBLOCKED: tool call denied by pre-tool hook: Blocked: worktree path "../elsewhere" resolves to … outside …\.claude\worktrees/, no worktree createdinstall.sh --hosts agy --protect-mainwrites the entry with--protect-push, keepsmy-hook, creates no.agy/, counts 6 guard hooks; a plain re-install keeps the push guard; a confighost: "agy"wires it; a plain install writes nohooks.json↳ verified:
tests/test-install.shscenario 25 (run on its own on Windows: the suite's symlink scenarios cannot run there)Bash(gh pr view:*)to a regex rule with--from-allowlist, refuses a malformed--add(64) and an invalid file (2)↳ verified:
tests/test-agy-permissions.sh(6 scenarios)install.sh --hosts agy --protect-main), agy 1.4.6 /gemini-3.8-flashon Windows 11, 2026-10-23: card feat: dynamic-workflow worker backend (worker_backend: "workflow") #3 of the playground went Ready → Done, ✨ [feat] cart: clearCart empties the cart and drops its discount danielegaleazzi92/super-board-agy-playground#4 (squashcc1b8ef), Build 8.5 min, QA + Review 19 min, every lane returning a valid structured result. The one lane that failed in between was denied on its first command because agy had rewritten its own settings file with a UTF-8 BOM and loaded no permissions from it; the helper now strips it (✨ [feat] install: guard hooks and permissions for Antigravity (agy) #82).command(*)+ deny rules and not a prefix allowlist: on agy 1.4.6 / Windows the rules match exactly, and a lane improvised a;-chain, a multi-linepython -c, a here-string and amktempwrite in four successive runs, each auto-denied; with this profile and the hooks a card went Ready → Done (✨ [feat] host: run the board on Google Antigravity (agy) #80, evidence link)Iteration history
Risk
🟡 Medium · security plumbing, additive.
.agents/hooks.jsonentries written by it stay inert (the adapter file is gone, the hook fails closed: remove the entry too)--hosts agy(new behaviour) ·install.shhost parsing and the hook count for every host (covered by the existing suite) · the agy settings file only when the user runs the helper with--applyPart of #80 (slice 2 of 4), stacked on #81.
🤖 Generated with Claude Code