Skip to content
The AI Agent Factory

30.2 What crosses the application boundary

Approved by
Panaversity ·
14 min read

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".1 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'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).

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.

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). The second checks each value against something the model did not write (25.9). 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)".2
  • Files. Files are kept until you delete them, or until "they reach their expires_at".3 You can set that expiry once, at upload, to between 1 hour and 90 days.3
  • Batches. Batch results are kept for 29 days.4

Some organizations have zero data retention (ZDR), an agreement with Anthropic about what may be kept. Neither files nor batches are covered by it.4 And such an organization "cannot call the Claude API directly from a browser". Its requests must come from a server.4 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."4 Neither the Files API nor batches are HIPAA-eligible.4 Flagged content may be kept "for up to 2 years", even under zero data retention.4

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".1 A session decision is what one conversation may hold, and for whom.

RequirementA design that fails itA design that meets it
"Each company sees only its own invoices"One conversation shared by a support pageOne conversation per person and task (21.13), and one company per session (23.11)
"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 patternA schema on the response, checked before use (25.7, 25.9)
"No bank details leave the company"The whole vendor record in the promptOnly 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 questionsFixtures 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 keptDevelopmentStagingProduction
ValueRequests and responses logged, for testing (21.13)Recorded answers and traces in CI (Lab 24). Sessions kept until deleted (23.3). 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 weekReal 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 folderBy a person: no fixture holds a person's question, and the week's sessions were deletedconfig/prompts.yaml#production.fileExpirySeconds, from Task 4. Until production uploads files, by a person

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.

Check yourself

Question 1 / 6

0 answered

A reviewer asks you to map what crosses your application's boundary. Which three things does the map need?

  1. Claude Certified Developer - Foundations Exam Guide, version 1.1, Anthropic.↑↑2
  2. How long do you store my organization's data?, Anthropic Privacy Center.↑
  3. Files API, Claude API docs, Anthropic.↑↑2
  4. API and data retention, Claude API docs, Anthropic.↑↑2↑3↑4↑5↑6
Owner
Panaversity