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

# Agent and AI

> Answers to common Agent questions—fixing a frozen or looping Agent, reducing costs, Agent modes, rolling back changes, and using your own API keys.

These answers cover working with Agent. For full reference, see the [Agent overview](/features/agent/overview), [Agent modes](/features/agent/agent-modes), and [AI billing](/billing/ai-billing).

<AccordionGroup>
  <Accordion title="Agent is frozen or keeps disconnecting—how do I fix it?">
    1. Open the command palette with `Cmd+K` (Mac) or `Ctrl+K` (Windows).
    2. Search for **Restart compute** and select it to restart the development environment.
    3. Open a new Agent chat and describe your task again to continue.

    While Agent looks frozen, stop sending messages—extra messages create conflicting instructions. If Agent keeps freezing on the same task, break the work into smaller, focused prompts.
  </Accordion>

  <Accordion title="Agent is looping or repeating the same steps—how do I stop it?">
    1. Select **Stop** in the Agent panel to halt it immediately.
    2. Open the command palette with `Cmd+K` (Mac) or `Ctrl+K` (Windows), search for **Restart compute**, and select it.
    3. Open a new Agent chat and rephrase your task more specifically.

    To avoid loops:

    * Break large tasks into smaller prompts—one goal per message.
    * Use [Plan mode](/features/agent/plan-mode) to scope the work before Agent builds.
    * Set a usage limit in [Managing your spend](/billing/managing-spend) so a loop can't run up a large bill.
  </Accordion>

  <Accordion title="How do I reduce Agent costs—what settings actually help?">
    These choices make the biggest difference:

    * **[Free Mode](/features/agent/agent-modes)**—no-cost everyday Agent work for Core and Pro subscribers within an allowance.
    * **[Power mode](/features/agent/agent-modes)**—more capability at an affordable price when your work needs it.
    * **[Plan mode](/features/agent/plan-mode)**—scope and approve work before Agent builds, so you don't pay for changes you didn't want.
    * **Usage limit and budget**—set a hard cap in [Managing your spend](/billing/managing-spend).

    It also helps to start a new Agent chat when you switch tasks. Check your usage dashboard to see which tasks cost the most.
  </Accordion>

  <Accordion title="What are the Agent modes, and how do they differ?">
    Agent has three top-level modes. See [Free Mode](/help/free-agent-mode) for full guidance.

    * **Free Mode**—no-cost everyday Agent work for Core and Pro subscribers within an allowance that resets every five hours and has a weekly limit. The Starter tier keeps its existing limits. Check **Settings → Usage** to see your usage.
    * **Power**—a paid, mid-tier mode with powerful models at an affordable price.
    * **Max**—a paid, top-tier mode with the best frontier models for the most demanding work.
    * **Turbo**—an optional Advanced settings toggle available only with Max.

    The paid modes were renamed. **Economy is now Power**, and the mode previously called **Power is now Max**. Existing mode settings carry over with the new names. If a request needs more capability than Free Mode, Agent may offer a paid **Allow once** option. Replit asks for confirmation before a paid action starts, and Agent returns to Free Mode afterward.

    Separately, [Plan mode](/features/agent/plan-mode) lets Agent scope work before making changes, while Build mode applies changes directly. See [Plan vs. Build mode](/learn/plan-vs-build-mode).
  </Accordion>

  <Accordion title="Agent made changes I didn't want—how do I roll back?">
    Replit saves [checkpoints](/features/version-control/checkpoints-and-rollbacks) as Agent works. In the Agent chat, find the message before the change you want to undo and select the rollback option next to it to restore your project to that point.

    For full rollback options—including recovering specific files—see [Checkpoints and rollbacks](/features/version-control/checkpoints-and-rollbacks).
  </Accordion>

  <Accordion title="Agent says it can't access the internet or external APIs—is that expected?">
    During the build and edit phase, Agent works in a sandboxed environment with restricted outbound access. Your published app can still make external API calls when it runs—the sandbox applies to Agent's editing environment, not your running app.

    If an API call fails in your running app, confirm your keys are saved in the [Secrets](/core-concepts/project-editor/app-setup/secrets) pane, then check the provider's status page. On a corporate or school network, outbound connections from your app may be blocked—check with your network admin.
  </Accordion>

  <Accordion title="Can I use my own API keys with Agent?">
    Yes. Add your keys to the [Secrets](/core-concepts/project-editor/app-setup/secrets) pane and your app uses them for its API calls. Open the **Secrets** tool, select **+ New secret**, and enter a name (such as `OPENAI_API_KEY`) and value.

    You can [bring your own AI provider keys](/features/integrations/replit-ai-integrations) for the models your app calls. The model that powers the Agent experience itself runs on Replit's infrastructure and can't be swapped.
  </Accordion>

  <Accordion title="Agent keeps adding features I didn't ask for—how do I get more precise behavior?">
    Keep Agent focused with tighter prompts:

    * Start with the word *Only*—for example, "Only add a delete button to the user card. Don't change anything else."
    * Use [Plan mode](/features/agent/plan-mode) first to review what Agent intends to do before it changes anything.
    * If Agent makes an unwanted change, ask it to undo that change in the same chat right away.

    For more, see [Effective prompting](/learn/effective-prompting).
  </Accordion>
</AccordionGroup>

## Still need help?

If your Agent question isn't answered here, [contact Replit Support](https://replit.com/support).
