dspy-fundamentals
Warn
Audited by Gen Agent Trust Hub on Apr 22, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONPROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The skill documents and provides examples for
dspy.ProgramOfThought, which dynamically generates and executes Python code based on LLM output. This poses a risk of arbitrary code execution if user-controlled input influences the generated logic. - [COMMAND_EXECUTION]: The skill describes a method to save and load full programs using
save_program=True, which utilizescloudpicklefor serialization.cloudpickleis an unsafe deserialization method that can execute arbitrary code when loading files from an untrusted source. - [PROMPT_INJECTION]: The skill exhibits an indirect prompt injection surface where untrusted user data is processed by predictors without explicit sanitization.
- Ingestion points: User input fields in
dspy.Signaturesubclasses, such as thequestionfield inSKILL.mdandexample_qa.py. - Boundary markers: None identified in the provided code templates to delimit instructions from user data.
- Capability inventory: The skill employs
dspy.ChainOfThoughtanddspy.ProgramOfThought, which generate text and executable code respectively. - Sanitization: No input validation, escaping, or filtering routines are demonstrated for the ingested content.
Audit Metadata