Your LLM Isn’t the Risk. Your Logs Are.


Why this matters right now

Most “AI governance” conversations miss the actual blast radius.

For most organizations deploying LLMs today, the primary risks are not sci‑fi autonomy or vague “AI ethics.” They’re:

  • Sensitive data leaking into logs, prompts, and third‑party APIs
  • Inability to answer basic audit questions (“Who saw what, when, via which model?”)
  • Shadow integrations that silently bypass your retention and access controls
  • Prompts and tools that violate your own policies because they never went through the same change controls as the rest of your stack

If you’re already SOC 2 or ISO 27001 compliant, generative AI doesn’t magically invalidate your controls. It quietly routes around them.

The real shift: you’ve added a probabilistic, centrally‑connected text engine that now touches:

  • Customer data
  • Source code
  • Internal strategy docs
  • Production incidents
  • Vendor conversations

…and often routes through one or more external LLM APIs whose data handling you don’t fully control or monitor.

This post is about that mundane but existential layer: privacy, governance, data retention, model risk, auditability, and how to bring policy‑as‑code discipline into your LLM stack.


What’s actually changed (not the press release)

Three concrete technical shifts matter for privacy and governance:

  1. Everything is “data” now — including context and logs

    Before LLMs:

    • You had fairly clear boundaries: DBs, queues, metrics, application logs.
    • You knew which systems held PII/PHI and which didn’t.

    With LLMs:

    • Prompts + retrieved context + tool inputs become semi‑structured blobs that often contain:
      • User emails, IDs, chat history
      • Internal tickets or logs
      • Snippets of code and configuration
    • These blobs get:
      • Sent to vendors
      • Stored in observability tools
      • Dumped into “debug logs” or tracing spans

    Your “non‑sensitive” telemetry is now quietly sensitive.

  2. Model behavior is a new failure mode

    You now have model risk on top of system risk. Even with a secure data pipeline, the model can:

    • Hallucinate non‑existent user attributes
    • Fabricate policy interpretations
    • Exfiltrate secrets seen in previous messages or tools

    This doesn’t fit neatly into existing controls like “encrypt at rest” or “RBAC.” You have to think about behavioral risk: what the model could say under what prompts.

  3. Governance boundaries blurred by orchestration

    Modern LLM apps chain:

    • Retrieval (vector DB / search)
    • Tooling (APIs, internal services)
    • Multiple models (routing / ensembles)
    • Agents / planners

    Every hop is:

    • A potential privacy violation
    • A potential policy violation
    • A logging/retention punt

    Old model:

    Request → Service → DB

    New model:

    Request → Orchestrator → Tools + Retrieval → LLM(s) → More tools → Result
    plus: logs, traces, prompt stores, evaluation artifacts, feedback data

    This graph is what your auditors care about, but most orgs don’t even have it drawn.


How it works (simple mental model)

Use this mental model to reason about privacy & governance in your LLM systems:

1. Data planes vs. control planes

  • Data plane: everything that touches user content or internal documents:

    • Prompts & responses
    • Retrieval indexes
    • Tool inputs/outputs
    • Logs and traces containing any of the above
  • Control plane: everything that decides what is allowed:

    • Access control rules
    • Data classification policies
    • Retention configurations
    • Evaluation and red‑team harnesses
    • Policy‑as‑code (OPA, custom engines, etc.)

If your LLM initiative has grown without a control plane that actually understands the data plane, you’re in “security by slide deck” territory.

2. Three kinds of policy you must encode

Think of policy‑as‑code for LLMs as three layers:

  1. Data policy – what can move where?

    • “Customer PII may not be sent to third‑party APIs in region X”
    • “Production data must be masked before entering non‑prod models”
    • “Logs containing user free‑text are retained for 30 days max”
  2. Access policy – who can do what with which data/model?

    • “Support agents can query tickets for their own region only”
    • “Only SREs can use tools that can restart production services”
    • “Only specific roles can run ‘wide’ data analysis prompts”
  3. Behavior policy – what the model is allowed to say or do

    • “Do not provide legal advice phrased as definitive”
    • “Never output raw access tokens or keys”
    • “When uncertain, defer and log instead of guessing”

All three can and should be turned into checks in code, not just guidelines on a wiki.

3. Governance primitives you actually need

You don’t need a “governance platform” buzzword. You need a small set of primitives wired through the stack:

  • Classification – identify sensitive content in prompts, context, tools, and responses.
  • Redaction / minimization – strip or mask unnecessary data before it hits the model or leaves your infra.
  • Attribution / lineage – track which data sources were used for which answer.
  • Policy evaluation – a programmable gate that can say “no” or “route differently.”
  • Audit log – immutable-ish record of:
    • Who/what called which model
    • With which data classes
    • Under which policy version
    • What was returned

If you don’t have these, you’re flying blind.


Where teams get burned (failure modes + anti-patterns)

Failure mode 1: “The LLM is private, our logs are not”

Pattern:
– You negotiate strong data retention and training terms with your LLM vendor.
– Meanwhile, prompts and responses are:
– Shipped unredacted to logging SaaS
– Mirrored to Slack or email for “triage”
– Captured in analytics events for “UX measurement”

Result:
– You’ve just multiplied your attack surface and retention footprint.
– Auditors ask “Where does customer data go?” and the real answer is “everywhere.”

Mitigation:
– Treat prompts/responses as high‑sensitivity data by default.
– Introduce logging scrubbing layers:
– Mask emails, IDs, tokens, obvious PII before logs.
– Truncate long prompts/responses or sample them carefully.


Failure mode 2: Shadow evaluations and ad‑hoc datasets

