Back to the blog
AI agents

Your AI Coding Agent Is Editing IAM. Give It a Gate.

November 24, 2026 · PosturaNet · 5 min read

Coding agents write a growing share of infrastructure code. Ask one to "let the new service reach the database" and it will edit a security group. Ask it to fix a permissions error and it may reach for ec2:*. The agent doesn't know which sources the bastion depends on, or which actions a nightly job uses. Neither does the reviewer skimming a 400-line diff.

Give the agent something to ask

PosturaNet's MCP server exposes check_change: give it a plan or the changed files, and it answers PASS, BLOCK or UNKNOWN against your behavior contracts, with the reason. The rule PosturaNet installs for the agent says: call check_change before changing security groups, IAM or S3, and don't go ahead on BLOCK.

$ posturanet connect cursor --write --repo .
# also claude-code, codex, copilot, gemini, windsurf

In Claude Code, the plugin adds a hook that checks every .tf edit as it happens, so the agent sees the BLOCK in the same turn it made the change.

Read-only by default

Three of the four MCP tools only read: explain_finding, propose_fix and check_change. The fourth, open_fix_pr, writes, and the agent must get your explicit yes for that specific proposal first. Finding text, code comments and tool output reach the agent as data, not instructions, so a crafted finding description can't tell it to open a PR.

Catch the agents that don't ask

Not every agent follows its rules. The backstop is the same check as a required status on pull requests: posturanet contract check --source runs offline in CI, and a BLOCK fails the "PosturaNet contract" check. With the Team plan, one org-wide config makes that check required on every repository through a GitHub ruleset.

Why a contract and not a linter

A linter knows that 0.0.0.0/0 is risky. It doesn't know that removing 10.0.4.12/32 will break deploys, because that fact lives in your traffic, not in the code. The contract carries that fact from the logs into the review, for people and agents alike.

See the MCP server docs and the org-wide contract gate.