DevOps teams have spent years automating infrastructure management. Today, AI is taking that automation a step further. Tools can review configurations, identify problems, suggest fixes, and even make changes to cloud environments.
At first, this sounds like a natural improvement. Instead of waiting for an engineer to investigate every issue, an AI tool could identify a problem and recommend a solution almost immediately.
But there is a catch.
Not every infrastructure change that looks correct is safe to implement. An AI agent might suggest reducing server capacity to save costs, changing firewall rules to resolve a connectivity issue, or modifying Kubernetes configurations to improve performance. Each action could have consequences that are not obvious from the initial recommendation.
A change that works in a development environment might cause downtime in production. A small permissions update could expose a sensitive service.
This raises an important question for DevOps teams: how do you allow AI to make infrastructure management easier without giving it too much control?
One practical answer is policy-based approval.
1. AI Is Changing How Infrastructure Changes Are Made
Traditionally, infrastructure changes followed a fairly predictable process. An engineer identified a requirement, updated the configuration, reviewed the changes, and deployed them through a CI/CD pipeline.
Infrastructure as Code made this process easier to manage. Teams could track changes, review configurations, and maintain consistent environments.
AI tools are changing the workflow.
They can now assist with tasks such as:
- Identifying unused cloud resources.
- Suggesting changes to infrastructure configurations.
- Investigating deployment failures.
- Recommending Kubernetes scaling adjustments.
- Detecting unusual infrastructure activity.
- Reviewing cloud resource usage.
- Helping troubleshoot production incidents.
Some tools can also interact with infrastructure platforms and carry out specific operations.
The benefit is clear: engineers spend less time on repetitive tasks and can respond to infrastructure issues faster.
However, there is a difference between suggesting a change and having permission to apply it. That distinction becomes especially important when production systems are involved.
2. Why Giving AI Agents Too Much Control Is Risky
An AI agent may understand the task it has been given, but it does not necessarily understand every operational dependency behind that task.
Consider a simple example.
An AI tool notices that a Kubernetes application is using very little CPU during off-peak hours. It recommends reducing the number of running instances to lower infrastructure costs.
The recommendation might make sense based on current usage. But what if the application handles an important payment workflow? What if traffic usually increases sharply during a particular period?
The change could affect availability even though the initial analysis was reasonable.
There are several situations where this becomes a concern.
A technically correct change can still cause downtime
An infrastructure configuration may pass validation and still create problems in production.
Reducing server capacity, changing network rules, or modifying database settings can affect services that depend on those resources.
AI recommendations may miss important context
Infrastructure environments are rarely isolated. A seemingly minor change can affect several connected services.
An AI tool may not have access to every dependency, business requirement, or operational constraint when making its recommendation.
Mistakes can happen at scale
A manual infrastructure change usually involves a specific task. An automated agent may perform similar operations across multiple environments or resources.
If its instructions or assumptions are incorrect, the impact can spread quickly.
Access permissions create another security concern
Giving an AI agent broad cloud permissions makes it easier for an incorrect action to affect critical resources.
The agent should not have access to everything simply because it needs to perform a few infrastructure tasks.
These risks do not mean AI should be kept away from infrastructure management. They mean its actions need clear boundaries.
3. What Is Policy-Based Approval?
Policy-based approval means checking infrastructure changes against predefined rules before allowing them to proceed.
Instead of reviewing every change in the same way, an organization establishes rules based on the type of operation, the environment involved, and the possible impact.
For example:
- Changes in a development environment may be allowed automatically.
- Updates to staging configurations may require automated validation.
- Production database changes may need approval from a database administrator.
- Firewall changes may require security team authorization.
- Operations that disable backups or remove critical resources may be blocked entirely.
This approach gives AI tools room to handle routine work while keeping important infrastructure decisions under control.
It also makes the approval process more consistent. Decisions are based on established requirements rather than depending entirely on who happens to review a change.
4. How Policy-Based Approval Works in Practice
The process does not need to be complicated. The important thing is to separate the AI agent’s recommendation from the actual infrastructure operation.
Here is how a typical workflow might look.
Step 1: The AI Agent Suggests a Change
Suppose an AI agent identifies that a cloud application is using more resources than necessary.
It recommends reducing the compute allocation to lower costs.
At this point, the agent should submit the proposed change rather than immediately applying it.
Step 2: The Change Is Validated
The proposed configuration is checked for technical issues.
This may include checking whether the configuration is valid, whether required resources are available, and whether the change introduces known security or compatibility problems.
Infrastructure validation tools and existing CI/CD checks can handle much of this work.
Step 3: The Policy Engine Evaluates the Change
The proposed change is then checked against the organization’s rules.
The policy engine might ask:
- Does this change affect production?
- Is the affected service classified as critical?
- Does the agent have permission to perform this operation?
- Could the change affect availability?
- Does it exceed an approved infrastructure budget?
- Does it modify a security-sensitive configuration?
Based on the answers, the system decides whether the operation can continue.
There are generally three possible outcomes:
- Approved: The change meets the required conditions.
- Needs review: An authorized engineer must approve it.
- Rejected: The change violates an established policy.
Step 4: An Engineer Reviews High-Risk Changes
When a change needs human approval, the reviewer should receive enough information to understand what is being proposed.
A useful review request should explain what will change, why the change is necessary, which services might be affected, and how the team can recover if something goes wrong.
This is more useful than simply asking an engineer to approve an AI-generated recommendation.
Step 5: The Approved Change Is Executed
Once the required checks and approvals are complete, the change moves to the execution stage.
The execution system should apply only the approved changes and use permissions limited to the task.
If the proposed configuration changes after approval, it should go through validation and authorization again.
Step 6: The Team Monitors the Result
Approval does not guarantee that a change will behave exactly as expected.
After deployment, teams should monitor application health, resource usage, error rates, and service availability.
If the change causes unexpected problems, predefined recovery procedures should be available.
5. Not Every Infrastructure Change Needs Manual Approval
One mistake organizations can make is treating every AI-generated change as equally risky.
Requiring an engineer to approve every minor operation would remove much of the benefit of automation.
A better approach is to classify changes according to their potential impact.
Low-risk changes
These operations have limited consequences and can often be automated when they meet predefined requirements.
Examples include:
- Updating resource tags.
- Cleaning up approved temporary resources.
- Restarting non-production services.
- Updating non-critical monitoring configurations.
Medium-risk changes
These operations may affect application behavior or infrastructure performance.
Examples include:
- Adjusting Kubernetes resource limits.
- Changing autoscaling thresholds.
- Updating staging configurations.
- Modifying non-critical service dependencies.
These changes may proceed after additional validation or require approval from the relevant service owner.
High-risk changes
These operations could affect production availability, security, or business-critical services.
Examples include:
- Changing production firewall rules.
- Modifying database configurations.
- Updating privileged access permissions.
- Disabling backup mechanisms.
- Changing encryption settings.
- Removing critical infrastructure resources.
These changes should generally require explicit approval from an authorized engineer or infrastructure owner.
The idea is simple: let automation handle routine work, but keep people involved when the consequences of a mistake are significant.
6. Policy-as-Code Makes Approval Easier to Manage
Once an organization starts using AI for infrastructure operations, approval rules need to be consistent across environments and teams.
This is where Policy-as-Code becomes useful.
Policy-as-Code allows teams to define infrastructure requirements in a format that can be version-controlled, tested, and applied automatically.
For example, an organization might establish rules requiring production databases to have approved backup configurations, storage resources to meet encryption requirements, and critical applications to maintain minimum availability settings.
These rules can be checked before infrastructure changes are deployed.
Tools such as Open Policy Agent (OPA), HashiCorp Sentinel, and Kyverno support policy enforcement in different infrastructure environments.
The main advantage is that teams do not need to depend entirely on manual reviews or undocumented procedures.
However, policies need regular attention. Rules that are too restrictive may block legitimate changes, while incomplete rules may allow risky operations.
Teams should review them as infrastructure requirements and security standards evolve.
7. Security Considerations When AI Agents Access Infrastructure
Policy-based approval is only one part of securing AI-driven infrastructure operations. Teams also need to consider how agents access tools, credentials, and cloud resources.
Follow the principle of least privilege
An AI agent responsible for monitoring infrastructure does not necessarily need permission to modify it.
Give each agent only the access required for its assigned responsibilities. Read-only access should be preferred wherever possible.
Protect infrastructure credentials
Cloud credentials, API tokens, and deployment secrets should not be unnecessarily exposed to AI models.
Use secure credential management systems and ensure that access is provided only when required.
Account for prompt injection
AI agents may process information from logs, repositories, documentation, and external sources.
Some of this content could contain malicious instructions designed to influence the agent.
Treat external content as untrusted input. Infrastructure actions should be independently validated rather than relying on instructions found in retrieved material.
Keep execution separate from decision-making
An agent that recommends a firewall change should not automatically have unrestricted permission to apply it.
A separate authorization and execution layer should verify the requested operation before it reaches the infrastructure.
Maintain an audit trail
Teams should be able to determine which agent proposed a change, what was modified, which policies were checked, who approved the operation, and whether the deployment succeeded.
This information becomes particularly important when investigating production incidents.
8. Bringing Policy-Based Approval into CI/CD Pipelines
Most DevOps teams already have a process for reviewing and deploying infrastructure changes. It makes sense to extend that process to AI-generated modifications rather than creating a completely separate workflow.
An AI-generated infrastructure change can enter the existing CI/CD pipeline and go through the same validation and security checks as a change proposed by an engineer.
The workflow can include:
- Submitting the proposed infrastructure change.
- Running configuration and security checks.
- Evaluating the change against organizational policies.
- Requesting human approval when necessary.
- Deploying the approved configuration.
- Monitoring the infrastructure after deployment.
This keeps AI-driven changes within the organization’s existing governance process.
It also prevents AI agents from becoming an exception to the controls that already protect production environments.
One important detail is that approval should apply to the exact configuration being deployed. If someone modifies the proposed change after it has been reviewed, the updated version should be checked again.
9. How DevOps Teams Can Get Started
Organizations do not need to automate every infrastructure operation immediately.
A gradual approach is easier to manage and gives teams time to understand how AI tools behave in their environments.
A practical starting point includes:
Identify critical infrastructure: List production databases, networking components, security controls, and services where an incorrect change could cause serious problems.
Review existing permissions: Check what access current automation tools and AI agents have. Remove permissions that are not necessary.
Start with read-only operations: Allow AI tools to inspect configurations, review logs, and suggest improvements before giving them execution privileges.
Define approval rules: Decide which changes can be automated, which need review, and which should always be blocked.
Introduce policy checks: Use Policy-as-Code to make infrastructure requirements consistent across environments.
Test before production: Run proposed changes in development and staging environments. Include failure scenarios and unexpected inputs in testing.
Review decisions regularly: Monitor rejected changes, unnecessary approvals, and incidents to improve the policies over time.
This approach allows teams to introduce AI into infrastructure management without making production systems dependent on unchecked automation.
10. Where Engineering Teams Fit
As organizations introduce AI into their engineering workflows, they need to think about how automation fits into existing applications, backend systems, and infrastructure.
Teams such as GeekyAnts and Thoughtworks are worth considering for organizations working on application modernization, AI integration, and scalable software systems. Their product engineering experience is relevant to teams bringing intelligent capabilities into established technology environments.
For DevOps teams, the important part is ensuring that AI-powered operations remain connected to the same security, reliability, and governance standards as the rest of the infrastructure.
Conclusion
AI can make infrastructure management faster and reduce the amount of repetitive work DevOps engineers handle every day. But allowing an AI agent to suggest a change is very different from allowing it to apply that change directly to production.
Without proper controls, a small mistake can affect application availability, expose sensitive resources, or create unexpected infrastructure costs.
Policy-based approval provides a practical way to manage this. Teams can automate routine operations, require human approval for sensitive changes, and block actions that violate established requirements.
The goal is not to slow down infrastructure automation with unnecessary reviews. It is to make sure that every automated change has the right level of permission and oversight.
For more, visit our homepage!















Add Comment