# 30.2 What crosses the application boundary (/building-ai-workers/shipping-claude-applications/what-crosses-the-boundary)

---
type: Document
title: "30.2 What crosses the application boundary"
description: "What leaves your systems in a request, what comes back and must be checked, what is kept and for how long, and whether a design's schema and session choices meet its requirements."
status: stable
order: 330.02
ksor:
  owner: team:panaversity
  audience:
    - public
  approval:
    by: process:panaversity
    at: 2026-11-30T10:58:03Z
chapter: '30'
part: III
expert_status: builder-only
concepts: [ "30.2" ]
last_verified: '2026-11-30'

sources:
  - id: anthropic-ccdv-f-exam-guide
    title: Claude Certified Developer - Foundations Exam Guide, version 1.1, effective December 7, 2026 (read 2026-11-30)
    resource: https://cc.sj-cdn.net/instructor/6nizmqk8tpzpfjvt6qmmav7rh/public/1794946771/Claude_Certified_Developer_-_Foundations_Exam_Guide_Updated_Dec_7.pdf
  - id: anthropic-files-api
    title: Files API (Claude API docs, verified 2026-11-30)
    resource: https://platform.claude.com/docs/en/build-with-claude/files
  - id: anthropic-data-retention
    title: API and data retention (Claude API docs, verified 2026-11-30)
    resource: https://platform.claude.com/docs/en/manage-claude/api-and-data-retention
  - id: anthropic-privacy-retention
    title: How long do you store my organization's data? (Anthropic Privacy Center, verified 2026-11-30)
    resource: https://privacy.claude.com/en/articles/7996866-how-long-do-you-store-my-organization-s-data
generated:
  at: 2026-11-30T10:58:03Z
  by: esl-rewrite/1.2.0+ksor.1
trust_tier: unverified
build_id: sha256:d6ce3f28a2cf8e492a60bae1b426b7cc6466e35e83d70c3b9763db2c55009f4b
dirty: true
ksor_version: 0.0.60
---

**In everyday life.** A small clinic sends a blood sample to an outside laboratory. The form with it carries what the test needs: a patient number and the test's name, not the patient's whole file. When the result comes back, the doctor checks that it belongs to this patient and makes sense before acting on it. And the clinic decides how long it keeps a copy of each form. In this section, the clinic is your application, and the laboratory is the model's provider. The form, the result and the copies are what crosses the boundary.

**What you will learn.** You practice this in Lab 30, Task 0, where you fill row 2 of the table.

- What is the application boundary?
- What should leave, and what should not?
- When can your code trust what comes back?
- What is kept, where, and for how long?
- Does a design's choice meet its requirement?
- What goes in row 2 for each environment?

**Why it matters.** Every request copies data out of your systems. Some choices are fine on your laptop, such as logging every request. The same choice is different in production, where the requests hold real invoices and real questions.

**At work.** It is still Monday. Since Chapter 21 your laptop has logged every request and response, for testing (21.13). Until today a request held an invoice's text. From now on it can hold a photo of a real paper invoice, and a photo carries the whole page. Before the change goes further, you write row 2: what each column sends, and what each keeps.

### What is the application boundary?

**The line between your systems and everything outside them.** The exam guide asks "what content crosses the application boundary".[^anthropic-ccdv-f-exam-guide] Three things cross it.

- *Out.* Everything in a request leaves your systems.
- *Back.* Everything in a response arrives from outside them.
- *Kept.* Copies stay behind, on both sides: in your logs and fixtures, and with the provider.

### What should leave, and what should not?

**Only the fields the task needs.** This is [17.7](../connectors-and-mcp/untrusted-output.md)'s rule for a connector, "return only the fields the caller needs", now for your own calls. Brightline set the limit in Part II. A duplicate check did not need bank account numbers. It needed "the type of tax ID and its last four digits" ([10.2](../../managing-ai-workers/governance-and-responsible-use/can-this-data-go-in.md)).

A file leaves whole. A photo of a paper invoice carries everything printed on the page, not only the fields you want. That includes bank details printed at its foot. So decide, before you upload, whether the whole page may leave.

<!-- EDITOR: Chapter 28's thread is asked whether its connector also returns only an account's last four digits (spec, "Threads", 28). If it does, this section points to it. -->

### When can your code trust what comes back?

**Only after code has checked it.** A response is untrusted until checked. Chapter 25 gave the two checks. The first is a schema on the response ([25.7](../prompts-and-structured-output/structured-outputs.md)). The second checks each value against something the model did not write ([25.9](../prompts-and-structured-output/validate-before-use.md)). An extracted total is checked against the invoice's own subtotal and tax, not taken on trust.

### What is kept, where, and for how long?

**Some of it on your side, by your choice, and some with the provider, by its rules.** On your side, 21.13 drew the line: "Log requests and responses on your own computer, for testing. In a product, think before you log what a person asked, and never log a key or a sign-in token." On the provider's side, the rules are Anthropic's, as of November 30, 2026.

