Skip to content

Fix Guardrails.record() dropping tool args for prerequisite tracking#72

Merged
antoinezambelli merged 2 commits into
antoinezambelli:mainfrom
hobostay:fix/guardrails-record-args
May 25, 2026
Merged

Fix Guardrails.record() dropping tool args for prerequisite tracking#72
antoinezambelli merged 2 commits into
antoinezambelli:mainfrom
hobostay:fix/guardrails-record-args

Conversation

@hobostay
Copy link
Copy Markdown
Contributor

Summary

  • Guardrails.record() only passed tool names to StepEnforcer.record(), but StepEnforcer also accepts an optional args parameter for argument-based prerequisite checks
  • Without args, prerequisite checks that depend on argument values (e.g., "tool B requires tool A to have been called with mode='full'") always see missing data and produce false negatives
  • Update the signature to accept both plain tool names (backward compatible) and (name, args) tuples

Impact

  • The runner already passes args correctly (step_enforcer.record(tc.tool, tc.args)) — this fix brings the Guardrails convenience wrapper to parity
  • Any caller using Guardrails.record() will now properly support argument-based prerequisites

Test plan

  • Verify passing plain tool names still works (backward compatible)
  • Verify passing (name, args) tuples properly forwards args
  • Run existing test suite

🤖 Generated with Claude Code

Test User and others added 2 commits May 20, 2026 21:06
Guardrails.record() only passed tool names to StepEnforcer.record(),
but StepEnforcer also accepts an optional args parameter used for
argument-based prerequisite checks (e.g., "tool B requires tool A to
have been called with mode='full'"). Without args, prerequisite checks
that depend on argument values always see missing data and produce
false negatives.

Update the signature to accept both plain tool names (backward
compatible) and (name, args) tuples, forwarding args to the enforcer
when provided. The runner already passes args correctly — this fix
brings the convenience wrapper to parity.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@antoinezambelli antoinezambelli merged commit a6111bc into antoinezambelli:main May 25, 2026
2 checks passed
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