Skip to content
guidePhase: PlanData SecurityGuide 14 of 16

Roles: security · data steward

Guide: Data Governance Layers ​

Decision: How to classify, control, retain, and trace data — including what may enter AI prompts and RAG indexes.

Related: data-governance.md · ai-guardrails-security.md · SOP-010 · monitoring-tracing-logging.md


Layer 1 — Classification & catalog ​

ApproachProsCons
Manual labels in catalog (Glue, Collibra, Atlan)Business-owned definitionsDrift if not enforced in code
Automated classification (Macie, Microsoft Purview)Finds PII in S3/RDSFalse positives; tuning
Tag-based (AWS resource tags + ABAC)Policy-enforceableTag hygiene required
Schema annotations (OpenAPI x-classification)Close to API contractOnly covers declared fields

Recommended: Combine schema annotations for APIs + Macie for object stores + steward-owned catalog glossary.

Classification tiers (example) ​

TierExamplesAI promptRAG indexLog/trace
PublicMarketing copyAllowedAllowedAllowed
InternalInternal APIs docsEnterprise AI onlyInternal indexAllowed masked
ConfifiedCustomer metadataDeny by defaultSeparate restricted indexRedact fields
RestrictedPII, PCI, PHINeverNever without legal sign-offNever log raw

Layer 2 — Access control ​

ToolScopeProsCons
IAMAWS resourcesUniversal on AWSCoarse without ABAC
Lake FormationData lake tablesFine-grained LF-tagsLake-centric
Row/column security (RDS, Redshift)DatabaseStrong for SQLPer-engine setup
VPC + PrivateLinkNetwork pathData doesn't traverse public internetComplexity
KMS CMK per tierEncryption keysAudit via CloudTrailKey management overhead

Pitfall: AI-generated SQL or queries bypass app-layer checks → use least-privilege DB roles + query audit.

→ Full IAM, RBAC, secrets, and CI OIDC patterns: Guide: Identity, access & secrets.


Layer 3 — Retention & deletion ​

ApproachProsCons
S3 lifecycle rulesAutomatic tier/expireMisconfigured rule deletes early
CloudWatch log retentionSimple per groupEasy to set too long (cost + compliance)
Legal hold (S3 Object Lock)Litigation readyBlocks deletion
Right-to-erasure workflowGDPR complianceMust map all copies (backups, indexes)

With AI/RAG: Embeddings and vector stores are copies — deletion must include index purge, not just source S3.


Layer 4 — Lineage & quality ​

ToolPurposeProsCons
OpenLineage / MarquezPipeline lineageOpen standardRequires instrumentation
AWS Glue Data CatalogAWS-native metadataIntegrated with Athena/Glue jobsAWS-centric
Great Expectations / SodaData quality checksCatches bad AI training inputsAnother pipeline stage
dbt testsTransform layer QADev-friendlyWarehouse-specific

Pitfall: AI generates ETL without documenting lineage → require ADR + lineage emit on new pipelines.


Layer 5 — AI-specific governance ​

ControlPurposeOptions
Prompt boundaryBlock restricted data in modelsGateway proxy, DLP on egress
RAG scopeIndex only approved docsSeparate indexes by classification
Training prohibitionEnterprise contractCursor/Q/Bedrock enterprise tiers
Synthetic dataDev and testFaker, Gretel, domain fixtures
Audit logWho prompted whatBedrock logging, gateway logs

Cross-reference SOP-010.


AWS services map (reference) ​

ConcernAWS services
Discover PIIMacie, GuardDuty ( exfil patterns )
CatalogGlue Data Catalog, DataZone
Lake accessLake Formation
EncryptionKMS, SSE-S3, TLS
AuditCloudTrail, CloudTrail Lake
DLP patternsMacie custom data identifiers
Backup retentionAWS Backup with locked vaults

Third-party: Collibra, Alation, Immuta, BigID — when enterprise data office already standardized.


Pitfalls ​

PitfallWhy it hurtsMitigation
Prod snapshot in devCompliance breachSynthetic fixtures only
Full JSON bodies in logsPII in CloudWatchRedact + allowlist fields
Single RAG index for all docsRestricted text in agent contextSplit indexes by classification
AI summarizes customer ticket with PIIPrompt leakTicket scrubbing before AI
Retention "forever" on logsCost + legal exposureTier-based retention ADR
Classification without enforcementLabels ignoredOPA/IAM/Macie alerts
Forgotten vector embeddingsErasure requests failIndex lifecycle tied to source
Cross-border inferenceRegulatory violationRegion-pinned Bedrock, data residency ADR

  1. Define 4-tier classification glossary (steward-owned)
  2. Macie on S3 + secret/PII patterns in CI logs
  3. OpenAPI field classification for external APIs
  4. Separate RAG indexes: internal vs restricted (restricted = none for coding agents)
  5. CloudTrail + Bedrock invocation logging
  6. Retention ADR per data domain

Record choices in your project's ADRs.


Reference template only — no production code. Adapt in your own project.