Mesrai
All use cases
Use case · Platform & DevOps

Review infrastructure changes like code.

A one-line change to Terraform or a CI workflow can expose a database or leak a deploy key. Mesrai reviews infrastructure-as-code and pipeline changes in the same pull request flow as everything else.

Covers
Terraform, K8s, CI
Guardrails
Folder-level rules
Same flow
As app PRs

How platform and DevOps teams use AI code review

Platform and DevOps teams use AI code review on infrastructure-as-code: Terraform, Kubernetes manifests, Helm charts, Dockerfiles and CI workflows. Mesrai flags risky changes such as public storage buckets, security groups open to the internet, privileged containers, secrets in pipeline files and missing resource limits, and platform teams encode their own guardrails as rules for the infrastructure folders.

I.

Why infrastructure review is risky

  • 01

    Infrastructure changes have a large blast radius but are often reviewed by one person in a hurry.

  • 02

    Plans and diffs are long; the one dangerous line hides among hundreds of routine ones.

  • 03

    Pipeline files hold the most powerful credentials in the company.

  • 04

    Guardrails exist in a wiki, not in the review.

II.

How Mesrai reviews infrastructure

Cloud misconfiguration checks

Public buckets, open ingress, overly broad IAM policies, unencrypted storage and disabled logging.

Kubernetes and containers

Privileged containers, running as root, missing resource limits, latest tags and host mounts.

Pipeline security

Secrets in workflow files, remote scripts piped to a shell, and untrusted input in CI commands.

Guardrails as folder rules

Apply infrastructure rules only to infra/ and .github/, so application code isn't affected.

III.

Real-world scenarios

2 examples

Illustrative examples of the kind of change platform and DevOps teams make every week, and the review comment Mesrai would post.

Scenario 01

A database open to the internet

To debug a connection issue, an engineer widens a security group.

infra/network/db.tf
ingress {
  from_port   = 5432
  to_port     = 5432
  protocol    = "tcp"
  cidr_blocks = ["0.0.0.0/0"]
}
MesraiSecurity agentMUST_FIX

This opens Postgres to the whole internet. Restrict cidr_blocks to the application subnet or reference the app security group instead.

Result: A temporary debugging change doesn't become a permanent exposure.

Scenario 02

A container without limits

A new worker deployment is added for a batch job.

k8s/worker/deployment.yaml
containers:
  - name: worker
    image: registry.example.com/worker:latest
    securityContext:
      privileged: true
MesraiMesrai RulesMUST_FIX

Platform rules: no privileged containers, pinned image tags and CPU/memory limits are required. This pod runs privileged with :latest and no limits, so one bad job can take the node down.

Result: Platform guardrails apply automatically to every team's manifests.

IV.

Set up infrastructure review

Configure your infrastructure folders separately from application code.

  1. 1

    Configure folder-level settings for infra/, k8s/ and .github/workflows/.

  2. 2

    Add rules for your guardrails: allowed CIDR ranges, required tags, pinned images, limits.

  3. 3

    Enable security analysis for these folders at a stricter severity.

  4. 4

    Keep Terraform plan checks and policy-as-code in CI; use Mesrai for review of intent and context.

V.

Who uses it, and how

Platform engineers
Encode guardrails once and apply them to every team's infrastructure changes.
Application teams
Get platform feedback on their manifests without waiting for the platform team.
Security
See risky infrastructure changes flagged at review time.
VI.

What teams achieve

Fewer exposed resources and over-broad permissions

Pipeline credentials protected

Platform guardrails enforced in every repository

Faster reviews for routine infrastructure changes

VII.

Platform & DevOps — frequently asked

2 questions
  • Can AI code review check Terraform?

    +

    Yes. Mesrai reviews Terraform like any other code change, flagging risky configurations and enforcing your own rules for infrastructure folders.

  • Does this replace tools like Checkov or OPA?

    +

    No. Keep policy-as-code and scanners as deterministic gates. Mesrai adds review that explains risk in context and applies guardrails written in plain English.

Try it on your next pull request.

14-day free trial · every feature unlocked · no credit card required.

Start free