AWS Builder Center

Weekend Showcase Challenge: ARIA Pre-Action SRE Gate for Autonomous Cloud Ops

Vision & What It Does: As SRE and DevOps teams integrate autonomous LLM agents to remediate cloud infrastructure incidents, they encounter a critical gap: observability tells you what an agent did after the fact, but it cannot evaluate whether the agent should have acted before execution.

Senior DevOps & SRE | IEEE Senior Member | AI Observability & Cloud Resilience





Vision & What It Does

As SRE and DevOps teams integrate autonomous LLM agents to remediate cloud infrastructure incidents, they encounter a critical gap: observability tells you what an agent did after the fact, but it cannot evaluate whether the agent should have acted before execution.
Traditional SRE relies on human judgment or deterministic scripts sitting between signal detection and production mutation. When an LLM reasoning loop autonomously modifies production resources—such as scaling fleets, altering route tables, or restarting containers—it can trigger cascading outages if operating on hallucinated assumptions or stale telemetry.
Reactive Flow (Standard Observability):
[Incident Alert] ──> [LLM Agent Action] ──> [Outage / Blast Radius] ──> [Post-Mortem Logs]

Proactive Flow (ARIA Pre-Action SRE Gate):
[Incident Alert] ──> [LLM Agent Proposal] ──> [Pre-Action SRE Gate] ──> [Verified Safe Mutation]
│ (Failed Check)
└──> [HITL Escalate / Block]

ARIA (Agentic Runtime Integrity Arbiter) introduces the Pre-Action SRE Gate: a real-time governance arbiter placed directly in front of agent tool execution paths. Instead of relying on post-incident traces, ARIA intercepts proposed infrastructure mutations at runtime.
The system evaluates four core Service Level Indicators (SLIs) to determine decision viability:
  • DQR (Decision Quality Rate): Evaluates whether the proposed remediation is backed by verified, multi-signal telemetry.
  • TIE (Tool Invocation Efficiency): Flags agent loop thrashing and prompt drift.
  • HER (Human Escalation Rate): Identifies anomalous edge cases and routes them to Human-in-the-Loop (HITL) queues.
  • AQDD (Approval Queue Depth Drift): Monitors backlog trends in gated operational queues.

AWS Services Used / Architecture Overview

ARIA is deployed completely on AWS Free Tier services, utilizing Amazon Bedrock for generative reasoning, AWS Lambda for serverless gate orchestration, Amazon DynamoDB for SLI state tracking, and Amazon CloudWatch with Amazon SNS for observability and human escalation routing.
┌──────────────────────────────────────────────┐
│ Amazon Bedrock (Nova / Claude) │
│ Autonomous SRE Remediation Agent │
└──────────────────────┬───────────────────────┘
│ Proposes Tool Mutation
▼
┌──────────────────────────────────────────────┐
│ AWS Lambda: Pre-Action SRE Gate │
│ - Evaluates DQR, TIE, and Blast Radius │
│ - Queries Historical SLI Drift │
└──────────────┬───────────────────────────────┘
│
┌───────────────────────┼───────────────────────┐
│ Pass │ Low DQR / Degraded │ Critical Thrash
▼ ▼ ▼
┌──────────────────────┐ ┌──────────────────┐ ┌────────────────────────┐
│ Target Cloud Resource│ │ Amazon SNS Queue │ │ AWS Lambda Trip Switch │
│ (Execute Mutation) │ │ (HITL Approval) │ │ (Revoke Agent Token) │
└──────────────────────┘ └──────────────────┘ └────────────────────────┘
│ │ │
└───────────────────────┼───────────────────────┘
▼
┌──────────────────────────────┐
│ Amazon DynamoDB State │
│ Amazon CloudWatch Logs │
└──────────────────────────────┘


AWS Service Breakdown:

  • Amazon Bedrock: Hosts Foundation Models (Amazon Nova Lite and Anthropic Claude 3 Haiku) acting as the autonomous diagnostic agent.
  • AWS Lambda (Python 3.12 runtime): Executes the Pre-Action SRE Gate middleware, evaluating runtime payload parameters and scoring SLIs in under 25 milliseconds.
  • Amazon DynamoDB: Serves as the high-throughput, low-latency Sprawl & Authority Registry, storing real-time DQR/TIE scores and active agent blast-radius permissions.
  • Amazon CloudWatch & EventBridge: Streams operational alerts into Bedrock and tracks SLI metrics across rolling execution windows.
  • Amazon Simple Notification Service (SNS): Routes diverted mutation requests to engineers via SMS/Email whenever an agent's confidence falls below the escalation threshold.

How You Built It

The solution was implemented in Python using the  agentsre  and  agentsre-langchain  open-source framework.

Key Technical Decisions:

  1. In-Line Interception over Log Scanning: Instead of asynchronously analyzing CloudWatch logs after an API call executes, the system implements an execution wrapper decorator ( @pre_action_sre_gate ) inside AWS Lambda. If the DQR threshold is breached, the execution terminates before calling downstream AWS SDK ( boto3 ) mutation endpoints.
  1. Deterministic Thresholding for Stochastic Models: While LLMs are probabilistic, the gate itself is strictly deterministic. The arbiter requires cross-validated telemetry evidence (minimum 2 independent CloudWatch data points) before allowing write access to critical tiers.

Code Implementation (AWS Lambda Gate Handler):

Python
import json
import boto3
from dataclasses import dataclass
from typing import Dict, Any

dynamodb = boto3.resource('dynamodb')
sns = boto3.client('sns')

@dataclass
class GateDecision:
allowed: bool
escalate_hitl: bool
dqr_score: float
tie_score: float
reason: str

def evaluate_pre_action_gate(agent_intent: Dict[str, Any]) -> GateDecision:
telemetry_evidence = agent_intent.get("telemetry_evidence", [])
iteration_depth = agent_intent.get("iteration_depth", 1)
# 1. Calculate Decision Quality Rate (DQR)
dqr_score = 1.0 if len(telemetry_evidence) >= 2 else 0.60
# 2. Calculate Tool Invocation Efficiency (TIE)
tie_score = 1.0 / iteration_depth

# Deterministic SRE Policy Thresholds
if dqr_score < 0.80:
return GateDecision(
allowed=False,
escalate_hitl=True,
dqr_score=dqr_score,
tie_score=tie_score,
reason=f"Low DQR ({dqr_score:.2f}): Mutation unsupported by multi-point telemetry."
)
return GateDecision(
allowed=True,
escalate_hitl=False,
dqr_score=dqr_score,
tie_score=tie_score,
reason="Pre-Action Gate validated: Sufficient evidence to mutate target infrastructure."
)

def lambda_handler(event, context):
agent_payload = json.loads(event.get("body", "{}"))
action_name = agent_payload.get("action_name", "UNKNOWN_ACTION")
decision = evaluate_pre_action_gate(agent_payload)
if not decision.allowed:
if decision.escalate_hitl:
# Route to Amazon SNS for Human Approval
sns.publish(
TopicArn="arn:aws:sns:us-east-1:123456789012:SRE-HITL-Approval",
Subject=f"HITL Required: Blocked Autonomous Action [{action_name}]",
Message=f"Action: {action_name}\nReason: {decision.reason}\nDQR: {decision.dqr_score}"
)
return {
"statusCode": 403,
"body": json.dumps({"status": "ESCALATED_TO_HUMAN", "reason": decision.reason})
}
# Proceed to execute infrastructure mutation
return {
"statusCode": 200,
"body": json.dumps({"status": "EXECUTED", "action": action_name})
}


Challenges Overcome:

  • Cold-Start Latency: To keep the Pre-Action Gate from adding latency to automated incident remediation, database queries to the Sprawl Registry were optimized by caching active agent policies in memory across warm Lambda invocations.
  • Blast Radius Scoping: Developed custom IAM policies attached to the execution role so the agent cannot bypass the gate to execute high-privilege  ec2:*  or  rds:*  mutations directly.

What You Learned

Building this autonomous SRE framework provided key insights into deploying LLM agents in mission-critical environments:
  1. Agent Governance Requires New SLIs: Traditional uptime and latency metrics are insufficient for generative AI. Tracking decision drift (DQR) and tool loop thrashing (TIE) is necessary before granting agents autonomous write permissions.
  1. Serverless Fits Governance Perfectly: AWS Lambda paired with Amazon DynamoDB provides a low-cost, zero-idle-maintenance security checkpoint capable of intercepting requests with millisecond overhead.
  1. Defense-in-Depth for AI: Combining Amazon Bedrock with deterministic AWS Lambda evaluation gates ensures that probabilistic reasoning is always bound by enterprise reliability policies.

Link to App or Repo

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article