You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add a prompt-injection guard to the system prompt: contact fields
(including optional_context) are framed as untrusted data; the model is
told never to follow instructions, role-play prompts, or formatting
overrides found inside contact fields.
- Move the request schema into src/lib/templates/personalize.ts so it is
unit-testable. Cap optional_context to 30 keys at 500 chars each
(~15KB upper bound) instead of unbounded keys at 2000 chars.
- Wire outputFileTracingIncludes for /api/personalize -> templates/**/*.md
in next.config.js so the markdown pack ships in the Vercel serverless
bundle (process.cwd() is the function dir, not the repo root).
- Tests: 5 new cases cover the guard wording and the schema caps
(accepts at the boundary, rejects past it for both keys and value
length). Full suite: 20/20 pass.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
0 commit comments