How to Build Your Own AI SRE on StratoNext
Every week another vendor launches an “AI SRE”. Most of them are a chat window on top of your telemetry. They read logs, write a theory, and hand the work back to a human. Useful, but that is a research assistant, not an SRE.
An SRE does the work. It restarts the service, rolls back the deploy, rotates the credential, closes the public bucket. That is the hard part, and it is the part nobody wants to hand to a model holding a static admin key.
We built StratoNext so you can build that part yourself. Not a ready-made bot with a fixed personality, but a platform where you define what your agents do, which accounts they touch, and where a human signs off.
The key idea is the runbook workflow. StratoNext is not an incident analysis tool with a chat box. It is a workflow engine for operations: you write a runbook once as a workflow, and agents, scripts, decisions, and approvals execute it. An incident is just one trigger. A schedule, a ticket, a CI job, or a request from a teammate can start the same engine, so the same platform covers incident response, cost reviews, security sweeps, patching, and every other repeatable job your team does by hand.
In this post we build one end to end, starting with an incident runbook and then going well beyond incidents. It takes about an hour.
What an AI SRE Actually Is
Strip the marketing and an AI SRE is a loop with five parts:
- A trigger. An alert, a schedule, or a request from another tool.
- Context. Your topology, deployments, recent changes, and runbooks.
- Judgment. A model that reads evidence and picks a branch.
- Hands. Scoped access to change something in a real cloud account.
- Guardrails. Approvals for risky actions and an audit trail for every step.
Most tools ship parts 2 and 3. StratoNext ships all five, and it keeps judgment and hands separate. Agent nodes reason. Script nodes execute deterministically. Approval gates sit between them. Your runbook decides how they connect, and the workflow engine is what runs it, every time, the same way.
What You Need
- An AWS account you can connect (Azure and GCP environments also connect; this walkthrough uses AWS).
- A StratoNext workspace. The free tier needs no credit card: app.stratonext.com.
- An API key for the model you want the agent to use: Amazon Bedrock, Anthropic, or OpenAI. You bring the key, the provider bills the tokens, and we do not mark them up.
- A coding agent such as Claude Code or Codex. Optional, but it makes setup a conversation instead of a checklist.
- An active workflow runner. Workflows only execute while a runner is active, so set one up first: runner docs.
- One service worth watching. We use an ECS service called
checkoutthat throws 5xx errors when something breaks.
Step 1: Install the CLI and the Skill
The CLI manages projects, environments, agents, tasks, and approvals from the terminal.
uv tool install stratonext
stratonext login
stratonext whoami
Then export the StratoNext skill into your repo so your coding agent can drive the platform:
stratonext --skill-dir .claude/skills/stratonext
Or skip both blocks and paste one line into your coding agent:
Fetch https://app.stratonext.com/prompt.md and follow it to install and configure the StratoNext skill in this project.
The skill covers every CLI command, so your local agent can do anything you can do from the terminal.
Step 2: Connect One Environment
Create a project and connect your AWS account from the portal. The onboarding template creates an Operations Role that StratoNext uses to mint short-lived, task-scoped credentials. Nothing agent-related runs in your account, and no agent ever holds a static key.
Two defaults matter here:
- Agents start read-only. Write access is granted per task and expires when the task ends.
- New environments start at Supervised, production included. Reads and reversible changes run on their own. Anything destructive waits for a person.
Once connected, StratoNext discovers your topology, services, environment variables, and deployment history. That is the context your agent reasons over later.
Step 3: Give It Eyes
An SRE without signals is guessing. Ask your coding agent to set them up:
Using the StratoNext skill, set up signals for this project. List the signals the project already has, with their current status. Show me the list and wait for my confirmation before adding anything. Add the signals I approve, then show me the project’s signals with their status.
Under the hood the agent discovers candidates and registers the ones you approve:
stratonext signal candidates --environment-id <environment_id> \
--source CLOUD_WATCH_METRIC --search AWS/ECS
stratonext signal upsert --deployment-id <deployment_id> \
--external-id arn:aws:cloudwatch:us-east-1:123456789012:alarm:checkout-5xx \
--warning 3 --critical 10 --name "Checkout 5xx"
stratonext signal list --status
Alarms you already defined in CloudFormation or Terraform show up automatically. Cost and user-count signals work the same way.
Step 4: Give It a Brain
Now create a background agent. It runs in StratoNext’s cloud, uses the model you choose, and works through the environment’s Operations Role.
export STRATONEXT_MODEL_API_KEY=<your-api-key>
stratonext agent create --name "sre-agent" \
--environment-id <environment_id> \
--setting Region=us-east-1 --model-provider BEDROCK
Give it a read-only first task before you trust it with anything else:
stratonext task create --target PROJECT \
--name "Investigate the latest checkout errors" \
--description "5xx errors in the last 24 hours and their likely cause" \
--assignee-id <agent_id> --assignee-type AGENT
stratonext task dispatch <task_id>
stratonext task get <task_id>
Read the result and check it against your dashboards. If the agent needs more permissions than it has, it does not work around the gate. It files a request and waits.
At this point you have the same thing most AI SRE products sell: an agent that investigates and writes a report. Now we give it hands.
Step 5: Write the Runbook as a Workflow
This is the heart of the platform, and where your AI SRE becomes yours. Analysis tells you what happened. A runbook workflow does something about it, and it does so for any job you can describe, not only incidents. A workflow is one YAML file: a trigger, a set of nodes, and the dependencies between them. We combine four node types:
stratonext.script.runruns deterministic commands with scoped cloud credentials.stratonext.task.createhands open-ended investigation to the agent.stratonext.decideturns evidence into a branch, with rules or with model-answered questions.stratonext.approval.requeststops everything downstream until a human decides.
Here is a runbook for checkout 5xx alerts. It reads service health, asks the agent for a root cause, decides whether a restart is the right fix, asks the on-call engineer, restarts, and verifies.
apiVersion: workflows.stratonext.com/v1
kind: Workflow
name: checkout-5xx
description: Investigate checkout 5xx alerts and restart the service when that is the fix.
on:
webhook: {}
vars:
cluster: prod
service: checkout
region: us-east-1
environment: env_prod
agent_id: agt_sre_agent
defaults:
timeout: 5m
retry: { max_attempts: 2, backoff: exponential, interval: 5s }
nodes:
health:
name: Read service health
uses: stratonext.script.run@v1
with:
shell: bash
env:
CLUSTER: ${{ vars.cluster }}
SERVICE: ${{ vars.service }}
REGION: ${{ vars.region }}
aws:
environment: env_prod
reason: Read ECS service state for a checkout 5xx alert.
script: |
aws ecs describe-services --region "$REGION" \
--cluster "$CLUSTER" --services "$SERVICE" \
--query 'services[0].{running:runningCount,desired:desiredCount,events:events[:5]}'
investigate:
name: Find the root cause
needs: [health]
uses: stratonext.task.create@v1
timeout: 20m
with:
name: Investigate checkout 5xx
description: "Alert: ${{ trigger.payload.alarm }}"
instructions: |
Read-only. Correlate the 5xx spike with ECS service events,
recent deployments and CloudTrail changes in the last hour.
State the most likely cause, the evidence, and whether a
restart, a rollback or neither would fix it.
environments: ["${{ vars.environment }}"]
assignee: ${{ vars.agent_id }}
wait_for: completed
triage:
name: Is a restart the fix?
needs: [investigate]
uses: stratonext.decide@v1
with:
state:
health: ${{ nodes.health.outputs.json }}
finding: ${{ nodes.investigate.outputs.summary }}
questions:
restart_fixes_it:
type: noul
instructions: Based on the finding, would restarting the checkout service resolve the errors?
thresholds:
confident: 0.75
decide:
- when: ${{ answers.restart_fixes_it.noul >= thresholds.confident }}
choice: restart
- choice: escalate
on_error: { choice: escalate }
approve:
name: Ask the on-call SRE
needs: [triage]
if: ${{ nodes.triage.outputs.choice == 'restart' }}
uses: stratonext.approval.request@v1
with:
title: "Restart ${{ vars.service }} in production?"
message: ${{ nodes.investigate.outputs.summary }}
risk: high
restart:
name: Restart the service
needs: [approve]
if: ${{ nodes.approve.outputs.decision == 'approved' }}
uses: stratonext.script.run@v1
with:
shell: bash
aws:
environment: env_prod
permissions:
- actions: [ecs:UpdateService]
resources: [arn:aws:ecs:us-east-1:111122223333:service/prod/checkout]
reason: Approved restart of checkout after a 5xx investigation.
script: aws ecs update-service --cluster prod --service checkout --force-new-deployment
verify:
name: Verify recovery
needs: [restart]
uses: stratonext.script.run@v1
timeout: 15m
with:
shell: bash
aws:
environment: env_prod
reason: Confirm checkout is stable after the restart.
script: aws ecs wait services-stable --cluster prod --services checkout
escalate:
name: Page a human
needs: [triage]
if: ${{ nodes.triage.outputs.choice == 'escalate' }}
uses: stratonext.http.request@v1
with:
url: https://hooks.example.com/oncall
method: POST
secret_headers:
Authorization: { secret: ONCALL_TOKEN, prefix: "Bearer " }
body:
summary: ${{ nodes.investigate.outputs.summary }}
A few things to notice:
- The agent never touches production. It investigates read-only. The only write is a script node with one action on one resource, and it runs only after a person says yes.
- Judgment has a threshold. The decide node asks the model one question and only takes the restart branch when the answer clears 0.75. Anything uncertain, or any model error, pages a human.
- Credentials are per node. Each script node gets a short-lived role in one account, scoped to what it needs, with a reason that lands in the audit log. Write the
awsblock out literally rather than as an expression: what a run may do is fixed when the workflow is published.
Validate it and do a dry run before you publish:
stratonext workflow validate ./checkout-5xx.yaml
stratonext workflow run <workflow_id> --draft
Every publish creates a new numbered version. If a change goes wrong, stratonext workflow restore brings back an earlier one.
The engine is not specific to this example. The same nodes, the same approvals, and the same audit trail run any runbook you write. Step 7 shows how far that goes.
Step 6: Wire the Trigger
Make sure a runner is active, because a workflow will not execute without one. Then create a webhook in your workspace settings that targets the workflow. StratoNext shows the secret once, so store it in your secrets manager. Then point any tool that can POST JSON at it: your alerting system, PagerDuty, Grafana, a CI job, or an internal portal.
curl -X POST "https://api.prod.stratonext.com/v1/webhooks/$WEBHOOK_ID" \
-H "Authorization: Bearer $WEBHOOK_SECRET" \
-H "Idempotency-Key: checkout-5xx-2026-11-27T10:14Z" \
-H "Content-Type: application/json" \
-d '{"alarm": "checkout-api 5xx > 5%", "service": "checkout"}'
The body arrives in the run as ${{ trigger.payload }}. The Idempotency-Key header means an alerting tool that retries does not start two restarts. A repeated key returns the original result.
Fire it once by hand and watch the run graph fill in: health, investigation, decision, then a pending approval waiting for you.
Step 7: Go Beyond Incidents
Incident analysis is the demo. Runbook workflows are the product. Everything in Step 5 applies to any operational job you can write down: the engine does not care whether the trigger was an alarm, a schedule, a ticket, or a person. Here is the work nobody gets to, running on the same building blocks:
- Cost: a nightly review that flags the most expensive resources of the last seven days and proposes what to shut down.
- Reliability: a weekly check that every Lambda function has an error alarm, with a proposed fix for each one that does not.
- Security: a sweep for S3 buckets or databases open to the public, with a report and a proposed remediation behind an approval.
- Maintenance: patching, certificate renewals, and log retention clean-up, each behind its own approval policy.
- Requests: routine asks like access changes or environment setup, started from a webhook by your portal or ticketing tool.
Every one of these is the same shape: gather facts with a script node, let an agent reason over them, decide with a threshold, ask a person when it matters, act with a scoped credential, and verify. Schedule them as recurring jobs assigned to an agent, or trigger them from the tools you already use. Each one is a runbook you already have in a wiki. Now it runs.
A workflow is not always the answer. For a one-off task, skip the runbook. Connect your interactive agent session (Claude Code, Codex) to StratoNext with the skill from Step 1, and you have an SRE engineer working alongside you, ready to act on the spot: check a service, pull the logs, make one change. The same scoped credentials and approvals apply. Write a workflow when the job repeats.
That is the real shift. You are not buying an AI SRE that analyzes incidents. You are building an operations team of agents, one runbook workflow at a time, with each one doing a job you defined.
Buy or Build?
You can buy a packaged AI SRE. Before you do, ask four questions:
- Can it act, or only advise? A diagnosis still leaves the 2 a.m. work to a person.
- Who decides what it is allowed to do? If the answer is “the vendor”, your runbooks do not matter.
- What credentials does it hold? Standing cross-account keys are a breach waiting to happen.
- What happens when it is wrong? You want an approval gate before the damage, not an apology after.
StratoNext’s answer: agents act through short-lived, task-scoped credentials, you define every runbook, approvals sit wherever you put them, and every step is logged with the agent identity, the action, the reason, the policy, and the approver. You bring your own model, or run the whole platform self-hosted in your VPC.
Closing Thoughts
The model is the least interesting part of an AI SRE. Swap Bedrock for Anthropic or OpenAI and the runbook still works. What makes it trustworthy is everything around the model: the context it reasons over, the scope of what it can touch, and the human who signs off when it matters.
Start with one environment, one policy, one agent, and one real task. Then ask yourself which runbook your team runs most often by hand. That is your second AI SRE.
Build your AI SRE on StratoNext. Free tier, no credit card. Get started or book a demo.