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

# act

> Run an AI agent that performs actions to satisfy a natural-language goal.

`act` lets the agent decide which clicks, types, and waits are needed to reach
`goal`. The agent reads the page on every iteration and stops when the goal is
met or the budget is exhausted. For deterministic interactions, prefer explicit
commands like `click` and `type`.

## Parameters

| Parameter       | Type         | Required | Description                                                           |
| --------------- | ------------ | -------- | --------------------------------------------------------------------- |
| `goal`          | `string`     | Yes      | Natural-language description of what the agent should accomplish.     |
| `version`       | `"2" \| "3"` | No       | AI action version. Defaults to V3.                                    |
| `precondition`  | `string`     | No       | Assertion that must pass before the agent runs. V3 only.              |
| `postcondition` | `string`     | No       | Assertion that must pass after the agent finishes. V3 only.           |
| `saveAs`        | `string`     | No       | Name of the variable to write this step's return value to.            |
| `retries`       | `number`     | No       | Number of times to retry the step on failure before failing the test. |
| `skipped`       | `boolean`    | No       | Skip this step at execution time.                                     |

## Shorthand

Goal as a single string.

```yaml theme={null}
- act: Search for 'sam altman' and make sure there are more than 3 results
```

## Examples

```yaml theme={null}
- act:
    goal: Ensure the Email Address input box exists and can receive inputs.
```

```yaml theme={null}
- act:
    goal: create a new test with {{ env.RANDOM_TEST_NAME }} in the name
    postcondition: the created test is open in the editor
```

```yaml theme={null}
- act:
    goal: |-
      close the announcement pop up if it is still visible, then trigger the
      login pop up by typing into the text box for adding details
    version: "3"
```

```yaml theme={null}
- act:
    goal: Pick aubergine from the fruit select
    version: "2"
```

## Related

* [Agentic testing](/core-concepts/agentic-testing)
* [Test format](/core-concepts/test-format)
