The interview problem

Practice prompt

A research agent reads public pages and can save notes to an internal workspace. A retrieved page tells it to upload private files. Design the boundary that prevents this instruction from becoming an authorized action.

Original practice, not a reported company interview. All worked numbers are illustrative. Interview date: not applicable. Written October 3, 2026.

1. Scope and assumptions

Treat retrieved text, tool output and model-generated arguments as untrusted. The model may misunderstand provenance. Scope the exercise to read and export permissions, not a claim that all malicious language can be recognized.

2. Architecture and decisions

Untrusted document → provenance-tagged context → proposed action → capability check → constrained executor

Give the executor a task capability describing allowed resources, destinations and operations. The capability comes from authenticated user intent, never from retrieved text. Reading a page must not grant permission to enumerate the private workspace. Keep credentials out of model context and resolve resource handles server-side.

Validate the complete action at dispatch: caller, tenant, source resource, destination and operation. Bind any approval to these exact fields and an expiry, so subsequent tool output cannot widen it. Route exports through an allowlisted destination policy. Preserve document provenance for the answer, but do not mistake a provenance label or a system prompt for an enforcement mechanism.

3. Work through the example

If a task permits reading 20 public URLs and writing one named note, a request to read a private file is outside the capability even if it fits the tool schema. With 100 attack fixtures and zero unauthorized effects, the observed failure count is zero; this is not proof that the attack space is exhausted.

4. Failure cases and trade-offs

A broad export tool can bypass an otherwise narrow read tool. Redirects and indirect resource references must be checked at their final resolved destination. Disabling tools entirely reduces utility; coarse permissions improve usability but enlarge the consequences of a model error. Sanitization is useful defense in depth, not the authorization boundary.

5. Validation and acceptance

Inject instructions into titles, quoted text, search snippets and tool errors. Assert that unauthorized effects never reach the executor, rather than grading only the final response. Record blocked action types without logging private content. Test legitimate note creation to detect overblocking.

6. Follow-ups and self-review

What changes when the user explicitly asks to export a private document? Reward action-scoped authority, destination checks, exact approval binding and adversarial end-to-end tests.

Sources and related practice

OWASP identifies prompt injection as an application risk; the capability policy and fixtures are original practice.

Read the primary technical reference

Reference retrieved October 3, 2026. Retrieval date is not an interview or source publication date. The reference supports the named concept; scenario, architecture, examples and rubric are original.

Continue with Design human approval for consequential agent actions; Design a coding-agent execution platform.

Continue your preparation

Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.