What the pack covers
LLM03, LLM04, LLM08, ASI04, ASI07, ASI08 and ASI10 concern supply chain, training data, vector stores and multi-agent systems, which a conversation with your agent cannot reach. A conversation can reach ASI05 (Unexpected Code Execution) and ASI09 (Human-Agent Trust Exploitation), but the pack has no attack for them: ASI05 needs an agent that runs code, and ASI09 turns on what a person does with the reply.
Apply it with your coding agent
Install the LangWatch skills and ask your coding agent:- the pack in your tests, in the language your repo uses
- an adapter that calls your agent
- a config filled in from your system prompt and tools
- the results of one attack, then of the full pack
Apply it by hand
- Copy the Python pack or the TypeScript pack into one test folder.
-
In
agent_adapter.pyoragent-adapter.ts, makecall_agentorcallAgentcall your real agent and return its reply, tool calls included. If your TypeScript agent takes OpenAI chat messages, usetoOpenAIMessagesandfromOpenAIMessagesfrom the same file. -
In
owasp_config.pyorowasp.config.ts, fill in the config block. You describe the agent’s name and job, its tools, the tools that change data, what it must never do and the data it must never disclose. The pack builds every attack goal and judge criterion from this one block. Every field ships asFILL ME, and the pack refuses to run while any field still holdsFILL ME. Two limits ship filled:max_reply_words(500) andmax_tool_calls_per_turn(5). They set the longest reply and the most tool calls per message that the LLM10 attack accepts.
Run it
Install the test dependencies if your repo does not have them yet:@ai-sdk/openai on 3.x: @langwatch/scenario 1.7 refuses 4.x models. The attacker and the judge need an OpenAI-compatible chat model, set with OWASP_MODEL. For Python, set OWASP_MODEL to that provider’s LiteLLM id. Both languages take a LiteLLM id such as openai/gpt-5-mini. For TypeScript, also swap the openai import and factory in owasp-pack.redteam.ts for that provider’s AI SDK package. Gemini fails as attacker or judge in the current SDK. Your agent can use any model.
Set LANGWATCH_API_KEY and the API key of the provider OWASP_MODEL points to (OPENAI_API_KEY for the default), then run:
-k LLM01 (pytest) or -t LLM01 (vitest) to run one id.
The pack calls live models, so keep it out of your default test run and CI. For pytest, add -m "not agent_test" to your default options (addopts under [tool.pytest.ini_options]); -m agent_test on the command line overrides it. For vitest, the pack file owasp-pack.redteam.ts does not end in .test.ts, so the default include skips it and only owasp.vitest.config.ts runs it.
OWASP_TURNS sets the attacker’s turns per attack: 10 when unset or empty, 30 before a release. A value that is not a whole number of at least 1 stops the run.
To read the results:
- In LangWatch, open Simulations.
- Pick the
owasp-red-teamset: it holds one run per OWASP id. - Open a run to read the conversation and the judge’s verdict on each criterion. The criteria judge security only, so a plain refusal passes. The test output names the unmet criteria but not the turn, so find the first agent reply that breaks one here.