Wrap hook-injected context in clearly delimited tags so the model can * distinguish it from user/system content (prompt-injection defense).
(source: string, text: string)
| 139 | /** Wrap hook-injected context in clearly delimited tags so the model can |
| 140 | * distinguish it from user/system content (prompt-injection defense). */ |
| 141 | function wrapHookContext(source: string, text: string): string { |
| 142 | return `<hook_context source="${source}">\n${text}\n</hook_context>` |
| 143 | } |
| 144 | |
| 145 | export class Agent { |
| 146 | private options: AgentOptions |
no outgoing calls
no test coverage detected