Skip to content

Source Code Leak Prevention Guide

Risk Scenarios

  • Developers sending internal confidential information to external APIs via unrestricted copy-paste
  • Inadequate access control for prompt log storage
  • Third-party extensions extracting data via pre-encryption hooks

Control Layers

LayerSpecific MeasuresMetrics
PolicyClassification levels (PUBLIC/INT/CONF)Label assignment rate
ToolingPre-send scanner (PII/secret keywords)Block count
InfrastructureTransparent encryption / KMS key rotationKey rotation interval
LoggingTransmission hash + minimal traceRecoverability
EducationLeast privilege & exception proceduresTraining completion rate

Pre-Prompt Transmission Inspection Flow

  1. Extract diff & isolate changed lines only
  2. Inspect for secret patterns/PII
  3. Confidentiality threshold score > threshold → mask or block
  4. Store hash + emit audit event

Back to: index.md