Back to skill

Security audit

safety-interlocks

Security checks for vulnerabilities and agentic risk

Overview

The skill is a simple safety-control guidance document, but its example code has safety-critical gaps that could lead users to implement incomplete interlocks.

Treat this skill as requiring review before installation or use. It does not appear to perform hidden or privileged actions, but its safety-control examples should not be copied into real equipment, industrial control, lab automation, robotics, or other high-impact systems without substantial engineering review, explicit lower- and upper-limit handling, finite-value checks, verified fail-safe actions, and tests.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:17
Finding

Minimum Safety Limit Is Accepted but Never Enforced

Content
View full analysis
= max_limit: command = min_output # Emergency cutoff safety_triggered = True # Clamp output to valid range command = max(min_output, min(max_output, command)) return command, safety_triggered ``` ### Technical Analysis The function accepts `min_limit` as the minimum safe measurement value, but never compares the measurement against it. It therefore appears to provide upper- and lower-bound protection while enforcing only the upper bound. Output clamping does not compensate for this omission. Clamping restricts the actuator command to a configured range, but it does not select a fail-safe action when the measured process value falls below its safe operating range. ### Attack Path 1. A sensor failure, process fault, or manipulated sensor input causes `measurement` to fall below `min_limit`. 2. The only measurement interlock, `measurement >= max_limit`, evaluates to false. 3. `safety_triggered` remains false. 4. The requested command is only clamped to the ordinary output range. 5. The control system continues operating despite the process being outside its documented lower safety boundary. ### Impact Assessment No operating-system privileges are obta ...[truncated 471 chars]
Remediation
View remediation
= max_limit: return upper_limit_safe_output, True if measurement <= min_limit: return lower_limit_safe_output, True ``` ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:35
Finding

Non-Finite Sensor Values Can Bypass Runtime Safety Interlocks

Content
View full analysis
= max_limit: command = min_output # Emergency cutoff safety_triggered = True # Clamp output to valid range command = max(min_output, min(max_output, command)) ``` ```python def compute(self, measurement, dt): """Compute safe control output.""" # Check safety FIRST if measurement >= self.max_limit: self.safety_events.append({ "measurement": measurement, "action": "emergency_cutoff" }) return self.min_output # Normal control output = self.controller.compute(measurement, dt) # Clamp to valid range return max(self.min_output, min(self.max_output, output)) ``` ### Technical Analysis Neither runtime safety path verifies that `measurement` is finite before comparing it with the configured limit. In Python, a comparison such as `float("nan") >= max_limit` evaluates to false. A `NaN` sensor value can therefore bypass the emergency cutoff and reach the underlying controller. Infinity and invalid measurement types also require explicit handling. Even when an infinite value happens to trigger one comparison direction, relying on ordinary comparisons does not provide a complete sensor-integrity policy. The controller output is likewise not explicitly checked for finiteness before clamping. ### Attack Path 1. A failed sensor, malformed integration response, numerical error, or manipulated data source supplies `NaN` as `measurement`. 2. The expression `measurement >= max_limit` evaluates to false. 3. The emergency cutoff and safety-event logging are skipped. 4. `self.controller.compute(measurement, dt)` receives the invalid value. 5. The controller may return `NaN`, an extreme result, or otherwise undefined output. ...[truncated 605 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:116
Finding

Pre-Control Safety Validation Relies on Removable Assertions

Content
View full analysis
Remediation
View remediation
= config["max_limit"]: raise ValueError("Safety limits are inconsistent") return True ``` ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:78
Finding

Open-Loop Safety Monitoring Applies the Cutoff Only After an Unsafe Step

Content
View full analysis
= max_limit: current_input = 0.0 # Cut input return data ``` ### Technical Analysis The function applies `current_input` through `system.step()` before examining the resulting measurement. Once the output reaches or exceeds `max_limit`, the code merely changes the input for the next iteration. It does not terminate the loop, invoke an emergency stop, verify that zero is the correct fail-safe command, or confirm that the system entered a safe state. This creates a time-of-check-after-use condition in a safety-critical path. At least one hazardous step has already occurred before mitigation begins, and physical inertia, transport delay, actuator latching, or stored energy can make a next-cycle zero command insufficient. The result is also accessed without validating key presence, type, or finiteness, so malformed telemetry may prevent a controlled shutdown. ### Attack Path 1. Open-loop excitation begins with `current_input = input_value`. 2. `system.step(current_input)` applies the command before checking the safety threshold. 3. The process output crosses `max_limit` during that step. 4. The function sets `current_input` to zero only for the next iteration. 5. The loop continues instead of invoking an immediate stop or aborting the test. 6. The system may overshoot further because of inertia, delayed response, latched outputs, or an unsafe interpretation of zero input. An attacker able to influence ...[truncated 692 chars]
Remediation
View remediation
= max_limit: system.emergency_stop() log_safety_event(result, current_input) break ``` ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep