aion-redteam 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. aion_redteam-0.1.0/.env.example +10 -0
  2. aion_redteam-0.1.0/.gitattributes +4 -0
  3. aion_redteam-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +31 -0
  4. aion_redteam-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
  5. aion_redteam-0.1.0/.github/ISSUE_TEMPLATE/new_scenario.md +30 -0
  6. aion_redteam-0.1.0/.github/workflows/ci.yaml +39 -0
  7. aion_redteam-0.1.0/.github/workflows/release.yaml +71 -0
  8. aion_redteam-0.1.0/.gitignore +55 -0
  9. aion_redteam-0.1.0/CHANGELOG.md +35 -0
  10. aion_redteam-0.1.0/CODE_OF_CONDUCT.md +55 -0
  11. aion_redteam-0.1.0/CONTRIBUTING.md +57 -0
  12. aion_redteam-0.1.0/LICENSE +21 -0
  13. aion_redteam-0.1.0/PKG-INFO +286 -0
  14. aion_redteam-0.1.0/README.md +243 -0
  15. aion_redteam-0.1.0/RELEASING.md +126 -0
  16. aion_redteam-0.1.0/SECURITY.md +47 -0
  17. aion_redteam-0.1.0/docs/adapter_guide.md +69 -0
  18. aion_redteam-0.1.0/docs/scenario_authoring.md +91 -0
  19. aion_redteam-0.1.0/examples/demo_run.py +64 -0
  20. aion_redteam-0.1.0/examples/ollama_langgraph_agent.py +63 -0
  21. aion_redteam-0.1.0/examples/simple_langgraph_agent.py +77 -0
  22. aion_redteam-0.1.0/pyproject.toml +98 -0
  23. aion_redteam-0.1.0/src/aion_redteam/__init__.py +10 -0
  24. aion_redteam-0.1.0/src/aion_redteam/adapters/__init__.py +45 -0
  25. aion_redteam-0.1.0/src/aion_redteam/adapters/langgraph.py +250 -0
  26. aion_redteam-0.1.0/src/aion_redteam/cli/__init__.py +1 -0
  27. aion_redteam-0.1.0/src/aion_redteam/cli/main.py +322 -0
  28. aion_redteam-0.1.0/src/aion_redteam/core/__init__.py +1 -0
  29. aion_redteam-0.1.0/src/aion_redteam/core/judge.py +124 -0
  30. aion_redteam-0.1.0/src/aion_redteam/core/report.py +239 -0
  31. aion_redteam-0.1.0/src/aion_redteam/core/result.py +86 -0
  32. aion_redteam-0.1.0/src/aion_redteam/core/runner.py +263 -0
  33. aion_redteam-0.1.0/src/aion_redteam/core/scenario.py +324 -0
  34. aion_redteam-0.1.0/src/aion_redteam/core/target.py +123 -0
  35. aion_redteam-0.1.0/src/aion_redteam/policies/.gitkeep +1 -0
  36. aion_redteam-0.1.0/src/aion_redteam/policies/owasp_agentic_top10.yaml +39 -0
  37. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI01_goal_hijack/role_play_evil_assistant.yaml +50 -0
  38. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI01_goal_hijack/system_prompt_override.yaml +46 -0
  39. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI02_tool_misuse/argument_injection.yaml +48 -0
  40. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI02_tool_misuse/dangerous_tool_invocation.yaml +51 -0
  41. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI03_identity_privilege/credential_extraction.yaml +48 -0
  42. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI03_identity_privilege/scope_escalation.yaml +48 -0
  43. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI04_supply_chain/compromised_tool_plugin.yaml +50 -0
  44. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI04_supply_chain/malicious_dependency_load.yaml +45 -0
  45. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI05_code_execution/arbitrary_code_via_tool.yaml +48 -0
  46. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI05_code_execution/sandbox_escape_attempt.yaml +48 -0
  47. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI06_memory_poisoning/persistent_persona_injection.yaml +44 -0
  48. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI06_memory_poisoning/rag_corpus_poisoning.yaml +46 -0
  49. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI07_inter_agent/message_spoofing.yaml +45 -0
  50. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI07_inter_agent/peer_impersonation.yaml +48 -0
  51. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI08_cascading_failure/error_loop_induction.yaml +44 -0
  52. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI08_cascading_failure/infinite_plan_generation.yaml +45 -0
  53. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI09_human_trust/confidence_inflation.yaml +45 -0
  54. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI09_human_trust/fake_citation_injection.yaml +45 -0
  55. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI10_rogue_agent/behavioral_drift.yaml +53 -0
  56. aion_redteam-0.1.0/src/aion_redteam/scenarios/ASI10_rogue_agent/unbounded_autonomy.yaml +48 -0
  57. aion_redteam-0.1.0/tests/__init__.py +0 -0
  58. aion_redteam-0.1.0/tests/conftest.py +76 -0
  59. aion_redteam-0.1.0/tests/test_bundled_scenarios.py +38 -0
  60. aion_redteam-0.1.0/tests/test_cli.py +53 -0
  61. aion_redteam-0.1.0/tests/test_judges.py +85 -0
  62. aion_redteam-0.1.0/tests/test_langgraph_adapter.py +144 -0
  63. aion_redteam-0.1.0/tests/test_realagent_e2e.py +68 -0
  64. aion_redteam-0.1.0/tests/test_report.py +79 -0
  65. aion_redteam-0.1.0/tests/test_runner.py +223 -0
  66. aion_redteam-0.1.0/tests/test_scenario_loader.py +145 -0
