
Aegis
Agent Loop Prevention: Multi-Agent Cyclic Loop Suppression & Deadlock Mitigation Engine
Autonomous Multi-Model Adversarial Fuzzing Certified
Continuous stress-testing against prompt injections, cyclic parameter drift, and upstream rate limits via Llama 3.3 70B & DeepSeek-R1 (Autonomous Fuzzing).
Production Runtime Specification (Aegis)
Direct integration contract for Aegis. Deployable as a native microservice or imported directly into your agent runtime.
"""
Aegis: Agent Loop Prevention & Oscillation Breaker
Detects infinite tool-call loops via sliding-window n-gram trajectory hashing.
"""
import hashlib
from typing import List, Dict, Any, Optional
from pydantic import BaseModel, Field
class ToolCallEvent(BaseModel):
tool_name: str
arguments_hash: str
iteration: int
class TrajectoryEvaluation(BaseModel):
is_oscillating: bool
detected_cycle_length: int
confidence_score: float
mitigation_action: str
class AegisLoopGuard:
def __init__(self, window_size: int = 6, max_cycle_repetitions: int = 2):
self.window_size = window_size
self.max_cycle_repetitions = max_cycle_repetitions
self.history: List[str] = []
def record_and_evaluate(self, tool_name: str, args: Dict[str, Any], iteration: int) -> TrajectoryEvaluation:
# Create deterministic fingerprint of the tool call
canonical_str = f"{tool_name}:{sorted(args.items())}"
step_hash = hashlib.sha256(canonical_str.encode()).hexdigest()[:12]
self.history.append(step_hash)
# Inspect sliding window for repeating cycles (periods 1 to window/2)
history_len = len(self.history)
for period in range(1, (self.window_size // 2) + 1):
if history_len >= period * self.max_cycle_repetitions:
pattern = self.history[-period:]
repeats = True
for r in range(1, self.max_cycle_repetitions):
start_idx = -(period * (r + 1))
end_idx = -(period * r)
if self.history[start_idx:end_idx] != pattern:
repeats = False
break
if repeats:
return TrajectoryEvaluation(
is_oscillating=True,
detected_cycle_length=period,
confidence_score=0.98,
mitigation_action="HALT_TOOL_EXECUTION_AND_INJECT_SYSTEM_CORRECTION"
)
return TrajectoryEvaluation(
is_oscillating=False,
detected_cycle_length=0,
confidence_score=0.0,
mitigation_action="PROCEED"
)
Production Failure Modes Addressed
Multi-agent frameworks suffer from infinite execution loops when sub-agents pass ambiguous or poorly formatted instructions back and forth, burning thousands of API dollars in minutes.
Implementing rigid manual iteration counters or hardcoded timeouts that terminate the workflow completely and lose all state.
Aegis intercepts tool-call trajectories in-memory using sliding-window parameter signature hashing. If cyclic reasoning or oscillating tool arguments are detected, Aegis immediately trips a deterministic circuit breaker and invokes a fallback procedure before token budgets are exhausted.
Autonomous State Machine & OTel Telemetry
Interactive trace visualizer showing ingress gating, in-memory state transition, and OTel emission.
Sliding-Window Action Sequence Hasher
Graph Cycle Detection & Oscillation Breaker
Autonomous Self-Healing Backoff Interceptor
Distributed Agent State Snapshot & OTel Egress
Enterprise Runtime Specifications & SLA
Zero Data Retention (ZDR) Architecture
Operates strictly in-memory. Prompts and tool arguments are zeroized immediately following circuit evaluation.
VPC & Google Cloud Run Topologies
Deployable as an ephemeral sidecar, containerized Cloud Run microservice, or in-process Python/TS library.
Deterministic Circuit Breaker SLA
99.95% production uptime commitment with automatic graceful degradation on upstream LLM provider outages.
Open-Spec Code Ownership
Full Apache-2.0 core licensing. You maintain absolute ownership of your deployed infrastructure and workflows.
Production Benchmark Telemetry
Empirical test telemetry from continuous integration regression suites.
Deploy Aegis to Your Production Cluster
Explore the open-source specification on GitHub or connect with our engineering team to deploy a private, dedicated sandbox cluster on Google Cloud.