Audit Log, Token Manager & Privacy Guard
Security observability, authentication token lifecycle, and privacy protection — the operational side of PrismSecurity.
Security Audit Log
Tamper-evident, append-only event log using SHA-256 hash chains. Each entry’s hash depends on the previous — breaking one link invalidates the chain.
Record Events
24 Event Kinds
Query and Filter
Verify Integrity
Export
Capacity Management
The hash chain uses SHA256(event.id + event.kind + event.detail + event.timestamp + previousHash). Verifying integrity is O(n) — call it periodically, not on every write.
Token Manager
Actor-based JWT token lifecycle with automatic refresh and concurrent request handling.
Store Tokens
Get Valid Token (Auto-Refresh)
Concurrent Refresh Handling
Multiple concurrent callers won’t trigger parallel refresh requests — the actor queues them and shares the result:
JWT Decode
PrismAccessToken.decode parses the JWT payload without verifying the signature — it’s for client-side claim inspection only. Always validate tokens server-side.
Token Configuration
Intercept Requests
Privacy Guard
PII Redaction
Detect and redact personally identifiable information using regex patterns.
Redaction Styles
PII Types
Privacy Guard (Unified Facade)
Privacy Levels
Screen Protection (SwiftUI)
Hide sensitive content when the app goes to background or appears in the app switcher.
Or wrap in a secure container:
When the app leaves the foreground, a lock overlay with a shield icon replaces the content.
Clipboard Guard
Auto-clear the clipboard after copying sensitive data.
Screen protection uses @Environment(\.scenePhase) — it must be applied inside a SwiftUI view hierarchy that receives scene phase changes. It won’t work in isolated view previews.