Skip to content

Security and governanceChecklist

A prompt and payload logging policy for LLM traffic

Every team running LLM traffic ends up with a logging policy, written or not. This checklist makes it explicit: what is recorded always, what is captured only on purpose, who can read it, how long it lives and what leaves for other systems.

By INFRO Editorial

Published

7 min read

Stacked translucent isometric plates joined by glowing amber connectors on a dark ground, representing layers of an LLM logging policy

In short

Record request metadata for every LLM call, capture prompt and completion content only by explicit opt-in with a short retention window and a deletion job that runs, restrict content reads to named roles, redact known sensitive formats before anything is stored, keep content out of exports and telemetry, and remember that your provider keeps its own logs under your agreement with it.

Key takeaways

  • Metadata and content are different data with different purposes; log the first always and the second only on purpose.
  • A retention window is only real if a deletion job runs and reads stop at the deadline.
  • Content access should be a separate grant from the ability to call models or read metadata.
  • Your provider keeps its own logs; turning gateway capture off does not change them.

Every organization that sends traffic to language models has a logging policy. Often it is implicit: whatever the SDK's debug mode prints, whatever the proxy happens to keep, whatever a developer turned on during an incident and never turned off. An explicit policy is shorter than people expect, and it answers the questions a security reviewer, a data-protection officer and an on-call engineer will each ask sooner or later.

This checklist is organized in the order those decisions should be made. Each section ends with items you can tick.

  1. Always

    Request metadata
    Model, provider, connection, route, token counts, latency, status, estimated provider cost, your metadata tags. Needed for budgets, attribution and incident work.
  2. Opt-in

    Captured prompts and completions
    Off by default. A retention window, a reader list and a deletion job that actually runs.
  3. Separate

    Provider-side logs
    Governed by your own provider account and agreement. Turning capture off in the gateway does not change them.
  4. Outbound

    Exports and telemetry
    CSV, FOCUS and OpenTelemetry. Decide field by field what may leave, and to whom.
The four layers a logging policy has to cover. Only the second is optional; the policy's main job is to keep it that way by default.

Separate metadata from content

Metadata about a call — which model, which provider and account, how many tokens, how long it took, what it is estimated to cost your provider account, whether it failed and why, and the tags your application attached — is what budgets, cost attribution, failover analysis and incident response run on. It is useful for every request and rarely sensitive, with one exception: fields you fill yourself. A user_id that is an email address, or a tag holding a customer name, turns metadata into personal data.

Content — the prompt, the system instructions, retrieved documents, tool results and the completion — is a different kind of data. It is where personal and confidential information lives, and it is needed only for specific jobs: debugging a bad answer, building an evaluation set, investigating abuse.

  • Metadata is recorded for every request, including failed and refused ones.
  • Caller-supplied identifiers are opaque (a hashed or internal ID), never an email address or name.
  • Content is stored in a separate place from metadata, with its own access rules and its own retention.

Decide the default for content

The GDPR's data minimisation principle asks that personal data be adequate, relevant and limited to what is necessary for the purpose1. For LLM traffic the practical reading is that content capture should be off unless there is a named purpose for it. OWASP's guidance on sensitive information disclosure points the same way, recommending restricted access and clear policies on retention, usage and deletion2.

Off by default does not mean never. It means capture is a decision someone takes for a reason, at the narrowest scope that serves it, with an end date.

  • Content capture is off by default at the organization level.
  • Turning it on requires a named owner and a stated purpose.
  • Individual requests can opt out even when capture is on, for flows that must never be stored.
  • A per-request flag cannot turn capture on when the organization policy says off.

Set retention and prove deletion

The storage limitation principle requires that personal data be kept in identifiable form for no longer than necessary for its purpose1. A retention window on a settings page is only half of that. The other half is a job that deletes expired content and a read path that stops returning content at the deadline, whether or not the job has run yet.

Pick windows by purpose: hours for live debugging, days to a few weeks for incident investigation, longer only for a deliberately curated evaluation set that has its own review.

  • Every captured payload carries its own expiry, set when it is written.
  • Reads refuse content past its expiry, independently of deletion.
  • A scheduled job deletes expired content, and its lag is monitored and alerted on.
  • Shortening the window applies to content already captured, not only to new content.
  • Deletion removes rows; it does not only set a flag.

Control who can read content

The ability to call a model, the ability to read request metadata and the ability to read captured content are three different permissions. A service key that sends traffic should not, by default, be able to read what every other service sent. A dashboard for cost owners needs metadata and never content.

Article 32 of the GDPR asks for technical and organizational measures appropriate to the risk, including the ability to ensure ongoing confidentiality of processing systems3. Separate grants are the simplest such measure to put in place.

Can this caller read captured content for this request?

  • Capture was off for the organization, or the request sent logging: falseNothing was stored — nothing to read
  • Gateway key without payload accessMetadata only, within the key's history scope
  • Gateway key granted payload access by an owner or adminContent, until the retention deadline
  • Past the retention deadlineNever returned, even before the deletion job has run
  • CSV export of the same requestsNever includes content
Who can read a captured prompt, as INFRO implements it. The same shape works for any gateway: content is a separate grant, and the deadline beats the grant.
  • Reading content requires an explicit grant, given by an administrator, separate from reading metadata.
  • History access defaults to the caller's own project or key, not the whole organization.
  • Support staff at your gateway vendor cannot read your captured content.
  • Administrative reads and exports are recorded in an audit log.

Redact before you store

