文档/安全配置

安全配置

详细的安全策略配置选项

完整配置

[security]
# 启用沙箱隔离
sandbox_enabled = true
# 沙箱后端: auto | windows_job | landlock | firejail | bubblewrap | docker
sandbox_backend = "auto"
# 默认本地绑定
bind_local = true
# 启用操作审计
audit_enabled = true
# 审计日志路径
audit_path = "~/.config/axoncog/audit.log"
# 危险操作需确认
confirm_dangerous = true

[security.whitelist]
# 允许访问的目录
paths = ["~/projects", "~/Documents"]
# 允许执行的命令
commands = ["git", "cargo", "npm", "python"]
# 允许访问的域名
domains = ["api.openai.com", "api.deepseek.com"]

[security.limits]
# 最大内存使用(MB)
max_memory = 1024
# 最大CPU时间(秒)
max_cpu_time = 300
# 最大文件大小(MB)
max_file_size = 100

白名单机制

只有白名单中的资源才能被 AI 访问。不在白名单的操作会被拒绝。

拒绝:
读取 /etc/passwd
不在白名单路径中
允许:
读取 ~/projects/main.rs
在白名单路径中