T09 · Insecure Skill Coding Practices
- Location
scripts/monitor.py:164- Finding
Critical pause and kill actions are recorded but never enforced
- Content
View full analysis
list[Alert]: alerts = [] # Rate limit check violation = self.rules.check_rate_limit(event.action, self.events) if violation: alerts.append(Alert("warn", "rate_limit", violation, event, "log")) # Tool allowlist if event.tool: violation = self.rules.check_tool_allowlist(event.tool) if violation: alerts.append(Alert("critical", "tool_block", violation, event, "pause")) self.paused_agents.add(event.agent_id) # Budget check self.total_cost += event.cost_usd violation = self.rules.check_budget(self.total_cost) if violation: alerts.append(Alert("fatal", "budget", violation, event, "kill")) # Scope check if event.target: violation = self.rules.check_scope(event.target) if violation: alerts.append(Alert("critical", "scope", violation, event, "pause")) self.paused_agents.add(event.agent_id) # Anomaly detection anomaly = self.detector.detect_anomaly(event, self.events) if anomaly: alerts.append(Alert("warn", "anomaly", anomaly, event, "log")) self.events.append(event) self.detector.update_baseline(self.events) self.alerts.extend(alerts) return alerts ``` ### Technical Analysis The monitor represents enforcement outcomes only as alert metadata. For tool and scope violations, it adds the agent identifier to `paused_agents`, but `process_event()` never checks that set before accepting later events. A fatal budget violation creates an alert whose `action_taken` value is `"kill"`, but it does not terminate, disable, reject, or otherwise constrain the offending agent. The implementation also lacks an enforcement callback or interface through which the mon ...[truncated 1381 chars]- Remediation
View remediation
