Skip to content

SessionPrivacyPolicy CRD

SessionPrivacyPolicy is a namespaced enterprise CRD that captures privacy rules for session data: what gets recorded, how long it is kept, whether users can opt out, how data is encrypted at rest, and whether privacy operations are audit-logged. Policies are reusable documents — a single policy can be referenced by multiple service groups or agent overrides. The policy itself carries no binding information; binding happens at the consumer side.

apiVersion: omnia.altairalabs.ai/v1alpha1
kind: SessionPrivacyPolicy

SessionPrivacyPolicy is namespace-scoped. Policies must live in the same namespace as the Workspace or AgentRuntime that references them, except for the global default, which lives in omnia-system.

Policies are attached to consumers, not embedded in the policy itself.

Each entry in Workspace.spec.services[] has an optional privacyPolicyRef field that selects a policy in that workspace’s namespace:

apiVersion: omnia.altairalabs.ai/v1alpha1
kind: Workspace
metadata:
name: my-workspace
spec:
services:
- name: default
privacyPolicyRef:
name: my-policy

An AgentRuntime can override its service group’s policy via spec.privacyPolicyRef. The policy must exist in the same namespace as the AgentRuntime:

apiVersion: omnia.altairalabs.ai/v1alpha1
kind: AgentRuntime
metadata:
name: my-agent
namespace: my-workspace-ns
spec:
privacyPolicyRef:
name: strict-policy

When the session-api resolves the effective policy for a session, it uses the first matching rule in this chain:

  1. AgentRuntime.spec.privacyPolicyRef — per-agent override in the agent’s own namespace.
  2. The service group’s privacyPolicyRef on the Workspace whose spec.namespace.name matches the agent’s namespace. The service group is determined by AgentRuntime.spec.serviceGroup (defaults to default).
  3. The global default SessionPrivacyPolicy named default in the omnia-system namespace.
  4. No policy applies — all session data is recorded without restriction.

There is no merge semantics. The first matching policy is used in its entirety.

Binding locationPolicy must live in
Workspace.spec.services[].privacyPolicyRefThe workspace’s own namespace (spec.namespace.name)
AgentRuntime.spec.privacyPolicyRefThe AgentRuntime’s namespace
Global defaultomnia-system namespace, named default

Controls what session data is recorded.

FieldTypeDefaultRequired
recording.enabledboolYes
recording.facadeDataboolfalseNo
recording.richDataboolfalseNo
recording.piiPIIConfigNo

When recording.enabled is false, all write endpoints on the session-api return 204 No Content and drop the data.

When recording.richData is false, the middleware blocks assistant messages, tool calls, runtime events, and provider calls. User messages, status updates, and TTL refreshes continue to be accepted.

recording.facadeData controls whether facade-layer summary metadata (session open/close timestamps, user IDs, counts) is recorded.

Configures automatic PII detection and handling.

FieldTypeDescription
pii.redactboolEnable PII redaction
pii.encryptboolEncrypt detected PII instead of (or in addition to) redaction
pii.patternsstring[]PII patterns to detect. Built-in: ssn, credit_card, phone_number, email, ip_address. Custom regex with custom: prefix, e.g. custom:^[A-Z]{2}\d{6}$
pii.strategystringRedaction method: replace (default, e.g. [REDACTED_SSN]), hash (deterministic SHA-256), mask (preserve last 4 chars)
spec:
recording:
enabled: true
richData: true
pii:
redact: true
patterns:
- email
- ssn
- credit_card
strategy: replace

Privacy-specific retention overrides. These are additive constraints on top of any SessionRetentionPolicy that governs the workspace.

FieldTypeDescription
retention.facade.warmDaysint32Days to keep facade data in warm store
retention.facade.coldDaysint32Days to keep facade data in cold archive
retention.richData.warmDaysint32Days to keep rich session content in warm store
retention.richData.coldDaysint32Days to keep rich session content in cold archive

Enables end-user control over session recording.

FieldTypeDescription
userOptOut.enabledboolAllow users to opt out of recording
userOptOut.honorDeleteRequestsboolProcess user data deletion requests (GDPR/CCPA)
userOptOut.deleteWithinDaysint32Maximum days to fulfill a deletion request (minimum: 1)

When userOptOut.enabled is true and a user has opted out, all session-api write endpoints return 204 No Content and silently drop the request. The X-Omnia-User-ID header propagated by the facade and runtime enables per-user enforcement.

