Skip to content

feat(rules): extend EBTE tool-call claims to six more SDKs (schemas 33–36) - #281

Merged
ericksondelacruz merged 6 commits into
mainfrom
feat/ebte-claims-coverage
Oct 28, 2026
Merged

ericksondelacruz merged 6 commits into
mainfrom
feat/ebte-claims-coverage

Conversation

@ericksondelacruz

@ericksondelacruz ericksondelacruz commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Extends EBTE (Explanation-Bound Tool Execution) tool-call claims from #276 (OpenAI Agents, MCP, LangChain; Python) to six more SDKs. Each SDK gets the same three rules: no claim (info), claim declared but never read (medium), claim only printed, logged, serialized or returned (medium). Stacks on #276 and adds 18 rules, from 364 to 382.

Commit Schema Rules What it adds
cd59e99 — — LangChain factory tools (StructuredTool.from_function(fn), StructuredTool(func=fn), Tool.from_function(fn)) get the claim_use fact from the wrapped function, so LC-029 / LC-030 apply to them
897a7ef 32 → 33 CREW-016..018, PYD-016..018 claim_use on CrewAI and Pydantic AI tools. New repo-level pass analysis.ApplyClaimMediators treats the SDK's pre-tool hook (CrewAI before_tool_call family, Pydantic AI tool-execution Hooks, a tool args_validator=) as a possible mediator
0c32fb3 33 → 34 CSDK-026..028 Claude Agent SDK @tool handlers. New ToolDef.InputKeys records the input-schema keys, so tool_claim_use sees a claim in the schema and classifies args["claim"] / args.get("claim") reads. A PreToolUse hook, or can_use_tool without allowed_tools / bypassPermissions, counts as a possible mediator
4d68031 34 → 35 OAI-037..039 TypeScript @openai/agents tool({...}) with a zod claim parameter. Reads destructured bindings and input.claim in the inline execute. inputGuardrails counts as a possible mediator
cb97906 35 → 36 ADK-024..026, AG2-023..025 Google ADK FunctionTool(fn) and AutoGen register_function / register_for_llm / register_for_execution tools. An ADK before_tool_callback (agent keyword or plugin method) counts as a possible mediator. AutoGen's registering decorators do not
4ca2139 — — Docs: the schema reference and FactClaimUse comment describe every discovery path and mediator

Each commit bumps SupportedSchemaVersion and the fixture manifest, with a schema note in internal/rules/schema_version.go.

Notes for review

Test plan

  • go build ./..., go vet ./..., go test ./... (27 packages ok) on every commit; go test -race on internal/analysis, internal/rules and internal/scanner at the tip
  • scripts/check-rules-sync.sh against the rules branch: in sync (144 files)
  • trustabl rules validate on the rules branch: OK: 143 rule pack(s), 382 rule(s) valid under rule schema version 36
  • CI passes

A tool built with StructuredTool.from_function(fn), StructuredTool(func=fn) or
Tool.from_function(fn) now gets the claim_use fact from its wrapped
function, so LC-029 and LC-030 apply to it.

No decorator registers a factory-built tool, so any decorator on the
wrapped function makes the fact wrapped (wrappedFuncClaimUse). A
decorated wrapped function is found by a separate lookup so the other
users of indexTopLevelFunctions resolve exactly what they did before.
No schema change.
CREW-016..018 and PYD-016..018 apply the tool-call claim rungs (no claim,
claim never read, claim only written out) to CrewAI and Pydantic AI tools.
ApplyClaimMediators marks a claim as possibly mediated when the repo
registers the SDK pre-tool hook (CrewAI before_tool_call family, Pydantic AI
Hooks tool-execution hooks, or a tool args_validator=). Pydantic AI Tool(fn)
factories now get the claim fact from the wrapped function.
CSDK-026..028 apply the tool-call claim rungs to Python Claude Agent SDK
@tool handlers. The handler takes one args dict, so discovery records the
input schema keys in ToolDef.InputKeys (short dict, JSON-schema properties,
or a same-file TypedDict or dict) and classifies args["claim"] /
args.get("claim") reads. A PreToolUse hooks entry, or can_use_tool on an
options call without allowed_tools or bypassPermissions, counts as a
possible mediator.
OAI-037..039 apply the tool-call claim rungs to @openai/agents tool({...})
definitions whose zod parameters declare claim. stampTSOpenAIClaim reads the
inline execute function: a destructured binding ({ claim }, { claim: c }) or
input.claim / input["claim"]. A tool with inputGuardrails counts as possibly
mediated.
ADK-024..026 over FunctionTool(fn) and AG2-023..025 over register_function
and register_for_llm / register_for_execution tools, with the claim fact
taken from the wrapped function. The AutoGen registering decorators are not
counted as mediators. An ADK before_tool_callback (agent keyword or plugin
method) anywhere in the repo marks ADK claims as possibly mediated.
The tool_claim_use schema reference and the FactClaimUse comment still said
only Python decorated tools carry the fact and that absent reads only
param_names.
@ericksondelacruz
ericksondelacruz changed the base branch from feat/analyzer-ebte-claims to main October 28, 2026 02:49
@ericksondelacruz
ericksondelacruz merged commit 0883968 into main Oct 28, 2026
5 checks passed
@ericksondelacruz
ericksondelacruz deleted the feat/ebte-claims-coverage branch October 28, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants