How to Test an AI Agent Before Launch
How to test an AI agent before launch when it can read documents and take actions: five tests covering inputs, tools, permissions, memory and traceability.
The demo shows what the agent should do. Launch is about everything else it can do.
Will it hold up? That's the question someone has to answer the week before an AI agent with write access goes live. Usually it gets answered with the tests the team already has: a few dozen happy-path prompts, a handful of jailbreak attempts, and a product owner who liked the demo.
Those tests check the model. They say very little about the agent.
Why the demo test misses the real risk
An agent is a model wired to things. It reads documents, emails and web pages. It calls tools. It holds an identity with permissions. It remembers. Each of those is a way in, and none of them shows up when you type polite questions into a chat box.
When we audited an AI agent for Forward Global, a strategic intelligence and risk advisory firm, the agent could read client documents and then write to records, open billing and draft outbound messages. The serious problems weren't in the foundation model. They sat in the ingestion path and the tool layer:
- instructions hidden in client input were acted on as if the operator had sent them
- tool permissions were broader than the agent's tasks
- memory leaked between contexts
- tool calls weren't validated
- personal data was retrievable without an access check
- actions couldn't be traced back to the input that caused them
None of that would have surfaced in a demo. All of it is testable before launch.
A WORKING RULE
If your agent can read it, assume someone else can write to it.
How to test an AI agent before launch: five tests, in order
Run them against the agent's real configuration, permissions and tool wiring, in a copy of the environment with synthetic or sanitized data. Production stays untouched.
1. Map everything the agent can touch
Before any attack, write down the agent's doors:
- every input it reads: uploads, inboxes, URLs, tool results, retrieved documents
- every tool it can call, and the permission behind each one
- what it writes to memory, and who can read that memory later
Test: next to each tool, write the narrowest permission its task actually needs. Every gap between "needs" and "has" is a finding before you've sent a single prompt.
2. Put hostile instructions where the agent reads
Indirect prompt injection is the attack that matters most for agents, because the attacker never talks to the agent. They leave instructions in something it will read: a contract, a support ticket, a web page, a tool's response.
Test: plant instructions in test inputs that ask the agent to do something outside its task. Pass condition: no tool fires, and the attempt shows up in your logs. Run each case several times. A model that resists once may not resist the fifth time.
3. Push the tool layer, not the chat
Most teams test what the agent says. The damage comes from what it calls.
Test: send malformed tool calls, out-of-scope arguments and chained calls that each look fine on their own. Pass condition: anything outside the tool's contract is rejected before it reaches the system behind it.
4. Check what memory carries across contexts
Memory turns a one-off trick into policy. A note planted in one conversation that shows up in another is now an instruction the agent trusts.
Test: plant a marker in one user's context and look for it in another's. Then search memory for personal data as a user who shouldn't see it.
5. Make every action traceable
If something goes wrong after launch, the first question will be "why did it do that?" If you can't link an action to the input that caused it, you can't answer, and you can't prove the fix worked.
Test: pick five actions from your test runs and trace each one back to its input. If any trail goes cold, fix logging before launch, not after.
An agent that passed the demo has proven it can do its job. Launch is when you find out what else it can do.
Three ways this goes wrong
- Testing once. Every model swap, prompt edit or new data source changes the agent. Turn each finding into an automated test and run the set on every change, in CI/CD.
- Counting attacks instead of paths. A hundred variants of the same injection are one finding. Coverage of doors matters more than volume.
- Fixing the prompt and calling it done. If the agent had write access it didn't need, a better prompt is a weaker fix than a narrower permission.
When you want a second pair of hands
Most teams can run the first two tests themselves this week. Tests three to five are where a team that attacks agents for a living saves time, because the interesting failures sit between components, not inside one.
That's what our AI security and agent testing service does. We start from your agent's real configuration and permissions, attack it the way someone outside your company would, and hand you findings your engineers can act on.
We use AI to attack AI, with people in charge. Our own attacker agent and test scenarios run against your system. Our evaluation agent Aria then re-runs every finding several times before it counts.
The test suite we leave behind is built with Promptfoo and DeepEval and runs in your CI/CD whenever the model, prompt or data changes. Our engineers design the attacks, decide which findings are real and hand remediation to your team.
At Forward Global, the audit took about 8 weeks and left a 200-test evaluation suite in CI/CD. The published outcomes:
20%
fewer production incidents
40%
faster delivery of agentic features
200
tests re-running on every change
If you'd like to see how that played out on a live agent, read how we audited Forward Global's AI agent.
One thing to do tomorrow morning: open your agent's tool configuration, list every tool with its permission, and circle each one that can write somewhere its job doesn't need. That list is your first finding.