Some content should never be stored, even when capture is on: card numbers, national identifiers, credentials that users paste into chat. Redacting at the gateway, before the request reaches the provider and before capture, means the stored copy and the provider's copy both hold a placeholder instead.

Pattern-based redaction is deterministic and cheap, and it misses anything outside the patterns it knows: a name, an address, a number written in words. Treat it as reducing exposure, not as a data-loss control.

  • Known formats (card numbers, account numbers, credentials) are redacted before capture.
  • The policy says plainly what redaction does not catch.
  • Matched sensitive text is never written to logs, alerts or audit records; only counts are.

Control what leaves

Exports and telemetry are where logging policies usually leak. A CSV sent to finance, a span sent to an observability vendor, a webhook to an alerting tool — each moves data into a system with its own, often wider, access model.

  • Request exports contain metadata only, never content.
  • Telemetry attributes are built from an explicit allowlist, not by copying a database row.
  • Telemetry and webhook destinations require HTTPS.
  • Every export is recorded with who ran it and what it contained.

Remember the provider's logs

Your gateway's policy governs your gateway. The provider keeps its own records under your agreement with it. OpenAI, for example, states that API data is not used for training unless you opt in, that abuse-monitoring logs may be retained for up to 30 days unless longer retention is required by law, and that eligible organizations can apply for Modified Abuse Monitoring or Zero Data Retention4. Other providers document their own terms.

  • The policy lists each provider account in use and its retention terms.
  • Every fallback target is included, not only the primary provider.
  • Anyone who sets logging: false knows it does not change provider-side retention.

Configuring payload capture in INFRO

INFRO records metadata for every request and captures content only when an organization opts in on a plan that includes it; the database column controlling capture defaults to off. A request can send logging: false to skip capture even when the organization has enabled it, and logging: true cannot override organization policy or plan limits. See Privacy & data.

POST /v1/chat/completions — skip content capture for this request
{
  "model": "anthropic/claude-sonnet-5",
  "messages": [{ "role": "user", "content": "Summarize this contract clause." }],
  "logging": false
}

When capture is on, the organization picks a window of 24 hours, 14, 30, 60 or 90 days, or one year, and the stored window is the shorter of that choice and the plan's ceiling:

Payload retention ceiling

days

  • Developer24 hours
  • Startup14 days
  • Team30 days
  • Business90 days
Maximum retention of captured payloads by INFRO plan, from the privacy documentation on 2026-09-29. Enterprise retention follows the agreement.

Reading captured content needs a separate payload permission on the gateway key, granted by an owner or admin, on top of its history scope; content is never returned past its retention deadline, even if deletion has not run. GET /v1/requests/export never includes prompts, responses or captured payloads, and every export is written to the audit log. If guardrails redact a prompt, the redacted text is what capture, failover targets and the OpenTelemetry export see; with the flag action nothing is changed, so capture stores the original. Guardrails are included from the Business plan and are pattern-based.

From the team that builds it

Where this shows up in INFRO

INFRO is a control plane in front of the provider accounts you already hold. The capabilities below are the parts of it this article touches, each with the documentation that defines its behaviour.

  • Request traces and payload logs

    Private early access

    Per-request timing detail, with prompt and completion logging off by default and a retention window you choose.

    Read the documentation for Request traces and payload logs
  • Usage and cost per request

    Private early access

    Every request records its model, latency, token or unit counts, and estimated provider cost, queryable by project and key.

    Read the documentation for Usage and cost per request
  • Usage, request and FOCUS exports

    Private early access

    GET /v1/usage and GET /v1/requests on any gateway key, the request log and usage series as CSV, plus a FOCUS v1.4 Cost and Usage dataset as JSON or CSV, so AI spend lands in your FinOps platform beside the rest of your cloud cost.

    Read the documentation for Usage, request and FOCUS exports
  • OpenTelemetry export

    Private early access

    Spans pushed to your own collector from the request path, with the endpoint and headers set in the console. Included from the Team plan.

    Read the documentation for OpenTelemetry export
  • Guardrails

    Private early access

    Pattern-based checks on chat completion prompts and responses: block, redact or flag email addresses, phone numbers, card numbers, IBANs, US Social Security numbers, IP addresses, API keys and your own terms, plus optional classifier checks on your own connection to a decision model's provider. Detection can miss things. Included from the Business plan.

    Read the documentation for Guardrails

INFRO is in private early access. Provider usage is billed to you by your providers; INFRO charges a software subscription and takes 0% of model spend. See plans.

Sources

Numbered in order of first citation. Each was opened and checked against the claim on the date shown.

  1. 1.Regulation (EU) 2016/679 (GDPR), Article 5: Principles relating to processing of personal data (opens in a new tab) — European Union (consolidated text via gdpr-info.eu). Accessed Sep 29, 2026.
  2. 2.LLM02:2025 Sensitive Information Disclosure (opens in a new tab) — OWASP GenAI Security Project. Accessed Sep 29, 2026.
  3. 3.Regulation (EU) 2016/679 (GDPR), Article 32: Security of processing (opens in a new tab) — European Union (consolidated text via gdpr-info.eu). Accessed Sep 29, 2026.
  4. 4.Data controls in the OpenAI platform (opens in a new tab) — OpenAI. Accessed Sep 29, 2026.

About this article

Written from the logging, retention and export documentation and source of the INFRO gateway, which the authors build, and from the GDPR text, OWASP and provider documentation cited. Nothing here is legal advice.

Last checked against its sources on . The next review is due by . No separate named reviewer is recorded for this article.

How articles are written, sourced and corrected is set out in the editorial standards.