Tighten handoff param patterns to block prompt injection via spaces
Param values for matter_id and clause are interpolated directly into the steering-prompt templates. Their patterns previously permitted spaces, which would let a hostile document smuggle a natural-language sentence into the prompt through a field that looks like an ID. Restrict both to slug shape (no spaces); descriptive context belongs in the note/event fields, which are never interpolated and are wrapped in the data frame. Also render templates via format_map with an empty-string default so an optional param the template references (e.g. playbook_monitor's clause) degrades gracefully instead of raising KeyError, and ignore __pycache__.
This commit is contained in:
parent
d541734b08
commit
f7ccda739f
2 changed files with 18 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -3,3 +3,5 @@
|
|||
/logs/
|
||||
/outputs/
|
||||
/.claude/
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue