Version: 2.0.0
Last Updated: 2025-01-05
- Security Model
- Authentication
- Authorization
- Data Protection
- Network Security
- Vulnerability Reporting
- Security Best Practices
- Security Updates
AgentMem implements a multi-layered security model:
- Authentication: Verify user identity
- Authorization: Control access to resources
- Encryption: Protect data in transit and at rest
- Audit Logging: Track security events
- Input Validation: Prevent injection attacks
Default authentication method
// Generate token
let token = jwt::encode(
&Header::default(),
&Claims::new(user_id, expiration),
&EncodingKey::from_secret(secret.as_ref()),
)?;Features:
- Stateless authentication
- Configurable expiration
- Refresh token support
- Secure secret management
For service-to-service communication
curl -H "X-API-Key: your-api-key" \
http://localhost:8080/api/v1/memoriesFeatures:
- Per-service keys
- Key rotation support
- Scope-based permissions
For web UI
- Secure session cookies
- CSRF protection
- Session timeout
AgentMem supports fine-grained permissions:
- Admin: Full system access
- User: Standard user access
- Service: Service account access
- Read-Only: Read-only access
memory:read- Read memoriesmemory:write- Create/update memoriesmemory:delete- Delete memoriesagent:manage- Manage agentsuser:manage- Manage userssystem:admin- System administration
Memories are scoped by:
- User: User-specific memories
- Agent: Agent-specific memories
- Organization: Organization-wide memories
- Session: Session-specific memories
- TLS 1.2+ for all HTTP connections
- HTTPS required in production
- Certificate validation
- Database encryption (optional)
- Vector store encryption (optional)
- Backup encryption (recommended)
- Multi-tenancy: Complete data isolation
- Scoped access: Memory scoping
- User separation: User-level isolation
Recommended Ports:
8080: HTTP API (internal)8443: HTTPS API (production)9090: Metrics (internal)
Block:
- Direct database access
- Internal service ports
- API rate limits: Prevent abuse
- IP-based throttling: DDoS protection
- User-based limits: Fair usage
// Production CORS settings
let cors = Cors::default()
.allow_origin("https://yourdomain.com")
.allow_methods([Method::GET, Method::POST])
.allow_headers([CONTENT_TYPE, AUTHORIZATION]);Security vulnerabilities should be reported privately:
- Email: security@agentmem.dev
- PGP Key: [Link to key]
- Response Time: Within 48 hours
- Disclosure: Coordinated disclosure
- Description of vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
- Do not publicly disclose until fixed
- Do not exploit vulnerabilities
- Do allow time for fix
- Do coordinate disclosure
-
Use Strong Secrets
# Generate secure secret openssl rand -base64 32 -
Enable HTTPS
[server] tls_enabled = true tls_cert = "/path/to/cert.pem" tls_key = "/path/to/key.pem"
-
Regular Updates
- Keep AgentMem updated
- Update dependencies
- Monitor security advisories
-
Audit Logging
[observability] audit_logging = true log_level = "info"
-
Backup Encryption
# Encrypted backup tar czf - data/ | gpg -c > backup.tar.gz.gpg
-
Input Validation
// Validate user input if content.len() > MAX_MEMORY_LENGTH { return Err(Error::InvalidInput); }
-
SQL Injection Prevention
- Use parameterized queries
- Validate all inputs
- Use ORM where possible
-
XSS Prevention
- Sanitize user input
- Use content security policy
- Escape output
-
Secret Management
// Use environment variables let api_key = std::env::var("API_KEY") .expect("API_KEY not set");
- Monitor: Security advisories
- Assess: Vulnerability severity
- Patch: Apply security fixes
- Test: Verify fixes
- Deploy: Update production
- Notify: Inform users
- Current Version: Full support
- Previous Version: Security patches only
- Older Versions: No support
- Failed authentication attempts
- Rate limit violations
- Unusual access patterns
- Error rates
- Multiple failed logins
- Unusual API usage
- Security events
- System anomalies
- Email: security@agentmem.dev
- PGP: [Link to key]
- Response Time: 48 hours
Last Updated: 2025-01-05
Version: 2.0.0