Rules: Security
Детализация security правил. Red lines определены в Codex, здесь — имплементация.
Authentication & Access
Agent Identity
- Каждый агент имеет уникальный
agent_id - Все tool calls привязаны к
agent_idв audit log - Нет shared credentials между агентами
- Agent identity не может быть подменена через prompt
Tool Access
- Allowlist per agent в
roles/*.yaml - Enforce через Policy-Layer (code, не промпты)
- Нет wildcard доступа (
allowed_tools: ["*"]запрещён)
Secrets Management
- Никогда в промптах — masking обязателен
- Никогда в логах — masking на уровне logger
.envне в git (.gitignore)- Rotation: каждые 90 дней для production credentials
- При подозрении на leak → немедленная ротация + incident
Data Classification
| Класс | Примеры | Доступ агентов | Внешние |
|---|---|---|---|
| Public | Manifest, цены, документация | Все — read | Да |
| Internal | Планы, OKR, roadmap | Агенты — read | Нет |
| Confidential | Клиенты, финансы | Specific agents | Нет |
| Secret | Пароли, API keys | Vault only | Нет |
| PII | Email, телефон, имя клиента | Specific + masking | Нет |
Least Privilege
- Минимум tools per agent — только необходимые для роли
- Memory scope:
self/department— неglobal(кроме read) - Write
global— только Agent-Librarian после review - Нет доступа к другим departments (кроме через CEO)
Destructive Operations
Требуют human approval через Telegram confirmation:
DELETEоперации (данные, файлы, записи)- Внешние сообщения (email, chat, social)
- Финансовые операции (любые)
- Изменения production (deploy, config, DNS)
- Создание/модификация user accounts
Список DESTRUCTIVE_TOOLS определён в коде Policy Engine — не в промптах.
Prompt Injection Defence
Input Sanitization
- Вход пользователя помечается флагом
untrusted_user_input - Fetched web pages —
untrusted_external_content - Policy Engine не выполняет tool calls, извлечённые из содержимого fetched pages
System Prompt Integrity
- Системный промпт загружается из
roles/*.yaml(код), не из user input - Пользователь не может модифицировать system prompt через сообщения
- Injected instructions в web content → ignored by Policy Engine
Defence in Depth
Input sanitization → System prompt isolation → Tool allowlist →
Policy Engine → Output validation → Audit log
Network Security
- Нет direct internet access кроме approved tools (
web_search,web_fetch) - Whitelist доменов для strict mode (Phase 2)
- Rate limits: 100 requests/hour per agent
- No outbound connections to unknown hosts
Audit
- Security events →
security_audit_log(append-only) - Retention: 2 года минимум
- Regular review: monthly sample audit
- Quarterly: full security review
Security Events (обязательная запись)
- Policy violation attempt
- Unexpected tool chain (tool A → tool B не в expected flow)
- Output содержит PII/secrets (post-execution detection)
- Escalation triggered by injection pattern
- Failed authentication attempt
- Rate limit exceeded
Incident Response
- Auto-block агента
- Telegram alert Human Owner
- Запись в
security_incidents - RCA обязательно (Root Cause Analysis)
- ADR если нужно менять policy
Review Cycle
| Когда | Что |
|---|---|
| После каждого incident | RCA + policy update |
| Ежеквартально | Full security review |
| При новых agent types | Tool allowlist review |
| При новых tools | Threat model update |
Связанные документы
- Codex — Red Lines (что нельзя)
- Policy-Layer — техническая реализация
- Rules-DataAccess — data access control
- Observability — audit logging