> ## 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.                                                                                                |
| `cache`         | `false`      | No       | Set to `false` to disable caching. The AI agent runs on every execution instead of replaying previously generated steps. V3 only. |
| `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"
```

Disable caching so the agent re-derives the flow on every run. Useful when the
page content changes between runs and cached steps would go stale immediately.

```yaml theme={null}
- act:
    goal: Open the most recent invoice and download its PDF
    cache: false
```

## Related

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