Secure Mode
Secure Mode là chế độ bảo mật nâng cao của Antigravity, cung cấp các kiểm soát nghiêm ngặt hơn cho file access và browser interactions.
Secure Mode là gì?
Khi bật Secure Mode, Antigravity sẽ:
- Hạn chế truy cập file ngoài workspace
- Kiểm soát chặt browser actions
- Yêu cầu approval cho các operations nhạy cảm
Khi nào nên bật Secure Mode
✅ Nên bật
- Làm việc với code production
- Xử lý dữ liệu nhạy cảm
- Môi trường enterprise/corporate
- Khi cần audit trail rõ ràng
❌ Có thể tắt
- Development/sandbox environment
- Personal projects
- Khi cần tốc độ cao
- Prototyping nhanh
Các tính năng bảo mật
File Access Control
| Tính năng | Mô tả |
|---|---|
| Workspace isolation | Chỉ access files trong workspace |
| Read-only areas | Một số paths chỉ được đọc |
| Sensitive files protection | Protection cho .env, secrets, etc. |
Browser Security
| Tính năng | Mô tả |
|---|---|
| Denylist enforcement | Block malicious URLs (server-side) |
| Allowlist control | Chỉ access URLs được approve |
| Credential isolation | Không share credentials với main profile |
Execution Control
| Tính năng | Mô tả |
|---|---|
| Command approval | Review trước khi chạy commands |
| Dangerous command blocking | Block rm -rf, sudo, etc. |
| Resource limits | Giới hạn CPU/memory usage |
Denylist
Denylist được enforce server-side bởi Google’s BadUrlsChecker:
- Block phishing sites
- Block malware sources
- Block known dangerous URLs
Denylist luôn được ưu tiên - không thể bypass bằng allowlist.
Allowlist
Allowlist là file local bạn kiểm soát:
# ~/.antigravity/allowlist.txt
localhost
127.0.0.1
*.mycompany.com
staging.myapp.comMặc định
Allowlist mặc định chỉ chứa:
localhostThêm URL vào Allowlist
Cách 1: Khi được prompt
- Agent sẽ hỏi khi truy cập URL mới
- Click “Always allow” để thêm vào allowlist
Cách 2: Edit file trực tiếp
- Mở
~/.antigravity/allowlist.txt - Thêm URLs, mỗi URL một dòng
Wildcards
Allowlist hỗ trợ wildcards:
*.example.com # All subdomains
api.example.com # Specific subdomainBật/Tắt Secure Mode
Qua Settings
- Mở Settings (
Cmd+,/Ctrl+,) - Tìm “Secure Mode”
- Toggle on/off
Qua Command
"Bật Secure Mode cho conversation này"
"Tắt Secure Mode"Secure Mode vs Regular Mode
| Aspect | Secure Mode | Regular Mode |
|---|---|---|
| File access | Workspace only | Broader access |
| Browser URLs | Allowlist required | Prompt per session |
| Commands | Always approve | Safe commands auto-run |
| Speed | Slower (more approvals) | Faster |
| Safety | Higher | Standard |
Best Practices
🔐 Production Environments
Luôn bật Secure Mode khi làm việc với:
- Production databases
- Customer data
- Secret keys
- Financial systems
📝 Maintain Allowlist
- Chỉ thêm URLs bạn thực sự cần
- Review allowlist định kỳ
- Remove URLs không còn dùng
⚠️ Sensitive Operations
Dù có Secure Mode, vẫn nên:
- Review mọi database queries
- Double-check file deletions
- Verify before pushing to production
Logging và Auditing
Secure Mode cung cấp:
- Action logs - Mọi action được log
- Approval history - Ai đã approve gì
- Access attempts - Log các lần truy cập bị block
Logs hữu ích cho:
- Security audits
- Debugging
- Compliance requirements
Last updated on