T09 · Insecure Skill Coding Practices
- Location
scripts/computer_use_agent.py:121- Finding
Model-Controlled Safety Confirmation Fails Open
- Content
View full analysis
bool: explanation = safety_decision.get("explanation", "") decision = safety_decision.get("decision", "") print("Safety decision:") if explanation: print(explanation) if decision != "require_confirmation": return True while True: response = input("Proceed with the action? [y/n] ").strip().lower() if response in ("y", "yes"): return True if response in ("n", "no"): return False ``` ```python args = maybe_cast_args(call.args) safety_decision = args.get("safety_decision") if isinstance(args, dict) else None if safety_decision and isinstance(safety_decision, dict): if not prompt_for_safety_confirmation(safety_decision): return {"blocked": "user_denied"}, True ``` ```python results: List[Tuple[str, Dict[str, Any]]] = [] for call in function_calls: print(f"Executing: {call.name}") result, should_stop = execute_function_call( call, page, args.screen_width, args.screen_height ) results.append((call.name, result)) if should_stop: print("Terminating due to safety denial.") browser.close() return 2 ``` ### Technical Analysis The local application asks for confirmation only when the remote model includes a dictionary-valued `safety_decision` field whose `decision` value is exactly `require_confirmation`. If the field is absent, malformed, assigned another type, or contains any other decision value, the action is allowed without an independent local safety assessment. The model is both the source of an action and the source of the metadata that determines ...[truncated 1643 chars]- Remediation
View remediation
