Add indirect prompt injection payloads for Issue #13 - #26
Conversation
|
Warning Review limit reached
Next review available in: 41 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe change adds indirect prompt injection localization strings, maps them to controller levels 1–4, and adds tests for metadata, locale resolution, and secure level 4 registration. ChangesIndirect prompt injection
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/test_indirect_prompt_injection_registry.py (1)
47-52: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winAssert vulnerability exposure metadata, not only locale keys.
The tests verify descriptions, payloads,
Variant.SECURE, andsecret_token. They do not verifyvulnerability_exposed. The controller requiresVulnerabilityType.INDIRECT_PROMPT_INJECTIONon Levels 1–3 and an empty list on Level 4. Add these expected exposure lists to the registry assertions.Also applies to: 75-78
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_indirect_prompt_injection_registry.py` around lines 47 - 52, Update test_indirect_attack_vectors_use_indirect_specific_keys to include expected vulnerability exposure metadata in its parameterized inputs and assert each attack vector’s vulnerability_exposed values. Expect VulnerabilityType.INDIRECT_PROMPT_INJECTION for Levels 1–3 and an empty list for Level 4, while preserving the existing description and payload assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/controllers/indirect_prompt_injection_controller.py`:
- Around line 26-29: Replace both mojibake `鈥?` sequences in the user-facing
description near the agentic-systems paragraph and the indirect prompt injection
reference title with a valid ASCII hyphen or UTF-8 em dash, preserving the
surrounding HTML and wording.
---
Nitpick comments:
In `@tests/test_indirect_prompt_injection_registry.py`:
- Around line 47-52: Update
test_indirect_attack_vectors_use_indirect_specific_keys to include expected
vulnerability exposure metadata in its parameterized inputs and assert each
attack vector’s vulnerability_exposed values. Expect
VulnerabilityType.INDIRECT_PROMPT_INJECTION for Levels 1–3 and an empty list for
Level 4, while preserving the existing description and payload assertions.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5a8e4fff-d52c-4bf4-a4be-b9f5bb17d528
📒 Files selected for processing (3)
locale/messages_us.propertiessrc/controllers/indirect_prompt_injection_controller.pytests/test_indirect_prompt_injection_registry.py
Fix mojibake dashes in the controller description and assert vulnerability_exposed metadata in registry tests.
|
Addressed CodeRabbit feedback in the latest commit: fixed mojibake dashes in the controller description, and extended registry tests to assert |
Summary
API_KEY/ spaced-key style payload from Issue Create Payload for Indirect Prompt injection #13payload.direct_injection,payload.hidden_content,payload.context_confusion,payload.na) that previously rendered as raw keysmessages_us.propertiesRelation to existing work
Issue #13 already has open PR #22, but it is merge-conflicting / stale. This PR rebuilds the same intent on current
mainwith tests.Closes #13
Test plan
pytest tests/test_indirect_prompt_injection_registry.py -v→ 6 passedpytest tests/ -q→ 27 passedMade with Cursor
Summary by CodeRabbit
New Features
Tests