Applications and Integration
Application Boundary and Surface Behavior
Exam objective: Evaluating an application design for how Claude interprets instructions on different surfaces, what content crosses the application boundary, and whether its schema and session decisions meet the stated requirements.
What the exam tests
Whether you can review an application design and say how Claude will read its instructions on a given surface, what content crosses the application boundary (and with what authority or retention), and whether the schema and session choices satisfy the stated requirements.
Key rules
Surfaces and instructions
- The published claude.ai system prompts apply to the chat apps. An API application must supply the date, tone, format and policy it relies on.
- Agent SDK starting points: no
systemPromptgives a minimal tool-calling prompt without the preset's safety instructions; theclaude_codepreset (optionally withappend) fits human-steered coding tools; a custom string fits a different surface, identity or permission model, and you must re-add the guidance you need. CLAUDE.mdenters the conversation as context, whatever the system prompt.settingSourcescontrols whether it loads.- Output styles change role, tone and format. Neither they nor
CLAUDE.mdenforce anything; hooks and settings do.
What crosses the boundary
systemcontent carries operator authority;usercontent is the end user. Third-party text (email, web pages, files, tool output) goes intool_resultblocks, ideally JSON-encoded and labeled.- Put nothing in a prompt that Claude does not need. Leak defenses reduce risk but are not foolproof.
- With ZDR, browser calls are rejected (CORS), so route through your back end. ZDR does not cover consumer plans, the Console or third-party integrations.
- Structured output schemas are cached apart from messages: never put PHI in property names,
enum,constorpattern.
Schema decisions
- Objects need
additionalProperties: false; unknown keys become an array of{key, value}. - Numeric and string length limits are unsupported in raw schemas. SDK helpers may strip them and validate in your code.
- Check
stop_reason:refusalandmax_tokenscan break the schema. Compare enums case-insensitively.
Session decisions
- The Messages API is stateless by default.
- Agent SDK:
continuetakes the latest session in the directory;resumetakes an ID (needed for multi-user); fork copies history; session files are local to one host. - A resumed session reuses its recorded system prompt until compaction. Send changes in the conversation.
{"role": "system", "content": "The workspace is now read-only."}
On supported models, this mid-conversation message goes after a user turn, keeps operator priority and preserves the cached prefix.
Traps
- Assuming behavior seen in claude.ai will reproduce on the API.
- Using
appendto turn the coding preset into a support bot. - Believing a custom prompt stops
CLAUDE.mdfrom loading. - Using
continue: truein a multi-user server. - Expecting a new
appendto apply onresume. - Putting retrieved documents in a system message because it is "authoritative".
- Treating schema-valid output as correct: ranges and business rules still need code.
- Expecting fork or resume to roll back files.
Decide quickly
| Situation | Choice | Why |
|---|---|---|
| Chat widget or non-coding agent | Custom system prompt | Different surface and identity |
| Coding tool with house rules | Preset plus append | Keeps tool guidance and safety |
| New operator rule mid-session | Mid-conversation system message | Priority without a cache miss |
| Email or web content | tool_result block | Treated as untrusted data |
| Many users, one server | resume with stored ID | continue may pick another user's |
| Ephemeral hosts | Session store or app state | Transcripts are local files |
| Unknown field names | Key/value array | Objects only return listed keys |
| ZDR web app | Server-side calls | Browser requests are rejected |