Add compliance/prompt_injection_firewall skill#267
Conversation
…scanning. Introduce a deterministic pre-flight firewall that detects hidden HTML payloads, invisible Unicode smuggling, instruction overrides, and common exfiltration patterns before untrusted text reaches an LLM. Fixes ARPAHLS#46 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks @mrmasa88, this was a good start as expected when following the AI native workflow from earlier today. Some things to address before merge: The heuristic core is solid and useful as a Layer-1 trust-boundary scanner, but I would remove the Gemini Coverage is a good base but not complete yet. Still add detectors + golden tests for: homoglyphs/confusables, variation-selector / emoji smuggling, markdown/HTML comments actually wired, and at least one nested encoding case. Include one false-positive fixture so the lexicon isn’t hair-trigger. Overal, think about it, and discuss with your model to see what kind of protection a prompt injection firewall could have locally, then pass your insights to the worker model. On category, I have a feeling this could be under security later, but compliance is good for now as requested from the issue, need to think about it. Some minor things
on PR processSince this was automatically opened by the agent, it's ok, but as with the previous PR notice, please try to manually open PRs from your fork, and not let the agent to do it. Agents can commit and push to your fork, from where it is recommended you manually open PR, review the code one last time before PR, and use PR template in content block, short is fine, eg. skip empty N/A noise, also don’t include “Made with Cursor.” Ping when updated and I’ll re-review and merge if green. This is good as a v0.1. In short, I would take some time to think, or discuss with AI, what kind of practices and methods we should use to run this locally without relyig on external models to review prompts, considering if prompt injection is found, it can harm also the auditing model. There was a good repo karpathy shared with context about prompt injection patterns and types that could be used as local reference set, similar to wallet screening or mica skills. Just an idea, don't take it by word, maybe you find a better format. <3 |
Summary
compliance/prompt_injection_firewall, an offline deterministic pre-flight scanner for hostile instructions in untrusted text.{is_safe, detected_threat, sanitized_text, action, confidence, threats}with optional Gemini second opinion (disabled by default).Fixes #46
Test plan
pytest skills/compliance/prompt_injection_firewall/test_skill.pypytest tests/test_skill_issuer.pypytest tests/test_registry_docs.pypytest tests/test_card_ui_schema.pypytest skills/ tests/(332 passed)Made with Cursor