Segurança
Criptografia em nível de campo para proteger dados sensíveis em seus agentes Astreus
Visão Geral#
O Astreus inclui criptografia AES-256-GCM integrada para proteger dados sensíveis armazenados em seu banco de dados. Este recurso fornece criptografia transparente em nível de campo para conversas, prompts de sistema, dados de tarefas e conteúdo da base de conhecimento.
Configuração Rápida#
1. Gere a Chave de Criptografia#
# Generate a cryptographically secure 256-bit key
openssl rand -hex 322. Configure o Ambiente#
# Enable encryption
ENCRYPTION_ENABLED=true
# Your secure master key (keep this secret!)
ENCRYPTION_MASTER_KEY=your-256-bit-encryption-key-here
# Optional: specify algorithm (default: aes-256-gcm)
ENCRYPTION_ALGORITHM=aes-256-gcm3. Use Normalmente#
import { Agent } from '@astreus-ai/astreus';
// Create agent with sensitive system prompt
const agent = await Agent.create({
name: 'SecureAgent',
systemPrompt: 'Your confidential business logic here', // ← Automatically encrypted
memory: true,
knowledge: true
});
// All interactions automatically encrypted
const response = await agent.ask('Sensitive question here');
// Knowledge uploads automatically encrypted
await agent.knowledge.addDocument(
'Confidential Document',
'Sensitive content here' // ← Automatically encrypted
);Gerenciamento de Chaves#
Requisitos da Chave Mestra#
- Comprimento Mínimo: 32 caracteres (256 bits)
- Geração: Use geradores aleatórios criptograficamente seguros
- Armazenamento: Armazene com segurança fora do código-fonte
- Rotação: Planeje rotações periódicas de chave