https://promptfoo.dev/ logo
Compatibility with local Burpsuite proxy
# questions
p
Has anyone tried proxying requests from Promptfoo through a local Burpsuite proxy? I'd like to see the requests and responses resulting from red teaming an application that uses an AI Agent to talk to an LLM. I'm following the instructions here https://www.promptfoo.dev/docs/faq/#how-do-i-use-a-proxy-with-promptfoo. I've added the following to an .env file in the directory I'm running
promptfoo redteam
from:
Copy code
# Promptfoo Proxy with authentication
export HTTPS_PROXY=127.0.0.1:8080
# SSL certificates - Absolute path
export PROMPTFOO_CA_CERT_PATH=/Users/user/burpsuitecacert.der
When running
promptfoo -v redteam run
I get the following output in verbose mode:
Copy code
[apiHealth.js:17] [CheckRemoteHealth] Checking API health: {"url":"https://www.promptfoo.app/health","env":{"httpsProxy":"127.0.0.1:8080"}}
[apiHealth.js:36] [CheckRemoteHealth] Making fetch request: {"url":"https://www.promptfoo.app/health","options":{"headers":{"Content-Type":"application/json"}},"timeout":5000,"nodeVersion":"v24.7.0"}
[fetch.js:114] Using custom CA certificate from /Users/user/burpsuitecacert.der
[fetch.js:122] Using proxy: https://127.0.0.1:8080/
[apiHealth.js:95] [CheckRemoteHealth] API health check failed: {"error":"Request timed out after 5000 ms","url":"https://www.promptfoo.app/health"}
When I do not use the proxy, it works as it should. When I proxy local browser traffic to the API endpoint I want to test, it works as it should. I definitely have access to https://www.promptfoo.app/health so it seems the problem is with the communication between Promptfoo and Burpsuite proxy. Any ideas where to look when troubleshooting this will be very welcome!
Found what was causing the problem! the
export HTTPS_PROXY=127.0.0.1:8080
line in the .env file is wrong. It should be
export HTTPS_PROXY=http://127.0.0.1:8080
Should've read the documentation more carefully. It does include the correct proxy URL format. Burpsuite now works.