- *Ordinary requests.* Anthropic deletes API inputs and outputs "within 30 days of receipt or generation", except for a service "with longer retention under your control (e.g. Files API)".[^anthropic-privacy-retention]
- *Files.* Files are kept until you delete them, or until "they reach their `expires_at`".[^anthropic-files-api] You can set that expiry once, at upload, to between 1 hour and 90 days.[^anthropic-files-api]
- *Batches.* Batch results are kept for 29 days.[^anthropic-data-retention]

Some organizations have **zero data retention** (ZDR), an agreement with Anthropic about what may be kept. Neither files nor batches are covered by it.[^anthropic-data-retention] And such an organization "cannot call the Claude API directly from a browser". Its requests must come from a server.[^anthropic-data-retention] A PDF sent inline in a request is eligible for HIPAA, the United States law on health data. "HIPAA eligibility applies to PDFs sent inline through the Messages API, not through the Files API."[^anthropic-data-retention] Neither the Files API nor batches are HIPAA-eligible.[^anthropic-data-retention] Flagged content may be kept "for up to 2 years", even under zero data retention.[^anthropic-data-retention]

<!-- OPEN: the exact terms of a ZDR arrangement are not on any page read for this chapter. This section says only which features it does not cover, and the browser rule. -->

### Does a design's choice meet its requirement?

**Read the design against each stated requirement, one row each.** The guide asks "whether its schema and session decisions meet the stated requirements".[^anthropic-ccdv-f-exam-guide] A **session decision** is what one conversation may hold, and for whom.

| Requirement | A design that fails it | A design that meets it |
| --- | --- | --- |
| "Each company sees only its own invoices" | One conversation shared by a support page | One conversation per person and task (21.13), and one company per session ([23.11](../hosted-agents/one-session-one-person-one-company.md)) |
| "Totals are compared to the cent" | A schema that types the total as free text, such as "1,234.5" | Whole cents as an integer, `amountCents`, checked against `subtotalCents` and `taxCents` (25.7, 25.9) |
| "The code that uses the total reads it as a number" | Free text, read with a search pattern | A schema on the response, checked before use (25.7, 25.9) |
| "No bank details leave the company" | The whole vendor record in the prompt | Only the fields the task needs, such as the type of tax ID and its last four digits (10.2) |
| "No person's question is kept in a test fixture" | CI's fixtures recorded from production's questions | Fixtures from the golden set only, checked by a person |

### What goes in row 2 for each environment?

**What each column sends, what it keeps, and the proof.** The three columns keep different things, on purpose.

| Row 2: what leaves, and what is kept | Development | Staging | Production |
| --- | --- | --- | --- |
| *Value* | Requests and responses logged, for testing (21.13) | Recorded answers and traces in CI (Lab 24). Sessions kept until deleted ([23.3](../hosted-agents/reading-a-session.md)). Files kept until deleted or expired. During the week of real questions, the same rule as production: nothing of their content is logged, and their sessions are deleted after the week | Real questions leave. Nothing of their content is logged. Each file is uploaded with an expiry, and deleted when its invoice closes |
| *Proof* | `.gitignore` covers the log folder | By a person: no fixture holds a person's question, and the week's sessions were deleted | `config/prompts.yaml#production.fileExpirySeconds`, from Task 4. Until production uploads files, by a person |

<!-- EDITOR: staging's rule for the week of real questions is proposed in round 3, and rests on a proposed story fact: Chapter 23's reference says the staging workspace holds "test data only" (hosted-agents/reference.md:632). If the editor rules that staging takes no real questions, remove this sentence and change row 6's gate and 30.6's canary paragraph instead. -->

<!-- EDITOR: the key `fileExpirySeconds` in `config/prompts.yaml` is proposed in the spec (raised point 23), with `model`, `fallbacks` and `workspace`. It is not in any lab yet. -->

<!-- OPEN: how long production's expiry is, and what closes an invoice for this purpose, are set when Lab 30 is built. This draft states no number. -->

The development cell is safe because the log never leaves your laptop. The same log in production would keep every question every person asked. That is why the production cell has no log of content at all, and its files have an end date.

**The operating rule:** send only what the task needs, and check what comes back before code uses it. Then write down, for each environment, what is kept and for how long.

**Do this now.** Ask your coding agent to map one boundary you already have. Copy this line:

> For one request this project sends to a model, list every field and file it sends, and say which ones the task needs. Then list every place a copy of the request or its response is kept, here or with the provider, and for how long. Say which of those keeps differ between the laptop, staging and production, and which file sets each one. Change no file.

[^anthropic-ccdv-f-exam-guide]: Claude Certified Developer - Foundations Exam Guide, version 1.1, Anthropic.
[^anthropic-privacy-retention]: How long do you store my organization's data?, Anthropic Privacy Center.
[^anthropic-files-api]: Files API, Claude API docs, Anthropic.
[^anthropic-data-retention]: API and data retention, Claude API docs, Anthropic.
