セキュリティ

Astreusエージェント内の機密データを保護するための、フィールドレベル暗号化

概要#

Astreusには、データベースに保存された機密データを保護するための、組み込みのAES-256-GCM暗号化が含まれています。この機能は、会話、システムプロンプト、タスクデータ、ナレッジベースのコンテンツに対して、透過的なフィールドレベル暗号化を提供します。

クイックセットアップ#

1. 暗号化キーの生成#

bash
# Generate a cryptographically secure 256-bit key
openssl rand -hex 32

2. 環境の設定#

bash
# 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-gcm

3. 通常通り使用する#

javascript
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
);

キー管理#

マスターキーの要件#

  • 最小長: 32文字(256ビット)
  • 生成: 暗号学的に安全な乱数生成器を使用する
  • 保存: コードベースの外部に安全に保存する
  • ローテーション: 定期的なキーローテーションを計画する