Postguy
Guide

AI Agent

Set up a model provider, chat with an agent that edits and runs your collections, approve deletes, and drive the agent headless. What is sent, what it can do and its limits.

The AI Agent is a chat pane. You ask in plain words. A model you choose uses Postguy's own tools to create, edit, run and export your collections, requests and environments.

Nothing is sent anywhere until you press Send. The model and its key are yours. See Privacy before you use it on a workspace with real secrets.

Set it up

Open Settings › AI Agent. It sits between Proxy and About.

FieldMeaning
ProviderOpenAI compatible, Claude, Gemini or OpenRouter.
EndpointOnly for OpenAI compatible. The base URL of the API. The default is https://api.openai.com/v1. Postguy posts to <endpoint>/chat/completions. It must start with http:// or https://. An empty value resets to the default. A trailing / is dropped.
ModelThe model id the provider expects. Each provider remembers its own model. You must type one. The grey placeholders (gpt-5-mini, claude-sonnet-4-5, gemini-2.5-flash, deepseek/deepseek-v4.1-flash-1017) are only hints.
API keyMasked. Stored in the operating system keychain, never in settings.json.

This is the only settings page that does not save at once. Press Save. Typing a key and pressing Save stores it. Once a key is stored, the page says A key is saved in the system keychain… and shows Remove key.

Where the key lives

SystemStore
macOSKeychain
WindowsCredential Manager
Linux and FreeBSDSecret Service

The entry uses service postguy and account ai-agent/<provider slug>, for example ai-agent/claude. The slugs are openai-compatible, claude, gemini and openrouter. Each provider has its own key.

Where the traffic goes

ProviderRequest
OpenAI compatiblePOST <endpoint>/chat/completions, Authorization: Bearer
OpenRouterPOST https://openrouter.ai/api/v1/chat/completions, Authorization: Bearer, X-Title: Postguy
ClaudePOST https://api.anthropic.com/v1/messages, x-api-key, anthropic-version: 2023-06-01, max_tokens 8192
GeminiPOST https://generativelanguage.googleapis.com/v1beta/models/<model>:generateContent, x-goog-api-key. A leading models/ is stripped. Names may hold only letters, digits, ., - and _.

Calls use the app's own HTTP client, so the proxy, CA bundle and client certificate settings apply. The timeout is 180 s and a reply is capped at 8 MiB. Model calls write no Console or History entry.

A 401 or 403 from the provider says to check the API key in Settings › AI Agent.

The pane

Click AI Agent at the far right of the bottom bar, or run Toggle AI Agent from the command palette. The pane opens at the window's right edge. Drag its edge to resize it. The default width is 380 px and the minimum is 300.

  • The header shows AI Agent and <provider> · <model>, or · no model set. The + button starts a new chat.
  • Your messages are right-aligned bubbles. Replies are text. Fenced code blocks show in a code frame.
  • Each tool the agent ran is a step row with a check or an x.
  • postguy://run/<collection>/<run> links in a reply show as Open run in Runner.
  • The message box sends on Enter. Shift+Enter adds a new line. While the agent works, Send becomes Stop.

Replies are not streamed. Tool steps appear live, and the reply appears when the model finishes.

An empty chat shows Ask the agent to create, edit, run or export your collections, requests and environments. Without a model, a Set up AI Agent button opens Settings › AI Agent.

If the model or key is missing, Postguy refuses before sending. The chat is left as it was and your text goes back in the box.

Example prompts

Under an empty chat is a row of example prompts built from your real collections. Scroll it sideways. Clicking one fills the message box. It does not send. Edit it, then press Send.

  • Run collection "X" and export the result to x-results.csv
  • Tidy up collection "X"
  • Fix request "R" in collection "Y"
  • Add a test that checks for status 200 to every request in "X"
  • Create an environment "Local" with baseUrl = http://localhost:3000

What it can do

The agent has exactly these tools. They are the same automation tools the CLI runs.

GroupTools
Workspaceworkspace_info
Collectionscollection_list, collection_get, collection_create, collection_rename, collection_duplicate, collection_update, collection_delete
Foldersfolder_create, folder_get, folder_update, folder_rename, folder_delete
Requestsrequest_create, request_get, request_update, request_move, request_duplicate, request_delete, request_send
Environments and globalsenv_list, env_get, env_create, env_rename, env_duplicate, env_delete, env_set_active, env_set_var, env_unset_var, globals_get, globals_set_var
Runscollection_run, run_list, run_get, run_export
Variablesvariables_resolve

It cannot open another workspace, import files, touch cookies, use gRPC or WebSocket tools, or call its own agent tools.

When the agent changes the workspace, open tabs without unsaved edits reload. A tab with unsaved edits is kept, and the status bar warns that saving it overwrites the agent's change.

Approvals

Some steps pause the turn and show an approval card with Approve and Decline:

  • Deletes: collection_delete, folder_delete, request_delete, env_delete and env_unset_var.
  • A run_export that would overwrite an existing file.

The card says what will happen, for example Delete collection “Shop” or Overwrite exports/r.csv. A declined step is reported to the model. It is told not to retry. Stop declines a pending approval. Deleted items go to the workspace trash as usual.

Ask the agent to run a collection. The result comes back with a link that opens the run in the Runner. If you name a file, the agent exports the run to it.

  • Exports are confined to the workspace folder. Relative paths resolve there. A path outside it is refused with the standard is outside the allowed directory refusal.
  • With no path, the agent uses exports/<collection name>-<run id>.<ext>.
  • The format follows the extension: csv, json, junit, html, xlsx or pdf.

Limits

LimitValue
Model round trips per message25. After that you see Stopped after 25 steps. Send “continue” to let the agent go on.
Tool calls per round trip16
One tool result sent back64 KiB
History sent to the modelAbout 400 KB. The oldest turns are left out.
Chat fileThe newest 500 messages and 8 MiB

Chat history

The chat is saved per workspace in .postguy/agent-chat.json. Saves are atomic. If the file is corrupt, Postguy renames it to agent-chat.json.corrupt-<time> and starts an empty chat. New chat clears it. See the workspace format.

Privacy

  • No network traffic happens until you press Send. The traffic goes only to the provider you chose.
  • Your messages are sent, and so is whatever the agent reads: collections, requests, environments and run results.
  • Secret variable values the agent reads are sent unmasked. Masking would let the agent overwrite real secrets with placeholders.

Use a provider you trust with that data. Do not use the agent on a workspace whose secrets must not leave your machine. See Privacy and security.

Headless use

The same agent runs through the automation tools. See the reference.

Each postguy-cli call starts a new process with no workspace open, so use run --script to open the workspace, set the provider and chat in one session:

[
  {"tool": "workspace_open", "args": {"path": "work"}},
  {"tool": "agent_settings_set", "args": {"provider": "claude", "model": "claude-sonnet-4-5", "api_key": "sk-..."}},
  {"tool": "agent_chat", "args": {"message": "List my collections"}}
]
postguy-cli run --script agent.json --root /tmp/pg
  • agent_chat returns {reply, steps, links, declined}. Deletes and overwrites are declined unless you pass "allow_destructive": true.
  • Cancel a running chat with request_cancel and sendId agent.
  • agent_chat_get reads the saved chat, and agent_chat_clear empties it.
  • agent_settings_get never returns the key. It reports apiKeyStored.
Copyright © 2026