Hello Heron,
Have in mind that for Active Response is capable of running scripts on the endpoints and/or in the Wazuh Manager. In order for it to run in your endpoints, the script should be located in the endpoint itself.
So, there would be no need on connecting to it, unless that for some reason you need to run it on your Wazuh Manager instead of your endpoint.
Now because of what you already commented, if by removing the import paramiko, it works it might be a problem with you script's code or maybe you're just missing such module on the server you're trying to run the script. If this was the case, you could install such module in your Wazuh Server (or wherever you're trying to run it).
Also, if you run the script manually, does it run properly?
It would be useful to see the active-response module you've configured in your Wazuh Manager along with the corresponding command module for your script. Also, the log file from the manager (/var/ossec/logs/ossec.log) could provide information if the issue is related to Wazuh. Otherwise, you might need to add some debugging feature to your script.
You can find information about Active Response next:
Looking forward to your comments.