Offline command-line wargame to learn attacking and defending AI agents, one level at a time. No API key, no Docker, no network access.
Agents combine instructions, tools and untrusted content, and most of their incidents come from mixing these up. wargent turns each class of weakness into a short level. The agents are simulated and deterministic, so every level is reproducible and runs without any setup.
pipx install wargent wargent list wargent play 0 Python 3.10 or later is required. pip install wargent works as well.
Each level has three progressive hints and references the OWASP Top 10 for LLM Applications and the OWASP Top 10 for Agentic Applications. Levels unlock in order.
After solving a level, wargent defend N creates a Python guard that can be edited. wargent defend N --run replays the recorded attack and a set of legitimate inputs. The defense is accepted when the attack fails and legitimate use still works.
def allow_tool_call(call, ctx): return call.name != "send_email" Hooks and their contracts are described in docs/en/index.md.
Agents are rule-based programs without a language model. Files, pages, mail, tools and domains (*.example.test) exist only in memory. The engine never executes a command, reads a real file or opens a network connection on behalf of an agent. Every secret is fictional.
The source code of the agent is readable. Reading it is part of the learning, but it reveals how each level works.
See CONTRIBUTING.md. Solutions are never added to the repository.
wargent targets beginners and runs offline. Other labs cover complementary ground: DVMCP, DVAA and OWASP FinBot CTF. References: OWASP GenAI Security Project.
Both files in this release have provenance metadata.
agents ai-security ctf cybersecurity education llm-security prompt-injection wargame
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Both files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Nov 22, 2026 2 release files Full provenance




