Safeguard
AI Security•

Red teaming an AI agent before launch: a checklist for engineers

Before an agent ships, test what it can do, not just what it says. A defensive checklist covering tools, permissions, injection paths and stop controls.

Safeguard Security Team
4 min read

Red teaming an AI agent means attacking it the way a hostile user or a poisoned data source would, before launch, to see what actions it can be pushed into. Test the tools and permissions first, because an agent's worst failures are actions, not sentences.

How is an agent different from a chatbot?

A chatbot's worst output is bad text. An agent calls tools: it reads files, sends email, runs code, queries databases. NIST's framework for AI risk and OWASP's work on generative AI both stress testing the whole system, including the integrations and data it touches, not only the model.

OWASP's Excessive Agency entry describes three root causes: excessive functionality, excessive permissions and excessive autonomy. A good test plan probes each one.

What should the plan cover?

Inventory first. List every tool the agent can call, with its permissions, and every source of text it reads (web pages, tickets, documents, email). Each source is an input an attacker may control.

Indirect injection paths. The risky case is an instruction hidden in content the agent fetches. Plant harmless canary instructions, such as "reply with the word PINEAPPLE", in a test document, web page and ticket, and see whether the agent obeys. A canary shows the path is open without any harmful payload.

Permission boundaries. Try to make the agent use a tool outside its task. Ask a support agent to read a different customer's record. Ask a code agent to touch a repository it was not given. Record every success as a permissions bug, not a prompt bug.

Destructive and irreversible actions. Confirm that deletes, payments, outbound messages and production changes need human approval, and that the approval screen shows what will actually happen.

Data leakage. Check what the agent can reveal from its system prompt, memory and connected stores, and whether its outputs can carry data to an external URL.

Runaway behavior. Test loops, cost spikes and rate limits. Verify a kill switch works while a task is in flight.

What counts as passing?

A constructed example: a scheduling agent can read calendars and send invitations. The red team finds that a meeting description containing instructions causes the agent to invite an external address. That is a failure of both the injection path and the outbound-action control. The fix is not a better prompt alone: restrict invitees to approved domains and require approval for external recipients.

Pass means the layers hold when the model is fooled, not that the model never is.

How do you handle findings without breaking the product?

Not every finding means removing a feature. Sort them by fix type. Some are permission fixes: narrow a token, drop a tool, add an allow list. Some are workflow fixes: add an approval step before an irreversible action. Some are monitoring fixes: log tool calls and alert on unusual sequences. Prompt wording changes come last, since they are the weakest layer and the easiest to bypass.

Write each finding as a scenario with its preconditions, the action reached and the control that should have stopped it. Retest after the fix with the same scenario. Keep the scenarios in the repository as a regression suite, so a later model upgrade or new tool cannot quietly reopen an old hole.

How to check or apply this

  1. Write the agent's intended task in one sentence. Anything outside it is out of bounds.
  2. Inventory tools, permissions, data sources and credentials.
  3. Run canary injection tests through every input channel.
  4. Attempt out-of-scope tool use and cross-tenant access.
  5. Verify human approval on irreversible actions, and test that it cannot be bypassed.
  6. Review logs: can you reconstruct what the agent did and why?
  7. Test the kill switch and token revocation under load.
  8. Fix findings at the permission layer first, then retest.

Safeguard's MCP Guardrail is designed to sit between agents and tools to enforce what they may call, which gives your red team a concrete control to test.

Quick check

Is a jailbreak test enough?

No. Jailbreaks test the model's text behavior. Launch risk sits in tool access, permissions and data flows.

Who should red team the agent?

Someone other than its builders, with authority to block launch. Independent eyes find assumptions the builders no longer see.

Sources

Last reviewed: 18 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.