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

# Configure Agent Mode and Max Steps

> Make runs fail fast and bound how many steps the agent takes

> [!NOTE]
>
> **Capability:**`agent_config` (beta — enroll at [agent.tinyfish.ai/beta](https://agent.tinyfish.ai/beta) to enable it for your account)

Use this when a run needs to stop sooner than the default — a precise test
that shouldn't wander, or a simple goal that shouldn't burn 150 steps
exploring workarounds.

## Join the Beta

Agent Mode and Max steps are beta-gated — this is required before either
the Playground or the API will accept them. Enroll at the
[Beta Program](https://agent.tinyfish.ai/beta) page to unlock them.

![TinyFish Beta Program page showing the account enrolled](https://mintcdn.com/tinyfish/6Yr77veemMps6Ft4/images/agent-tutorial/max-steps/01-beta-enrolled.png?fit=max\&auto=format\&n=6Yr77veemMps6Ft4\&q=85\&s=8d560f9f615f8589a52387fd37fb94f7)

Click **Enrolled** to join — this unlocks beta-gated fields.

## Set Up in the Playground

**1. Open Run settings**

In the Agent Playground, click the gear icon next to **Run**.

![Agent Playground with the Run settings gear icon highlighted next to the Run button](https://mintcdn.com/tinyfish/6Yr77veemMps6Ft4/images/agent-tutorial/max-steps/02-open-run-settings.png?fit=max\&auto=format\&n=6Yr77veemMps6Ft4\&q=85\&s=39a72edd7ac2ac8e2b13f23c92579137)

The gear icon opens **Run settings**.

**2. Switch Agent Mode to Strict**

Set **Agent Mode** to **Strict** for a run that should stop instead of
exploring workarounds. Leave it on **Default** for open-ended tasks.

![Run settings panel with Agent Mode set to Strict, shown as a badge next to the Run button](https://mintcdn.com/tinyfish/6Yr77veemMps6Ft4/images/agent-tutorial/max-steps/03-strict-mode.png?fit=max\&auto=format\&n=6Yr77veemMps6Ft4\&q=85\&s=91af36d5594a08a969845a91912fdc8d)

**Strict** selected — the toolbar badge confirms it's attached.

**3. Set Max steps**

Type a step limit. The toolbar badge updates to show both settings at a
glance.

![Max steps field set to 15, with the toolbar badge reading Strict · 15 steps](https://mintcdn.com/tinyfish/6Yr77veemMps6Ft4/images/agent-tutorial/max-steps/04-max-steps-set.png?fit=max\&auto=format\&n=6Yr77veemMps6Ft4\&q=85\&s=389d6d51bdfe83dcf034ec9e2f684a22)

**Strict · 15 steps** — both settings are now attached to the run.

## Set Up With the API

```python Python theme={null}
from tinyfish import TinyFish, AgentConfig

client = TinyFish()

run = client.agent.run(
    url="https://example.com",
    goal="Check that checkout succeeds with a saved test account",
    agent_config=AgentConfig(mode="strict", max_steps=30),
)

print(run.result)
```

```typescript TypeScript theme={null}
import { TinyFish } from "@tiny-fish/sdk";

const client = new TinyFish();

const run = await client.agent.run({
  url: "https://example.com",
  goal: "Check that checkout succeeds with a saved test account",
  agent_config: {
    mode: "strict",
    max_steps: 30,
  },
});

console.log(run.result);
```

```bash cURL theme={null}
curl -X POST https://agent.tinyfish.ai/v1/automation/run \
  -H "X-API-Key: $TINYFISH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "goal": "Check that checkout succeeds with a saved test account",
    "agent_config": {
      "mode": "strict",
      "max_steps": 30
    }
  }'
```

* `mode: "strict"` makes the agent stop the moment the page isn't what it
  expected, instead of trying alternate paths. Use it for precise tests and
  repeatable automation — use the default mode for open-ended browsing,
  search, or recovery-oriented tasks.
* `max_steps` caps how many tool-call steps the run takes, from 1 to 500.
  Lower it to fail fast and bound cost on simple goals; raise it for
  multi-page workflows that legitimately need more steps. Omit it to use
  the default of 150.

Both fields are beta-gated — a non-beta account that sends `max_steps`
gets `403 FORBIDDEN`; requests that omit it are unaffected.

## Related

> [card] [Agent Mode, Max Steps, and Max Duration](https://docs.tinyfish.ai/agent/explanation/agent-modes.md)
>
> When to use each, and how they combine

> [card] [Agent Config Reference](https://docs.tinyfish.ai/agent/api)
>
> Full `agent_config` request schema


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.