Migrate explain_vulnerability prompt
What does this MR do and why?
Related to Migrate Duo Chat Tools: ExplainVulnerability (#475046 - closed)
In this MR, we:
- Add
prompt_migration_explain_vulnerabilityFF - Migrate the
ExplainVulnerabilitytool to use the AIGW - Use
UseAiGatewayAgentPromptconcern with a FF
How to set up and validate locally
- Setup runners and the ExplainVulnerability context
- Run AI Gateway with Anthropic debug:
ANTHROPIC_LOG=debug poetry run ai_gateway - Checkout
migrate-explain-vulnerability-toolin the AIGW - Enable
prompt_migration_explain_vulnerabilityfeature flag on Rails (::Feature.enable(:prompt_migration_explain_vulnerability)) - Perform
/vulnerability_explainslash command in Duo Chat, eg../vulnerability_explain #include <stdio.h> int main(int argc, char *argv[]) { char buf[8]; memcpy(&buf, "123456789"); printf("hello, world!"); } - Verify that
/v1/prompts/chat//vulnerability_explainendpoint is called in the AIGW - Verify that the correct prompt is sent to Anthropic
I recorded a quick demo of the test results since setting up the environment would be very time-consuming.
Edited by Mohamed Hamda