***

title: set_isolated
slug: /reference/python/agents/context-builder/context/set-isolated
description: Set whether to truncate conversation history when entering this context.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[ref-context]: /docs/server-sdks/reference/python/agents/context-builder/context

Set whether to truncate conversation history when entering this context. Creates
a clean slate for the new context.

## **Parameters**

<ParamField path="isolated" type="bool" required={true} toc={true}>
  Whether to truncate conversation history on entry.
</ParamField>

## **Returns**

[`Context`][ref-context] -- Self for method chaining.

## **Example**

```python {9}
from signalwire import AgentBase

agent = AgentBase(name="my-agent", route="/agent")

contexts = agent.define_contexts()
contexts.add_context("default").add_step("menu").set_text("Ask what the caller needs.")

secure = contexts.add_context("secure")
secure.set_isolated(True)
secure.set_system_prompt("You are verifying the caller's identity.")
secure.add_step("verify").set_text("Ask for the caller's account PIN.")

agent.serve()
```