Local AI test agent: what it sends, what to keep on your machine
On this page
A local AI test agent runs on your machine, works in your own repository and drives a local browser, so the only data that has to leave is what the model needs. Whether that data leaves at all depends on one choice: a hosted model with your own key, or a model server on your own computer.
This guide lists what an agent actually sends, how to choose a model setup, and the controls worth insisting on.
What does a local AI test agent send to the model?
An agent is a loop: it sends the model the task and the context, the model asks for an action (read a file, click a button, run a command), the agent does it and sends back the result. Over a session the model therefore receives:
- your prompts and the conversation so far;
- the files the agent opens, including configuration, fixtures and anything you did not mean to share;
- what the agent sees in the browser: page text and the structure it reads to find elements;
- command output, such as test failures and stack traces.
That last group is easy to forget. A failing test can print an API response, a database row or an environment variable straight into the conversation.
The local part keeps everything else at home: the repository, the browser and its sessions, run history and reports.
Diagram What leaves your machine, and what stays
Sent to the model
- Prompts and the conversation
- Files the agent opens
- Page text it reads in the browser
- Command output and stack traces
Keep on your machine
- Provider keys, in the OS keychain
- A separate browser profile per project
- Run history and screenshots
- Synthetic data and test accounts
Hosted model or local model: how do you choose?
| Question | Hosted provider, your own key | Model server on your machine |
|---|---|---|
| Where do prompts and file contents go? | To the provider, under its terms | Nowhere outside the machine, unless you configure it |
| Capability | Larger models, usually stronger at multi-step tool use | Depends on the model and your hardware |
| Cost | Paid to the provider per use | Your hardware and electricity |
| Setup | A key and a model name | A server such as Ollama or LM Studio and a model that fits your hardware |
| Network | Needed | Not needed for the model |
Two practical points decide most cases:
- Tool calling. An agent needs a model that can call tools reliably. Many local models can; smaller ones often struggle with long, multi-step tasks. Try your real task before committing.
- Compatible APIs. Ollama serves an OpenAI-compatible endpoint on
localhost, and its documentation notes that the client requires an API key value but Ollama ignores it. An agent that speaks that API can switch between hosted and local models without code changes.
A common split: use a local model for code and data you may not share, and a hosted model for public or demo applications where capability matters more.
What else should stay on your machine?
The model is one flow. Four others deserve the same attention:
- Keys. Keep provider keys in the operating system keychain or an encrypted file, not in a
.envfile inside the repository. A key the agent can read is a key that can end up in a prompt. - Browser sessions. Give the agent its own clean browser profile per project, not your personal one with every logged-in account.
- Test data. Use synthetic data and dedicated test accounts. Anything the agent reads may be sent to the model.
- Run history. Transcripts, screenshots and reports can hold sensitive values. Keep them in a local data folder you can inspect and delete.
How do you stop an agent from doing something you did not ask?
Agents read text they did not write: web pages, issue descriptions, instruction files in a repository. OWASP calls this indirect prompt injection, where a model accepts input from external sources such as websites or files. Its listed mitigations apply directly to test agents: least privilege, human approval for privileged operations, and clear separation of untrusted content.
In practice, look for these controls:
- Folder trust. Nothing from a newly opened folder is read into a prompt or run until you trust it. A cloned repository is untrusted input until you say otherwise.
- Site allowlist. The agent opens
localhostand your own application without asking, and asks before any other site. - Approval modes. By default the agent asks before consequential actions such as editing files or running commands; a read-only planning mode exists for exploring.
- Sandboxing for unattended runs. If an agent may act without asking, run it inside a container or an operating system sandbox.
- A transcript. Every action and approval is recorded, so you can check what happened afterwards.
Do you need a model in CI?
Usually not. If the agent writes ordinary test files into your repository, CI runs them with your normal test command, with no model, no key and no data leaving the pipeline. Reserve model calls for the steps that need judgment, such as drafting tests or proposing repairs, and give the key to that one step only.
This also keeps your suite independent of any vendor. The AI test generation for Playwright guide shows how to review generated tests before they reach CI, and self-healing test scripts covers how to review repairs.
An example of this design
Probeflow Desktop, a local AI test agent that designs, writes and runs tests in your own repository, is built around these choices and is currently in preview. It has no account and no built-in model: you use a key from Anthropic, OpenAI, Google or a server that speaks the OpenAI-compatible API, or a local model server that needs no key. Keys are kept in the operating system keychain by default and never appear in prompts, logs or generated code. New folders open in Restricted Mode until you trust them, and the default permission mode asks before every consequential action. The page on what the Desktop agent sends to your model provider states exactly what is shared and how to stop it.
Sources
- Ollama documentation, OpenAI compatibility, checked 2026-11-26.
- OWASP GenAI Security Project, LLM01: Prompt Injection, checked 2026-11-26.
- Probeflow Desktop documentation, Keys and providers, Projects and permissions and Command line and CI, checked 2026-11-26.
Frequently asked questions
What is a local AI test agent?
It is a test agent that runs on your own computer, works in your own repository and drives a browser locally. The model it talks to can be a hosted provider you choose with your own key, or a model server on the same machine.
Does a local agent keep my code private?
Only partly, unless the model is local too. With a hosted provider, the prompts and the files the agent reads go to that provider under its terms. With a local model server, they stay on your machine.
Where should I store the model API key for a test agent?
In the operating system keychain or an encrypted file on a workstation. In CI, give the key only to the one step that needs a model, and run ordinary test steps without it.
Can a web page or a repository file manipulate a test agent?
Yes. Text the agent reads can contain instructions, which is called indirect prompt injection. Limit which folders and sites it may use, and require approval for consequential actions.