Configures encryption at rest for session data using envelope encryption (AES-256-GCM with a KMS-managed data key).

FieldTypeDescription
encryption.enabledboolEnable encryption
encryption.kmsProviderstringKMS provider. One of: aws-kms, azure-keyvault, gcp-kms, vault
encryption.keyIDstringKey identifier within the KMS provider
encryption.secretRef.namestringName of a Secret containing provider credentials
encryption.keyRotationKeyRotationConfigKey rotation settings

Both kmsProvider and keyID are required when enabled is true (enforced by CEL validation).

Not all fields are encrypted. Fields that are useful for analytics or operational queries remain plaintext:

ObjectEncryptedPlaintext
Messagecontent, all metadata valuesrole, type, sessionID, timestamps
ToolCallarguments, result, errorMessagename, status, sessionID, timestamps
RuntimeEventdata, errorMessageeventType, sessionID, timestamps
ProviderCall(none — entirely plaintext)all fields

The enc:v1: prefix identifies encrypted string fields (such as errorMessage). JSON envelope fields are identified by an _encryption metadata key within the stored JSON object.

FieldTypeDescription
keyRotation.enabledboolEnable automatic rotation
keyRotation.schedulestringCron expression, e.g. 0 0 1 * * for monthly
keyRotation.reEncryptExistingboolRe-encrypt existing data after rotation
keyRotation.batchSizeint32Messages per re-encryption batch (1–1000, default 100)

Key rotation updates encryption.keyID. New writes immediately use the new key. Existing ciphertext remains readable as long as the old key is still accessible in the KMS.

spec:
encryption:
enabled: true
kmsProvider: aws-kms
keyID: arn:aws:kms:us-east-1:123456789012:key/mrk-abc123
secretRef:
name: aws-kms-credentials
keyRotation:
enabled: true
schedule: "0 0 1 * *"
reEncryptExisting: true
batchSize: 100

Logs privacy-related operations (opt-out changes, deletion requests, policy applications) for compliance purposes.

FieldTypeDescription
auditLog.enabledboolEnable audit logging
auditLog.retentionDaysint32Days to retain audit entries (minimum: 1)
FieldTypeDescription
status.phasestringActive or Error
status.observedGenerationint64Last generation reconciled
status.conditionsCondition[]Standard Kubernetes conditions
status.keyRotationKeyRotationStatusKey rotation progress (when configured)
TypeMeaning
ReadyPolicy is valid and can be applied
FieldTypeDescription
keyRotation.lastRotatedAttimeTimestamp of the last successful rotation
keyRotation.currentKeyVersionstringVersion of the key currently in use
keyRotation.reEncryptionProgress.statusstringPending, InProgress, Completed, or Failed
keyRotation.reEncryptionProgress.messagesProcessedint64Messages re-encrypted so far
keyRotation.reEncryptionProgress.startedAttimeWhen re-encryption began
keyRotation.reEncryptionProgress.completedAttimeWhen re-encryption finished
apiVersion: omnia.altairalabs.ai/v1alpha1
kind: SessionPrivacyPolicy
metadata:
name: record-only
namespace: my-workspace-ns
spec:
recording:
enabled: true
facadeData: true
richData: true

Comprehensive policy — PII redaction, encryption, opt-out, audit

Section titled “Comprehensive policy — PII redaction, encryption, opt-out, audit”
apiVersion: omnia.altairalabs.ai/v1alpha1
kind: SessionPrivacyPolicy
metadata:
name: gdpr-compliant
namespace: my-workspace-ns
spec:
recording:
enabled: true
facadeData: true
richData: true
pii:
redact: true
patterns:
- email
- ssn
- credit_card
- phone_number
strategy: replace
retention:
facade:
warmDays: 90
richData:
warmDays: 30
coldDays: 365
userOptOut:
enabled: true
honorDeleteRequests: true
deleteWithinDays: 30
encryption:
enabled: true
kmsProvider: aws-kms
keyID: arn:aws:kms:us-east-1:123456789012:key/mrk-abc123
secretRef:
name: aws-kms-credentials
keyRotation:
enabled: true
schedule: "0 0 1 * *"
reEncryptExisting: false
auditLog:
enabled: true
retentionDays: 365
apiVersion: omnia.altairalabs.ai/v1alpha1
kind: SessionPrivacyPolicy
metadata:
name: default
namespace: omnia-system
spec:
recording:
enabled: true
facadeData: true
richData: false
auditLog:
enabled: true
retentionDays: 90