feat(p2-roadmap): community attack registry v1.5.0#7
Merged
Conversation
Phase 15 β closes the P2 backlog. toki.community: CommunityRegistry + CommunityAttack dataclass. 25 curated attacks across jailbreak/injection/edge_case/boundary/indirect/agentic, each with OWASP LLM Top 10 2025 tag, severity, provenance, and technique tags. Bundled as python/toki/data/community_registry.json (SHA-256 verified on load). filter(category, tag, severity) with AND logic. stats() summary. get_registry() module-level cache. load_remote(url, expected_sha256) for pinned-SHA-256 remote pull via stdlib urllib. CLI: python -m toki attack-community [--category] [--tag] [--severity] [--json] Server: GET/POST /api/attacks/community with filter support 27 new tests (test_community.py: 23, test_main.py: 4). 520 β 547 passing. Zero failures. https://claude.ai/code/session_01XCHiLCiVeL6WXQdsAcQTbx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
toki.communityβCommunityRegistry+CommunityAttackdataclass. 25 curated attacks across all six categories (jailbreak / injection / edge_case / boundary / indirect / agentic), each tagged with OWASP LLM Top 10 2025, severity, technique tags, and provenance. Bundled aspython/toki/data/community_registry.jsonwith SHA-256 integrity verification on load.CommunityRegistry.filter(category, tag, severity)β AND-logic query;stats()summary;get_registry()module-level cache (reload-able).load_remote(url, expected_sha256)β optional pinned-SHA-256 remote pull via stdliburllib; raisesValueErroron mismatch.python -m toki attack-community [--category] [--tag] [--severity] [--json]GET /api/attacks/community(no filters) andPOST /api/attacks/community(body filters:category,tag,severity)Test plan
python -m pytest python/tests/ -x -qβ 547/547 passing (27 new)cargo test && cargo clippy -- -D warningsβ cleanpython -m toki attack-communityβ prints 25 attacks with severity/category columnspython -m toki attack-community --category agentic --jsonβ 4-item JSON array, allcategory=="agentic"python -m toki attack-community --severity critical --jsonβ all items haveseverity=="critical"get_registry()returns same object on repeated calls (cache hit)load_remote(url, expected_sha256="wrong")raisesValueErrorregistry.sha256P2 backlog status
https://claude.ai/code/session_01XCHiLCiVeL6WXQdsAcQTbx
Generated by Claude Code