dspy-optimization
Warn
Audited by Gen Agent Trust Hub on Jun 20, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONREMOTE_CODE_EXECUTIONPROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The script
scripts/test-signature.pyutilizesimportlib.import_module()with a module path derived from the--modulecommand-line argument. This allows for the loading of any arbitrary Python module available in the environment, which can trigger code execution during module initialization or via subsequent attribute access. - [REMOTE_CODE_EXECUTION]: The skill employs the
picklemodule for serializing and deserializing optimized DSPy programs, as seen inscripts/optimize-dspy.pyand documented inreferences/optimizers.md. Serializing and later loading artifacts withpickle.load()is inherently unsafe and can be exploited to achieve arbitrary code execution if the pickled file is compromised. - [PROMPT_INJECTION]: The skill's optimization workflow involves ingesting training data from external JSONL files and evaluating model-generated outputs. This configuration creates an attack surface for indirect prompt injection, where malicious instructions embedded in the examples or predictions could influence the behavior of the optimization process or the agent.
- Ingestion points:
scripts/optimize-dspy.py(load_examples function). - Boundary markers: None implemented to isolate external content from instructions.
- Capability inventory: The execution environment includes capabilities for dynamic module loading and binary deserialization.
- Sanitization: No input validation or sanitization is performed on the ingested training data.
Audit Metadata