# BR-TOOL-02

When the setting is "Input only", then the arguments are restored and the result goes to the model as the tool returned it.

Defined in [Let a tool act on the real values](https://docs.piighost.dev/en/domain/processes/let-a-tool-act/#br-tool-02).

## Where the rule lives

- [`PIIAnonymizationMiddleware.awrap_tool_call()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/integrations/langchain/middleware.py#L220)

## Direct tests

No test calls this code directly.

## Indirect tests

- [`tests/integrations/langchain/test_middleware_e2e.py::test_second_model_call_never_sees_clear_tool_args`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/langchain/test_middleware_e2e.py#L74)
- [`tests/integrations/langchain/test_middleware_stream.py::test_middleware_deanonymize_stream_restores_split_token`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/langchain/test_middleware_stream.py#L33)
- [`tests/integrations/langchain/test_middleware.py::TestFactoryContract::test_a_pipeline_without_a_recognizer_is_refused`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/langchain/test_middleware.py#L639)
- [`tests/integrations/langchain/test_middleware.py::TestFactoryContract::test_reads_the_recognizer_from_the_pipeline`](https://github.com/Athroniaeth/piighost/blob/master/tests/integrations/langchain/test_middleware.py#L610)

## Used by

No caller found.

Read from the code graph graphify builds, at the places the domain documentation gives.
