Repository navigation
fix(tools): enforce referenced input schemas - #2332
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 474e027 | Commit Preview URL | Aug 22 2026, 02:24 AM |
96cdc18 to
474e027
Compare
|
Reviewed and rebased onto The bug is worth stating plainly: a A few things I checked rather than assumed:
TM-INJ-024 kept here. #2337 independently claimed the same ID and is being renumbered to TM-INJ-025. Generated by Claude Code |
Motivation
ToolDefuses a$refto place constraints in/$defs, because the previous validator ignored$refand thus callbacks could be invoked with unvalidated input.Description
$refresolution and cyclic detection to the registry validator by introducingvalidate_schema_innerand calling it fromvalidate_schemaincrates/bashkit/src/tool_registry.rsso local JSON Pointer references are applied when validating inputs.$refas validation failures (fail closed) so callbacks are never invoked with skipped constraints.registry_resolves_local_schema_references_before_callbackincrates/bashkit/tests/integration/tool_registry_tests.rsthat proves referenced-required properties are enforced and the callback is not called on schema failure.$reftargets are resolved and to record the new mitigated threat (TM-INJ-024). Files updated:tool_registry.rs,tool_registry_tests.rs,knowledge/integrations/scripted-tool-orchestration.md,knowledge/security/threat-model.md, andcrates/bashkit/docs/threat-model.md.Testing
cargo test -p bashkit --test integration registry_resolves_local_schema_references_before_callback --features scripted_tool,python,typescript -- --nocapture, which passed.cargo clippy -p bashkit --lib --features scripted_tool,python,typescript -- -D warnings,cargo fmt --all -- --check,just check-okf, andjust check-doc-links, all of which succeeded.Codex Task