| name | gremlin-enterprise-chaos |
| description | Apply Gremlin's enterprise chaos engineering methodology. Emphasizes categorized failure injection, safety controls, and structured experimentation. Use when implementing chaos engineering in enterprise environments with compliance requirements. |
| tags | chaos-engineering, fault-injection, resilience, gameday, blast-radius, reliability, failure-modes, testing |
Gremlin Enterprise Chaos Engineering
Overview
Gremlin, founded by Kolton Andrus (former Amazon/Netflix reliability engineer), productized chaos engineering for enterprise adoption. Their approach emphasizes safety, categorization, and measurable outcomes—making chaos engineering accessible to organizations that can't afford to "move fast and break things."
The Pioneer
Kolton Andrus
Built chaos engineering infrastructure at Amazon (Game Days) and Netflix before founding Gremlin. His insight: chaos engineering needs to be safe, repeatable, and auditable for enterprise adoption.
"We basically inject a little harm in order to find weak spots and build an immunity. We proactively break things."
References
Core Philosophy
"Thoughtful, planned experiments that teach us something about the system."
"The goal is not to break things—it's to build confidence."
Gremlin's approach differs from early chaos engineering by emphasizing safety controls, categorized attacks, and enterprise readiness (audit trails, RBAC, compliance).
Attack Categories
Gremlin organizes chaos attacks into three categories:
1. Resource Attacks
┌─────────────────────────────────────────────────────────┐
│ Resource Attacks - Stress system resources │
├─────────────────────────────────────────────────────────┤
│ CPU │ Consume CPU cycles │
│ Memory │ Allocate memory, cause pressure │
│ Disk │ Fill disk, stress I/O │
│ IO │ Stress disk I/O subsystem │
└─────────────────────────────────────────────────────────┘
2. Network Attacks
┌─────────────────────────────────────────────────────────┐
│ Network Attacks - Disrupt network connectivity │
├─────────────────────────────────────────────────────────┤
│ Latency │ Add delay to network calls │
│ Packet Loss │ Drop percentage of packets │
│ Blackhole │ Drop all traffic to targets │
│ DNS │ Fail DNS resolution │
└─────────────────────────────────────────────────────────┘
3. State Attacks
┌─────────────────────────────────────────────────────────┐
│ State Attacks - Modify system state │
├─────────────────────────────────────────────────────────┤
│ Shutdown │ Terminate process/container │
│ Time Travel │ Skew system clock │
│ Process Kill│ Kill specific processes │
└─────────────────────────────────────────────────────────┘
When Implementing
Always
- Start with read-only observation (no injection)
- Use built-in safety controls (halt conditions)
- Define rollback procedures before starting
- Communicate experiments to stakeholders
- Document findings and remediation
- Maintain audit trail for compliance
Never
- Run chaos without abort mechanisms
- Skip stakeholder communication
- Experiment without monitoring
- Start with complex, multi-failure scenarios
- Ignore compliance requirements
- Chaos in production without staging validation
Prefer
- Categorized attacks over ad-hoc failures
- Automated safety controls over manual monitoring
- Graduated complexity over big-bang tests
- Business hours for initial experiments
- Team-wide involvement over siloed testing
Implementation Patterns
Attack Definition Framework
from dataclasses import dataclass, field
from typing import List, Optional, Dict, Callable
from enum import Enum
from abc import ABC, abstractmethod
class AttackCategory(Enum):
RESOURCE = "resource"
NETWORK = "network"
STATE = "state"
class AttackType(Enum):
CPU = "cpu"
MEMORY = "memory"
DISK = "disk"
IO = "io"
LATENCY = "latency"
PACKET_LOSS = "packet_loss"
BLACKHOLE = "blackhole"
DNS = "dns"
SHUTDOWN = "shutdown"
TIME_TRAVEL = "time_travel"
PROCESS_KILL = "process_kill"
@dataclass
class SafetyControls:
"""Built-in safety mechanisms"""
max_duration_seconds: int = 300
halt_on_error_rate: float = 0.05
halt_on_latency_p99_ms: int = 5000
excluded_hosts: [] = field(default_factory=)
require_healthy_baseline: =
business_hours_only: =
() -> :
metrics.get(, ) > .halt_on_error_rate:
metrics.get(, ) > .halt_on_latency_p99_ms:
:
name:
category: AttackCategory
attack_type: AttackType
description:
targets: []
target_percentage: =
duration_seconds: =
ramp_up_seconds: =
safety: SafetyControls = field(default_factory=SafetyControls)
parameters: = field(default_factory=)
():
() -> :
() -> :
():
category: AttackCategory = AttackCategory.RESOURCE
attack_type: AttackType = AttackType.CPU
():
.parameters.setdefault(, )
.parameters.setdefault(, )
():
category: AttackCategory = AttackCategory.NETWORK
attack_type: AttackType = AttackType.LATENCY
():
.parameters.setdefault(, )
.parameters.setdefault(, )
.parameters.setdefault(, [])
.parameters.setdefault(, [])
():
category: AttackCategory = AttackCategory.STATE
attack_type: AttackType = AttackType.SHUTDOWN
():
.parameters.setdefault(, )
.parameters.setdefault(, )
Safety-First Execution
import time
import threading
from typing import Optional
from datetime import datetime, timedelta
class SafeChaosExecutor:
"""
Gremlin's key insight: chaos must be SAFE for enterprise adoption.
Built-in halt conditions, audit trails, and rollback.
"""
def __init__(self, metrics_client, notification_client):
self.metrics = metrics_client
self.notify = notification_client
self.active_attacks = {}
self.audit_log = []
def execute(self, attack: Attack) -> dict:
"""Execute attack with safety controls"""
attack_id = self._generate_id()
preflight = self._preflight_checks(attack)
if not preflight['passed']:
self._audit("BLOCKED", attack, preflight['reason'])
return {'status': 'blocked', 'reason': preflight['reason']}
self.notify.send(
f"🔬 Starting chaos experiment: {attack.name}",
)
.active_attacks[attack_id] = {
: attack,
: datetime.now(),
:
}
monitor_thread = threading.Thread(
target=._monitored_execution,
args=(attack_id, attack)
)
monitor_thread.start()
._audit(, attack)
{
: ,
: attack_id,
:
}
() -> :
attack.safety.business_hours_only:
hour = datetime.now().hour
( <= hour < ):
{: , : }
attack.safety.require_healthy_baseline:
current_metrics = .metrics.get_current()
current_metrics.get(, ) > :
{: , : }
target attack.targets:
target attack.safety.excluded_hosts:
{: , : }
{: }
():
start_time = time.time()
:
._inject_failure(attack)
time.time() - start_time < attack.duration_seconds:
current = .metrics.get_current()
attack.safety.check_halt_conditions(current):
._emergency_halt(attack_id, )
.active_attacks[attack_id][] == :
._emergency_halt(attack_id, )
time.sleep()
._complete_attack(attack_id)
Exception e:
._emergency_halt(attack_id, )
():
attack = .active_attacks[attack_id][]
._rollback_failure(attack)
.active_attacks[attack_id][] =
.active_attacks[attack_id][] = reason
.notify.send(
,
)
._audit(, attack, reason)
() -> :
attack_id .active_attacks:
.active_attacks[attack_id][] =
():
.audit_log.append({
: datetime.now().isoformat(),
: action,
: attack.name,
: attack.attack_type.value,
: attack.targets,
: details,
: ._get_current_user()
})
Graduated Complexity
from dataclasses import dataclass
from typing import List
from enum import Enum
class MaturityLevel(Enum):
"""Chaos engineering maturity levels"""
LEVEL_1 = "Exploring"
LEVEL_2 = "Practicing"
LEVEL_3 = "Operating"
LEVEL_4 = "Optimizing"
@dataclass
class ChaosMaturityAssessment:
"""Assess and guide chaos engineering maturity"""
level: MaturityLevel
def recommended_attacks(self) -> List[str]:
"""What attacks are appropriate for this level"""
if self.level == MaturityLevel.LEVEL_1:
return [
"CPU stress (single host)",
"Memory pressure (single host)",
"Network latency (internal)",
"Process restart"
]
elif self.level == MaturityLevel.LEVEL_2:
return [
"Multi-host resource attacks",
"Network partition (AZ simulation)",
,
]
.level == MaturityLevel.LEVEL_3:
[
,
,
,
]
.level == MaturityLevel.LEVEL_4:
[
,
,
,
]
() -> []:
.level == MaturityLevel.LEVEL_1:
[
,
,
,
]
.level == MaturityLevel.LEVEL_2:
[
,
,
,
]
.level == MaturityLevel.LEVEL_3:
[
,
,
,
]
:
[]
:
():
.experiments_completed = []
.current_level = MaturityLevel.LEVEL_1
() -> :
assessment = ChaosMaturityAssessment(.current_level)
attacks = assessment.recommended_attacks()
completed_types = {e[] e .experiments_completed}
available = [a a attacks a completed_types]
available:
{
: ,
: assessment.prerequisites_for_next_level()
}
{
: available[],
: ,
: ._safety_notes_for_level()
}
() -> []:
.current_level == MaturityLevel.LEVEL_1:
[
,
,
,
]
.current_level == MaturityLevel.LEVEL_2:
[
,
,
]
:
[
,
,
]
Game Day Framework
from dataclasses import dataclass
from typing import List, Optional
from datetime import datetime, timedelta
@dataclass
class GameDayScenario:
"""A specific failure scenario to test"""
name: str
description: str
attacks: List['Attack']
expected_behavior: str
success_criteria: List[str]
rollback_procedure: str
@dataclass
class GameDay:
"""
Structured chaos game day - Gremlin/Amazon style.
Planned, communicated, and educational.
"""
name: str
date: datetime
duration_hours: int
scenarios: List[GameDayScenario]
facilitator: str
observers: List[str]
responders: List[str]
slack_channel: str
video_call_link: str
def generate_runbook(self) -> str:
"""Generate game day runbook"""
runbook = f"""
# Game Day: {self.name}
Date:
Duration: hours
## Facilitator
## Communication
- Slack:
- Video:
## Participants
**Observers**:
**Responders**:
## Timeline
### Pre-Game (30 min before)
- [ ] Verify monitoring dashboards are accessible
- [ ] Confirm all participants have joined
- [ ] Review halt procedures
- [ ] Capture baseline metrics
### Scenarios
"""
i, scenario (.scenarios, ):
runbook +=
runbook +=
runbook
Mental Model
Gremlin/Enterprise chaos engineering asks:
- Is this safe? Built-in safeguards, halt conditions, audit trail
- What category of failure? Resource, network, or state
- What's our maturity level? Match experiments to capability
- Who needs to know? Communication is not optional
- What did we learn? Document and share findings
Signature Gremlin Moves
- Categorized attack library (resource, network, state)
- Built-in safety controls and halt conditions
- Graduated maturity model
- Game day framework
- Enterprise features (RBAC, audit, compliance)
- Failure as a Service