Pattern:
– A team exports production chat logs to:
– Build fine‑tuning datasets
– Evaluate model A vs model B
– Train a RAG system

  • No one updated:
    • Data processing registries
    • Retention schedules
    • Access controls on these “temporary” buckets

Result:
– Sensitive user content lives forever in S3 folders named llm-experiments/ that only one person remembers.
– You can’t convincingly prove to auditors that data was deleted or minimized.

Mitigation:
– Treat evaluation and fine‑tuning datasets as production datasets.
– Tag and classify them.
– Apply the same IAM and lifecycle policies as production DBs.


Failure mode 3: Policy only in prompt, not in code

Pattern:
– You ask the model nicely:
– “You must never reveal secrets.”
– “You must follow GDPR.”
– “You must follow our internal policy.”

  • No technical controls:
    • Tools can still return raw secrets.
    • RAG can still fetch restricted docs.
    • Logs still store everything.

Result:
– The first jailbreak prompt or prompt‑injection incident bypasses your “policies.”

Mitigation:
– Put hard constraints in code:
– Tool wrappers that redact and validate.
– Retrieval filters based on user/context ACLs.
– Output filters that detect and block forbidden content classes.


Failure mode 4: SOC 2/ISO mapped at the box level, not the flow level

Pattern:
– You update your SOC 2 narrative:
– “We added an LLM service running in VPC X with encryption at rest.”
– You don’t:
– Document data flows across tools, RAG, vendors.
– Align retention and access controls for new stores (vectors, traces, eval data).

Result:
– On paper you’re compliant; in reality:
– Unapproved third‑party embeddings services hold PII.
– Non‑prod models see prod data “for debugging.”

Mitigation:
– Extend your data flow diagrams to include:
– Orchestrator
– Vector stores / indexes
– Evaluations / labeling tools
– Observability stack
– Make this diagram the basis for your SOC 2/ISO control mappings.


Practical playbook (what to do in the next 7 days)

Assume you’re mid‑flight on LLM adoption. Here’s a week‑long, engineering‑led playbook.

Day 1–2: Inventory and classify the blast radius

  1. Map the flows

    • For each LLM app or integration:
      • Where does input come from? (prod DB, tickets, raw user text)
      • Which vendors/models does it call?
      • Where do outputs and logs go?
  2. Tag data classes

    • Mark each hop with:
      • public / internal / confidential / regulated
      • PII/PHI presence: none / possible / likely / definite
    • Rough is fine; you’re building a risk picture, not a thesis.

Day 3: Put guardrails in front of logs and vendors

  1. Implement a minimal redaction layer

    • One shared library/middleware that:
      • Detects and masks obvious PII (emails, phone, IDs, tokens).
      • Shortens or hashes long strings when logging.
    • Roll it out to:
      • LLM prompts/responses
      • Tool I/O where feasible
  2. Lock down vendor usage

    • For each external LLM/embedding API:
      • Confirm data retention/training terms.
      • Confirm region and data residency.
      • Restrict what apps/environments can call it (keys, IP allowlists).

Day 4: Introduce policy-as-code for at least one rule

  1. Pick a simple, real policy and encode it
    Example:

    • “User support bots may not access tickets from other regions.”
      Implementation sketch:
    • A central policy module (could be OPA, or just a function) that:
      • Takes: user identity + requested resource metadata.
      • Returns: allow/deny.
    • Orchestrator calls this before retrieval/tools.
    • Log the decision and policy version.

This doesn’t solve everything; it proves the pattern and forces the architecture conversation.

Day 5: Stand up basic auditability

  1. Define an LLM audit log schema
    For each request:

    • actor_id (user/service)
    • model_id and provider
    • data_classes touched (from Day 2 tagging)
    • tools_used
    • policy_version
    • decision (allowed/blocked/modified route)
    • timestamp
  2. Wire at least one critical path

    • Start with the highest‑risk app (e.g., customer‑facing assistant).
    • Don’t log full prompts/responses yet; log metadata and data classes.

Day 6: Align with your existing SOC 2/ISO controls

  1. Re-map two or three key controls
    For example:

    • Logical access control → LLM orchestration & tools
    • Data retention → vector DB and logs holding LLM data
    • Change management → prompt templates, tools, and policies

    Document:

    • New systems in scope
    • Data flows
    • How your new policy‑as‑code and logging support these controls

Day 7: Run a tabletop, not a slide deck

  1. Simulate two realistic incidents

    • “We discover PII has been sent to an unapproved LLM API for 90 days.”
    • “A red‑team prompt gets the model to output a customer’s secret data.”

    For each:

    • How do we detect it?
    • Can we see which users are impacted?
    • Can we prove deletion within policy timelines?
    • Which policy gates failed?

Use that to prioritize the next 30–90 days.


Bottom line

If you’re serious about privacy, compliance, and operational risk, treat LLMs as:

  • A high‑sensitivity data pipeline, not a UI feature.
  • A new behavior surface that requires explicit constraints, not vibes.
  • Another system of record (via logs, traces, eval sets, embeddings), not just stateless inference.

The core levers are old, boring, and proven:

  • Data minimization and redaction
  • Explicit retention policies
  • Access control and least privilege
  • Auditability and traceability
  • Policy‑as‑code instead of policy‑as‑prompt

The change is that you must now apply them to prompts, context, and model behavior, not just tables and services.

If you can answer, with evidence, these four questions:

  1. What sensitive data can reach our models, and through which paths?
  2. Which vendors see which data classes, under what terms?
  3. How do we prevent, not just discourage, policy‑violating prompts and outputs?
  4. How quickly can we trace, contain, and prove deletion for an incident?

…then your AI governance is on real engineering footing, not marketing copy. Everything else is optimization.

Similar Posts