Skip to content

feat(guardrails): forward agent_input to deterministic pre-evaluation [AL-410]#815

Open
valentinabojan wants to merge 1 commit intomainfrom
valentinabojan/al-410-agent-input-source
Open

feat(guardrails): forward agent_input to deterministic pre-evaluation [AL-410]#815
valentinabojan wants to merge 1 commit intomainfrom
valentinabojan/al-410-agent-input-source

Conversation

@valentinabojan
Copy link
Copy Markdown
Contributor

@valentinabojan valentinabojan commented Apr 29, 2026

Summary

  • When an input_schema is configured, the agent's validated input dict is extracted from graph state via the existing extract_input_data_from_state helper and passed to DeterministicGuardrailsService.evaluate_pre_deterministic_guardrail so rules can reference FieldSource.AGENT_INPUT.
  • Plumbs input_schema through create_tool_guardrail_node / _create_guardrail_node (additions are positional with safe defaults).
  • Post-execution path is unchanged — agent_input rules are pre-only by design.

Depends on the SDK changes in https://github.com/UiPath/uipath-python (uipath-core ≥ 0.5.14 carrying FieldSource.AGENT_INPUT). Phase A of AL-405; tracked under AL-410.

Test plan

  • pytest tests/agent/guardrails/ tests/cli/test_agent_with_guardrails.py tests/cli/test_guardrails_in_langgraph.py — 294 passed (with locally-installed editable uipath-core 0.5.14)
  • ruff check . and ruff format --check . — clean
  • mypy src/uipath_langchain/agent/guardrails/ src/uipath_langchain/agent/react/guardrails/ — clean
  • New tests assert: pre-evaluation forwards extracted agent_input; post-evaluation never receives agent_input.

🤖 Generated with Claude Code

When an input_schema is configured, the agent's validated input
parameters are extracted from graph state and passed to
DeterministicGuardrailsService.evaluate_pre_deterministic_guardrail
so rules can reference FieldSource.AGENT_INPUT (uipath-core 0.5.14+).

Plumbs input_schema through create_tool_guardrail_node /
_create_guardrail_node; extraction reuses extract_input_data_from_state.
Post-execution is unchanged — agent_input rules are pre-only by design.

AL-410 / AL-405 (Phase A).
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.

1 participant