Security Architecture
The Sigilum protocol implements a defense-in-depth security model with multiple layers of protection:Cryptographic Foundation
Ed25519 signatures provide the core security primitive:- 128-bit security strength
- Fast signature generation and verification
- Small signature size (64 bytes)
- Resistant to timing attacks
- No random number generation required during signing
- Private keys are 32 bytes
- Public keys are 32 bytes
- Signatures are 64 bytes
- Deterministic signature generation
Local-First Security Model
Identity creation and signing are local operations:- No hosted dependency required at agent runtime
- Private keys never leave the local machine
- Identity files stored in
~/.sigilum/identities/<namespace>/ - Verification is deterministic and offline-capable for signature checks
- Identity files should use filesystem permissions (recommended:
0600) - Private keys stored in plaintext locally (rely on OS-level protection)
- Future: Hardware security module (HSM) support for production deployments
Threat Model
Protected Against
The protocol protects against:1. Man-in-the-Middle Attacks
Protection: Ed25519 signatures ensure message authenticity and integrity. Attack scenario: Attacker intercepts and modifies request. Defense: Any modification invalidates the signature. Signature verification fails.2. Replay Attacks
Protection: Nonce and timestamp validation. Attack scenario: Attacker captures valid signed request and replays it. Defense mechanisms:- Nonce uniqueness: Each request includes a unique nonce (UUID v4)
- Nonce tracking: Services track seen nonces within timestamp window
- Timestamp freshness:
createdtimestamp must be recent - Bounded replay window: Implementation-defined maximum age (e.g., 5 minutes)
3. Body Tampering
Protection:content-digest header with SHA-256 hash.
Attack scenario: Attacker modifies request body but keeps headers.
Defense: Content-digest mismatch detected during verification.
Example:
4. Header Tampering
Protection: All Sigilum headers are included in signature. Attack scenario: Attacker modifiessigilum-namespace to impersonate another namespace.
Defense: Modified header invalidates signature.
Signed headers:
sigilum-namespacesigilum-subjectsigilum-agent-keysigilum-agent-cert
5. Key Substitution
Protection: Certificate binding. Attack scenario: Attacker provides their own key and certificate. Defense mechanisms:- Certificate includes namespace binding
- Certificate proof signed by the agent key itself
- Namespace authorization checked against registry
- Key must be approved for the namespace/service combination
6. Downgrade Attacks
Protection: Single supported algorithm (Ed25519). Attack scenario: Attacker attempts to downgrade to weaker algorithm. Defense: Onlyalg="ed25519" is accepted. No algorithm negotiation.
NOT Protected Against
The protocol does NOT protect against:1. Compromised Private Keys
If an agent’s private key is compromised:- Attacker can sign valid requests
- Attacker can impersonate the agent
- Detect unusual activity patterns
- Revoke compromised key:
revokeClaimDirect(namespace, publicKey, service) - Rotate to new key
- Future: Hardware security modules (HSMs)
2. Compromised Namespace Owner
If namespace owner account is compromised:- Attacker can approve malicious agents
- Attacker can transfer namespace ownership
- Strong authentication for namespace owner
- Multi-signature approval for critical operations
- Audit logging of all namespace operations
- Regular review of authorized agents
3. Local Filesystem Access
If attacker gains local filesystem access:- Can read private keys from
~/.sigilum/identities/ - Can exfiltrate identity files
- OS-level filesystem permissions
- Full-disk encryption
- Secure workstation practices
- Future: Encrypted identity storage with passphrase
4. Side-Channel Attacks
Timing, power analysis, or other side-channel attacks:- Ed25519 is designed to be resistant to timing attacks
- Implementation-dependent vulnerabilities possible
- Use vetted cryptographic libraries
- Regular security audits
- Follow constant-time implementation practices
Authentication and Authorization
Two-Level Security Model
Sigilum separates authentication from authorization:1. Signature Verification (Authentication)
Proves:- Request came from holder of private key
- Request has not been tampered with
- Request is fresh (not replayed)
- Agent is authorized for the specific operation
- Subject has permission for the resource
2. Namespace Authorization (Authorization)
Checks:- Agent key is approved for namespace/service
- Subject has permission for the operation
- Service-specific authorization rules
Subject-Level Authorization
Thesigilum-subject header enables fine-grained authorization:
Use cases:
- MCP tool filtering per user
- Resource access control
- Rate limiting per subject
- Audit trail attribution
Key Management
Key Lifecycle
Creation:- Private keys stored in local filesystem
- Public keys registered in DID Document
- Certificate binds key to namespace
Best Practices
DO:- Generate keys locally using cryptographically secure random number generator
- Store private keys with restrictive filesystem permissions (
0600) - Rotate keys regularly (e.g., every 90 days)
- Revoke keys immediately upon suspected compromise
- Use separate keys per service when possible
- Audit approved keys regularly
- Share private keys between agents
- Transmit private keys over network
- Store private keys in version control
- Log private keys
- Use the same key across multiple namespaces
Certificate Security
Certificate Structure
Certificates are self-signed proofs binding a key to a namespace:Certificate Validation
Verifiers MUST check:- Proof signature: Verify
proof.sigagainst canonical certificate text - Namespace consistency: Certificate namespace matches request header
- Key consistency: Certificate public key matches request header
- KeyID format:
keyIdfollowsdid:sigilum:<namespace>#ed25519-<suffix>format - Expiration: If
expiresAtis set, certificate must not be expired - Registry authorization: Key must be approved in namespace registry
Certificate Expiration
Current behavior:- Most certificates have
expiresAt: null(no expiration) - Expiration is optional
- Enforce maximum certificate lifetime (e.g., 1 year)
- Require periodic re-certification
- Automated certificate renewal
Replay Protection
Nonce Management
Services MUST track nonces to prevent replay attacks: Storage requirements:- Store nonce with timestamp
- Index by nonce for fast lookup
- Expire entries after maximum request age
- Share nonce store across service replicas
- Use Redis or similar for shared state
- Accept small race condition window (duplicate nonce detection is best-effort)
Timestamp Validation
Clock skew tolerance:- Accept timestamps slightly in the future (e.g., +30 seconds)
- Accept timestamps within maximum age (e.g., -5 minutes)
Content Integrity
Content-Digest Algorithm
Required algorithm: SHA-256 Format: RFC 9530 structured field:Body Hashing
Process:- Take raw request body bytes (before any parsing)
- Compute SHA-256 hash
- Encode hash in base64
- Format as
sha-256=:hash:
Verification
Requirements:- Compute digest from received body
- Compare to
content-digestheader value - Comparison MUST be constant-time to prevent timing attacks
Network Security
Transport Security
HTTPS required:- All production traffic MUST use HTTPS
- TLS 1.2 or higher
- Strong cipher suites only
- Signatures prove authenticity and integrity
- HTTPS provides confidentiality (encryption)
- HTTPS prevents passive eavesdropping
API Endpoints
Protected endpoints:/v1/*- All API endpoints/.well-known/*- DID resolution endpoints
/health- Health checks/metrics- Prometheus metrics (if enabled)
Audit and Monitoring
Audit Logging
Log all authentication events:- Successful signature verifications
- Failed signature verifications
- Namespace operations (approve, revoke, transfer)
- Unusual patterns (rate limiting, geo-location)
Security Monitoring
Monitor for:- Sudden increase in signature verification failures
- Replay attack attempts (nonce reuse)
- Unauthorized namespace access attempts
- Key usage from unexpected IP addresses
- Unusual request patterns (rate, timing)
- Multiple signature failures from same namespace
- Nonce replay detection
- Unauthorized claim approval attempts
- Key compromise indicators
Security Best Practices
For Namespace Owners
- Secure namespace account with strong authentication
- Review authorized agents regularly
- Revoke unused keys promptly
- Monitor audit logs for unusual activity
- Use subject identifiers accurately
- Rotate keys periodically
- Enable multi-signature approval for critical operations (future)
For Agent Operators
- Protect private keys with filesystem permissions
- Use separate keys per service when possible
- Monitor for compromised keys
- Rotate keys every 90 days
- Never share keys between agents
- Use hardware security modules for production (future)
For Service Operators
- Enforce signature verification on all protected endpoints
- Implement replay protection with nonce tracking
- Validate all components (method, URI, headers, body)
- Check namespace authorization after signature verification
- Log all authentication events
- Monitor for attack patterns
- Use HTTPS for all traffic
- Implement rate limiting per namespace/subject
Vulnerability Disclosure
If you discover a security vulnerability in the Sigilum protocol or implementation:- Do NOT open a public GitHub issue
- Email [email protected] with:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
- Allow 90 days for remediation before public disclosure
- Coordinate disclosure timeline with Sigilum team
Related Documentation
Protocol Overview
High-level protocol documentation
Signing Profile
RFC 9421 signing profile details
DID Method
DID method specification
TypeScript SDK
SDK implementation and usage