Ir para o conteúdo

Lição 23 · Safety and Production

Production Checklist and Data Privacy

Prepare an OpenAI app for launch: data privacy and retention, logging, deprecations, rollouts, monitoring, cost controls and a practical checklist.

A demo shows that something can work. Production means it keeps working when users are many, inputs are strange, the service is slow and a model is retired. This lesson collects what to check before and after launch: data handling, logging, change management and monitoring.

Know your data

Before sending anything, list what goes into your requests: user text, documents, tool results and history. Then ask:

  1. Do we need each piece?
  2. Are we allowed to send it, under law, contracts and our own privacy notice?
  3. Where is it stored, by us and by the provider, and for how long?
  4. How do we delete it when asked?

As of December 2026, OpenAI's data controls page says:

  • API data is not used to train OpenAI models unless you opt in to share it.
  • Abuse monitoring logs are kept for up to 30 days by default, with longer retention when law requires it or when needed to protect services or others.
  • The Responses API keeps application state for at least 30 days by default, or when store is true. Set store=False if you do not need it. Some features, such as background mode, still store data temporarily.
  • Zero Data Retention is available only to approved customers, and some endpoints, including Conversations, Files and Batches, may still store application state.

Different features have different rules, and data residency options exist for some customers. Read the current page and your agreement, and ask legal or privacy experts for decisions. This lesson is not legal advice.

Minimize and redact

Send less. Remove what the task does not need, and replace identifiers with placeholders. Regular expressions catch some patterns, but they miss many others, such as names and addresses. Treat the following as one layer only.

Python A simple redaction layer

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The name "Dana Reed" stays in the output. This shows why you also need rules about which fields are sent at all.

Log with care

Useful logs make problems visible without becoming a second copy of private data. For each call, record:

  • Time, feature, response ID and request ID.
  • Model ID and prompt version.
  • Status, error type, retry count and latency.
  • Token usage and tool names.
  • Check results and whether a human reviewed it.

Avoid logging full prompts and replies by default. If you must keep some for quality review, restrict access, set a deletion date and tell users. Never log API keys or other secrets.

Plan for model and API changes

APIs and models change. In 2026 alone, OpenAI's deprecations page included the shutdown of the Assistants API, the Videos API, reusable prompt objects, the Evals platform and Agent Builder, the end of new self-serve fine-tuning jobs by December 15, and many model retirements, with more dates in 2027.

Make change routine:

  • Put every model ID in configuration.
  • List the models, endpoints and features you use, and who owns each.
  • Check the deprecations page and changelog regularly, and read OpenAI's notices.
  • Keep your evaluation set ready, so you can test a replacement quickly.

Roll out changes gradually

  1. Run your evaluations.
  2. Release to a small share of users, behind a feature flag.
  3. Watch errors, latency, cost and quality signals.
  4. Expand slowly, and keep a quick rollback.

Treat a prompt change like a code change.

Monitor what matters

Signal Alert when
Error rate and error types It rises sharply
Latency, time to first text It stays above your target
Tokens and spend per feature It jumps unexpectedly
Validation failures and refusals The rate changes
Human escalations and ratings Quality seems to fall

The launch checklist

Area Check
Keys Server-side only, per environment, rotation plan
Limits Rate limits, spend controls, per-user quotas
Reliability Timeouts, bounded retries, fallback
Output Status and refusal handling, validation
Tools Permissions in code, approvals, idempotency
Safety Moderation policy, safety identifiers, reporting
Privacy Data map, retention, deletion, user notice
Quality Evaluation set and release rule
Operations Monitoring, kill switch, named owner
Transparency Users know they are using AI and its limits

Practice an outage before it happens. Point your staging app at a fake client that always fails and watch what users would see.

A kill switch

A feature flag that turns off AI calls, without a new deployment, is cheap and valuable. Make sure the rest of your product still works when it is off.

Do not send secrets, regulated health data, payment data or confidential company material until the right people in your organization have approved it and you have checked the provider's terms.

Name the owners

A checklist works only when someone is responsible for each line. Write down who watches spending, who reviews deprecation notices, who handles safety reports and who may turn the feature off. Review the list on a regular date, and again after every incident or major change. An unchecked item should be a visible decision with a reason, not something everyone assumed another person had done.

Common mistakes

  • Assuming that no training on your data means that nothing is stored.
  • Logging full requests during a launch and forgetting to turn that off.
  • Having a rollback plan that nobody has ever tried.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What does OpenAI's data controls page say about API data and training, as of December 2026?

    Training use requires an explicit opt-in. Retention rules still apply separately.
  2. 2. Why is a regular expression redactor not enough?

    Pattern matching catches only some data, so send only the fields you need.
  3. 3. What helps you handle a model retirement?

    You can switch and verify a replacement quickly.
  4. 4. What is a good way to release a prompt change?

    Staged releases limit the effect of a mistake.

Summary

  • Map your data and confirm that you may send and store it.
  • Know the provider's training and retention rules, and use store=False when suitable.
  • Log useful metadata without collecting private content.
  • Track deprecations and keep model IDs configurable.
  • Release gradually, monitor and keep a kill switch.

Next: Project: Support Ticket Triage

Seu progresso fica salvo neste navegador. Não precisa de conta.