MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / wrapHookContext

Function wrapHookContext

src/core/agent.ts:141–143  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 3

runTurnMethod · 0.85
compactMethod · 0.85
handleToolCallMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected