# IaC & CI/CD

Sedai writes optimizations back to Terraform, Helm, or Kustomize as PRs — eliminating config drift and protecting gains across every deployment.

## Fix IaC Drift at the Source

Sedai fits your IaC and GitOps workflow — writing optimizations back to Git as reviewable PRs, or, on Kubernetes, applying them without ever touching your deployment blueprint.

## Your IaC Workflow Wasn't Designed for Autonomous Systems

Git-as-source-of-truth works well when humans are the only ones making changes. Autonomous systems change that.

### Live changes create invisible debt.

Adjustments made directly to a running cluster exist outside your declared state — and get reverted on the next reconciliation.

### Manual promotion doesn't scale.

Translating live changes back into IaC by hand is slow, error-prone, and rarely happens consistently.

### Policy lives outside your review process.

Guardrails configured outside code have no version history, no peer review, and no audit trail.

Sedai is an autonomous cloud optimization platform that writes every infrastructure change back to your IaC — Terraform, Helm, or Kustomize — as a pull request. Unlike drift detection tools that only alert on discrepancies, Sedai generates the optimization, applies it safely with validation and rollback, then syncs the result to Git so your declared state never falls behind your live environment.

## Optimization That Lives in Your Repository

Sedai integrates directly with your IaC and GitOps workflows, so every change it makes is reviewable, auditable, and permanent.

### Drift Prevention

After every optimization, Sedai opens a pull request with the exact code changes needed — Terraform variables, Helm values, Kustomize patches. Your declared state stays current autonomously.

### Deployment Resilience

Sedai's CI/CD overwrite protection detects when a new deployment would revert an optimization and re-applies the correct configuration. Your gains don't disappear at the next push.

### Policy in Version Control

Define the guardrails for autonomous optimization in Git. Sedai reads and enforces those boundaries from your repository — reviewed, versioned, and managed like any other policy file.

### No Manual Translation

Sedai generates the exact code changes required. Engineers review a PR, not a recommendation. Sedai has already written the optimization; it just needs an approval.

## Set the Rules Once. Enforce Them Everywhere.

Sedai lets you define CPU, memory, replica, & cost boundaries directly in Git as policy files, with no portal configuration required.

Guardrails are versioned alongside your application code, and they're subject to the same review & approval process.

## Every Optimization Becomes a Pull Request

After Sedai applies a change to your live environment, it autonomously opens a PR with the corresponding IaC changes. This can take the form of Terraform .tfvars, Helm values.yaml, or Kustomize patches.

The PRs include a summary of what changed, the "why" behind it, and the projected impacted, reviewable by any engineer without Sedai access.

## Optimizations That Survive Every Deployment

Sedai monitors for deployment events that would overwrite a previous optimization. When Sedai detects a conflict, it re-applies the correct configuration after the deployment completes — without manual intervention.

For GitOps environments running ArgoCD or Flux, the Live Sync Controller intercepts reconciliation conflicts before they cause drift — on Kubernetes, this covers the direct-edit model; Pod Interceptor avoids the conflict at its source instead.

## For Kubernetes, Optimize Without Ever Touching Your Blueprint

On Kubernetes, Sedai can apply optimizations directly to the pod at creation — without touching the deployment spec your GitOps tool watches, so there's nothing to detect as drift.

Guardrails as Code and optional IaC loopback both still apply. Pod Interceptor is Sedai's default Kubernetes execution model; the direct-edit model above remains available.

## Know Exactly What Code Controls What Infrastructure

Sedai's IaC Mapping Agent autonomously traces live cluster resources back to their originating IaC source: Terraform module, Helm release, or Kustomize overlap

Sedai maintains mapping continuously as your stack evolves, without manual annotation or tagging.

“What I found with Sedai is that it's very focused on safety. I don't really have to worry about it. It just delivers the optimization, in a very gradual and safe way.”

— Robert Berger, Chief Architect // Informed

## Works With Your Stack

### Terraform

### Helm

### Kustomize

### GitHub

### GitLab

### Bitbucket

### ArgoCD

### Flux

## The Sedai Difference

| Without Sedai | Sedai |
| --- | --- |
| Optimizations applied to live infra are overwritten by the next deployment | Sedai writes changes back to IaC as PRs, so optimizations survive every deploy |
| Engineers manually translate recommendations into Terraform or Helm code | Sedai generates the exact code changes required, no manual translation |
| Configuration drift accumulates silently between code and live environment | Code and live environment stay in sync automatically after every optimization |
| Changes bypass code review, leaving no audit trail | Every optimization follows the same PR-based approval process as any other change |
| GitOps tools like ArgoCD revert Sedai's changes on reconciliation | On Kubernetes, Pod Interceptor applies changes without ever triggering GitOps reconciliation; Live Sync Controller handles it everywhere else |

## Resources

## Optimization That Lives in Your Code, Not Your Cluster.

## Frequently Asked Questions

### What is IaC drift and why does it matter?

IaC drift is when your live infrastructure diverges from the state defined in your Terraform, Helm, or Kustomize files. It means your code is no longer the source of truth — deployments become unpredictable, and optimizations get silently reverted.

### How does Sedai prevent IaC drift?

After every optimization, Sedai opens a pull request with the exact IaC changes — Terraform variables, Helm values, or Kustomize patches. Your declared state stays current after every change, not just after manual updates.

### What happens when a deployment overwrites a Sedai optimization?

Sedai's CI/CD Overwrite Protection detects deployment events that would revert a previous optimization and re-applies the correct configuration after the deployment completes. For ArgoCD or Flux environments, the Live Sync Controller intercepts reconciliation conflicts before they cause drift.

### How is Sedai different from drift detection tools like Spacelift or env0?

Drift detection tools alert when infrastructure diverges from code and revert to the last-known state. Sedai goes further: it generates optimizations, applies them safely, and writes the results back to your repository as PRs — so your IaC improves over time instead of just staying frozen.

### Does Sedai work with GitOps workflows?

Yes. Sedai integrates with ArgoCD and Flux through its Live Sync Controller, which intercepts reconciliation conflicts. It also works with GitHub, GitLab, and Bitbucket for PR-based IaC updates across Terraform, Helm, and Kustomize.
