Show HN: Applygate, stop coding agents from running Terraform destroy in prod Flurit released applygate, a pre-1.0 hook for macOS and Linux that intercepts commands from AI coding agents such as Claude Code and Codex and returns allow, ask or block before execution, covering Terraform, OpenTofu, Terragrunt and the aws, gcloud, az, kubectl and helm CLIs. The tool judges each command by the environment it targets — protected, standard or disposable — blocking `terraform destroy`, `apply -auto-approve`, state changes and cloud delete commands in protected environments, and it starts in observe mode that logs would-be blocks without enforcing them. applygate uses fixed rules with no model involved by default and keeps data on the local machine, but Flurit states it is not a sandbox: an agent determined to bypass it and holding write credentials can still do damage. Stop coding agents from running terraform destroy in production. - What it does: before an AI coding agent runs a command, applygate checks it and answers allow , ask or block , with a reason the agent can act on. It covers Terraform, OpenTofu and Terragrunt, and the aws, gcloud, az, kubectl and helm CLIs. - Who it is for: teams that let Claude Code, Codex or another coding agent work in infrastructure repositories. - How: it runs on your machine as the agent's pre-tool-call hook. Fixed rules decide, with no model involved by default, and nothing leaves your machine. - What it is not: a sandbox. It catches mistakes and most injected instructions, but an agent that is set on getting around it and holds credentials that can write can still do damage. What it does not protect against what-it-does-not-protect-against . applygate is pre-1.0, for macOS and Linux. brew install Flurit/tap/applygate other ways to install: docs/install.md cd your-infra-repo applygate init .applygate.yaml for this repository, hooks for Claude Code and Codex, a user config if you have none applygate check "terraform -chdir=envs/prod destroy" - Using Codex? Open it and run /hooks once to trust the new hook. Until you do, Codex skips it without saying so. applygate doctor tells you whether it will run. - Two config files. .applygate.yaml lists the repository's environments; commit it so your team shares it. It can only add protection, and after every edit a person runs applygate trust , so an agent cannot quietly relabel production. Your own settings, such as observe or enforce, live in ~/.config/applygate/config.yaml . - It starts in observe mode. It logs what it would block and blocks nothing. That includes an agent editing or removing applygate itself, so try it where that is acceptable. - Then turn it on. After a few days, applygate report shows what it would have stopped and applygate suggest proposes environments and tiers. Set mode: enforce in your user config and run applygate doctor . Every command is judged by the environment it targets. You map directories, workspaces, backends, AWS profiles, Kubernetes contexts, GCP projects and Azure subscriptions to a tier in .applygate.yaml config https://github.com/Flurit/applygate/blob/main/docs/config.md : protected for production, standard or disposable . Anything applygate cannot place counts as protected. | Command | Protected | Standard | Disposable | |---|---|---|---| | Read-only: plan , show , validate , state list | allow | allow | allow | | Apply a saved plan: terraform apply tfplan | plan check | plan check | allow | | Apply without a saved plan: apply -auto-approve | block | ask | allow | | Destroy: destroy , apply -destroy , -replace , a plan that deletes | block | ask | allow | | State changes: state rm/mv/push , force-unlock , taint | block | ask | ask | | Cloud deletes: aws … delete- , s3 rb , kubectl delete , helm uninstall | block | ask | ask | | Turning applygate off: skip-permission flags, editing hooks or applygate's files | block | block | block | | Git commands that rewrite files in a repository holding agent hook files such as .claude/settings.json : checkout BRANCH , pull , merge | ask | ask | ask | | Commands it cannot resolve: curl … \| bash , eval "$ curl … " | ask | ask | allow | | Anything else that is not a plain, known command: loops, bash -c , npx , unknown programs | ask | allow | allow | - Plan check: for apply