Skip to content

feat(core): tool-level secure parameter binding, fast-fail and validation - #780

Open
anubhav756 wants to merge 1 commit into
anubhav-secure-paramsfrom
anubhav-secure-params-core-tool
Open

feat(core): tool-level secure parameter binding, fast-fail and validation#780
anubhav756 wants to merge 1 commit into
anubhav-secure-paramsfrom
anubhav-secure-params-core-tool

Conversation

@anubhav756

@anubhav756 anubhav756 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

Implements immutable secure parameter binding, prompt injection defense, local fast-fail validation, and dynamic callable resolution on ToolboxTool and ToolboxSyncTool.

Changes

  • Ensures __signature__, __doc__, __annotations__, and Pydantic validation models are constructed strictly using regular __params. __secure_params is completely isolated.
  • Model/caller attempts to supply secure parameter keys in call arguments are blocked by inspect.Signature.bind() raising TypeError: unexpected keyword argument.
  • Missing required secure parameters fail locally in __call__ with ValueError before dispatching any network RPCs.
  • Supports static values, synchronous callables (lambda: ...), and async coroutines (async def ...) resolved per-invocation via resolve_value().
  • Added bind_secure_param(name, value) and bind_secure_params({name: value}) returning new immutable copies via __copy().
  • Throws helpful ValueError when attempting to bind secure parameters via bind_param or regular parameters via bind_secure_param.
  • Added bind_secure_param / bind_secure_params to ToolboxSyncTool.
  • Added test coverage verifying schema isolation, immutable copy semantics, callable resolution, and two-way collision errors.

@anubhav756
anubhav756 marked this pull request as ready for review August 20, 2026 06:11
@anubhav756
anubhav756 requested a review from a team as a code owner August 20, 2026 06:11
@anubhav756
anubhav756 force-pushed the anubhav-secure-params-core-tool branch from b911b4b to f9ce7d7 Compare August 20, 2026 06:25
Comment thread packages/toolbox-core/src/toolbox_core/tool.py Outdated
Comment thread packages/toolbox-core/src/toolbox_core/sync_tool.py
@anubhav756
anubhav756 force-pushed the anubhav-secure-params-core-tool branch from f9ce7d7 to 3d928b1 Compare August 20, 2026 10:08
@twishabansal twishabansal added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Aug 25, 2026
@anubhav756
anubhav756 force-pushed the anubhav-secure-params-core-tool branch from 3d928b1 to 2014f99 Compare August 25, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p2 Moderately-important priority. Fix may not be included in next release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants