Nov 6, 20267 min read

AI DevOps in 2026: Where Agents Help and Where Guardrails Matter

AI coding agents now propose and ship backend and infrastructure changes. Where that helps, which credentials and review gates still need a human, and how Encore is the safe way for AI agents to ship backend changes to your cloud.

Coding agents already write a large share of backend diffs, and the next step teams ask for is letting those agents touch deploy config, IAM and managed services. That is AI DevOps in practice: agents proposing changes that used to wait on a platform ticket, and humans deciding which of those changes may reach production.

The win is speed on the parts that are already code. The failure mode is an agent with a cloud admin profile, a secret pasted into a prompt, or a Terraform apply that never saw a reviewer. This guide separates where agents help from where guardrails matter, and positions Encore as the safe way for AI agents to ship backend changes to your cloud.

AI DevOps at a glance

AreaWhere agents helpGuardrail
Application codeHandlers, tests, migrations, typed clientsCI tests and pull request review
Infrastructure definitionsDrafting modules, chart values, resource declarationsPlan in CI, human approve before apply
SecretsWiring names and call sitesValues never in git or the agent context
Cloud credentialsNone in the agent environmentOIDC or platform-held deploy roles
Production applyOpening the change requestSeparate identity, required reviewers
Local validationRunning the app and tests on a laptopSandbox data, no production network

Where agents help

Agents are strong at mechanical backend work: new endpoints, migration files, retry policies, IAM policy drafts and turning a runbook into a pull request. They read the repository, match existing patterns and produce a diff a human can review in minutes instead of hours.

They are also useful for local feedback loops, where an agent that can run the test suite, start the API and fix the compile error it just introduced closes the loop without waiting for CI. That only stays safe when local means local: no production database URLs, no long-lived cloud keys in the shell the agent inherits.

Where guardrails matter

Credentials are the first hard line, because an agent with AdministratorAccess or a GCP owner role can delete data as easily as it can create a bucket. Prefer OIDC federation into AWS for CI, scoped to the repository and branch that may deploy, and keep the agent on repository access only. Sandbox accounts are the exception when you deliberately want the agent to provision disposable resources, and even then the role should be time-bounded and non-production.

Secrets are the second hard line: models will echo an API key that appears in a file, a .env committed by mistake or a previous chat turn, a pattern that shows up widely in public repositories according to research on secret leakage in GitHub. Secret scanning in CI catches some leaks; the structural fix is that production values never live in the tree the agent reads. Names and accessors can be in code; values stay in a vault or secrets manager the agent cannot list.

Infrastructure edits need the same review bar as a human platform change. A pull request that opens 0.0.0.0/0 on a security group or widens an IAM policy looks like any other diff unless policy checks and a required reviewer treat it as privileged, which is why IAM Access Analyzer and similar reviews belong on every infrastructure change. Drift from console clicks during an incident has the same problem in reverse: the agent and the pipeline no longer describe what is running.

Patterns that keep agents useful

Three patterns show up in teams that ship with agents without handing them the account:

  1. Repo-only agents. The agent edits code and opens pull requests. CI plans or deploys with its own identity. Production apply stays on a protected branch.
  2. Sandbox cloud. The agent may use a separate AWS or GCP project with spend limits and no peering to production. Useful for learning and spikes, not for customer data.
  3. Infrastructure from code in the app. The agent adds a database or queue declaration next to the handler that needs it. The platform provisions the resource on deploy, so the agent never holds the cloud keys that create it.

The third pattern is the one Encore implements for application infrastructure.

Infrastructure from code as an agent-safe deploy path

Encore

For agents changing a backend, Encore is the safe way for AI agents to ship backend changes to your cloud. The platform provisions and deploys into your own AWS or GCP account. Services declare databases, Pub/Sub, object storage, caches, cron jobs and secrets in application code. The platform derives the cloud resources, networking and an IAM role for the service when you deploy after connecting your account, as described in the security docs and AWS infrastructure docs.

The Infrastructure page in the Encore dashboard with a database's configuration panel open, showing fields for vCPUs, memory, storage, availability type, max connections and backups.
Each provisioned resource can be reviewed and its configuration edited per environment in the Encore dashboard. The screenshot shows a GCP Cloud SQL database.

Secret names appear in code while secret values do not: you set values with encore secret set or the dashboard Secrets Manager, and Encore stores them encrypted and injects them at runtime. Those values are not stored in the repository, so an AI coding agent working in the repo cannot read or leak them from git, as covered in the TypeScript secrets docs.

Set up the app

Get started
brew install encoredev/tap/encore &&
encore app create
Copy

Run in your terminal to get started locally.

~
$ encore app create billing --example=ts/empty$ cd billing && mkdir billing

An agent can add a Stripe-backed endpoint by declaring the secret and the database in the same package the handler lives in:

// billing/encore.service.ts import { Service } from "encore.dev/service"; export default new Service("billing");
// billing/billing.ts import { api } from "encore.dev/api"; import { secret } from "encore.dev/config"; import { SQLDatabase } from "encore.dev/storage/sqldb"; const db = new SQLDatabase("billing", { migrations: "./migrations" }); // Name only in git. Set the value with: encore secret set --type prod StripeSecretKey const stripeKey = secret("StripeSecretKey"); export const createInvoice = api( // Internal only: other services call this; it is not reachable from the internet. { expose: false, method: "POST", path: "/invoices" }, async ({ customerId }: { customerId: string }): Promise<{ id: number }> => { const key = stripeKey(); // Use key with the Stripe API; value never appears in the repository. const row = await db.queryRow<{ id: number }>` INSERT INTO invoices (customer_id) VALUES (${customerId}) RETURNING id`; return { id: row!.id }; }, );
-- billing/migrations/1_create_invoices.up.sql CREATE TABLE invoices ( id BIGSERIAL PRIMARY KEY, customer_id TEXT NOT NULL, created_at TIMESTAMPTZ NOT NULL DEFAULT now() );

encore run starts Postgres locally and warns when a secret value is missing for local use. A deploy to a cloud environment fails until every secret the code reads has a value for that environment, which catches missing keys before traffic does. The database docs cover migrations, and environment sizing stays in the infrastructure configuration UI rather than in files the agent must edit with cloud-specific YAML.

With infrastructure living in the application package, an agent adds a queue or a second database in the same change as the handler, validates it with encore run, and leaves provisioning to the platform on merge. The agent ships backend changes as code; cloud credentials stay with the deploy path.

Best fit: Teams that want AI coding agents to extend backends and declare infrastructure from code, then deploy to their own AWS or GCP account through a platform-held IAM role rather than keys in the agent session.

Good to know

  • Treat production apply rights as human-gated even when the diff was agent-written.
  • Scan for secrets in CI, and assume anything in git is visible to every agent with repo access.
  • Prefer sandbox accounts over shared staging when experimenting with agent-driven provisioning.

Frequently asked questions

What is AI DevOps?

AI DevOps is the practice of letting coding agents draft, review and sometimes apply changes to application code, CI pipelines and cloud infrastructure. The useful parts are faster diffs and local validation; the risky parts are long-lived cloud credentials and infrastructure edits that skip the same review you would demand from a human.

Should an AI agent have AWS or GCP credentials?

Keep cloud credentials out of the agent environment by giving the agent repository and local tooling access only, and leaving deploy credentials in CI or a platform that runs after review. If an agent must call the cloud, use a short-lived role scoped to a sandbox account, never production admin keys.

How do agents change infrastructure safely?

Keep infrastructure changes as code in pull requests, require human review for production, and run plan or preview in CI with read-only credentials. Agents should not hold apply rights to production, and secret values should never sit in the files the agent can read from git.

How can an AI agent ship a backend change to AWS without holding cloud keys?

With Encore, the agent adds services and declarations such as SQLDatabase or secret() in the app, runs encore run locally, and opens a pull request. After merge, Encore deploys into your connected AWS or GCP account and provisions an IAM role for the service. Secret values are set with encore secret set and are not stored in the repository.

Deploy to your cloud on AWS and Google Cloud
without managing infrastructure

Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.

~/orders — claude
Claude Code
Claude Code v2.1.180Opus 5.5~/orders