firewall_check
Analyze code files for security risks by comparing structural patterns against known dangerous code to prevent malicious execution.
Instructions
Check if code is safe to pass to execution tools like rlm_exec.
Parses the code, normalizes to structural skeleton, embeds via Ollama, and checks similarity against blacklisted dangerous patterns.
Args: file_path: Path to the code file to check
Returns: { "allowed": bool, # True if safe to proceed "blocked": bool, # True if matched blacklist "similarity": float, # Similarity to closest blacklist match (0-1) "matched_pattern": str, # ID of matched pattern (if blocked) "reason": str, # Why it was blocked (if blocked) "near_miss": bool, # True if close but not blocked "structure_hash": str, # Hash of normalized structure }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes |