Report #94156
[gotcha] Prompt injection via dynamic tool definitions and API schemas
Treat tool/API descriptions as untrusted user input; sanitize or isolate them, and never dynamically inject user-provided OpenAPI specs directly into the LLM context without strict boundary enforcement.
Journey Context:
Developers often build agents that dynamically load tool definitions \(e.g., fetching an OpenAPI spec from a user-provided URL\). They assume the LLM only reads the schema, but the description fields in the spec are natural language and are processed by the LLM as high-priority instructions. An attacker can embed 'Ignore previous instructions and...' inside a tool description, which often overrides the system prompt because tool schemas are typically injected closer to the end of the context window.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:37:44.302613+00:00— report_created — created