1.2: Durable Execution and State Management
1.Driftwood Software runs a document-intake service for law firms, and its production pipeline includes a stateless, one-shot redaction agent written with the TypeScript Agent SDK. Each invocation receives a single contract, masks personal data, and returns the result, with no follow-up turns and no need to resume later. During a compliance review, the auditors inspected a worker after a batch finished and found conversation transcript files in the session directory on its disk, including prompts and tool results containing client text. The team already restricts the agent to read-only tools and starts every run with no earlier history, yet the files still appear. The review now requires that the run leave no conversation transcript on the worker's disk. Which approach meets this requirement?
- A.Set `persistSession` to `false`, so the run's history is held in memory and no file is written for it
- B.Set `forkSession` to `true`, so the run continues on a copy and the original session is removed from disk
- C.Limit `allowedTools` to read-only tools, so the run's tool calls and results are kept out of the transcript
- D.Set `continue` to `false`, so the run starts without prior history and is not saved to the session directory
Show answer & explanation
Correct answer: A — Set `persistSession` to `false`, so the run's history is held in memory and no file is written for it
- A. With `persistSession` set to `false` the SDK keeps the session in memory only and writes no transcript file, which suits a stateless one-shot agent that must leave nothing on the worker's disk.
- B. `forkSession` applies when resuming and creates a new persisted session with copied history. It does not delete the original, so transcript files remain on disk.
- C. `allowedTools` limits what the agent may do, not what is recorded. Prompts, replies and tool results are still written to the transcript on disk.
- D. `continue` only controls whether the most recent earlier session is picked up. The new run is still persisted and its transcript is written to disk.