# Ambiguity Handling

> Foundry is a deterministic system: it never guesses. When agent output is ambiguous, incomplete, or deviates from the expected format, Foundry responds…

Source: https://bifrost5.com/foundry/docs/ambiguity-handling/

# Ambiguity Handling

Information

Answer a question from your phone or chat, so a long job never sits waiting, with Production-Grade.

[See editions](/foundry/docs/editions)

Foundry is a deterministic system: it never guesses. When agent output is ambiguous, incomplete, or deviates from the expected format, Foundry responds with a fixed escalation path rather than proceeding silently.

## Escalation by Condition

| Condition | Response |
| --- | --- |
| Agent output asks a question | Generate clarification prompt → retry (up to `max_retries`) |
| Agent proposes alternatives | Generate clarification prompt → retry |
| Acceptance criteria partially met | Helper Agent → Interrogation → retry |
| Output format deviates from schema | HALT immediately |
| Required artifact missing | Helper Agent → Interrogation → retry |

## Retry Mechanism

- Validation failures trigger automatic retries up to `retry_policy.max_retries`.

- Ambiguous output triggers a clarification prompt on retry: the agent is told exactly what was missing or wrong.

- After max retries are exhausted → task is marked `BLOCKED`.

- The supervisor **continues to the next task** after blocking: it does not halt the entire pipeline on a single task failure.

## Critical Halt Conditions

The supervisor halts the entire pipeline immediately on:

- **`CURSOR_EXEC_FAILURE`**: Provider CLI execution failed (process-level error).

- **`BLOCKED`**: Provider explicitly reported a blocked status.

- **`OUTPUT_FORMAT_INVALID`**: Output schema mismatch after retries.

- **`RESOURCE_EXHAUSTED`**: Provider rate limit hit: see [Resource Exhaustion](#resource-exhaustion) for backoff details.

## Design Intent

Foundry never auto-resolves ambiguity by making assumptions. The operator sets intent via tasks and acceptance criteria: if that intent is unclear to the agent, the system surfaces it rather than inventing an answer. This is strict determinism in practice.
