> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Capture LLM Boundary • AI Agent SDK

> capture_llm_boundary: Capture exact state at LLM call boundary.

# capture\_llm\_boundary

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**ContextManager**](../classes/ContextManager) class in the [**manager**](../modules/manager) module.

Capture exact state at LLM call boundary.

Call this immediately before sending to LLM to get exact snapshot.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def capture_llm_boundary(messages: List[Dict[str, Any]], tools: List[Dict[str, Any]]) -> SnapshotHookData
```

## Parameters

<ParamField query="messages" type="List" required={true}>
  Exact messages being sent
</ParamField>

<ParamField query="tools" type="List" required={true}>
  Exact tool schemas being sent
</ParamField>

### Returns

<ResponseField name="Returns" type="SnapshotHookData">
  SnapshotHookData with hashes for verification
</ResponseField>

## Uses

* `json.dumps`
* `hexdigest`
* `hashlib.sha256`
* `messages_json.encode`
* `tools_json.encode`
* `SnapshotHookData`
* `isoformat`
* `datetime.now`
* `get_ledger`
* `callback`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/context/manager.py#L650">
  `praisonaiagents/context/manager.py` at line 650
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Models Overview" icon="microchip" href="/docs/models" />

  <Card title="LLM Configuration" icon="gear" href="/docs/configuration/llm-config" />

  <Card title="Model Router" icon="route" href="/docs/features/model-router" />

  <Card title="Model Failover" icon="shield" href="/docs/features/failover" />
</CardGroup>
