/** * Telemetry Policy Types * * NOTE: In the hybrid tier architecture, the OTEL Collector handles * sanitization, hashing, and routing. The SDK just emits full-fidelity data. * See obs/otel-collector/config-tiered.yaml for Collector configuration. */ import { DeploymentTypeEnum } from "@superblocksteam/shared"; export { DeploymentTypeEnum as DeploymentType }; /** * Telemetry tier definitions. * * Tier 1 (Local): Full fidelity data for debugging. Stored in customer LGTM. * Tier 2 (Operational): Sanitized metrics/traces for ops. Exported to Superblocks. * Tier 3 (Analytics): AI experience telemetry. Exported with content controls. * * In the hybrid architecture: * - SDK emits all data to the Collector * - Collector transforms and routes to appropriate tier pipelines * - Tier tagging, hashing, and filtering happen at Collector level */ export declare enum TelemetryTier { /** Full fidelity debugging data - prompts, code, tool IO, stack traces */ TIER_1_LOCAL = "tier_1_local", /** Sanitized operational metrics and traces for dashboards/billing */ TIER_2_OPERATIONAL = "tier_2_operational", /** AI experience telemetry - prompts, responses, quality signals (no tool outputs) */ TIER_3_AI_EXPERIENCE = "tier_3_ai_experience" } export declare enum EnforcementMode { /** Log violations but allow */ AUDIT = "audit", /** Block violations */ ENFORCE = "enforce" } /** * Tier 3 content export policy for runtime control during incidents. */ export interface Tier3ContentPolicy { /** Export AI prompts/responses. Kill switch for incidents. */ contentExportEnabled: boolean; /** Redact detected secrets (JWTs, API keys, PEM blocks) from content */ secretRedactionEnabled: boolean; /** Block export if tool output patterns detected in response */ toolOutputFilteringEnabled: boolean; /** Max prompt length in bytes */ maxPromptBytes: number; /** Max response length in bytes */ maxResponseBytes: number; } export interface TierConfig { /** Is this tier enabled for local retention? */ enabled: boolean; /** Is this tier enabled for export? */ exportEnabled: boolean; /** Sampling rate for this tier (0.0 - 1.0) */ sampleRate: number; } export interface TelemetryPolicy { /** Deployment context */ deploymentType: DeploymentTypeEnum; /** Per-tier configuration */ tiers: { [TelemetryTier.TIER_1_LOCAL]: TierConfig; [TelemetryTier.TIER_2_OPERATIONAL]: TierConfig; [TelemetryTier.TIER_3_AI_EXPERIENCE]: TierConfig; }; /** Tier 3 content export controls (prompts, responses). */ tier3Content: Tier3ContentPolicy; /** Enforcement behavior */ enforcementMode: EnforcementMode; /** Optional org-specific overrides */ orgOverrides?: Record>; } /** Default Tier 3 content policy (enabled with all guardrails) */ export declare const TIER3_CONTENT_POLICY_DEFAULT: Tier3ContentPolicy; /** Tier 3 content policy: disabled (kill switch) */ export declare const TIER3_CONTENT_POLICY_DISABLED: Tier3ContentPolicy; /** * Cloud deployment: all tiers enabled and exported. */ export declare const CLOUD_DEFAULT_POLICY: TelemetryPolicy; /** * Cloud-Prem deployment: Tier 1 local only, Tier 2/3 exported. * Hashing/sanitization handled by OTEL Collector. */ export declare const CLOUD_PREM_DEFAULT_POLICY: TelemetryPolicy; /** * Get the default policy for a deployment type. */ export declare function getDefaultPolicy(deploymentType: DeploymentTypeEnum): TelemetryPolicy; //# sourceMappingURL=policy.d.ts.map