AI Agents

Using the Agent sidebar

Ask an AI model to read, change and test your requests from inside Relay.

Overview

The Agent sidebar lets a connected AI model work on your requests. Ask it to find out why a request fails, write a test, or try an endpoint, and it reads your workspace, makes the changes and shows you each step as it goes.

The Agent uses a provider you connect in Settings → Intelligence, such as OpenAI, Anthropic, Google, xAI, OpenRouter, Groq, Ollama or LM Studio. Each chat works in the workspace it started in.

Start a chat

  1. Add a provider in Settings → Intelligence.
  2. Click the Agent button at the top of the sidebar, or press Option-Command-2.
  3. Choose a model below the prompt field.
  4. Type what you want and press Return. Press Shift-Return for a new line.

The first time you use a provider, Relay asks whether it can send data there. Your messages go to that provider, along with the requests, responses and scripts the Agent reads. A provider running on your Mac, such as Ollama, isn't asked about, because nothing leaves it.

To end a turn early, click Stop. New Chat starts over, and History holds your earlier chats. If "this request" comes up, the Agent takes it to mean the request open in your window.

Approve what it does

The Agent reads your workspace and edits requests without asking. Each edit is a normal step in your window's undo history, so Edit → Undo takes it back. It asks first before doing anything that can't be taken back:

The Agent wants toWhy it asks
Send a requestIt's real network traffic, and it can change data on a server.
Import from a URLRelay fetches a file from the internet.
Save a code generatorIt can replace another generator, and there's no undo.
Move a request with credentials to a new hostYour next Send would take those credentials there.

The card shows where the request goes, which secret variables it uses and which scripts will run. Choose Allow to let it through once, or Allow for This Chat to stop being asked about that host until you quit Relay. Choose Deny and the Agent carries on without it.

Scripts the Agent writes don't run until you allow them in the Scripts tab, like a script that changed outside Relay.

Know what the model can see

Relay hides the secrets it knows about before anything reaches the model: secret variables, auth credentials, tokens and cookies, along with headers and JSON fields whose names usually hold secrets. The model sees [redacted] in their place, and generated code keeps its {{variables}}.

Relay can't recognize every secret. A response can hold one it has no way of knowing about, so that text reaches your provider. Only use the Agent with data you're comfortable sending there.

Anything a tool returns can contain text written by someone else, including an API response written to mislead the model. That's why sending a request always needs your approval, and why the card describes the request from Relay's own data rather than from what the model says.

Chats are encrypted on your Mac. To stop the Agent using a provider, open it in Settings → Intelligence and choose Revoke Agent Access.

Search public documentation

The Agent can look up how a public API, SDK or library works using Algolia DocSearch. To turn it on or off, click the + button in the prompt field, or use Enable Algolia Docs Search in Settings → Agent.

Each search sends a product name and a short question to Algolia, without asking you first. Your requests, responses and secrets aren't part of the search unless the model puts them there, and a search is limited to a few hundred characters. No Algolia account is needed.

The pages each search found appear in its step in the chat.

Search the web

With OpenAI, Anthropic or OpenRouter, the Agent can also search the web using the provider's own search. To turn it on or off, click the + button in the prompt field, or use Enable Web Search in Settings → Agent. It's off until you turn it on, and isn't available with other providers.

Searches run on the provider's side, so Relay can't ask you first or see them before they go. OpenAI handles them itself, using its index of pages it has already fetched, so very recent pages may be missing. Anthropic runs them itself and doesn't open pages the model names. OpenRouter sends them to Exa. Providers can charge for each search, on top of the model's usage.

Your requests, responses and secrets aren't part of a search unless the model puts them there. Each search and the pages it used appear in the chat, and a model that can't search says so when you send a message.

See Also