# validate_goal_objective

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/goal_state_limits/validate_goal_objective)

Reject a goal objective that cannot fit its persistent context budget.

This checks raw length only. HTML escaping can still expand the text
fivefold, so a caller about to run criteria generation should also call
`validate_goal_objective_rendered`: an objective that passes here can still
leave no room for any criteria in the rendered notice.

## Signature

```python
validate_goal_objective(
    objective: str,
) -> None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `objective` | `str` | Yes | Goal objective proposed by the user or criteria model. |

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/caaa7e7c12d214afa5cf0a1afed8eb6232aa6f7b/libs/code/deepagents_code/goal_state_limits.py#L128)