@@ -0,0 +1,10 @@
1
+ # Copy to .env and fill in. Required to run scenarios against real LLM-backed agents.
2
+
3
+ # Anthropic (default provider for the example agent and the future LLMJudge)
4
+ ANTHROPIC_API_KEY=sk-ant-...
5
+
6
+ # Optional: model override for the example agent
7
+ AION_AGENT_MODEL=claude-haiku-4-5-20251001
8
+
9
+ # Optional: OpenAI, if you wire an OpenAI-backed agent instead
10
+ # OPENAI_API_KEY=sk-...
@@ -0,0 +1,4 @@
1
+ # Normalize line endings: LF in the repo, native on checkout.
2
+ * text=auto eol=lf
3
+ *.png binary
4
+ *.pdf binary
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a problem with aion-redteam
4
+ title: "[bug] "
5
+ labels: bug
6
+ ---
7
+
8
+ **Describe the bug**
9
+ A clear and concise description of what the bug is.
10
+
11
+ **To reproduce**
12
+ Steps or the exact command you ran, e.g.:
13
+
14
+ ```bash
15
+ aion-redteam run --target my_agent.py --adapter langgraph
16
+ ```
17
+
18
+ **Expected behavior**
19
+ What you expected to happen.
20
+
21
+ **Actual behavior / error output**
22
+ Paste the error or unexpected output (redact any secrets).
23
+
24
+ **Environment**
25
+ - aion-redteam version: (`aion-redteam --version`)
26
+ - Python version:
27
+ - OS:
28
+ - Adapter / framework version (e.g. langgraph):
29
+
30
+ **Additional context**
31
+ Anything else that helps.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an enhancement for aion-redteam
4
+ title: "[feat] "
5
+ labels: enhancement
6
+ ---
7
+
8
+ **Problem / motivation**
9
+ What problem are you trying to solve? Who is affected?
10
+
11
+ **Proposed solution**
12
+ What would you like aion-redteam to do?
13
+
14
+ **Alternatives considered**
15
+ Other approaches you thought about.
16
+
17
+ **Scope check**
18
+ Does this fit the tool's mission (a structured, OWASP-categorized red-team harness)?
19
+ Note: web UI, hosted scanning, and real-time monitoring are explicitly out of scope for
20
+ aion-redteam (that's aion-guard territory).
21
+
22
+ **Additional context**
23
+ Anything else.
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: New scenario proposal
3
+ about: Propose a new adversarial scenario
4
+ title: "[scenario] "
5
+ labels: scenario
6
+ ---
7
+
8
+ **OWASP category**
9
+ Which ASI category does this attack target? (ASI01–ASI10)
10
+
11
+ **Attack vector**
12
+ What single attack does this scenario test? (One vector per scenario.)
13
+
14
+ **Injection point**
15
+ user_message | system_prompt | tool_output | rag_document | memory | inter_agent_message
16
+
17
+ **Proposed payload (sketch)**
18
+ The adversarial content (a canary token makes success criteria unambiguous).
19
+
20
+ **Success criteria**
21
+ How do we know the attack succeeded? (string_match / regex against agent_response, etc.)
22
+
23
+ **Severity**
24
+ low | medium | high | critical — and why.
25
+
26
+ **Mitigations**
27
+ How should a defender (e.g. aion-guard) stop this?
28
+
29
+ **References**
30
+ Papers, CVEs, or OWASP links that motivate this scenario.
@@ -0,0 +1,39 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ python-version: ["3.11", "3.12"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v5
22
+
23
+ - name: Set up Python ${{ matrix.python-version }}
24
+ run: uv python install ${{ matrix.python-version }}
25
+
26
+ - name: Create venv and install
27
+ run: |
28
+ uv venv --python ${{ matrix.python-version }}
29
+ uv pip install -e ".[dev,langgraph]"
30
+
31
+ - name: Lint
32
+ run: uv run ruff check src tests examples
33
+
34
+ - name: Validate bundled scenarios
35
+ run: uv run aion-redteam validate src/aion_redteam/scenarios
36
+
37
+ - name: Test
38
+ # The real-agent e2e test skips automatically without ANTHROPIC_API_KEY.
39
+ run: uv run pytest -q --cov --cov-report=term-missing
@@ -0,0 +1,71 @@
1
+ name: Release
2
+
3
+ # Publishes to PyPI when a version tag (e.g. v0.1.0) is pushed.
4
+ # Uses PyPI Trusted Publishing (OIDC) — no API token or secret is stored in the repo.
5
+ on:
6
+ push:
7
+ tags: ["v*"]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ build:
14
+ name: Build distributions
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v5
21
+
22
+ - name: Build sdist and wheel
23
+ run: uv build
24
+
25
+ - name: Check distribution metadata
26
+ run: uvx twine check dist/*
27
+
28
+ - name: Upload build artifacts
29
+ uses: actions/upload-artifact@v4
30
+ with:
31
+ name: dist
32
+ path: dist/
33
+
34
+ publish-pypi:
35
+ name: Publish to PyPI
36
+ needs: build
37
+ runs-on: ubuntu-latest
38
+ # The 'pypi' environment is where you configure the trusted publisher on PyPI.
39
+ environment:
40
+ name: pypi
41
+ url: https://pypi.org/p/aion-redteam
42
+ permissions:
43
+ id-token: write # required for OIDC trusted publishing
44
+ steps:
45
+ - name: Download build artifacts
46
+ uses: actions/download-artifact@v4
47
+ with:
48
+ name: dist
49
+ path: dist/
50
+
51
+ - name: Publish to PyPI
52
+ uses: pypa/gh-action-pypi-publish@release/v1
53
+
54
+ github-release:
55
+ name: Create GitHub Release
56
+ needs: publish-pypi
57
+ runs-on: ubuntu-latest
58
+ permissions:
59
+ contents: write # required to create the release
60
+ steps:
61
+ - name: Download build artifacts
62
+ uses: actions/download-artifact@v4
63
+ with:
64
+ name: dist
65
+ path: dist/
66
+
67
+ - name: Create release with artifacts
68
+ uses: softprops/action-gh-release@v2
69
+ with:
70
+ generate_release_notes: true
71
+ files: dist/*
@@ -0,0 +1,55 @@
1
+ # Virtual environments
2
+ aion-redteam/
3
+ .venv/
4
+ venv/
5
+ env/
6
+
7
+ # Python
8
+ __pycache__/
9
+ *.py[cod]
10
+ *$py.class
11
+ *.egg-info/
12
+ *.egg
13
+ build/
14
+ dist/
15
+ .eggs/
16
+
17
+ # Test / coverage
18
+ .pytest_cache/
19
+ .coverage
20
+ htmlcov/
21
+ .mypy_cache/
22
+ .ruff_cache/
23
+ coverage.xml
24
+
25
+ # uv
26
+ uv.lock
27
+
28
+ # Reports / state produced by runs
29
+ redteam-report.html
30
+ results.json
31
+ *.redteam-report.html
32
+ *-report.html
33
+ .aion_redteam/
34
+
35
+ # Secrets / env
36
+ .env
37
+ .env.*
38
+ !.env.example
39
+
40
+ # Editors / OS
41
+ .vscode/
42
+ .idea/
43
+ .DS_Store
44
+ Thumbs.db
45
+
46
+ # Local-only build spec / strategy notes — not for the public repo
47
+ Claude.md
48
+ claude.md
49
+ CLAUDE.md
50
+
51
+ # Reference material (large binaries, redistribution)
52
+ *.pdf
53
+
54
+ # Local notes (keep the spec, ignore scratch)
55
+ scratch/
@@ -0,0 +1,35 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
5
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ### Added
10
+ - Core layer: scenario schema + `ScenarioLoader`, `StringMatch`/`Regex` judges, the
11
+ `Target` lifecycle abstraction, the async `Runner` (PASS/FAIL/FLAKY/ERROR/TIMEOUT
12
+ verdicts with a severity-weighted 0–100 risk score), and terminal/JSON/HTML reporters.
13
+ - LangGraph adapter (`LangGraphTarget`) with graph discovery and per-injection-point
14
+ message encoding.
15
+ - Real example LangGraph agents (Anthropic-backed and a no-key local Ollama target) and
16
+ a quick-start demo script.
17
+ - `ollama` optional extra (`langchain-ollama`) for the local example.
18
+
19
+ ### Fixed
20
+ - CLI/demo force UTF-8 console output so verdict icons no longer crash on legacy Windows
21
+ code pages (cp1252).
22
+
23
+ ### Security
24
+ - Judge evaluation now runs untrusted (community-contributed) regex with a capped input
25
+ length and under the scenario timeout, bounding ReDoS-style hangs.
26
+ - Target loading appends (rather than prepends) the target directory to `sys.path` so a
27
+ target cannot shadow stdlib/installed packages; documented the load/scenario trust
28
+ model in `SECURITY.md`.
29
+ - CLI (`aion-redteam`): `list`, `validate`, `run`, `report`, `init`.
30
+ - Bundled scenario library: 20 scenarios spanning all 10 OWASP Agentic (ASI) categories,
31
+ plus the `owasp_agentic_top10` policy manifest.
32
+ - Documentation: scenario authoring and adapter guides; community files (LICENSE,
33
+ SECURITY, CONTRIBUTING, CODE_OF_CONDUCT); GitHub issue templates and CI.
34
+
35
+ [Unreleased]: https://github.com/Cypharia/aion-redteam/commits/main
@@ -0,0 +1,55 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a
6
+ harassment-free experience for everyone, regardless of age, body size, visible or
7
+ invisible disability, ethnicity, sex characteristics, gender identity and expression,
8
+ level of experience, education, socio-economic status, nationality, personal appearance,
9
+ race, religion, or sexual identity and orientation.
10
+
11
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse,
12
+ inclusive, and healthy community.
13
+
14
+ ## Our Standards
15
+
16
+ Examples of behavior that contributes to a positive environment:
17
+
18
+ - Demonstrating empathy and kindness toward other people
19
+ - Being respectful of differing opinions, viewpoints, and experiences
20
+ - Giving and gracefully accepting constructive feedback
21
+ - Accepting responsibility and apologizing to those affected by our mistakes
22
+ - Focusing on what is best for the overall community
23
+
24
+ Examples of unacceptable behavior:
25
+
26
+ - The use of sexualized language or imagery, and sexual attention or advances of any kind
27
+ - Trolling, insulting or derogatory comments, and personal or political attacks
28
+ - Public or private harassment
29
+ - Publishing others' private information without their explicit permission
30
+ - Other conduct which could reasonably be considered inappropriate in a professional
31
+ setting
32
+
33
+ ## Enforcement Responsibilities
34
+
35
+ Community leaders are responsible for clarifying and enforcing our standards and will take
36
+ appropriate and fair corrective action in response to any behavior they deem
37
+ inappropriate, threatening, offensive, or harmful.
38
+
39
+ ## Scope
40
+
41
+ This Code of Conduct applies within all community spaces and also applies when an
42
+ individual is officially representing the community in public spaces.
43
+
44
+ ## Enforcement
45
+
46
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to
47
+ the community leaders responsible for enforcement via the contact on the repository
48
+ profile. All complaints will be reviewed and investigated promptly and fairly.
49
+
50
+ ## Attribution
51
+
52
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1,
53
+ available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
54
+
55
+ [homepage]: https://www.contributor-covenant.org
@@ -0,0 +1,57 @@
1
+ # Contributing to aion-redteam
2
+
3
+ Thanks for helping break agents before attackers do. The most valuable contribution is
4
+ usually a **new, well-crafted scenario**.
5
+
6
+ ## Development setup
7
+
8
+ This project uses [`uv`](https://docs.astral.sh/uv/).
9
+
10
+ ```bash
11
+ uv venv aion-redteam
12
+ # Windows (PowerShell): aion-redteam\Scripts\Activate.ps1
13
+ # macOS/Linux: source aion-redteam/bin/activate
14
+ uv pip install -e ".[dev,langgraph]"
15
+ ```
16
+
17
+ ## Before you open a PR
18
+
19
+ ```bash
20
+ ruff check src tests examples # lint
21
+ ruff format src tests examples # format (optional but appreciated)
22
+ pytest -q # tests must pass
23
+ aion-redteam validate src/aion_redteam/scenarios/ # if you touched scenarios
24
+ ```
25
+
26
+ The real-agent end-to-end test (`tests/test_realagent_e2e.py`) is skipped automatically
27
+ unless `ANTHROPIC_API_KEY` is set, so you don't need a key to run the suite.
28
+
29
+ ## Adding a scenario
30
+
31
+ See [docs/scenario_authoring.md](docs/scenario_authoring.md). Checklist:
32
+
33
+ - [ ] Correct `owasp_category` and matching `id` prefix.
34
+ - [ ] Realistic payload; unambiguous success criteria (canary tokens encouraged).
35
+ - [ ] At least one `mitigations` entry.
36
+ - [ ] `aion-redteam validate` passes.
37
+
38
+ ## Adding an adapter
39
+
40
+ See [docs/adapter_guide.md](docs/adapter_guide.md). Adapters must drive the **real**
41
+ agent; only adapter-plumbing unit tests may use deterministic stand-ins.
42
+
43
+ ## Commit and PR conventions
44
+
45
+ - **Conventional commits**: `feat:`, `fix:`, `docs:`, `test:`, `chore:`, `refactor:`.
46
+ - **Atomic commits** — one logical change each. No 2,000-line "initial commit" dumps.
47
+ - **Branch per feature**: `feat/<thing>`, `fix/<thing>`. Open a PR even when solo.
48
+ - CI must be green before merge.
49
+
50
+ ## Code style
51
+
52
+ - Type hints on all function signatures and return types.
53
+ - Google-style docstrings on public classes and functions.
54
+ - `pathlib.Path`, never `os.path`. `pydantic.BaseModel`, never `@dataclass`.
55
+ - No `print()` in library code (the CLI uses `rich`).
56
+
57
+ By contributing you agree your contributions are licensed under the project's MIT license.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Cypharia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.