# create_goal_criteria_fallback_agent

> **Function** in `deepagents_code`

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

Create the goal-only fallback agent for criteria generation.

This agent has no context tools, repository access, or HITL: it drafts
acceptance criteria from the goal message alone. `GoalCriteriaMiddleware`
invokes it when the context-enabled agent fails at the graph level (e.g.
exhausts its recursion budget) or returns no usable proposal, restoring the
guarantee that `/goal` always yields criteria unless the model itself is
unavailable.

## Signature

```python
create_goal_criteria_fallback_agent(
    *,
    model: str | BaseChatModel,
    model_retries: int = DEFAULT_MODEL_RETRIES,
    cli_max_retries: int | None = None,
    environ: Mapping[str, str] | None = None,
) -> Any
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `model` | `str \| BaseChatModel` | Yes | Chat model or model identifier used by the server graph. |
| `model_retries` | `int` | No | Model-node retry attempts after the first call. (default: `DEFAULT_MODEL_RETRIES`) |
| `cli_max_retries` | `int \| None` | No | Explicit `--max-retries` value for runtime model switches. (default: `None`) |
| `environ` | `Mapping[str, str] \| None` | No | Workspace environment retained for runtime model switches. (default: `None`) |

## Returns

`Any`

Compiled goal-only criteria agent graph.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/4bfa52000ef65ac623d8ada0cb67f67cbdd663ea/libs/code/deepagents_code/goal_rubric.py#L1754)