Repository navigation
Description
Summary
A program can declare a syntactically valid Jinja input renderer that fails for a particular value. Strict undefined behavior makes a missing member an error, which render_input_field_def turns into panic! during prompt construction. A typed input can pass validation while a data-dependent template references a missing member; service impact depends on how the host handles a task panic.
Affected code
- The template is stored as a render specification (entrypoint):
crates/dspy-rs/src/ir/text/parse.rs:620-629. - No live input context is rendered during signature validation (expected_control):
crates/dspy-rs/src/ir/sig.rs:342-363. - Strict undefined behavior turns missing context members into render errors (source):
crates/dspy-rs/src/adapter/chat.rs:99-113. - The adapter panics instead of returning a prediction error (root_control):
crates/dspy-rs/src/adapter/chat.rs:550-581. - Both demos and live input pass through the fallible renderer (sink):
crates/dspy-rs/src/ir/interp.rs:2824-2832.
Suggested resolution
- Make input rendering fallible and propagate compilation and render errors as structured prediction or run errors.
Acceptance criteria
- A missing Jinja member returns an error without panic.
- Valid Jinja input still renders identically.
Related issues
#45 concerns input formatting features, and PR #62 adds Jinja rendering support. This ticket concerns a runtime render failure becoming a panic.
Validation performed
Static source review of upstream main at 72b247e2bddc7337f923461fb27b4127c7d104f3. No runtime exploit or live deployment test was performed.
Fix under review
PR #103: The PR propagates Jinja rendering failures through prediction and run errors.
Tracking
- Finding ID:
csf_d52769d69e63d26a5acfe05d - Fingerprint:
codex-security/v1:sha256:cca6104b9f4399d27e72fc97cade52539bf4910cd84c3f7f7d0e4bbaa96a9bc5
AI disclosure
OpenAI Codex assisted with the static source review and organization of this issue. No code change is included.
Activity