63 / 108 · 03 Agentic Testing Architectures · The Five Guardrails for Agentic Testing← prev⊞ allnext →☰ Read as one page
8.3Guardrail Configuration by Environment
Different environments need different guardrail profiles:
| Guardrail | Development | CI/CD | Production Monitoring |
|---|---|---|---|
| Max steps | 50 (generous) | 30 (standard) | 10 (minimal) |
| Timeout | 10 minutes | 5 minutes | 2 minutes |
| Token budget | 100K (exploration) | 50K (standard) | 10K (focused) |
| Allowed domains | * (any) |
staging.* |
prod.* (read-only) |
| Actions | All | All except DELETE | Read-only (GET, observe) |
| Failure behavior | Log + continue | Fail test + screenshot | Alert + screenshot |
Loading Configuration from Environment
from dataclasses import dataclass, field
import os
@dataclass
class HarnessConfig:
max_steps: int = field(
default_factory=lambda: int(os.getenv("AGENT_MAX_STEPS", "30"))
)
timeout_seconds: int = field(
default_factory=lambda: int(os.getenv("AGENT_TIMEOUT", "300"))
)
max_tokens: int = field(
default_factory=lambda: int(os.getenv("AGENT_MAX_TOKENS", "50000"))
)
allowed_domains: list[str] = field(
default_factory=lambda: os.getenv("AGENT_ALLOWED_DOMAINS", "").split(",")
)
allowed_actions: list[str] = field(
default_factory=lambda: os.getenv(
"AGENT_ALLOWED_ACTIONS",
"NAVIGATE,CLICK,TYPE,ASSERT,SCREENSHOT"
).split(",")
)