Add comprehensive security documentation and improve command filtering

Co-authored-by: kingassune <6126851+kingassune@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-03 22:10:43 +00:00
parent 8b4e0a8868
commit cbb99c64e5
3 changed files with 271 additions and 1 deletions

View File

@@ -10,7 +10,8 @@ from nanobot.agent.tools.base import Tool
# List of potentially dangerous command patterns
DANGEROUS_PATTERNS = [
r'rm\s+-rf\s+/', # rm -rf /
r'rm\s+-rf\s+/\s*$', # rm -rf / (at root only)
r'rm\s+-rf\s+/(?![\w/])', # rm -rf / followed by whitespace or end
r':\(\)\{\s*:\|:&\s*\};:', # fork bomb
r'mkfs\.', # format filesystem
r'dd\s+if=.*\s+of=/dev/(sd|hd)', # overwrite disk